[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Making a function than can only be used interactively
From: |
Christopher Dimech |
Subject: |
Re: Making a function than can only be used interactively |
Date: |
Fri, 8 Jul 2022 18:14:58 +0200 |
> Sent: Friday, July 08, 2022 at 6:55 PM
> From: "Yuri Khan" <yuri.v.khan@gmail.com>
> To: "help-gnu-emacs" <help-gnu-emacs@gnu.org>
> Subject: Re: Making a function than can only be used interactively
>
> On Fri, 8 Jul 2022 at 13:31, Emanuel Berg <incal@dataswamp.org> wrote:
>
> > > It does not matter for interactive use. [...] ‘&optional’
> > > comes into play if you use this function non-interactively,
> > > from Lisp
> >
> > No, it matters. One example how it matters is that optional
> > arguments defaults to nil.
>
> You’re right, with an interactive specification that evaluates to a
> list it matters, because the list you return may or may not have as
> many arguments as the function takes.
>
> My point was that in the specific case of a three-argument function
> and a three-item string-valued interactive specification, &optional
> does not matter for interactive use.
It looks as if the easiest understanding of mandatory versus optional
function arguments occurs when using a function interactively.
For the interactive case, it is quite complicated, depending on whether
the function uses code characters or a list.
My proposition would be to include the corresponding explanation on using
in either the "Emacs Lisp Reference Manual" or the "Introduction to Programming
in Emacs Lisp".
- Re: Making a function than can only be used interactively, (continued)
- Re: Making a function than can only be used interactively, Emanuel Berg, 2022/07/07
- Re: Making a function than can only be used interactively, Yuri Khan, 2022/07/08
- Re: Making a function than can only be used interactively, Emanuel Berg, 2022/07/08
- Re: Making a function than can only be used interactively, Yuri Khan, 2022/07/08
- Re: Making a function than can only be used interactively, carlmarcos, 2022/07/08
- Re: Making a function than can only be used interactively, Emanuel Berg, 2022/07/08
- Re: Making a function than can only be used interactively, Emanuel Berg, 2022/07/10
- Re: Making a function than can only be used interactively, carlmarcos, 2022/07/08
- Re: Making a function than can only be used interactively, Christopher Dimech, 2022/07/08
- Message not available
- Re: Making a function than can only be used interactively, carlmarcos, 2022/07/08
- Re: Making a function than can only be used interactively,
Christopher Dimech <=
- RE: [External] : Re: Making a function than can only be used interactively, Drew Adams, 2022/07/08
- RE: [External] : Re: Making a function than can only be used interactively, carlmarcos, 2022/07/08
- RE: [External] : Re: Making a function than can only be used interactively, Drew Adams, 2022/07/08
- RE: [External] : Re: Making a function than can only be used interactively, carlmarcos, 2022/07/08
- RE: [External] : Re: Making a function than can only be used interactively, Drew Adams, 2022/07/09
- Re: [External] : Re: Making a function than can only be used interactively, Emanuel Berg, 2022/07/08
- Re: [External] : Re: Making a function than can only be used interactively, Emanuel Berg, 2022/07/08
- RE: [External] : Re: Making a function than can only be used interactively, Drew Adams, 2022/07/04
- no difference between interactive and "from Lisp" (was: Re: Making a function than can only be used interactively), Emanuel Berg, 2022/07/05
- Re: no difference between interactive and "from Lisp", Stefan Monnier, 2022/07/05