emacs-devel
[Top][All Lists]
Advanced

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

RE: Ordering of command completions


From: Drew Adams
Subject: RE: Ordering of command completions
Date: Sun, 7 Dec 2014 12:42:42 -0800 (PST)

> > I don't think Emacs should be overly ambitious here in excluding
> > commands.  It should instead exclude only commands that it is
> > absolutely sure no user would be able to use in the current
> > context.  What "context" means here is probably the real question.
> 
> Well, if the command definition comes with an attached statement
> about its applicable context ("when such mode is enabled") Emacs
> has a definitive method for the decision.

OK, yes.

It's not always good for the code of a command (which I guess is
where this declaration resides) to preclude where it might be
invoked.  But I guess this is no different in that regard than
the command raising an error if not in the desired mode.  So I
don't have a problem with this way of making it known to `M-x'
that a command is "inappropriate".

In that case, why only move it to the end of the sort order,
instead of completely excluding it as a candidate?  Presence
as a candidate affects completion (e.g. whether there is a match).

> > To me, if you have loaded a library that defines commands that
> > you can invoke currently (which, a priori is the case for most
> > commands), then I *want* `M-x' to include those commands when
> > my input matches their names.
> 
> I was thinking about this scenario: the user is happily hacking on C
> code, then he starts Gnus, reads for a while, quits the Gnus session
> and comes back to his C hacking. Now M-x lists hundreds of gnus-*
> functions such as gnus-summary-expire-articles-now, which only
> applies to a Gnus Summary buffer. This is a net negative contribution
> to the usability of M-x.

Yes, but whose fault is that? ;-)

Just kidding.  If Gnus declares its stuff invocable by `M-x'
only when in some Gnus mode, I agree that that is an improvement.

But in that case, it should not just be about sort order.  The
noise should be removed altogether, if it is truly inappropriate
outside of some context.

Sounds good to me, I guess.  Is there a way for a user to advise
such a command to change or remove the declaration?  Is `declare'
amenable to advising?



reply via email to

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