unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#56203: 28.1; completing-read-multiple fails from inside the completion table
@ 2022-06-24 17:12 Harald Judt
  2022-06-24 21:25 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Harald Judt @ 2022-06-24 17:12 UTC (permalink / raw)
  To: 56203; +Cc: monnier


[-- Attachment #1.1: Type: text/plain, Size: 8473 bytes --]

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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#56203: 28.1; completing-read-multiple fails from inside the completion table
  2022-06-24 17:12 bug#56203: 28.1; completing-read-multiple fails from inside the completion table Harald Judt
@ 2022-06-24 21:25 ` Lars Ingebrigtsen
  2022-06-24 21:58   ` Harald Judt
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-24 21:25 UTC (permalink / raw)
  To: Harald Judt; +Cc: 56203, monnier

Harald Judt <h.judt@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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#56203: 28.1; completing-read-multiple fails from inside the completion table
  2022-06-24 21:25 ` Lars Ingebrigtsen
@ 2022-06-24 21:58   ` Harald Judt
  2022-06-24 22:04     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Harald Judt @ 2022-06-24 21:58 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 56203, monnier


[-- Attachment #1.1: Type: text/plain, Size: 2326 bytes --]

Hi,

Am 24.06.22 um 23:25 schrieb Lars Ingebrigtsen:
> Harald Judt <h.judt@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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#56203: 28.1; completing-read-multiple fails from inside the completion table
  2022-06-24 21:58   ` Harald Judt
@ 2022-06-24 22:04     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-24 22:04 UTC (permalink / raw)
  To: Harald Judt; +Cc: 56203, monnier

Harald Judt <h.judt@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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-24 22:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-24 17:12 bug#56203: 28.1; completing-read-multiple fails from inside the completion table Harald Judt
2022-06-24 21:25 ` Lars Ingebrigtsen
2022-06-24 21:58   ` Harald Judt
2022-06-24 22:04     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).