Subject: 28.0.50; `M-x load-library` completion regression

From: Stefan Monnier <[email-masked]>
Date: Sun, 13 Sep 2020 23:43:21 -0400

Package: Emacs
Version: 28.0.50

I noticed two regressions in `M-x load-library`:

    emacs -Q
    M-x load-library RET
    o/or TAB
    C-a C-k
    /us/sh/ TAB

The first TAB used to expand `o/or` to `org/org`.
and the second TAB used to expand `/us/sh/` to `/usr/share/`.

Both regressions seem to come from the same commit:

    commit ed44217d3245ddc8f2cf75c9499d5bb37848cfd7
    Author: Lars Ingebrigtsen <[email-masked]>
    Date:   Tue Aug 27 09:46:28 2019 +0200
    
        Fix completion in `read-library-name'
        
        * lisp/emacs-lisp/find-func.el (read-library-name): Only list
        .el/.el.gz files when completing (bug#36945).

I only noticed the `o/or` regression recently, but have been annoyed by
the other regression for a while now but just always figured it was
a problem on my end and postponed looking into it to later (I have
a fair bunch of half-broken local hacks in the completion code).

        Stefan

In GNU Emacs 28.0.50 (build 1, i686-pc-linux-gnu, GTK+ Version 3.24.22, cairo version 1.16.0)
 of 2020-09-07 built on alfajor
Repository revision: 25ae39e261de3062c714826ab8001fd45bc98e21
Repository branch: work
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Debian GNU/Linux bullseye/sid

Configured using:
 'configure -C --with-modules --with-cairo --with-tiff=ifavailable
 'CFLAGS=-Wall -g3 -Og -Wno-pointer-sign'
 PKG_CONFIG_PATH=/home/monnier/lib/pkgconfig'

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

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

Major mode: InactiveMinibuffer

Minor modes in effect:
  shell-dirtrack-mode: t
  electric-pair-mode: t
  global-reveal-mode: t
  reveal-mode: t
  auto-insert-mode: t
  savehist-mode: t
  minibuffer-electric-default-mode: t
  global-compact-docstrings-mode: t
  url-handler-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  global-prettify-symbols-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/monnier/src/emacs/elpa/packages/ess/obsolete/ess-mouse hides /home/monnier/src/emacs/elpa/packages/ess/ess-mouse
/home/monnier/src/emacs/elpa/packages/ess/obsolete/ess-noweb-mode hides /home/monnier/src/emacs/elpa/packages/ess/ess-noweb-mode
/home/monnier/src/emacs/elpa/packages/ess/obsolete/mouseme hides /home/monnier/src/emacs/elpa/packages/ess/mouseme
/home/monnier/src/emacs/elpa/packages/ess/obsolete/msdos hides /home/monnier/src/emacs/elpa/packages/ess/msdos
/home/monnier/src/emacs/elpa/packages/ess/obsolete/ess-rutils hides /home/monnier/src/emacs/elpa/packages/ess/ess-rutils
/home/monnier/src/emacs/elpa/packages/ess/obsolete/ess-eldoc hides /home/monnier/src/emacs/elpa/packages/ess/ess-eldoc
/home/monnier/src/emacs/elpa/packages/ess/obsolete/ess-noweb hides /home/monnier/src/emacs/elpa/packages/ess/ess-noweb
/home/monnier/src/emacs/elpa/packages/ess/obsolete/ess-r-args hides /home/monnier/src/emacs/elpa/packages/ess/ess-r-args
/home/monnier/src/emacs/elpa/packages/ess/obsolete/ess-noweb-font-lock-mode hides /home/monnier/src/emacs/elpa/packages/ess/ess-noweb-font-lock-mode
/home/monnier/src/emacs/elpa/packages/ess/obsolete/ess-r-a hides /home/monnier/src/emacs/elpa/packages/ess/ess-r-a
/home/monnier/src/emacs/elpa/packages/ess/obsolete/ess-swv hides /home/monnier/src/emacs/elpa/packages/ess/ess-swv
/home/monnier/src/emacs/elpa/packages/cpio-mode/cpio-mode hides /home/monnier/src/emacs/work/lisp/cpio-mode
/home/monnier/src/emacs/elpa/packages/hyperbole/set hides /home/monnier/src/emacs/work/lisp/emacs-lisp/set
/home/monnier/src/emacs/elpa/packages/seq/seq hides /home/monnier/src/emacs/work/lisp/emacs-lisp/seq
/home/monnier/src/emacs/elpa/packages/landmark/landmark hides /home/monnier/src/emacs/work/lisp/obsolete/landmark
/home/monnier/src/emacs/elpa/packages/crisp/crisp hides /home/monnier/src/emacs/work/lisp/obsolete/crisp

Features:
(shadow mail-extr emacsbug sendmail markdown-mode color crm mm-archive
url-dav url-http-ntlm ntlm hmac-md5 hex-util md4 gnutls network-stream
url-cache url-http url-gw nsm html5-schema rng-xsd xsd-regexp rng-cmpct
rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt
rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap sgml-mode
nxml-util nxml-enc xmltok reftex-dcr reftex reftex-loaddefs reftex-vars
latexenc autorevert filenotify quail grep cal-china lunar solar cal-dst
cal-bahai cal-islam cal-hebrew holidays hol-loaddefs cal-french
diary-lib diary-loaddefs cal-move completion hibtypes hsys-www klink
hib-kbd hib-social hib-debbugs hsys-org hactypes hmail hargs hypb locate
hbut view hact hpath hui-select hvar set hhist hbdata htz cal-julian
hbmap hmoccur hversion hload-path completion-flex slime-tests ert slime
etags fileloop xref project arc-mode archive-mode hyperspec debug
backtrace ielm pp texinfo tex-mode shell eieio-opt racket-rewrites
mode-local cl-print log-edit sm-c-mode hippie-exp gud whitespace
org-element avl-tree generator ol-eww ol-rmail ol-mhe ol-irc ol-info
ol-gnus nnselect nnir gnus-art mm-uu mml2015 mm-view mml-smime smime dig
gnus-sum url url-proxy url-privacy url-expand url-methods url-history
mailcap shr kinsoku url-cookie url-domsuf url-util svg dom gnus-group
gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail
mail-source utf7 netrc nnoo parse-time iso8601 gnus-spec gnus-int
gnus-range message rmc puny rfc822 mml mml-sec mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus-win
gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums
text-property-search mail-utils mm-util mail-prsvr ol-docview doc-view
jka-compr image-mode exif ol-bibtex bibtex ol-bbdb ol-w3m org ob
ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src
ob-comint org-pcomplete pcomplete org-list org-faces org-entities
org-version ob-emacs-lisp ob-core ob-eval org-table ol org-keys
org-compat advice org-macs org-loaddefs format-spec find-func cal-menu
calendar cal-loaddefs sort mule-util mpc files-x bug-reference cus-edit
cus-start cus-load wid-edit package-x help-fns radix-tree executable
copyright epa-file epa derived epg epg-config misearch multi-isearch
filecache add-log log-view pcvs-util tuareg speedbar imenu ezimage
dframe tuareg-opam find-file typer-mode smie smerge-mode diff make-mode
cl-extra vc-git diff-mode vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs
vc-dir ewoc vc vc-dispatcher dired-x dired dired-loaddefs server
sexp-rewrite time-date flymake-proc flymake compile comint ansi-color
ring warnings noutline outline easy-mmode flyspell ispell checkdoc
lisp-mnt thingatpt help-mode load-dir elec-pair reveal autoinsert
savehist minibuf-eldef disp-table compact-docstrings cl-seq inline
gnu-elpa-features rx kotl-autoloads proof-site proof-autoloads
realgud-recursive-autoloads slime-autoloads finder-inf url-auth info
package easymenu browse-url url-handlers url-parse auth-source eieio
eieio-core cl-macs gv eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt bytecomp byte-compile cconv cl-loaddefs cl-lib
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
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 elisp-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame simple 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 charscript charprop
case-table epa-hook jka-cmpr-hook help abbrev obarray cl-preloaded
nadvice loaddefs button faces cus-face macroexp files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 8 805998 92560)
 (symbols 24 37456 1) (strings 16 164592 24408) (string-bytes 1 5283088)
 (vectors 8 117268)
 (vector-slots 4 2524008 280840) (floats 8 1241 439) (intervals 28 85184
                                                                732) (buffers 564 166))