Subject: 29.0.50; list-directory doesn't allow globbing interactively

From: chad <[email-masked]>
Date: Thu, 9 Jun 2022 14:56:24 -0400

>From emacs -Q, call list-directory ('C-x C-d'), and specify a glob
pattern, such as "/usr/local/src/emacs/lisp/*.el". Emacs will accept
this as the argument when called from lisp (following the behavior
described in the docstring), but will not accept it interactively. This
is due to passing t as the fourth (MUSTMATCH) argument to read-file-name
inside list-directory. I believe that this should instead be 'confirm. I
have tested the small attached patch for a couple weeks with no trouble.
In case there is a problem with the attached patch via gmail, the
change is around line 7385 of lisp/files.el:

      (list (read-file-name
>              (if pfx "List directory (verbose): "
>               "List directory (brief): ")
> -           nil default-directory t
> +           nil default-directory 'confirm
>              nil
>              (lambda (file)
>                (or (file-directory-p file)

This is a tiny change, and also I have assigned copyright papers on
file from past work on MH-e many moons ago, I believe under
"[email-masked]" (which has, sadly, moved to MS Exchange in the years
since).

Thanks,
~Chad

In GNU Emacs 29.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.24,
cairo version 1.16.0)
 of 2022-06-09 built on penguin
Repository revision: 0e401fa2670210c7a5c4424ef6ec6896fff7486e
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Debian GNU/Linux 11 (bullseye)

Configured using:
 'configure --with-native-compilation --with-gnutls --without-xwidgets
 --without-pop'

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

Important settings:
  value of $LC_COLLATE: C
  value of $LC_CTYPE: en_US.UTF-8
  value of $LC_MESSAGES: en_US.UTF-8
  value of $LC_NUMERIC: en_US.UTF-8
  value of $LC_TIME: en_US.UTF-8
  value of $LANG: en_US.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
  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 emacsbug message mailcap yank-media rmc puny
dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg
rfc6068 epg-config gnus-util text-property-search time-date seq gv
subr-x byte-opt bytecomp byte-compile cconv 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
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 nadvice
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 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
move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 56606 9544)
 (symbols 48 5724 0)
 (strings 32 16248 1701)
 (string-bytes 1 530792)
 (vectors 16 11364)
 (vector-slots 8 223293 17601)
 (floats 8 21 37)
 (intervals 56 234 3)
 (buffers 992 11))