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

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

Re: Placement of list within an interactive clause


From: Emanuel Berg
Subject: Re: Placement of list within an interactive clause
Date: Mon, 01 Aug 2022 13:52:46 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Jean Louis wrote:

> However, I have explained in the above example of mine that
> such input may be provided in the function itself. And it
> looks to me that it is better handled that way than through
> `interactive' declaration.

Cases that can't be handled by the ARG-DESCRIPTOR argument can
be handled with Lisp, if so the best place for that is within
the `interactive' form ...

> So this is the way to go:
>
> (defun my-fun-2 (&optional name)
>   (interactive)
>   (let ((name (or name (read-from-minibuffer "Name: "))))
>     (message "Hello %s" name)))

Here it is better to make the argument non-optional,
i.e. mandatory from Lisp, and interactively like this

  (interactive "sName: ")

> That means, when there is declaration (interactive), that
> function becomes accessible through M-x invokation, and it
> may be bound to a key.

Yes, it becomes a "command".

I don't know if I like this solution TBH, I think all
functions should be callable from everywhere and make sense
everywhere, called in whatever way they might ...

Dutch total football, if you like ...

> Function `interactive' DOES NOT make function "interactive"
> in the other contexts in English language, there is special
> meaning in the Emacs Lisp context. Programming meaning is
> simply not same to English context.

Programming should always be in English but it isn't
English LOL :D

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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