emacs-devel
[Top][All Lists]
Advanced

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

RE: [External] : Re: Completions and history


From: Drew Adams
Subject: RE: [External] : Re: Completions and history
Date: Wed, 13 Apr 2022 16:40:48 +0000

> > Maybe the same key `C-c C-l' could be bound by default
> > in the minibuffer to enable history completion?
> 
> Discussing default keybindings tends to be rather
> unfruitful, but still: unless I'm missing something,
> `M-r' (previous-matching-history-element)
> is strictly less powerful than `C-M-r'
> (isearch-backward-regexp).

Dunno why you would choose to compare those two.

Anyway, Isearch key `C-M-r' is "more powerful" than
Isearch key `C-r' too.  So what?  There are good
reasons why Emacs has two different keys for those
different commands.

> History completion is quite handy and would be a
> better use for `M-r' in my opinion.

Of course it's quite handy.  So is simple history
search with `M-r` (previous-matching-history-element).

Let's please not try to cram the proposed feature
onto an existing key binding.  Users should _also_
be able to complete against history items.

As the guy who long ago tried to get Emacs more
interested in using completion for minibuffer
reading, I'm convinced of its utility.

That doesn't mean completion is always the best way
to let users choose something.  It's just one way.

It doesn't mean that completion should replace other
longstanding ways to choose things, especially when
it doesn't offer the same possibilities.
___

I'll give you an analogous how-to-choose from
Icicles, FWIW:

You can use key `C-,' in the minibuffer during
completion to change to a different sort order.

How to choose the sort order?  One way is completion:
You can pick one from those available in the current
context (you can see them in *Completions*).  Another
way is just cycling among them, without bothering to
see them all or bothering to type input to match one.

Icicles offers both possibilities, both (1) as a user
preference (Customize option) and (2) on the fly, for
any given use of `C-,'.

In fact, the option allows three possibilities:

 1. Always use completion.
 2. Always use cycling.
 3. Use completion if there are more than N sort
    orders to choose from; else use cycling.

`C-u' flips the behavior: if the option would
normally call for completion then cycle instead,
and vice versa.

Why go to the trouble of providing those different
ways to change the sort order?  Because completion,
though "quite handy", as you say, isn't always the
best or quickest way to choose something.  Cycling
isn't always the best way either.

A simple rule is fine, but a given user, with a
given command that involves choosing something,
can want this or that behavior.  Let users choose
what they want easily.





reply via email to

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