[Top][All Lists]

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

Re: Making a function than can only be used interactively

From: carlmarcos
Subject: Re: Making a function than can only be used interactively
Date: Wed, 6 Jul 2022 00:34:31 +0200 (CEST)

Jul 4, 2022, 21:18 by

>> Another debate is that although one can declare a non-interactive function,
>> and an interactive function that can run non-interactively; there is no
>> construct that can define a purely interactive function.
> That's because an "interactive function" is just a normal function
> together with some auxiliary info to tell `call-interactive` how to call
> it "interactively".  Internally `call-interactively` will end up calling
> the function via `funcall`, i.e. "non-interactively".  So at
> a low-level, technically you just can't have a function that can be
> called interactively and not non-interactively.  You can try and kludge
> it up above if you really want to (like we've seen in a few different
> ways), but we're back to the question: what's the benefit?
>> Does a function know whether it was run from lisp code or from the user in
>> an Emacs session?
> Trying to behave differently depending on who/how a function was called
> goes against the design principle of functions, so it tends to be kludgy
> and unreliable, like `called-interactively-p`.
>  Stefan
Quite sure now that the plan ought  to be abandoned.

reply via email to

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