all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to get advised function name form inside of the advice
@ 2016-03-04 13:36 Vitalie Spinu
  2016-03-04 14:16 ` Marcin Borkowski
  0 siblings, 1 reply; 7+ messages in thread
From: Vitalie Spinu @ 2016-03-04 13:36 UTC (permalink / raw)
  To: emacs-devel



Hi,

How to retrieve the name of the original function from the inside of "new"
advice? I need to condition-case a function and show a meaningful error message
with function name instead of an error.

For concreteness:

    
    (defun tt (a b)
      (message "in: (%s . %d)" a b))
    
    (defun tt-add (fun &rest args)
      (message "running advice for: %s" how_to_get_tt_name_here_)
      (apply fun args))
    
    (advice-add 'tt :around 'tt-add)


Thanks,

  Vitalie




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-03-21  1:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-04 13:36 How to get advised function name form inside of the advice Vitalie Spinu
2016-03-04 14:16 ` Marcin Borkowski
2016-03-04 16:56   ` Vitalie Spinu
2016-03-04 18:30     ` Michael Heerdegen
2016-03-04 18:32     ` Marcin Borkowski
2016-03-08  4:22     ` Stefan Monnier
2016-03-21  1:33       ` Vitalie Spinu

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.