bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#60527: 30.0.50; Typing SPC in a minibuffer with completion


From: Drew Adams
Subject: bug#60527: 30.0.50; Typing SPC in a minibuffer with completion
Date: Tue, 3 Jan 2023 20:14:57 +0000

> I wish the SPC binding to `minibuffer-complete-word` would go because it
> makes it hard to type SPC in the minibuffer whenever there's completion.

Finally.  Bravo - bonne initiative !

> Typing a SPC in a "minibuffer with completion" can be needed when the
> things we want to complete contains a SPC character (e.g. file names,
> which is why we disable that SPC binding when completing file names),
> but also when using completion styles like `orderless` which make the
> use of a SPC character to specify how to select the
> completion candidates.
> 
> So my favorite option is indeed to simply remove this binding.
> Those few users who like it and use it (probably long-time users of
> Emacs) could easily get it back with:
> 
>     (define-key minibuffer-local-completion-map
>                 " " 'minibuffer-complete-word)
> 
> Another option is to change `minibuffer-complete-word` so that instead
> of beeping "No match", it inserts a SPC when there's no completion and
> `require-match` is nil (after checking that the command was invoked via
> SPC).
> 
> Yet another option would be to let callers of `completing-read` indicate
> that it's likely the users will sometimes want to type a SPC character
> for this specific minibuffer input (i.e. `completing-read` would then
> use a map like `minibuffer-local-filename-completion-map`).
> 
> Currently packages which want to use `completing-read` to let the users
> enter a string that will often contain spaces are reduced the either
> telling their users "Add this `define-key` thingy in your .emacs because
> the defaults suck" or having to use a `minibuffer-with-setup-hook`
> workaround that forcefully rebinds SPC during that minibuffer session,
> which may be the wrong thing to do if SPC was binding to something else
> than `minibuffer-complete-word`.
> Both of those options are undesirable, IMO.  We should instead improve
> the defaults to make such recommendations and workarounds unnecessary.

FWIW, Icicles removes `SPC' for word completion by
default (since 2005, i.e., nearly the beginning).
It puts word completion on a different key
(`M-SPC', by default).

____

 icicle-word-completion-keys is a variable defined in `icicles-opt.el'.

 Its value is ([(meta 32)])

 Documentation:

 Key sequences to use for minibuffer prefix word completion.
 A list of values that each has the same form as a key-sequence
 argument to `define-key'.  It is a list mainly in order to accommodate
 different keyboards.

 Because file names, in particular, can contain spaces, some people
 prefer such a key sequence to be non-printable, such as `M-SPC'.  This
 is the default value in Icicles.

 But because the spacebar is such a convenient key to hit, other people
 prefer to use `SPC' for word completion, and to insert a space some
 other way.  The usual way to do that is via `C-q SPC', but command
 `icicle-insert-a-space' is provided for convenience.  You can bind
 this to `M-SPC', for instance, in `minibuffer-local-completion-map',
 `minibuffer-local-completion-map', and
 `minibuffer-local-must-match-map'.

 You can customize this variable.
____






reply via email to

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