|
From: | Emanuel Berg |
Subject: | Re: factor out error message functions, access function stack to know location |
Date: | Tue, 27 Oct 2015 01:27:25 +0100 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
Dan Espen <despen@verizon.net> writes: > Pretty good discussion here, including access to the > call stack: > > http://emacs.stackexchange.com/questions/2310/can-functions-access-their-name Using `backtrace-frame', this almost worked: (defun function-stack () (cadr (backtrace-frame 3)) ) ;;; 3 = function-stack-caller (look below) ;;; 2 = function-stack ;;; 1 = cadr ;;; 0 = backtrace-frame (defun function-stack-caller () (function-stack) ) (function-stack-caller) ; function-stack-caller! <success music here> ;; however... (defun function-stack-embedded-caller () (if 'some-error-check (function-stack) )) (function-stack-embedded-caller) ; if! so doesn't help... -- underground experts united http://user.it.uu.se/~embe8573
[Prev in Thread] | Current Thread | [Next in Thread] |