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: Jean Louis
Subject: Re: Smarter M-x that filters on major-mode
Date: Fri, 12 Feb 2021 10:06:23 +0300
User-agent: Mutt/2.0 (3d08634) (2020-11-07)

* tomas@tuxteam.de <tomas@tuxteam.de> [2021-02-11 11:41]:
> > It would indeed be very useful to provide a mechanism to exclude
> > commands from M-x that are useless outside of their major mode.
> 
> Nobody uses M-x in an explorative way?

Me, I use it all the time.

M-x *KEYWORD<TAB>

is what I mostly use to find keyboards. Sometimes I turn on ivy-mode
and just type a keyword with other keywords in combination to
research. I also forget names of my own commands like these:

rcd-update-locations-from-arc-1964-utm-36N-to-wgs-84
rcd-update-locations-from-dms-arc1960-tz-to-wgs84

So I have to find the right one to apply it.

> IMO this is a bad idea for discoverability. What is (and what is not)
> relevant to a mode is necessarily subject to a judgement call by
> someone.

The idea to narrow M-x commands only to mode relevant commands shall
be user option that may be turned on by the user, and definitely not
by default. 

Those global commands shall not be excluded if they do not belong to
specific mode.

It would be useful to avoid some interactive commands to apprea in M-x
and here I do not refer to just those not relevant to current
mode. I refer to those functions which cannot be otherwise invoked
alone but have to be designed as interactive for them to be called by
some key.

Example error when I bind non-interactive function to "/ f":

Debugger entered--Lisp error: (wrong-type-argument commandp hyperscope-filter)
  call-interactively(hyperscope-filter nil nil)
  command-execute(hyperscope-filter)

but if function is interactive that error does not appear.

Because the function works and is meant to work only under specific
conditions I would like to exclude that function from appearing in the
M-x list. Alone it does nothing, as it expects condition of derived
tabulated list.

If there is some way to do so now, and somebody knows about it, let me
know.

Jean




reply via email to

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