emacs-devel
[Top][All Lists]
Advanced

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

Re: Current mode command discovery


From: Jean Louis
Subject: Re: Current mode command discovery
Date: Sat, 20 Feb 2021 14:55:39 +0300
User-agent: Mutt/2.0 (3d08634) (2020-11-07)

* Lars Ingebrigtsen <larsi@gnus.org> [2021-02-17 14:33]:
> Note: THIS IS NOT A DISCUSSION ABOUT M-X.
> 
> Óscar Fuentes <ofv@wanadoo.es> writes:
> 
> > That would be very interesting, but AFAIU with the current
> > implementation it has some problems.
> >
> > It would miss some candidates which belong to the current mode although
> > they are not marked as mode-specific because they are also applicable to
> > other contexts. This would be confusing for the user.
> >
> > So we need a mechanism for saying `foo-bar-command' belongs to
> > `foo-mode', but it is not specific of that mode.
> 
> Yes, that's a problem.
> 
> Hm...  there's two obvious sources if information about what commands
> "belong" to a mode: There's the key bindings, and then there's the new
> mode tagging.  We could perhaps use both in this new command?  I.e., if
> somebody has gone to the trouble to add a command to the keymap of the
> mode, then it's probably pretty useful for that mode?

For your consideration, many of commands I program are useful globally
but bound to specific keymap and mostly useful in specific mode. It is
useful in that mode, it appears in the menu, but is also useful
globally.

If I wish to see all SMS messages sent and received, I may invoke such
command in mode, on the line specific to person with some ID number
like 123 would be SMS messages related to 123, but invoked globally I
could see the latest messages list and simply respond or send new
messages from there.

Maybe consider advising package authors how to designate commands
related to specific modes. My idea about that is that you invoke new
variable automatically when defining the mode and that authors or
users if not authors, can add function names in a list to that
variable.

That way some users can extend the package and simply add new
functions to the same mode, so those functions would be appearing in
that mode, even if outside of scope of the mode.

Jean



reply via email to

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