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

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

Re: Is there way to read function invoked and its parameters?


From: Yuri Khan
Subject: Re: Is there way to read function invoked and its parameters?
Date: Mon, 28 Dec 2020 16:04:41 +0700

On Mon, 28 Dec 2020 at 14:08, Jean Louis <bugs@gnu.support> wrote:

> The principle for refreshing or reverting is there, that is
> right. Only that it is very inconvenient especially if there is large
> number of functions.
>
> In the above example I would rather like to pass some dynamically
> defined function to add-hook then making many revert functions for
> each report.
>
> I am now thinking to employ something like this concept:
>
> (defun my-report (arg1 arg2 arg3)
>   (cl-flet my-report--revert ()
>            (my-report arg1 arg2 arg3))
>   (invoke-other-function 'my-report--revert))
>
> Then other function can set up hooks by using that function. Does
> this sound alright to you?

It might be possible but it’s not a good idea. Even if you manage to
keep a function definition in a buffer-local variable, debugging that
is likely going to be unpleasant.



reply via email to

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