unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How can function know its own name?
@ 2022-06-25 20:21 Jean Louis
  2022-06-25 21:37 ` Emanuel Berg
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Jean Louis @ 2022-06-25 20:21 UTC (permalink / raw)
  To: Help GNU Emacs


I would like to invoke logging for specific functions automatically,
without specifying what to log, and my function should know which
function invoked it.

For example

(defun my-log (&optional function-name)
  (log-to-database function-name))

(defun logged-function ()
  (my-log (find-function-name)) ;; I would like at this point to recognize that it was invoked from within logged-function?
  (ignore))

Would this be possible somehow?


Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/




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

end of thread, other threads:[~2022-06-27  2:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-25 20:21 How can function know its own name? Jean Louis
2022-06-25 21:37 ` Emanuel Berg
2022-06-26  5:46 ` tomas
2022-06-26  8:08   ` Jean Louis
2022-06-26  8:54 ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-06-26  9:25   ` tomas
2022-06-26 10:13   ` Jean Louis
2022-06-26 21:25     ` Stefan Monnier
2022-06-27  2:35       ` Jean Louis
2022-06-26  9:43 ` Philip Kaludercic
2022-06-26 10:21   ` Jean Louis
2022-06-26 10:31   ` Jean Louis
2022-06-26 21:13     ` Stefan Monnier via Users list for the GNU Emacs text editor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).