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

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

Re: How can function know its own name?


From: Stefan Monnier
Subject: Re: How can function know its own name?
Date: Sun, 26 Jun 2022 17:13:57 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

> (defun my-function-name ()
>   (cadr (backtrace-frame 5)))

The number will need to be different if your code is byte-compiled, or
instrumented for Edebug, or if your function is advised (e.g. which
includes the use of `elp-profile`, `debug-on-entry`, `trace-function`).


        Stefan




reply via email to

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