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: Lars Ingebrigtsen
Subject: Re: Smarter M-x that filters on major-mode
Date: Thu, 11 Feb 2021 17:13:20 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> And since more than 90% of the commands will eventually get this sort of
>> annotation (I didn't actually count), that seemed kinda inefficient.
>
> That's indeed possible, but I'm not sure it will be the case (it seems
> like a lot of work to get there, unless we can come up with some way to
> automatically infer most of those predicates somehow, or to specify
> them "globally" by grouping in the source code commands that share the
> same predicate, or something).

I don't think anything automatic is possible -- in that case, automatic
filters would be fine.  I've gone over a bunch of Gnus files (and those
are as difficult as it gets, because there's a lot of Gnus modes), and
it's tedious, but not difficult.  And since this leads to immediate user
experience improvements, I'm hopeful that people will actually start
doing the markup.

> But since you're touching the `interactive-form` part, it's a good
> opportunity to mention that some commands would benefit from being able
> to specify not just how to build the arguments for interactive use but
> also what to do with the result (such as how to display it).
>
> So there's a case to be made that we should allow the `interactive-form`
> to specify a generic wrapper: a function that takes a single argument
> (the function to be called) and is then in charge of building the
> arglist, calling the function, and do what it wants with the result.

I'm not quite sure I follow you here...  the `interactive-form' function
just returns the interactive spec, and I've not changed that at all.
(I've changed how the function works internally, because the storage now
looks slightly different, but...)

> I'm not sure how best to integrate this with the kind of predicates we're
> discussing here...

I've also added a `read-extended-command-predicate' that users can tweak
to determine what they want to have included when they `M-x TAB', but
the default is "all commands, but not the ones that are tagged as
belonging to other modes than the current major mode".

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

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