GNU bug report logs - #34089
27.0.50; Substring icomplete broken for M-x switch-to-buffer

Previous Next

Package: emacs;

Reported by: João Távora <joaotavora <at> gmail.com>

Date: Wed, 16 Jan 2019 00:12:02 UTC

Severity: normal

Found in version 27.0.50

Done: João Távora <joaotavora <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34089 in the body.
You can then email your comments to 34089 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#34089; Package emacs. (Wed, 16 Jan 2019 00:12:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to João Távora <joaotavora <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 16 Jan 2019 00:12:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: monnier <at> iro.umontreal.ca
Subject: 27.0.50; Substring icomplete broken for M-x switch-to-buffer
Date: Wed, 16 Jan 2019 00:11:38 +0000
Hi maintainers,

In my newfound icomplete adventures, I've come across a very annoying
bug I just cannot catch:

    Emacs -Q
    M-x icomplete-mode
    M-: (setq completion-styles '(substring)) RET
    M-: (generate-new-buffer "Messages") RET
    C-x b

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

If, instead of "M", I type "essa", then "Messages" and "*Messages*"
_are_ both considered, correctly.

Tracing completion-substring-try/all-completion shows that it is not
being called in the first situation: why???

João








Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34089; Package emacs. (Wed, 16 Jan 2019 02:04:01 GMT) Full text and rfc822 format available.

Message #8 received at 34089 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: João Távora <joaotavora <at> gmail.com>
Cc: 34089 <at> debbugs.gnu.org
Subject: Re: 27.0.50; Substring icomplete broken for M-x switch-to-buffer
Date: Tue, 15 Jan 2019 21:02:59 -0500
> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34089; Package emacs. (Wed, 16 Jan 2019 06:49:02 GMT) Full text and rfc822 format available.

Message #11 received at 34089 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 34089 <at> debbugs.gnu.org, 34089-done <at> debbugs.gnu.org
Subject: Re: bug#34089: 27.0.50;
 Substring icomplete broken for M-x switch-to-buffer
Date: Wed, 16 Jan 2019 06:48:25 +0000
[Message part 1 (text/plain, inline)]
On Wed, Jan 16, 2019, 02:04 Stefan Monnier <monnier <at> iro.umontreal.ca wrote:

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


Delete everything and try again?

I kid, I kid... :-) Thanks Stefan, I was hoping for such an easy answer!

BTW how do you debug this stuff?  Edebug is akward because of the
minibuffer usage (and the second frame technique doesn't always work).

João
[Message part 2 (text/html, inline)]

Reply sent to João Távora <joaotavora <at> gmail.com>:
You have taken responsibility. (Wed, 16 Jan 2019 06:49:03 GMT) Full text and rfc822 format available.

Notification sent to João Távora <joaotavora <at> gmail.com>:
bug acknowledged by developer. (Wed, 16 Jan 2019 06:49:04 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 13 Feb 2019 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 74 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.