[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 monnier@iro.umontreal.ca:
>> 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.
Re: Making a function than can only be used interactively, Christopher Dimech, 2022/07/04
Re: Making a function than can only be used interactively, Christopher Dimech, 2022/07/04
Re: Making a function than can only be used interactively, Christopher Dimech, 2022/07/04
- Re: Making a function than can only be used interactively, Stefan Monnier, 2022/07/04
- Re: Making a function than can only be used interactively, Christopher Dimech, 2022/07/04
- Re: Making a function than can only be used interactively, Stefan Monnier, 2022/07/04
- RE: [External] : Re: Making a function than can only be used interactively, Drew Adams, 2022/07/05
- Re: RE: [External] : Making a function than can only be used interactively, Christopher Dimech, 2022/07/05
- RE: RE: [External] : Making a function than can only be used interactively, Drew Adams, 2022/07/05
- Message not available
- FW: RE: RE: [External] : Making a function than can only be used interactively, Drew Adams, 2022/07/05
- Re: FW: RE: RE: [External] : Making a function than can only be used interactively, Christopher Dimech, 2022/07/05
Re: Making a function than can only be used interactively, Christopher Dimech, 2022/07/04