Subject: 28.0.50; Within eshell, company completion for cd-less directory-changing wipes out all but the most recent subdirectory

From: Brian Leung <[email-masked]>
Date: Sun, 13 Jun 2021 05:23:18 +0200 (CEST)

With an init file like

> (require 'company)
> (global-company-mode 1)

I run

> mkdir ~/apple ~/apple/ball ~/apple/ball/caterpillar ~/apple/ball/catnip
> emacs -q -l above-init.el

and start Eshell in the home directory. At the Eshell prompt, I type

> apple/ball/cat

and am presented with two candidates for completion in the Company popup. Choosing either one will complete with that subdirectory alone (for example, "catnip/" instead of something like the desired "/home/alice/apple/ball/catnip/").

This issue appears only in Emacs 28; if I perform the same experiment with the latest rev of origin/emacs-27, the completion correctly completes with the full path.

In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo version 1.16.0)
Repository revision: 0afab352e02d7070a8ced2af53c1d01217400cdf
Repository branch: master
System Description: NixOS 21.11 (Porcupine)

Configured using:
 'configure
 --prefix=/nix/store/9ywhrly5lb0565d7kz830j339hiwm4hg-emacs-gcc-20210612.0
 --disable-build-details --with-modules --with-x-toolkit=gtk3 --with-xft
 --with-cairo --with-native-compilation'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT 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 $EMACSLOADPATH: 
  value of $EMACSNATIVELOADPATH: /nix/store/qf9ylv3vh988ls6y2fpmm6y4gk9mvka4-emacs-packages-deps/share/emacs/native-lisp::
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Eshell

Minor modes in effect:
  shell-dirtrack-mode: t
  eshell-prompt-mode: t
  eshell-hist-mode: t
  eshell-pred-mode: t
  eshell-cmpl-mode: t
  eshell-proc-mode: t
  eshell-arg-mode: t
  global-company-mode: t
  company-mode: t
  gpm-mouse-mode: t
  tooltip-mode: t
  global-eldoc-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
  transient-mark-mode: t

Load-path shadows:
/run/current-system/sw/share/emacs/site-lisp/site-start hides /nix/store/qf9ylv3vh988ls6y2fpmm6y4gk9mvka4-emacs-packages-deps/share/emacs/site-lisp/site-start
/run/current-system/sw/share/emacs/site-lisp/site-start hides /nix/store/9ywhrly5lb0565d7kz830j339hiwm4hg-emacs-gcc-20210612.0/share/emacs/site-lisp/site-start

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs auth-source 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 cl-extra help-mode em-unix em-term term shell
ehelp em-script em-prompt em-ls em-hist em-pred em-glob em-dirs esh-var
em-cmpl pcomplete comint ansi-color em-basic em-banner em-alias esh-mode
eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module
esh-groups esh-util company-oddmuse company-keywords company-etags etags
fileloop generator xref cl-seq project eieio eieio-core cl-macs
eieio-loaddefs ring company-gtags company-dabbrev-code company-dabbrev
company-files company-clang company-capf company-cmake company-semantic
company-template company-bbdb company edmacro kmacro pcase subr-x
cl-loaddefs cl-lib t-mouse term/linux jka-compr seq byte-opt gv bytecomp
byte-compile cconv disp-table iso-transl 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 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 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
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 109316 9452)
 (symbols 48 9713 0)
 (strings 32 31428 1928)
 (string-bytes 1 1096160)
 (vectors 16 17532)
 (vector-slots 8 361930 8072)
 (floats 8 54 296)
 (intervals 56 248 0)
 (buffers 992 12))

-- 
Mailfence.com
Private and secure email