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

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

bug#34089: 27.0.50; Substring icomplete broken for M-x switch-to-buffer


From: Stefan Monnier
Subject: bug#34089: 27.0.50; Substring icomplete broken for M-x switch-to-buffer
Date: Tue, 15 Jan 2019 21:02:59 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> Now type "M".  The minibuffer suggest the buffer "Messages", but what
> about "*Messages"?  Why isn't it considered?

Your (setq completion-styles '(substring)) is ignored by `C-x b`
because that command uses category `buffer` which has
a setting in completion-category-defaults of (styles basic substring),
so before trying `substring` it tries `basic`.

IOW, by default C-x b first tries prefix match and when that fails falls
back on `substring` and if you want to use `substring` without using
`basic` before, you'll need

    (add-to-list 'completion-category-overrides '(buffer (styles substring)))

Arguably this is a bug: the purpose of this completion-category-defaults
settings is to add substring after the global default `basic` style, so
if the global default starts with `substring` the better behavior would
be to just use the global default.

Not sure how to write the code that combines category-default-styles and
global styles in order to get that behavior.


        Stefan





reply via email to

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