From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: sbaugh@catern.com 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: Mon, 04 Sep 2023 00:30:16 +0000 (UTC) Message-ID: <87bkeird9k.fsf@catern.com> 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> <86edjfyx84.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15858"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 62700@debbugs.gnu.org, Spencer Baugh To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 04 02:31:39 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 1qcxVA-0003wy-NA for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Sep 2023 02:31:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qcxUn-0006WK-5F; Sun, 03 Sep 2023 20:31:13 -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 1qcxUc-0006U8-Fg for bug-gnu-emacs@gnu.org; Sun, 03 Sep 2023 20:31:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qcxUc-0008BK-7B for bug-gnu-emacs@gnu.org; Sun, 03 Sep 2023 20:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qcxUb-0007sP-OK for bug-gnu-emacs@gnu.org; Sun, 03 Sep 2023 20:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: sbaugh@catern.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Sep 2023 00:31:01 +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.169378742630233 (code B ref 62700); Mon, 04 Sep 2023 00:31:01 +0000 Original-Received: (at 62700) by debbugs.gnu.org; 4 Sep 2023 00:30:26 +0000 Original-Received: from localhost ([127.0.0.1]:47820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcxU2-0007rY-03 for submit@debbugs.gnu.org; Sun, 03 Sep 2023 20:30:26 -0400 Original-Received: from s.wrqvtzvf.outbound-mail.sendgrid.net ([149.72.126.143]:55678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcxTy-0007rJ-6N for 62700@debbugs.gnu.org; Sun, 03 Sep 2023 20:30:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:in-reply-to:references:mime-version:to:cc:content-type: content-transfer-encoding:cc:content-type:from:subject:to; s=s1; bh=ntMjadfGIO/NkFhX+wj4gKonvzVmzUMJ/Ftk1h6w0w8=; b=A8FwKPZr9rIjWcNVvpPa2dvScyHqGnp0Vbl0SR/fQ6fk3TyeWVvmd3speX6ZJjTDcwDL OEutB5xPqBMU3T0wM1KyagnDL8+uKId2DihHqkmboKMbvFQo19Z3NjZBqD/ii0PxZzp6f6 cCKdLiNivjR8gDuDPCI5TgRz/yI49ilQTlcpfC+Y9pDIvXsW5bkJlTrMV5zF8NMNKB5GTL 7GsQLJ6qQ4hwMPJmZ+zbwMck8erhUsE+JHtSFdzFRDeHjhdt/oa3HIrtb2imotLS/vFzO2 T2IPLPWeFo7BFejiObhH9VWe2+NgrWAp/V9XCRdxJlbX7HkH0FF6tqkcPqaXuknA== Original-Received: by filterdrecv-65f68489c8-lx4fk with SMTP id filterdrecv-65f68489c8-lx4fk-1-64F52518-20 2023-09-04 00:30:16.76350645 +0000 UTC m=+10025651.522729132 Original-Received: from earth.catern.com (unknown) by geopod-ismtpd-20 (SG) with ESMTP id j-2ajEujQd-nLWxijx7ysA Mon, 04 Sep 2023 00:30:16.637 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=linkov.net Original-Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id 1238C635B9; Sun, 3 Sep 2023 20:30:16 -0400 (EDT) In-Reply-To: <86edjfyx84.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 03 Sep 2023 20:37:15 +0300") X-SG-EID: ZgbRq7gjGrt0q/Pjvxk7wM0yQFRdOkTJAtEbkjCkHbKG2FmG87xWwHKu9u96mKKKJwt0Y5HfzyF+Z3e559VDGna8QNyZqeU1En0wbBWvcG5jHoEwCinGEPzNLcp7VrRIFlUeEfJAc51MMe4J27embzEDWhvpmB3MvDMs6TRCJNqqjA1o5AcMtxwvdIanfu5Orsa6z6hUx/f4CN+cZ3ySkQ== X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== 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:269201 Archived-At: Juri Linkov writes: >> 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. >> >> 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)) >> + "")) > > As was found in bug#64903, this change broke completion-in-region. > For example, with (setq completion-use-base-affixes t) > if there is some text in the current buffer after point, > then typing 'M-C-i' and selecting a candidate to insert to the buffer, > it replaces all the text after point with an empty string. > > Before this change, the suffix was set to the text after point, > and after inserting the selected candidate the suffix was > re-inserted to the same buffer. How can this be the cause of bug#64903? Wasn't that bug reproduced on Emacs 28? This change only went in to 29.