help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to determine the current function?


From: Stefan Monnier <address@hidden>
Subject: Re: how to determine the current function?
Date: 14 Feb 2003 10:45:50 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>>>>> "Kevin" == Kevin Rodgers <kevin.rodgers@ihs.com> writes:
> I could probably find out how to do this by looking into the
> implementation of the Emacs Lisp debuggers (debug.el and edebug.el), but
> I thought I'd be lazy and ask the experts here first.

It's a function named something like `backtrace'.

> I want to know whether I can distinguish between calls to 2 functions defined
> like this:
> (defun foo () ...)
> (fset 'bar 'foo)
> within a piece of advice:
> (defadvice foo (after ...)
>    ;; How can I determine whether called as foo or as bar?
>    ...)

I recommend you avoid the above-mentioned function and put an advice
around `bar' additionally to an advice around `foo' instead.
The advice around bar could just be

  (defadvice bar (around ...)
    (let ((i-m-in-bar t))
      ad-do-it))


-- Stefan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]