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: Thu, 06 Apr 2023 15:22:49 -0400 Message-ID: References: <864jpsrgaz.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11182"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 62700@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 06 21:23:50 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 1pkVD4-0002hn-6d for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Apr 2023 21:23:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkVCK-0004g0-4L; Thu, 06 Apr 2023 15:23:04 -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 1pkVCI-0004fL-Sf for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 15:23:02 -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 1pkVCI-0006md-KW for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 15:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pkVCI-0007KI-4r for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 15:23: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: Thu, 06 Apr 2023 19:23: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.168080897628136 (code B ref 62700); Thu, 06 Apr 2023 19:23:02 +0000 Original-Received: (at 62700) by debbugs.gnu.org; 6 Apr 2023 19:22:56 +0000 Original-Received: from localhost ([127.0.0.1]:55173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkVCC-0007Jj-DM for submit@debbugs.gnu.org; Thu, 06 Apr 2023 15:22:56 -0400 Original-Received: from mxout5.mail.janestreet.com ([64.215.233.18]:49217) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkVCB-0007JW-1p for 62700@debbugs.gnu.org; Thu, 06 Apr 2023 15:22:55 -0400 In-Reply-To: <864jpsrgaz.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 06 Apr 2023 21:55:48 +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:259350 Archived-At: Juri Linkov writes: >> 6. C-h v -path >> 7. C-a to move point to before -path >> 8. to show completions of variables ending in -path >> 9. Use M- and M- to switch between completions. Now as you >> switch completions, they are inserted at point, *without* replacing the >> text already in the buffer. So e.g. the minibuffer will contain >> "load-path-path". >> 10. Likewise, if you (setq minibuffer-completion-auto-choose nil), M-RET >> inserts the completion string at point, without replacing the text in >> the minibuffer, so you will get "load-path-path". >> >> I think this is basically just a bug. Hopefully we can fix this before >> Emacs 29 is released, because this is the last thing which stops these >> new commands from being a really great improvement to the Emacs >> completion defaults. > > I agree that it would be nice to fix this in Emacs 29. > But the problem is that this would require non-trivial changes. > We need to apply a small part of the patch mentioned in > bug#47711, bug#48356, bug#48841, bug#60313 and located at > https://lists.gnu.org/archive/html/emacs-devel/2021-08/msg00412.html > that implements the following FIXME item in 'completion-all-completions': > > ;; FIXME: We need to additionally return the info needed for the > ;; second part of completion-base-position. > > When it will return from 'completion-all-completions' not only the start > position of a completion, but also its end, then we could use this > additional information for M- and M-. Any updates on the status of this patch? I see you asked the same thing a year ago in one of those bugs. I can try to prepare a more minimal version of this patch, just targeted at adding the ability to return the end of the completion position. Do you have any advice on an appropriate API for that? An alist as in that patch seems reasonable to me, but perhaps there's an even simpler approach? (BTW, the reason I really want to fix this in Emacs 29 is that I don't want us to be concerned with being backwards-compatible with the current behavior in 29, which seems much worse to me. But if we won't be concerned about that, doing this in 30 seems totally fine. I can just backport it for my users anyway :) )