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: Mon, 14 Mar 2022 10:30:56 +0200 Organization: LINKOV.NET Message-ID: <86bky99c7r.fsf@mail.linkov.net> References: <86h782b3zk.fsf@mail.linkov.net> <871qz5k2na.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="16310"; 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 Mon Mar 14 09:48:28 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 1nTgNQ-0004AO-6M for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 14 Mar 2022 09:48:28 +0100 Original-Received: from localhost ([::1]:56298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nTgNO-0005xL-OA for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 14 Mar 2022 04:48:26 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTgN0-0005vJ-CL for bug-gnu-emacs@gnu.org; Mon, 14 Mar 2022 04:48:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50123) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nTgN0-00016M-2x for bug-gnu-emacs@gnu.org; Mon, 14 Mar 2022 04:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nTgMz-0007SC-QC for bug-gnu-emacs@gnu.org; Mon, 14 Mar 2022 04:48:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Mar 2022 08:48:01 +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.164724765728528 (code B ref 54374); Mon, 14 Mar 2022 08:48:01 +0000 Original-Received: (at 54374) by debbugs.gnu.org; 14 Mar 2022 08:47:37 +0000 Original-Received: from localhost ([127.0.0.1]:44020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTgMa-0007Q3-N5 for submit@debbugs.gnu.org; Mon, 14 Mar 2022 04:47:36 -0400 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]:41925) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTgMY-0007PA-Tp for 54374@debbugs.gnu.org; Mon, 14 Mar 2022 04:47:35 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id D6C442000F; Mon, 14 Mar 2022 08:47:27 +0000 (UTC) In-Reply-To: <871qz5k2na.fsf@posteo.net> (Philip Kaludercic's message of "Sun, 13 Mar 2022 20:39:53 +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:228335 Archived-At: > This seems to fix it: > > diff --git a/lisp/simple.el b/lisp/simple.el > index accc119e2b..7d47aba1ee 100644 > --- a/lisp/simple.el > +++ b/lisp/simple.el > @@ -9125,7 +9125,7 @@ next-completion > (unless (get-text-property (point) 'mouse-face) > (goto-char (next-single-property-change (point) 'mouse-face nil end))) > (setq n (1- n))) > - (while (< n 0) > + (while (and (< n 0) (< 1 (point))) > (let ((prop (get-text-property (1- (point)) 'mouse-face))) > ;; If in a completion, move to the start of it. > (when (and prop (eq prop (get-text-property (point) 'mouse-face))) Thanks, I confirm that it doesn't fail. However, there is some strange behaviour: when point is at the beginning of the completion buffer, then previous-completion switches to the minibuffer. But if point is at the first completion, then previous-completion wraps to the last completion. Shouldn't point at the beginning of the buffer wrap to the last completion as well?