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: Philip Kaludercic
Subject: Re: How can function know its own name?
Date: Sun, 26 Jun 2022 09:43:35 +0000

Jean Louis <bugs@gnu.support> writes:

> 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/

This might do the job: 
https://emacs.stackexchange.com/questions/2310/can-functions-access-their-name/2312#2312



reply via email to

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