From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#62700: 29.0.60; minibuffer-{previous,next,choose}-completion behave unintuitively when point is not at end of buffer Date: Tue, 13 Jun 2023 16:59:19 -0400 Message-ID: References: <8635574n10.fsf@mail.linkov.net> <868rema032.fsf@mail.linkov.net> <83r0se4bwf.fsf@gnu.org> <87pm7xkqsd.fsf@catern.com> <83jzy419bk.fsf@gnu.org> <874jourckv.fsf@catern.com> <83lei6mxa0.fsf@gnu.org> <86wn1jutxv.fsf@mail.linkov.net> <83zg6eby5t.fsf@gnu.org> <83r0qjzj22.fsf@gnu.org> <86h6rccz9c.fsf@mail.linkov.net> <83v8fsw0r9.fsf@gnu.org> <86v8fruwur.fsf@mail.linkov.net> <83352vwb6v.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5242"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 62700@debbugs.gnu.org, sbaugh@catern.com, Juri Linkov To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 13 23:01:48 2023 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 1q9B99-00019t-Mh for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Jun 2023 23:01:47 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q9B7W-0002CM-O1; Tue, 13 Jun 2023 17:00:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q9B7U-0002B3-KL for bug-gnu-emacs@gnu.org; Tue, 13 Jun 2023 17:00:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q9B7T-0006om-Rl for bug-gnu-emacs@gnu.org; Tue, 13 Jun 2023 17:00:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q9B7S-0005ec-NB for bug-gnu-emacs@gnu.org; Tue, 13 Jun 2023 17:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Jun 2023 21:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62700 X-GNU-PR-Package: emacs Original-Received: via spool by 62700-submit@debbugs.gnu.org id=B62700.168668996621638 (code B ref 62700); Tue, 13 Jun 2023 21:00:02 +0000 Original-Received: (at 62700) by debbugs.gnu.org; 13 Jun 2023 20:59:26 +0000 Original-Received: from localhost ([127.0.0.1]:43169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9B6s-0005cv-39 for submit@debbugs.gnu.org; Tue, 13 Jun 2023 16:59:26 -0400 Original-Received: from mxout5.mail.janestreet.com ([64.215.233.18]:45545) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9B6q-0005cg-NW for 62700@debbugs.gnu.org; Tue, 13 Jun 2023 16:59:25 -0400 In-Reply-To: <83352vwb6v.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 13 Jun 2023 19:59:04 +0300") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:263346 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Juri Linkov >> Cc: sbaugh@janestreet.com, 62700@debbugs.gnu.org, sbaugh@catern.com >> Date: Tue, 13 Jun 2023 19:54:04 +0300 >> >> >> I checked that no problems occurred in minibuffer.el on the master branch. >> > >> > Thanks. I wasn't sure that my manual resolution of the merge conflict >> > in this case was correct. >> >> I looked at the patch that should be pushed to master, and noticed >> that probably it needs the same change that was applied in emacs-29. >> Maybe Spencer could confirm what would be the right patch for master. > > Yes, Spencer, please take a look. Indeed it needs the same change. Here's the version of the patch that should be pushed to master. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Handle-point-not-at-EOB-in-minibuffer-choose-complet.patch >From 4769e70e2e9af6eb68947d6c2ed0dcff0831def0 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Mon, 24 Apr 2023 10:05:24 -0400 Subject: [PATCH] Handle point not at EOB in minibuffer-choose-completion Without this change, only the minibuffer contents before point are cleared when a completion is chosen, which results in stray text when point is in the middle of the minibuffer. After this change, we heuristically decide either to clear the whole buffer or only part of it, taking into account the location of point. * lisp/minibuffer.el (minibuffer-completion-help): Use point when calculating completion-base-affixes. (Bug#62700) --- lisp/minibuffer.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 539206a19e4..d079dc0bcdf 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2395,7 +2395,11 @@ minibuffer-completion-help (prefix (unless (zerop base-size) (substring string 0 base-size))) (base-prefix (buffer-substring (minibuffer--completion-prompt-end) (+ start base-size))) - (base-suffix (buffer-substring (point) (point-max))) + (base-suffix + (if (eq (alist-get 'category (cdr md)) 'file) + (buffer-substring (save-excursion (or (search-forward "/" nil t) (point-max))) + (point-max)) + "")) (all-md (completion--metadata (buffer-substring-no-properties start (point)) base-size md -- 2.39.3 --=-=-=--