From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#54374: 29.0.50; previous-completion fails at beginning of completions buffer Date: Sat, 19 Mar 2022 21:13:14 +0200 Organization: LINKOV.NET Message-ID: <864k3tu4pp.fsf@mail.linkov.net> References: <86h782b3zk.fsf@mail.linkov.net> <871qz5k2na.fsf@posteo.net> <86bky99c7r.fsf@mail.linkov.net> <87fsnk39nr.fsf@posteo.net> <86k0cwlcge.fsf@mail.linkov.net> <875yobnd7n.fsf@posteo.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="5840"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 54374@debbugs.gnu.org To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 19 20:29:37 2022 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 1nVeld-0001O7-8O for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Mar 2022 20:29:37 +0100 Original-Received: from localhost ([::1]:36448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVelc-000405-1W for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Mar 2022 15:29:36 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVel5-0003YA-KU for bug-gnu-emacs@gnu.org; Sat, 19 Mar 2022 15:29:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38478) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nVel5-0005Ax-AC for bug-gnu-emacs@gnu.org; Sat, 19 Mar 2022 15:29:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nVel5-0001sJ-7K for bug-gnu-emacs@gnu.org; Sat, 19 Mar 2022 15:29:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Mar 2022 19:29:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54374 X-GNU-PR-Package: emacs Original-Received: via spool by 54374-submit@debbugs.gnu.org id=B54374.16477181087134 (code B ref 54374); Sat, 19 Mar 2022 19:29:03 +0000 Original-Received: (at 54374) by debbugs.gnu.org; 19 Mar 2022 19:28:28 +0000 Original-Received: from localhost ([127.0.0.1]:60605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVekW-0001qy-Aq for submit@debbugs.gnu.org; Sat, 19 Mar 2022 15:28:28 -0400 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:44119) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVekT-0001qX-Ht for 54374@debbugs.gnu.org; Sat, 19 Mar 2022 15:28:27 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id BD54840005; Sat, 19 Mar 2022 19:28:18 +0000 (UTC) In-Reply-To: <875yobnd7n.fsf@posteo.net> (Philip Kaludercic's message of "Fri, 18 Mar 2022 21:49:16 +0000") 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:228607 Archived-At: >> Thanks, this fixed the issue. And I noticed another one: at the >> beginning of the buffer previous-completion wraps to the end of the buffer, >> not to the beginning of the last completion. >> >> Also when point at the last completion, next-completion >> jumps to the end of the buffer instead of wrapping to the >> first completion. > > I cannot replicate this issue in every case, but only if the last option > has completion annotation. It should be fixable by checking for these > kinds of edge-cases, but it might also be better to reconsider if > next-completion should be using `mouse-face' for navigation, or if a > special text property might be more elegant? I agree that `mouse-face' is unsuitable for detecting the completion boundaries, and it causes other problems: typing RET on the completion prefix or on the completion suffix/annotation causes the error: Debugger entered--Lisp error: (error "No completion here") error("No completion here") choose-completion(13 nil) funcall-interactively(choose-completion 13 nil) command-execute(choose-completion) So a special text property could also help to detect the completion for RET, if there are no such text properties already. But I see there is the text property 'completion--string'. So maybe it could be extended to cover prefix and suffix/annotation as well.