From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs 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 Message-ID: <871r96jb8m.fsf@tcd.ie> References: <1357001210.293856.1623554598367@ichabod.co-bxl> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31816"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Stefan Monnier , Brian Leung To: 48995@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 13 12:44:22 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lsNbJ-00086v-Ma for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 13 Jun 2021 12:44:21 +0200 Original-Received: from localhost ([::1]:33832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsNbI-0002i7-Ie for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 13 Jun 2021 06:44:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsNb0-0002hr-2l for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2021 06:44:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59412) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lsNaz-0003Pz-PX for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2021 06:44:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lsNaz-00070h-M7 for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2021 06:44:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 13 Jun 2021 10:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48995 X-GNU-PR-Package: emacs Original-Received: via spool by 48995-submit@debbugs.gnu.org id=B48995.162358102826921 (code B ref 48995); Sun, 13 Jun 2021 10:44:01 +0000 Original-Received: (at 48995) by debbugs.gnu.org; 13 Jun 2021 10:43:48 +0000 Original-Received: from localhost ([127.0.0.1]:42725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lsNam-000708-2C for submit@debbugs.gnu.org; Sun, 13 Jun 2021 06:43:48 -0400 Original-Received: from mail-wr1-f41.google.com ([209.85.221.41]:33612) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lsNak-0006zv-3p for 48995@debbugs.gnu.org; Sun, 13 Jun 2021 06:43:47 -0400 Original-Received: by mail-wr1-f41.google.com with SMTP id a20so11095132wrc.0 for <48995@debbugs.gnu.org>; Sun, 13 Jun 2021 03:43:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=R8YnnsPTcfcYKzsj5AY6HV0B1kk4SQRq1ZKa5PsefG4=; b=SByh38N8K4kP4HkY36tVB/sjl0chhYYi1wZahbLU16nEGbMxXzf4f4+OoY/vtZgZVt 0Jk/gBaZy3zSS7Fj/n9Wnqv+SzmnQMgLWWpg2NcLFSJ2vNzdONS6DWwhdpnAOkSo7SjQ JHXuCHJMhCcUNwJ2Gi+X12LG7vVctx3DeTRslLj+xJxSql+rMcwnuXGp78QMMtElFD1x WWPQhLIcGj3Hx+GrrgtBxG8bQ2TKlSGxRfMAf8J54j98OYyuni28NTHwk+KQ6dvdEHQC 1s9DJbsjx1AJ6yL64cqE9TdfpjqCfmVOb0bJIWePj9c+JcFYYCaWNpLeRePKmT6ksuA5 97pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=R8YnnsPTcfcYKzsj5AY6HV0B1kk4SQRq1ZKa5PsefG4=; b=tuawBs5en9Ieq2c3wLWF7nvSgdD4IY9cvx3e8bN5mE68NmeZ0x09DTM40TDTehc3Lm 5U3cWugavUa7VhbEmPl38FYL2WdFemnC5r38Nr1xjy4TpL+tFAOIKOrQkH7ysxFd7gIM JhCfAirrMbMMEN4wg/Rbjw3ebepfuzoU+A0QVC8BSAYGMRdGH9QvArfj8uPtj23c3pSE s/ca4nYYMpJy7aNw+RlxPhaQOLVQjepkdqr/yeS6cqlzsM0KFMXIpUm0KQkhrlr6jkQ/ wXMO0JHkdiOfu3LWj+bhJds0X/Mx79oCU5eXH7qnYQJGhdv7eMNHOJd66tQYzHspWSYV zoQw== X-Gm-Message-State: AOAM531eopmzipD9BWKY2KGrpMkBCb+nyHi2OIRTmvwhtR5GAm9rDEAU rSnrLz1v96/UjlMV/HwaMLt/zhVjgQtYLg== X-Google-Smtp-Source: ABdhPJwaylXEORWtS6BVRMLqry4vUFP7edguBSeL6drLOMWu7u3nRDxAZyEp16iI4RWE6tL5+UAPfg== X-Received: by 2002:a5d:6405:: with SMTP id z5mr13194226wru.39.1623581019858; Sun, 13 Jun 2021 03:43:39 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:d15:339e:aa10:60f1]) by smtp.gmail.com with ESMTPSA id b188sm22118806wmh.18.2021.06.13.03.43.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Jun 2021 03:43:39 -0700 (PDT) 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)") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:208416 Archived-At: Brian Leung via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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