emacs-devel
[Top][All Lists]
Advanced

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

Re: Smarter M-x that filters on major-mode


From: Stefan Kangas
Subject: Re: Smarter M-x that filters on major-mode
Date: Tue, 16 Feb 2021 11:07:53 -0600

Hi Alan,

Alan Mackenzie <acm@muc.de> writes:

>>  -- Special Form: interactive arg-descriptor
>>      This special form declares that a function is a command, and that
>>      it may therefore be called interactively (via ‘M-x’ or by entering
>>      a key sequence bound to it).
>
>> So `interactive' is exactly about showing it on `M-x'.  Now we add an
>> extension to that which says _in which modes_ `M-x' will show it (by
>> default).  That feels very natural to me.
>
> No, it's not about "showing" the command.  It's about executing it.

The difference between any function and an `interactive' command is that
the latter can be executed more conveniently: it can be bound to a key
or invoked with `M-x'.  IOW, both `interactive' and the new extension is
about making functions conveniently available for execution in various
contexts.  And yes, this includes "showing" it in `M-x'.

> Surely you see there's a difference, a substantial difference, between
> searching for a command, or choosing one, and then executing it?

Yes, of course.  You obviously might want to search for a function
without then also wanting to execute it.

However, `M-x' is _typically_ used to find and execute commands.
(We have other commands specifically intended for searching.)

IIUC, you have said that you use `M-x' to search for commands without
executing them, and at times prefer that to using the commands we have
specifically for searching.  That is a valid use-case, and precisely why
we should have an option to disable mode filtering.

But I don't see how that pertains to the relative cleanliness of making
this extension to `interactive'.  Perhaps I misunderstood the argument
you were trying to make.



reply via email to

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