Package: emacs;
Reported by: Lester Longley <lester <at> ieee.org>
Date: Sat, 18 Oct 2025 21:09:02 UTC
Severity: normal
Found in version 31.0.50
To reply to this bug, email your comments to 79652 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
bug-gnu-emacs <at> gnu.org:bug#79652; Package emacs.
(Sat, 18 Oct 2025 21:09:02 GMT) Full text and rfc822 format available.Lester Longley <lester <at> ieee.org>:bug-gnu-emacs <at> gnu.org.
(Sat, 18 Oct 2025 21:09:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Lester Longley <lester <at> ieee.org> To: bug-gnu-emacs <at> gnu.org Subject: 31.0.50; incorrect filtering in help--symbol-completion-table Date: Sat, 18 Oct 2025 17:07:55 -0400
[Message part 1 (text/plain, inline)]
Hello,
I'm reporting a bug, with guidance from Daniel Mendler.
The original discussion is at
https://github.com/oantolin/orderless/issues/193
To readily demonstrate the issue, these packages need to be installed:
(1) https://elpa.gnu.org/packages/orderless.html
(2) https://elpa.gnu.org/packages/marginalia.html
Then:
$ emacs -Q
and execute the following additional setup manually:
(progn
(dolist (path '("~/.emacs.d/elpa/marginalia-2.4"
"~/.emacs.d/elpa/orderless-1.5"))
(add-to-list 'load-path path))
(require 'marginalia)
(marginalia-mode)
(require 'orderless)
(custom-set-variables
'(completion-styles '(orderless basic))
'(completion-category-overrides '(
(command (styles orderless basic))
(symbol-help (styles orderless basic))
))
)
)
The issue involves "completion", using this expression: describe-
&(C-h.[A-Z])
Background: "&(C-h.[A-Z])" is an "orderless-annotation" ("&..." is the
general form of the annotation).
More info.: https://github.com/oantolin/orderless#style-modifiers
The difference concerns completion using "M-x" vs. "C-h f" (or "C-h x").
With "M-x describe- &(C-h.[A-Z]) TAB", I get the expected results--commands
beginning with "describe-", which have key bindings of the form: C-h [A-Z].
[image: emacs-marginalia-orderless_M-x.png]
However, with "C-h f describe- &(C-h.[A-Z]) TAB", I see additional results,
unexpected (by me), i.e., additional functions which aren't bound to C-h
[A-Z]:
[image: emacs-marginalia-orderless_C-h_f.png]
FWIW, I get the same results using "C-h x" (`describe-command') as I do
with "C-h f" (`describe-function').
I don't know of a simple way to exclude marginalia from this puzzle, since
it's needed to add binding annotations with "C-h f".
However, I can use orderless *without* marginalia, using the default
suggest-key-bindings = t, and get the expected result from "M-x describe-
&(C-h.[A-Z]) TAB":
[image: emacs-orderless_M-x.png]
Daniel identified that the issue can be circumvented by customizing
`help-enable-completion-autoload' to nil (I have confirmed this workaround).
He further identified what he believes to be the root cause in
`help--symbol-completion-table'--see "BUG: or is not correct here ..."
embedded in the following function listing (near end):
(defun help--symbol-completion-table (string pred action)
(if (eq action 'metadata)
`(metadata
,@(when completions-detailed
'((affixation-function .
help--symbol-completion-table-affixation)))
(category . symbol-help))
(when (and help-enable-completion-autoload
(memq action '(nil t lambda)))
(let ((prefixes (radix-tree-prefixes (help-definition-prefixes)
string)))
;; Don't load FOO.el during `test-completion' of `FOO-'.
(unless (and (eq action 'lambda) (assoc string prefixes))
(help--load-prefixes prefixes))))
(let ((prefix-completions
(and help-enable-completion-autoload
(mapcar #'intern (all-completions string
definition-prefixes)))))
(complete-with-action action obarray string
(if pred (lambda (sym)
(or (funcall pred sym) ;; BUG: or is
not correct here, since it ignores the Orderless predicate!
(memq sym
prefix-completions))))))))
Daniel further commented:
"I'm unsure what a proper fix should look like. It's possible that the
issue cannot be resolved because the predicate might be intentionally
ignored.
For autoloaded functions, there might not be enough information
available for the predicate to be satisfied.
Maybe there is nothing we can do than to either disable
help-enable-completion-autoload completely ...,
or make it less aggressively ignoring the predicate, or to live with
the additional unwanted candidates..."
Thanks,
Lester
In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.38, cairo version 1.16.0) of 2025-09-25 built on penguin
Repository revision: e719f62a50645dc096ba899fb576168c2e3aa6d2
Repository branch: master
System Description: Debian GNU/Linux 12 (bookworm)
Configured using:
'configure --with-pgtk 'CFLAGS=-g -O2
-ffile-prefix-map=/tmp/emacs.git=. -fstack-protector-strong -Wformat
-Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
-D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro'
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB
Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: Lisp Interaction
Minor modes in effect:
marginalia-mode: t
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
minibuffer-nonselected-mode: t
minibuffer-regexp-mode: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr compile comint ansi-osc ansi-color ring comp-run
bytecomp byte-compile comp-common rx emacsbug lisp-mnt message mailcap
yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache
epa derived epg rfc6068 epg-config gnus-util text-property-search
time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils orderless marginalia
compat rmc iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win
pgtk-win term/common-win touch-screen pgtk-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list replace newcomment text-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo gtk pgtk
lcms2 multi-tty move-toolbar make-network-process tty-child-frames
native-compile emacs)
Memory information:
((conses 16 69797 11253) (symbols 48 7013 0) (strings 32 17533 1036)
(string-bytes 1 564885) (vectors 16 10924)
(vector-slots 8 153240 6968) (floats 8 31 103) (intervals 56 335 16)
(buffers 1064 12))
[Message part 2 (text/html, inline)]
[emacs-marginalia-orderless_M-x.png (image/png, inline)]
[emacs-marginalia-orderless_C-h_f.png (image/png, inline)]
[emacs-orderless_M-x.png (image/png, inline)]
bug-gnu-emacs <at> gnu.org:bug#79652; Package emacs.
(Sun, 19 Oct 2025 04:42:03 GMT) Full text and rfc822 format available.Message #8 received at 79652 <at> debbugs.gnu.org (full text, mbox):
From: Eli Zaretskii <eliz <at> gnu.org> To: Lester Longley <lester <at> ieee.org> Cc: Daniel Mendler <mail <at> daniel-mendler.de>, 79652 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca> Subject: Re: bug#79652: 31.0.50; incorrect filtering in help--symbol-completion-table Date: Sun, 19 Oct 2025 07:40:56 +0300
> Date: Sat, 18 Oct 2025 17:07:55 -0400
> From: Lester Longley via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>
> I'm reporting a bug, with guidance from Daniel Mendler.
> The original discussion is at https://github.com/oantolin/orderless/issues/193
>
> To readily demonstrate the issue, these packages need to be installed:
>
> (1) https://elpa.gnu.org/packages/orderless.html
> (2) https://elpa.gnu.org/packages/marginalia.html
>
> Then:
>
> $ emacs -Q
>
> and execute the following additional setup manually:
>
> (progn
> (dolist (path '("~/.emacs.d/elpa/marginalia-2.4" "~/.emacs.d/elpa/orderless-1.5"))
> (add-to-list 'load-path path))
>
> (require 'marginalia)
> (marginalia-mode)
>
> (require 'orderless)
> (custom-set-variables
> '(completion-styles '(orderless basic))
> '(completion-category-overrides '(
> (command (styles orderless basic))
> (symbol-help (styles orderless basic))
> ))
> )
> )
>
> The issue involves "completion", using this expression: describe- &(C-h.[A-Z])
>
> Background: "&(C-h.[A-Z])" is an "orderless-annotation" ("&..." is the general form of the annotation).
> More info.: https://github.com/oantolin/orderless#style-modifiers
>
> The difference concerns completion using "M-x" vs. "C-h f" (or "C-h x").
>
> With "M-x describe- &(C-h.[A-Z]) TAB", I get the expected results--commands beginning with "describe-",
> which have key bindings of the form: C-h [A-Z].
>
> emacs-marginalia-orderless_M-x.png
>
> However, with "C-h f describe- &(C-h.[A-Z]) TAB", I see additional results, unexpected (by me), i.e.,
> additional functions which aren't bound to C-h [A-Z]:
>
> emacs-marginalia-orderless_C-h_f.png
>
> FWIW, I get the same results using "C-h x" (`describe-command') as I do with "C-h f" (`describe-function').
>
> I don't know of a simple way to exclude marginalia from this puzzle, since it's needed to add binding
> annotations with "C-h f".
> However, I can use orderless *without* marginalia, using the default suggest-key-bindings = t, and get the
> expected result from "M-x describe- &(C-h.[A-Z]) TAB":
>
> emacs-orderless_M-x.png
> Daniel identified that the issue can be circumvented by customizing `help-enable-completion-autoload' to nil
> (I have confirmed this workaround).
>
> He further identified what he believes to be the root cause in `help--symbol-completion-table'--see "BUG: or
> is not correct here ..." embedded in the following function listing (near end):
>
> (defun help--symbol-completion-table (string pred action)
> (if (eq action 'metadata)
> `(metadata
> ,@(when completions-detailed
> '((affixation-function . help--symbol-completion-table-affixation)))
> (category . symbol-help))
> (when (and help-enable-completion-autoload
> (memq action '(nil t lambda)))
> (let ((prefixes (radix-tree-prefixes (help-definition-prefixes) string)))
> ;; Don't load FOO.el during `test-completion' of `FOO-'.
> (unless (and (eq action 'lambda) (assoc string prefixes))
> (help--load-prefixes prefixes))))
> (let ((prefix-completions
> (and help-enable-completion-autoload
> (mapcar #'intern (all-completions string definition-prefixes)))))
> (complete-with-action action obarray string
> (if pred (lambda (sym)
> (or (funcall pred sym) ;; BUG: or is not correct here, since it ignores the Orderless
> predicate!
> (memq sym prefix-completions))))))))
>
> Daniel further commented:
>
> "I'm unsure what a proper fix should look like. It's possible that the issue cannot be resolved because the
> predicate might be intentionally ignored.
> For autoloaded functions, there might not be enough information available for the predicate to be
> satisfied.
>
> Maybe there is nothing we can do than to either disable help-enable-completion-autoload completely ...,
> or make it less aggressively ignoring the predicate, or to live with the additional unwanted candidates..."
Thanks, I added the relevant people to the discussion.
bug-gnu-emacs <at> gnu.org:bug#79652; Package emacs.
(Sun, 19 Oct 2025 14:51:02 GMT) Full text and rfc822 format available.Message #11 received at 79652 <at> debbugs.gnu.org (full text, mbox):
From: Daniel Mendler <mail <at> daniel-mendler.de> To: Eli Zaretskii <eliz <at> gnu.org> Cc: 79652 <at> debbugs.gnu.org, Lester Longley <lester <at> ieee.org>, Stefan Monnier <monnier <at> iro.umontreal.ca> Subject: Re: bug#79652: 31.0.50; incorrect filtering in help--symbol-completion-table Date: Sun, 19 Oct 2025 16:50:34 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:
>> Date: Sat, 18 Oct 2025 17:07:55 -0400
>> From: Lester Longley via "Bug reports for GNU Emacs,
>> the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>>
>> I'm reporting a bug, with guidance from Daniel Mendler.
>> The original discussion is at https://github.com/oantolin/orderless/issues/193
>>
>> To readily demonstrate the issue, these packages need to be installed:
>>
>> (1) https://elpa.gnu.org/packages/orderless.html
>> (2) https://elpa.gnu.org/packages/marginalia.html
>>
>> Then:
>>
>> $ emacs -Q
>>
>> and execute the following additional setup manually:
>>
>> (progn
>> (dolist (path '("~/.emacs.d/elpa/marginalia-2.4" "~/.emacs.d/elpa/orderless-1.5"))
>> (add-to-list 'load-path path))
>>
>> (require 'marginalia)
>> (marginalia-mode)
>>
>> (require 'orderless)
>> (custom-set-variables
>> '(completion-styles '(orderless basic))
>> '(completion-category-overrides '(
>> (command (styles orderless basic))
>> (symbol-help (styles orderless basic))
>> ))
>> )
>> )
>>
>> The issue involves "completion", using this expression: describe- &(C-h.[A-Z])
>>
>> Background: "&(C-h.[A-Z])" is an "orderless-annotation" ("&..." is the general form of the annotation).
>> More info.: https://github.com/oantolin/orderless#style-modifiers
>>
>> The difference concerns completion using "M-x" vs. "C-h f" (or "C-h x").
>>
>> With "M-x describe- &(C-h.[A-Z]) TAB", I get the expected results--commands beginning with "describe-",
>> which have key bindings of the form: C-h [A-Z].
>>
>> emacs-marginalia-orderless_M-x.png
>>
>> However, with "C-h f describe- &(C-h.[A-Z]) TAB", I see additional results, unexpected (by me), i.e.,
>> additional functions which aren't bound to C-h [A-Z]:
>>
>> emacs-marginalia-orderless_C-h_f.png
>>
>> FWIW, I get the same results using "C-h x" (`describe-command') as I do with "C-h f" (`describe-function').
>>
>> I don't know of a simple way to exclude marginalia from this puzzle, since it's needed to add binding
>> annotations with "C-h f".
>> However, I can use orderless *without* marginalia, using the default suggest-key-bindings = t, and get the
>> expected result from "M-x describe- &(C-h.[A-Z]) TAB":
>>
>> emacs-orderless_M-x.png
>> Daniel identified that the issue can be circumvented by customizing `help-enable-completion-autoload' to nil
>> (I have confirmed this workaround).
>>
>> He further identified what he believes to be the root cause in `help--symbol-completion-table'--see "BUG: or
>> is not correct here ..." embedded in the following function listing (near end):
>>
>> (defun help--symbol-completion-table (string pred action)
>> (if (eq action 'metadata)
>> `(metadata
>> ,@(when completions-detailed
>> '((affixation-function . help--symbol-completion-table-affixation)))
>> (category . symbol-help))
>> (when (and help-enable-completion-autoload
>> (memq action '(nil t lambda)))
>> (let ((prefixes (radix-tree-prefixes (help-definition-prefixes) string)))
>> ;; Don't load FOO.el during `test-completion' of `FOO-'.
>> (unless (and (eq action 'lambda) (assoc string prefixes))
>> (help--load-prefixes prefixes))))
>> (let ((prefix-completions
>> (and help-enable-completion-autoload
>> (mapcar #'intern (all-completions string definition-prefixes)))))
>> (complete-with-action action obarray string
>> (if pred (lambda (sym)
>> (or (funcall pred sym) ;; BUG: or is not correct here, since it ignores the Orderless
>> predicate!
>> (memq sym prefix-completions))))))))
>>
>> Daniel further commented:
>>
>> "I'm unsure what a proper fix should look like. It's possible that the issue cannot be resolved because the
>> predicate might be intentionally ignored.
>> For autoloaded functions, there might not be enough information available for the predicate to be
>> satisfied.
>>
>> Maybe there is nothing we can do than to either disable help-enable-completion-autoload completely ...,
>> or make it less aggressively ignoring the predicate, or to live with the additional unwanted candidates..."
>
> Thanks, I added the relevant people to the discussion.
Stefan, do you an idea how we could resolve the predicate issue? Also
I've discovered that the help autoloading leads to artificial
candidates. Starting from emacs -Q enter "C-h f describe ?". Then the
invalid symbol `describe-' appears in the completion list. I think I've
seen reports about this problem before.
Daniel
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.