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.devel Subject: Re: master 82c76e3: * lisp/eshell/em-cmpl.el: Try and fix bug#41423 Date: Wed, 26 May 2021 18:34:37 +0100 Message-ID: <87k0nlpff6.fsf@tcd.ie> References: <20210201002715.13331.49843@vcs0.savannah.gnu.org> <20210201002717.273E120DF3@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="982"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Stefan Monnier To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 26 19:44:56 2021 Return-path: Envelope-to: ged-emacs-devel@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 1llxaR-000Aa9-Vc for ged-emacs-devel@m.gmane-mx.org; Wed, 26 May 2021 19:44:56 +0200 Original-Received: from localhost ([::1]:33880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llxaQ-0001Wo-4C for ged-emacs-devel@m.gmane-mx.org; Wed, 26 May 2021 13:44:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llxQb-0001uz-0t for emacs-devel@gnu.org; Wed, 26 May 2021 13:34:45 -0400 Original-Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:39861) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llxQY-0002A6-2m for emacs-devel@gnu.org; Wed, 26 May 2021 13:34:44 -0400 Original-Received: by mail-wr1-x42b.google.com with SMTP id v12so1990435wrq.6 for ; Wed, 26 May 2021 10:34:41 -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=7VOzHoMAf1ylvc6rK/Byuy1vX3XkFhIlHvPVZ2WBfjQ=; b=bGhWzMbkC6zEKx74b1Qiaon79dfwn3dCWJoO2EBLocD/iNvnMC1LfJY23ntAfkI0ly UbUPp/uD4NyFTH4fTXL+X2TyZYus89ZmGkuUslubms47xHcYuyLfwyhTC3h7UFrypaK5 i6RgZzS4AqD0CcaEfiINQCdLxPgScow3YvxV9VNjyvkqfzHmX6RRFhDelyDG40oh6A8V pXwfBwvbjfm31aKzS3WLNoXakXyF/HuAEAlWyMeZjs25x91LMDX0OAdn4BiZnvTh7Osv VWxQ0nE6lzvyuH1g5CwosYicFVIxugCDq8WuFY6wiMJHkatxvA2lU/jpq3DEFSQFtrMN 9/GA== 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=7VOzHoMAf1ylvc6rK/Byuy1vX3XkFhIlHvPVZ2WBfjQ=; b=D+Az/BNlKHKzTCCvgvubCgzWdZSByRHTKcG4lXDBCCNdj+sQwSAVVAxuluLhC9I7ZF u8wFhb7hnzP5smsjlwQ1fw25eTEro+EK+iSvfiPYx11JZy0KjxDPJjug64mJBkvvRMUZ GMHSWMHDbkakhfGWc0Vu9anZuD1gVrDwi4zfuooE8AZI3a/mqmmRAK26ycDSBUCqqR2a h09wwWHki/twWbqSD5/fgWrB0xJXc42wiyuvT+lc+A2a/KG6TaYoi6W/TL0fKh6UueQ/ Xno2AHvhKQ0bmHrXX6cQngh54nYbd8Tduqq/dEpoy7saNWZMbTZasYH+ILnHr8OAiKND aWDg== X-Gm-Message-State: AOAM530pZMLqloTD930gGLD0XqlEphZcTRAEnyNJJq2UrbMWNcywos4r /zaxFKAA70Rg5+DPQx5pXOaiBIYpP1V85w== X-Google-Smtp-Source: ABdhPJxME8HRw4I4t3DFCsDWsZB1YP39bi4CUWHiF8hFmZyGOKyadMthqPa3iXlo5EbBsCI0X32IxQ== X-Received: by 2002:a5d:534f:: with SMTP id t15mr33030200wrv.206.1622050479417; Wed, 26 May 2021 10:34:39 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:d15:339e:aa10:60f1]) by smtp.gmail.com with ESMTPSA id d9sm20590965wrx.11.2021.05.26.10.34.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 10:34:38 -0700 (PDT) In-Reply-To: <20210201002717.273E120DF3@vcs0.savannah.gnu.org> (Stefan Monnier's message of "Sun, 31 Jan 2021 19:27:16 -0500 (EST)") Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=contovob@tcd.ie; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:269921 Archived-At: monnier@iro.umontreal.ca (Stefan Monnier) writes: > branch: master > commit 82c76e3aeb2465d1d1e66eae5db13ba53e38ed84 > Author: Stefan Monnier > Commit: Stefan Monnier > > * lisp/eshell/em-cmpl.el: Try and fix bug#41423 > > (eshell--complete-commands-list): Rename from `eshell-complete-commands-list`. > Return a (dynamic) completion table rather than a list of completions. > Use `dolist` and `push`. Ivy's (admittedly quite limited and buggy) completion hasn't worked properly since this commit. I've narrowed it down to the following change in behaviour. 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 executable file bin/foo under parent directory. (let ((exe (expand-file-name "bin/foo" dir))) (make-empty-file exe t) (set-file-modes exe (file-modes-symbolic-to-number "u+x" (file-modes exe)))) ;; 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 Before the commit in question, this gave: (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) And after: (metadata (completion--unquote-requote . t)) (#("bin/" 0 4 (face (completions-common-part))) . 0) Is this expected, or should some of the old information have been preserved? The relevant bug in Ivy[1] is due to its completion-in-region-function unfortunately relying on the completions-first-difference face to know how much of the existing buffer text to replace[2]. Do you have any recommendations for what to use instead? [1]: https://github.com/abo-abo/swiper/issues/2879 [2]: https://github.com/abo-abo/swiper/issues/1361 Thanks, -- Basil