GNU bug report logs - #48995
28.0.50; Within eshell, company completion for cd-less directory-changing wipes out all but the most recent subdirectory

Previous Next

Package: emacs;

Reported by: Brian Leung <leungbk <at> mailfence.com>

Date: Sun, 13 Jun 2021 03:24:01 UTC

Severity: normal

Tags: fixed

Found in version 28.0.50

Done: Brian Leung <leungbk <at> mailfence.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 48995 in the body.
You can then email your comments to 48995 AT debbugs.gnu.org in the normal way.

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#48995; Package emacs. (Sun, 13 Jun 2021 03:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Brian Leung <leungbk <at> mailfence.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 13 Jun 2021 03:24:02 GMT) Full text and rfc822 format available.

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

From: Brian Leung <leungbk <at> mailfence.com>
To: Bug Gnu Emacs <bug-gnu-emacs <at> gnu.org>
Subject: 28.0.50; Within eshell, company completion for cd-less
 directory-changing wipes out all but the most recent subdirectory
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48995; Package emacs. (Sun, 13 Jun 2021 10:44:01 GMT) Full text and rfc822 format available.

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

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: 48995 <at> debbugs.gnu.org
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>,
 Brian Leung <leungbk <at> mailfence.com>
Subject: Re: bug#48995: 28.0.50; Within eshell, company completion for
 cd-less directory-changing wipes out all but the most recent subdirectory
Date: Sun, 13 Jun 2021 11:43:37 +0100
Brian Leung via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs <at> gnu.org> writes:

> 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.

I suspect this is the same issue as the following, so I'm CCing Stefan.

https://lists.gnu.org/r/emacs-devel/2021-05/msg01220.html
https://lists.gnu.org/r/emacs-devel/2021-06/msg00254.html

I'm not familiar with Company, but in the case of Ivy, the problem boils
down to the following change in behaviour, starting with this change:

* lisp/eshell/em-cmpl.el: Try and fix bug#41423
82c76e3aeb 2021-01-31 19:27:10 -0500
https://git.sv.gnu.org/cgit/emacs.git/commit/?id=82c76e3aeb2465d1d1e66eae5db13ba53e38ed84

0. emacs -Q
1. Evaluate:

(let* (dir (clean (lambda () (when dir (delete-directory dir t)))))
  ;; Clean up temporary directory on exit.
  (add-hook 'kill-emacs-hook clean)
  ;; Create temporary parent directory.
  (setq dir (make-temp-file "ivy-" t))
  ;; Create 'bin' subdirectory.
  (make-directory (expand-file-name "bin" dir))
  ;; Start `eshell' in parent directory.
  (let ((default-directory dir))
    (eshell))
  ;; Debug in-buffer completion.
  (setq-local completion-in-region-function
              (lambda (beg end table &optional pred)
                (let* ((str (buffer-substring beg end))
                       (md (completion-metadata str table pred))
                       (all (completion-all-completions
                             str table pred (- end beg) md))
                       (standard-output (messages-buffer))
                       (inhibit-read-only t))
                  (terpri nil t)
                  (pp md)
                  (pp all)))))

2. C-h e
3. ./bi TAB

This used to yield:

  (metadata
   (cycle-sort-function . #[...])
   (category . file)
   (completion--unquote-requote . t))
  (#("bin/"
     0 1 (face completions-common-part)
     1 2 (face completions-common-part arg-end t
               rear-nonsticky (arg-end arg-begin))
     2 3 (face (completions-first-difference)))
   . 2)

but now yields:

  (metadata (completion--unquote-requote . t))
  (#("bin/" 0 4 (face (completions-common-part)))
   . 0)

So even without Company/Ivy, there is some loss of information and the
highlighting in *Completions* is inaccurate.

Thanks,

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48995; Package emacs. (Sun, 01 May 2022 21:38:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>, 48995 <at> debbugs.gnu.org
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>,
 Brian Leung <leungbk <at> mailfence.com>
Subject: Re: bug#48995: 28.0.50; Within eshell, company completion for cd-less
 directory-changing wipes out all but the most recent subdirectory
Date: Mon, 2 May 2022 00:37:01 +0300
On 13.06.2021 13:43, Basil L. Contovounesios wrote:
> 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.

Gentle ping: just want to confirm that this is still a problem, as 
evidenced by a new report we just got on the Company bug tracker.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48995; Package emacs. (Sat, 07 Jan 2023 12:10:01 GMT) Full text and rfc822 format available.

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

From: Nicolas Martyanoff <nicolas <at> n16f.net>
To: 48995 <at> debbugs.gnu.org
Subject: Apparently fixed
Date: Sat, 07 Jan 2023 11:24:45 +0100
FYI This bug seems to have been fixed by
899055eef5b212d63e352ada2ac917d13c033a59.

-- 
Nicolas Martyanoff
https://n16f.net
nicolas <at> n16f.net




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48995; Package emacs. (Sat, 07 Jan 2023 12:10:02 GMT) Full text and rfc822 format available.

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

From: Nicolas Martyanoff <nicolas <at> n16f.net>
To: 48995 <at> debbugs.gnu.org
Subject: Re: bug#48995: apparently fixed
Date: Sat, 07 Jan 2023 11:37:15 +0100
FYI This bug seems to have been fixed by
899055eef5b212d63e352ada2ac917d13c033a59.

-- 
Nicolas Martyanoff
https://n16f.net
nicolas <at> n16f.net




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48995; Package emacs. (Sun, 08 Jan 2023 22:01:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Nicolas Martyanoff <nicolas <at> n16f.net>, 48995 <at> debbugs.gnu.org,
 Brian Leung <leungbk <at> mailfence.com>
Subject: Re: bug#48995: Apparently fixed
Date: Sun, 8 Jan 2023 23:59:54 +0200
On 07/01/2023 12:24, Nicolas Martyanoff wrote:
> 
> FYI This bug seems to have been fixed by
> 899055eef5b212d63e352ada2ac917d13c033a59.
> 

Looks like it indeed.

Brian, would you care to verify?




Added tag(s) fixed. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 10 Jan 2023 09:08:01 GMT) Full text and rfc822 format available.

Reply sent to Brian Leung <leungbk <at> mailfence.com>:
You have taken responsibility. (Fri, 20 Jan 2023 08:29:02 GMT) Full text and rfc822 format available.

Notification sent to Brian Leung <leungbk <at> mailfence.com>:
bug acknowledged by developer. (Fri, 20 Jan 2023 08:29:03 GMT) Full text and rfc822 format available.

Message #27 received at 48995-done <at> debbugs.gnu.org (full text, mbox):

From: Brian Leung <leungbk <at> mailfence.com>
To: 48995-done <at> debbugs.gnu.org
Subject: Re: bug#48995: Apparently fixed
Date: Fri, 20 Jan 2023 09:27:48 +0100 (CET)
[Message part 1 (text/plain, inline)]
Closing.

January 8, 2023 at 10:59:54 PM CET Dmitry Gutov <dgutov <at> yandex.ru> wrote:On 07/01/2023 12:24, Nicolas Martyanoff wrote:
> 
> FYI This bug seems to have been fixed by
> 899055eef5b212d63e352ada2ac917d13c033a59.
> 

Looks like it indeed.

Brian, would you care to verify?

-- 
Sent with https://mailfence.com
Secure and private email
-- Sent with https://mailfence.com  Secure and private email
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 17 Feb 2023 12:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 69 days ago.

Previous Next


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