[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs 25.0.04: Feature Request: Make called-interactively-p's argume
From: |
Robert Weiner |
Subject: |
Re: Emacs 25.0.04: Feature Request: Make called-interactively-p's argument optional |
Date: |
Wed, 6 Jul 2016 01:03:03 -0400 |
On Tue, Jul 5, 2016 at 8:24 PM, Noam Postavsky
<address@hidden> wrote:
> The recommended way to test whether the function was called using
> ‘call-interactively’ is to give it an optional argument
> ‘print-message’ and use the ‘interactive’ spec to make it
> non-‘nil’ in interactive calls. Here’s an example:
>
> (defun foo (&optional print-message)
> (interactive "p")
> (when print-message
> (message "foo")))
This makes little sense to me. Every time I have a function that
needs to test whether it was called interactively you want me to add
essentially an interactive-flag to its argument signature and then
never send this argument when called non-interactively since the
caller won't care and the argument is optional so it will be nil by
default. Again, why should we name and have to look at an argument to
the function when the interactive test we want is internal to it.
This is similar to the argument that we shouldn't have to send the
default 'interactive argument to called-interactively-p.
I'm with John, let's simplify this. Let's undeprecate
(interactive-p). Did people actually have problems with that that
kept coming up? Raman and I seemed to have used it for years without
encountering any.
And John, if you undeprecate it do you really need a patch or can you
just change it?
Bob
- Re: Emacs 25.0.04: Feature Request: Make called-interactively-p's argument optional, (continued)
- Re: Emacs 25.0.04: Feature Request: Make called-interactively-p's argument optional, John Wiegley, 2016/07/05
- Re: Emacs 25.0.04: Feature Request: Make called-interactively-p's argument optional, Dmitry Gutov, 2016/07/05
- Re: Emacs 25.0.04: Feature Request: Make called-interactively-p's argument optional, John Wiegley, 2016/07/05
- Re: Emacs 25.0.04: Feature Request: Make called-interactively-p's argument optional, raman, 2016/07/05
- Re: Emacs 25.0.04: Feature Request: Make called-interactively-p's argument optional, Dmitry Gutov, 2016/07/05
- Re: Emacs 25.0.04: Feature Request: Make called-interactively-p's argument optional, Eli Zaretskii, 2016/07/06
- Re: Emacs 25.0.04: Feature Request: Make called-interactively-p's argument optional, raman, 2016/07/06
- Re: Emacs 25.0.04: Feature Request: Make called-interactively-p's argument optional, Eli Zaretskii, 2016/07/06
- Re: Emacs 25.0.04: Feature Request: Make called-interactively-p's argument optional, Robert Weiner, 2016/07/06
Re: Emacs 25.0.04: Feature Request: Make called-interactively-p's argument optional, Noam Postavsky, 2016/07/05