emacs-devel
[Top][All Lists]
Advanced

[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: Andreas Röhler
Subject: Re: Emacs 25.0.04: Feature Request: Make called-interactively-p's argument optional
Date: Wed, 6 Jul 2016 08:45:29 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.1.0



On 06.07.2016 07:03, Robert Weiner wrote:
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


1+



reply via email to

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