[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: |
Thu, 7 Jul 2022 13:03:58 +0200 |
> Sent: Thursday, July 07, 2022 at 8:29 AM
> From: "Jean Louis" <bugs@gnu.support>
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: carlmarcos@tutanota.com, "Stefan Monnier" <monnier@iro.umontreal.ca>,
> "Tassilo Horn" <tsdh@gnu.org>, help-gnu-emacs@gnu.org
> Subject: Re: Making a function than can only be used interactively
>
> * Christopher Dimech <dimech@gmx.com> [2022-07-06 23:00]:
> >
> > > Sent: Wednesday, July 06, 2022 at 12:07 PM
> > > From: "Jean Louis" <bugs@gnu.support>
> > > To: carlmarcos@tutanota.com
> > > Cc: "Stefan Monnier" <monnier@iro.umontreal.ca>, "Tassilo Horn"
> > > <tsdh@gnu.org>, help-gnu-emacs@gnu.org
> > > Subject: Re: Making a function than can only be used interactively
> > >
> > > * carlmarcos--- via Users list for the GNU Emacs text editor
> > > <help-gnu-emacs@gnu.org> [2022-07-04 22:52]:
> > > > Technically, you can use `completing-read` and `read-from-minibuffer`
> > > > if you'd also
> > > > like to set values interactively, while calling the function
> > > > non-interactively. One can
> > > > achieve more or less the same effect with setting values of local
> > > > variables outside
> > > > the interactive expression. In this scenario, running the function
> > > > non-interactively would
> > > > still force interactive input from the minibuffer.
> > > >
> > > > I am not sure if in practice that is ever desired.
> > >
> > > (interactive &optional ARG-DESCRIPTOR &rest MODES) -- this makes the
> > > function a command that may be tied to a key, and it helps in
> > > specifying the arguments to the function.
> > >
> > > In this context function may be run as command, or by pressing a
> > > key. However, it does not really mean it need to interact with user,
> > > not at all. It does not need to ask nothing of the user. In fact, it
> > > can just interactively, during Emacs session be called by user with
> > > M-x or by using a key. Beyond that, function may remain quite silent
> > > without interactivity.
> > >
> > > The above is one specific context where word "interactive" is used as
> > > in function (interactive).
> > >
> > > It does not exclude the other context that any function without
> > > (interactive) may do interactive activities, like ask user
> > > interactively for input.
> >
> > If one does not mind interactive activities with the minibuffer for
> > a function without the interactive clause.
>
> 1) That means for me, you did not understand what is interactive
> function. Just read docstring.
>
> 2) Nowhere it says that function without (interactive) cannot
> interact with user.
It is a way to pass arguments with user prompt.
> Numbers above (1) and (2) are different contexts. A word such as
> "interactive" has different meanings.
What different meanings?
> --
> Jean
>
> Take action in Free Software Foundation campaigns:
> https://www.fsf.org/campaigns
>
> In support of Richard M. Stallman
> https://stallmansupport.org/
>
- Re: Making a function than can only be used interactively, (continued)
- Re: Making a function than can only be used interactively, carlmarcos, 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, carlmarcos, 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, Jean Louis, 2022/07/05
- Re: Making a function than can only be used interactively, Christopher Dimech, 2022/07/06
- Re: Making a function than can only be used interactively, Jean Louis, 2022/07/07
- Re: Making a function than can only be used interactively,
Christopher Dimech <=
- Re: Making a function than can only be used interactively, carlmarcos, 2022/07/07
- 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, carlmarcos, 2022/07/07
- 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