GNU bug report logs - #56203
28.1; completing-read-multiple fails from inside the completion table

Previous Next

Package: emacs;

Reported by: Harald Judt <h.judt <at> gmx.at>

Date: Fri, 24 Jun 2022 19:17:01 UTC

Severity: normal

Found in version 28.1

To reply to this bug, email your comments to 56203 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


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#56203; Package emacs. (Fri, 24 Jun 2022 19:17:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Harald Judt <h.judt <at> gmx.at>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 24 Jun 2022 19:17:01 GMT) Full text and rfc822 format available.

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

From: Harald Judt <h.judt <at> gmx.at>
To: bug-gnu-emacs <at> gnu.org
Cc: monnier <at> iro.umontreal.ca
Subject: 28.1; completing-read-multiple fails from inside the completion table
Date: Fri, 24 Jun 2022 19:12:30 +0200
[Message part 1 (text/plain, inline)]
Hi,

I have posted my initial bug report here, because I first thought this
was a bug in the package vertico though it isn't:
https://github.com/minad/vertico/issues/244

The author of this package says this is an emacs bug, I am going to
quote him here because he gives more examples and in-depth explanation
than I have provided:

---
Thanks! I can confirm this on Emacs 28.1. This is an upstream bug. Please 
report it upstream via report-emacs-bug (maybe cc Stefan Monnier who is the 
expert on the table quotation mechanism).

    1. I argue that Vertico calls the API completion-all-completions in the 
correct way.
    2. Icomplete use the API completion-all-completions in the same way and 
fails too.
    3. Default completion fails too if you enter ~, M-x minibuffer-complete 
RET. Note that completing-read-multiple overrides minibuffer-complete with 
crm-complete which shadows the underlying bug in the completion table.
    4. The error occurs from inside the completion table, and not from 
Vertico code.
---

Here is the elisp debugger backtrace for my example:
Debugger entered--Lisp error: (args-out-of-range "" 0 6)
  completion--file-name-table("" 6 completion--unquote)
  complete-with-action(completion--unquote completion--file-name-table "" 6)
  #f(compiled-function (table) #<bytecode 
0x17ceea27424a904e>)(completion--file-name-table)
  completion--some(#f(compiled-function (table) #<bytecode 
0x17ceea27424a904e>) (completion--embedded-envvar-table 
completion--file-name-table))
  read-file-name-internal("" 6 completion--unquote)
  complete-with-action(completion--unquote read-file-name-internal "" 6)
  completion-table-with-context(#("~/tmp," 0 6 (face nil)) 
read-file-name-internal "" 6 completion--unquote)
  crm--collection-fn(#("~/tmp," 0 6 (face nil)) 6 completion--unquote)
  completion--nth-completion(2 #("~/tmp," 0 6 (face nil)) crm--collection-fn 
file-directory-p 6 (metadata (category . file) (completion--unquote-requote . t)))
  #<subr completion-all-completions>(#("~/tmp," 0 6 (face nil)) 
crm--collection-fn file-directory-p 6 (metadata (category . file) 
(completion--unquote-requote . t)))
  apply(#<subr completion-all-completions> (#("~/tmp," 0 6 (face nil)) 
crm--collection-fn file-directory-p 6 (metadata (category . file) 
(completion--unquote-requote . t))))
  completion-all-completions(#("~/tmp," 0 6 (face nil)) crm--collection-fn 
file-directory-p 6 (metadata (category . file) (completion--unquote-requote . t)))
  vertico--all-completions(#("~/tmp," 0 6 (face nil)) crm--collection-fn 
file-directory-p 6 (metadata (category . file) (completion--unquote-requote . t)))
  vertico--recompute-candidates(6 #("~/tmp," 0 6 (face nil)))
  vertico--update-candidates(6 #("~/tmp," 0 6 (face nil)))
  vertico--exhibit()
  #<subr completing-read-multiple>("Directories: " read-file-name-internal 
file-directory-p t nil nil "~/")
  vertico-multiform--advice(#<subr completing-read-multiple> "Directories: " 
read-file-name-internal file-directory-p t nil nil "~/")
  apply(vertico-multiform--advice (#<subr completing-read-multiple> 
"Directories: " read-file-name-internal file-directory-p t nil nil "~/"))
  vertico--advice(#<subr completing-read-multiple> "Directories: " 
read-file-name-internal file-directory-p t nil nil "~/")
  apply(vertico--advice #<subr completing-read-multiple> ("Directories: " 
read-file-name-internal file-directory-p t nil nil "~/"))
  completing-read-multiple("Directories: " read-file-name-internal 
file-directory-p t nil nil "~/")
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  command-execute(eval-last-sexp)





In GNU Emacs 28.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo 
version 1.16.0)
 of 2022-06-01 built on localhost
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Gentoo Linux

Configured using:
 'configure --prefix=/usr --build=x86_64-pc-linux-gnu
 --host=x86_64-pc-linux-gnu --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
 --localstatedir=/var/lib --datarootdir=/usr/share
 --disable-silent-rules --docdir=/usr/share/doc/emacs-28.1
 --htmldir=/usr/share/doc/emacs-28.1/html --libdir=/usr/lib64
 --program-suffix=-emacs-28 --includedir=/usr/include/emacs-28
 --infodir=/usr/share/info/emacs-28 --localstatedir=/var
 --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
 --without-compress-install --without-hesiod --without-pop
 --with-file-notification=inotify --with-pdumper --disable-acl
 --with-dbus --with-modules --with-gameuser=:gamestat --with-libgmp
 --without-gpm --with-native-compilation --with-json --without-kerberos
 --without-kerberos5 --with-lcms2 --with-xml2 --without-mailutils
 --without-selinux --with-gnutls --without-libsystemd --with-threads
 --without-wide-int --with-zlib --with-sound=alsa --with-x --without-ns
 --without-gconf --without-gsettings --with-toolkit-scroll-bars
 --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-xpm
 --with-imagemagick --with-xft --with-cairo --with-harfbuzz
 --without-libotf --without-m17n-flt --with-x-toolkit=gtk3
 --without-xwidgets --with-dumping=pdumper 'CFLAGS=-march=native -O2
 -pipe -fno-ident -ggdb' CPPFLAGS= 'LDFLAGS=-Wl,-O1 -Wl,--as-needed
 -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,--sort-common
 -Wl,-z,now''

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS HARFBUZZ IMAGEMAGICK JPEG JSON
LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3
ZLIB

Important settings:
  value of $LC_ALL: de_DE.UTF-8
  value of $LANG: de_DE.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  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
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs auth-source eieio eieio-core eieio-loaddefs
password-cache json map text-property-search time-date mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils comp
comp-cstr warnings subr-x rx cl-seq cl-macs cl-extra help-mode seq
byte-opt gv cl-loaddefs cl-lib bytecomp byte-compile cconv iso-transl
tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-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 cl-generic
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 simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting font-render-setting cairo move-toolbar gtk
x-toolkit x multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 77319 8541)
 (symbols 48 7849 1)
 (strings 32 22068 4871)
 (string-bytes 1 760949)
 (vectors 16 17362)
 (vector-slots 8 309931 16542)
 (floats 8 26 27)
 (intervals 56 286 0)
 (buffers 992 11))


Kind regards,
Harald Judt

-- 
`Experience is the best teacher.'

PGP Key ID: 4FFFAB21B8580ABD
Fingerprint: E073 6DD8 FF40 9CF2 0665 11D4 4FFF AB21 B858 0ABD
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56203; Package emacs. (Fri, 24 Jun 2022 21:27:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Harald Judt <h.judt <at> gmx.at>
Cc: 56203 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#56203: 28.1; completing-read-multiple fails from inside the
 completion table
Date: Fri, 24 Jun 2022 23:25:58 +0200
Harald Judt <h.judt <at> gmx.at> writes:

> Thanks! I can confirm this on Emacs 28.1. This is an upstream
> bug. Please report it upstream via report-emacs-bug (maybe cc Stefan
> Monnier who is the expert on the table quotation mechanism).
>
>     1. I argue that Vertico calls the API completion-all-completions
>     in the correct way.
>     2. Icomplete use the API completion-all-completions in the same
>     way and fails too.
>     3. Default completion fails too if you enter ~, M-x
>     minibuffer-complete RET. Note that completing-read-multiple
>     overrides minibuffer-complete with crm-complete which shadows the
>    underlying bug in the completion table.
>     4. The error occurs from inside the completion table, and not from
>     Vertico code.

Do you have a recipe to reproduce the problem without Vertico?  I tried:

(completing-read-multiple "Directories: " #'read-file-name-internal #'file-directory-p t nil nil "~/")

And I didn't see any obvious failures.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 24 Jun 2022 21:27:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56203; Package emacs. (Fri, 24 Jun 2022 22:05:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Harald Judt <h.judt <at> gmx.at>
Cc: 56203 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#56203: 28.1; completing-read-multiple fails from inside the
 completion table
Date: Sat, 25 Jun 2022 00:04:39 +0200
Harald Judt <h.judt <at> gmx.at> writes:

> Number 2:
> emacs -Q
> Evaluate the following:
> (icomplete-mode)
> (completing-read-multiple "Directories: " #'read-file-name-internal
> #'file-directory-p t nil nil "~/")
> Enter "~/," and behold the debugger chiming in.

[...]

> emacs -Q
> Evaluate the following:
> (setq enable-recursive-minibuffers t)
> (completing-read-multiple "Directories: " #'read-file-name-internal
> #'file-directory-p t nil nil "~/")
>
> Enter "~, " at the prompt (without quotes), then hit M-x minibuffer-complete RET.

Thanks; I'm able to reproduce those problems both in Emacs 28.1 and on
the current trunk.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56203; Package emacs. (Fri, 24 Jun 2022 22:11:01 GMT) Full text and rfc822 format available.

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

From: Harald Judt <h.judt <at> gmx.at>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 56203 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#56203: 28.1; completing-read-multiple fails from inside the
 completion table
Date: Fri, 24 Jun 2022 23:58:24 +0200
[Message part 1 (text/plain, inline)]
Hi,

Am 24.06.22 um 23:25 schrieb Lars Ingebrigtsen:
> Harald Judt <h.judt <at> gmx.at> writes:
> 
>> Thanks! I can confirm this on Emacs 28.1. This is an upstream
>> bug. Please report it upstream via report-emacs-bug (maybe cc Stefan
>> Monnier who is the expert on the table quotation mechanism).
>>
>>      1. I argue that Vertico calls the API completion-all-completions
>>      in the correct way.
>>      2. Icomplete use the API completion-all-completions in the same
>>      way and fails too.
>>      3. Default completion fails too if you enter ~, M-x
>>      minibuffer-complete RET. Note that completing-read-multiple
>>      overrides minibuffer-complete with crm-complete which shadows the
>>     underlying bug in the completion table.
>>      4. The error occurs from inside the completion table, and not from
>>      Vertico code.
> 
> Do you have a recipe to reproduce the problem without Vertico?  I tried:
> 
> (completing-read-multiple "Directories: " #'read-file-name-internal #'file-directory-p t nil nil "~/")
> 
> And I didn't see any obvious failures.

Number 2:
emacs -Q
Evaluate the following:
(icomplete-mode)
(completing-read-multiple "Directories: " #'read-file-name-internal 
#'file-directory-p t nil nil "~/")
Enter "~/," and behold the debugger chiming in.

Number 3 is an easy one to replicate too, but you have to enable recursive 
mini-buffers:

emacs -Q
Evaluate the following:
(setq enable-recursive-minibuffers t)
(completing-read-multiple "Directories: " #'read-file-name-internal 
#'file-directory-p t nil nil "~/")

Enter "~, " at the prompt (without quotes), then hit M-x minibuffer-complete RET.

Debugger entered--Lisp error: (args-out-of-range "" 0 2)
  completion--file-name-table("" 2 completion--unquote)
  complete-with-action(completion--unquote completion--file-name-table "" 2)
  #f(compiled-function (table) #<bytecode 
0x17ee37158998d04e>)(completion--file-name-table)
  completion--some(#f(compiled-function (table) #<bytecode 
0x17ee37158998d04e>) (completion--embedded-envvar-table 
completion--file-name-table))
  read-file-name-internal("" 2 completion--unquote)
[...]


-- 
`Experience is the best teacher.'

PGP Key ID: 4FFFAB21B8580ABD
Fingerprint: E073 6DD8 FF40 9CF2 0665 11D4 4FFF AB21 B858 0ABD
[OpenPGP_signature (application/pgp-signature, attachment)]

Removed tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 26 Jun 2022 14:58:02 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 51 days ago.

Previous Next


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