unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: 48995@debbugs.gnu.org
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
	Brian Leung <leungbk@mailfence.com>
Subject: 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	[thread overview]
Message-ID: <871r96jb8m.fsf@tcd.ie> (raw)
In-Reply-To: <1357001210.293856.1623554598367@ichabod.co-bxl> (Brian Leung via "Bug reports for GNU Emacs, the Swiss army knife of text editors"'s message of "Sun, 13 Jun 2021 05:23:18 +0200 (CEST)")

Brian Leung via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@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





  reply	other threads:[~2021-06-13 10:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-13  3:23 bug#48995: 28.0.50; Within eshell, company completion for cd-less directory-changing wipes out all but the most recent subdirectory Brian Leung via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-06-13 10:43 ` Basil L. Contovounesios [this message]
2022-05-01 21:37   ` Dmitry Gutov
2023-01-07 10:24 ` bug#48995: Apparently fixed Nicolas Martyanoff
2023-01-08 21:59   ` Dmitry Gutov
2023-01-20  8:27     ` Brian Leung via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-07 10:37 ` bug#48995: apparently fixed Nicolas Martyanoff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871r96jb8m.fsf@tcd.ie \
    --to=contovob@tcd.ie \
    --cc=48995@debbugs.gnu.org \
    --cc=leungbk@mailfence.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).