GNU bug report logs - #78959
31.0.50; *Completions* buffer navigation with 'n' and 'p'

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Dani Moncayo <dmoncayo@HIDDEN>; dated Sat, 5 Jul 2025 08:22:03 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 78959 <at> debbugs.gnu.org:


Received: (at 78959) by debbugs.gnu.org; 11 Jul 2025 11:24:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 11 07:24:46 2025
Received: from localhost ([127.0.0.1]:35496 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uaBrx-0006xl-Oi
	for submit <at> debbugs.gnu.org; Fri, 11 Jul 2025 07:24:46 -0400
Received: from mout.gmx.net ([212.227.17.22]:38325)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <stephen.berman@HIDDEN>)
 id 1uaBrt-0006x7-3y
 for 78959 <at> debbugs.gnu.org; Fri, 11 Jul 2025 07:24:43 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net;
 s=s31663417; t=1752233073; x=1752837873; i=stephen.berman@HIDDEN;
 bh=4vXwDi7Z3txOdIUaCjIv8BhofCwPNI8fOA5ZdQabbYI=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date:
 Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=BoqE1+bFGx0ygLgFMn5ao44xFlOBCEPQ6Fh1vYa9eEoPIzmP00cnH/rA5x2fQ8P2
 3NiXb/N4Oe4FqV5+bl0cD7bJPKH0kJOGIHueVfYMC2BihuanKx4FQnE3ieFGFDdW8
 Jowuen7dWLyjT+/Wn8VVmqCQVS9raVpe7ew1RKjJAj75L5jrigGBp6DrQ5aZ9Z9P3
 qo8THgFiC75qmWYtkYpfnu0NoasS5gAbcwjyhhGaKTDgdPFWpMbnA4oIMA5gSm1gi
 LmESaexd/iOYw8s0Iqhk5l/Kh/B/s+HU0fgOj6v7QTZQzJdWA9XaB6A2kJ+m4bBdc
 4qmKKUb0+4vTuXm0lA==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from strobelfs2 ([88.130.49.197]) by mail.gmx.net (mrgmx104
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N2Dx8-1umbbr1Zl8-00tcuu; Fri, 11
 Jul 2025 13:24:33 +0200
From: Stephen Berman <stephen.berman@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#78959: 31.0.50; *Completions* buffer navigation with 'n'
 and 'p'
In-Reply-To: <87tt3jg9v2.fsf@HIDDEN>
References: <CAH8Pv0hAOUwCxyHP_gJdWuuP16U+LYWWpAhopwbPVSDHukAURg@HIDDEN>
 <87ecuuwj7j.fsf@HIDDEN> <87o6tw4hbo.fsf@HIDDEN>
 <874ivo77vt.fsf@HIDDEN> <87wm8k2cjm.fsf@HIDDEN>
 <87ldozyt8r.fsf@HIDDEN> <875xg1sxxc.fsf@HIDDEN>
 <87a55cc9q9.fsf@HIDDEN> <87tt3jg9v2.fsf@HIDDEN>
Date: Fri, 11 Jul 2025 13:24:32 +0200
Message-ID: <8734b3otqn.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Provags-ID: V03:K1:uih5Do0MHg06T8TwjQn7ov6eSSPv0HJ4sDYsOi5SyQctvhwNQKi
 EppCSv/Ji7S76SWVktIzHg1Nxu94oOBVtIKNkTdxZxlS7aEZstZIkJRDSKrzDcsrheDfBtK
 9p7KjtoloP2H+DNPKR/0PqEdwbu60UxTsMqr08ExUOxxtddFP1GI4DnQnxDW4M/CsZBI4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DR1mm2yuIC6+dmOEMXBFlORkji+xsbACV56nHVees4Xox
 pl/9tlS+z7UebzfXUgGz5vdfTZ/+21tr4RRdvVM7UwjD74RTfVAiEfDwC78TWilXr9S/ZLQib
 /vIDrFDWcYU66Ks7kpk1N+NZg4esnN5PcOBiKpDtFA9ppiQIcA5XfgTjvTwxKBwn3Ka0R7tqq
 fW93Mb9JtQ7Xtpy+wEI2U+1AbWYF0oK3tvni48GTQocLCSNQKLwSMMHiDpn/cHPLJqX9CBMBp
 PBBIMJ2J9EPqnGFa80yhfhUjaV2IXKL741xULl1J5EtW6lMJle/m0X3qJ48rHxJbnagsPb6XF
 zqHgCdvk0Yp0xGawPdTy0Mvy5JQ7s60APT54dzsIvzaa0Yy/J44smVe7QYRypHxTtytdCMXSX
 acwxK/4+MKTcD2sTaoBqHpaDwc0k3pFPzwBQCPUJTDVenTkf3A0dDaKaSaTnaFNBBIVOiLWUH
 uukkPxBL3mai//sgy33O4kZNytb5OHNnBzt+I8Jha/D6+p8hE8YzVqIHJ6qSJbCNAExWDyw0O
 Cr6iK8h1W1hKAo4U4gBRT7J1NvolSmuO6UB+8D0jG0ph2S59hawQgleToDzjA/XR1aT6u9Ioi
 x1vWkHGjeIfnj5eacgDeXo3NEuw7vbz6geI6g5XNWC+ZVm48o6PyvTtiw==
X-Spam-Score: 3.6 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  On Thu, 10 Jul 2025 21:48:49 +0300 Juri Linkov wrote: >>>
 Do I understand correctly that you mean such behavior: >>> when
 `next-line-completion'
 reaches the bottom of the column >>> it should wrap to the top of the next
 column? >> >> Yes. >> >>> If you w [...] 
 Content analysis details:   (3.6 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
 [88.130.49.197 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [212.227.17.22 listed in sa-trusted.bondedsender.org]
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (stephen.berman[at]gmx.net)
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [212.227.17.22 listed in bl.score.senderscore.com]
 0.0 RCVD_IN_MSPIKE_H4      RBL: Very Good reputation (+4)
 [212.227.17.22 listed in wl.mailspike.net]
 0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
X-Debbugs-Envelope-To: 78959
Cc: 78959 <at> debbugs.gnu.org, Dani Moncayo <dmoncayo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.9 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  On Thu, 10 Jul 2025 21:48:49 +0300 Juri Linkov wrote: >>>
   Do I understand correctly that you mean such behavior: >>> when `next-line-completion'
    reaches the bottom of the column >>> it should wrap to the top of the next
    column? >> >> Yes. >> >>> If you w [...] 
 
 Content analysis details:   (1.9 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                          [212.227.17.22 listed in sa-trusted.bondedsender.org]
  0.0 RCVD_IN_MSPIKE_H4      RBL: Very Good reputation (+4)
                             [212.227.17.22 listed in wl.mailspike.net]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [88.130.49.197 listed in zen.spamhaus.org]
  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [212.227.17.22 listed in bl.score.senderscore.com]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (stephen.berman[at]gmx.net)
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
                             low trust
                             [212.227.17.22 listed in list.dnswl.org]
  0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

--=-=-=
Content-Type: text/plain

On Thu, 10 Jul 2025 21:48:49 +0300 Juri Linkov <juri@HIDDEN> wrote:

>>> Do I understand correctly that you mean such behavior:
>>> when `next-line-completion' reaches the bottom of the column
>>> it should wrap to the top of the next column?
>>
>> Yes.
>>
>>> If you will improve `next-line-completion', this will provide
>>> symmetry between `next-completion' and `next-line-completion'.
>>
>> Ok, I've tried to do that in the attached patch.  This also required
>> changes in `last-completion', which did not DTRT in vertical format.  I
>> think this patch improves on my previous patch, in terms of both the
>> code (which nevertheless remains rather convoluted) and the coverage (my
>> previous patch did not work right in vertical format when all columns of
>> completions have the same number of lines).  I've tested the patch with
>> -Q and all combinations of values of `completions-format' and
>> `completion-auto-wrap', and the resulting behavior seems sensible in
>> each case.
>
> I expected that the patch would be much simpler:
> after wrapping to the top of the current column
> would it be enough just to call `next-completion'
> to go to the next column on the same first row?
>
> And for `previous-line-completion' would it be simpler
> to call `previous-completion' to go to the previous column,
> and afterwards wrap to the bottom of the same column?

Thanks for pointing this out; I wonder why it hadn't occurred to me....
I've done this now in the attached patch; I did have to add some special
handling for (non-)wrapping according to the value of
`completion-auto-wrap', but the overall code changes are much simpler
than before, except...

> Then for `last-completion' is it possible to call
> `first-completion', then `previous-completion'
> will go to the last column, then `previous-line-completion'
> could wrap to its bottom?

...this doesn't work, because calling `(previous-completion 1)' with
point on the first completion item moves point to the last item of the
second column, not of last column.  I haven't found a simpler way to get
the right behavior for `last-completion' in vertical format than what I
implemented in the previous patch, so I've kept that in the current
patch.

>>> Or wrapping to the next column should be optional?
>>> Then maybe in your `next-completion-switch',
>>> `(next-line-completion n)' should be called with a new argument e.g.
>>> `(next-line-completion n 'next-column)'?
>>
>> I decided not to implement this, because it doesn't seem very useful to
>> me: the user can just stop hitting `n', `p', `down' or `up' to avoid
>> wrapping (and `left' and `right' still move between columns).
>
> So to achieve the previous behavior it is easy
> to type `left' or `right' after wrapping to go
> back to the original column?

That only works when the *Completions* buffer contains just two equally
long columns of completions.  With three columns, or when the final
column is shorter than the other(s), simply typing `left' and `right'
doesn't always yield the previous behavior.  I haven't debugged this yet
and, unless there's an easy fix, I'm not sure it's worth the effort,
since with at most just a few more keystrokes you can move point to the
desired position.  (And even in the current code, moving between columns
is not always line-preserving when the last column is shorter.)

Steve Berman


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment
Content-Description: next/previous completions patch
Content-Transfer-Encoding: quoted-printable

diff --git a/lisp/simple.el b/lisp/simple.el
index fa173b26289..e20c0ce65a0 100644
=2D-- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -10041,8 +10041,8 @@ completion-list-mode-map
     (define-key map [M-down] 'minibuffer-next-completion)
     (define-key map "\M-\r" 'minibuffer-choose-completion)
     (define-key map "z" 'kill-current-buffer)
-    (define-key map "n" 'next-completion)
-    (define-key map "p" 'previous-completion)
+    (define-key map "n" 'next-completion-switch)
+    (define-key map "p" 'previous-completion-switch)
     (define-key map "\M-g\M-c" 'switch-to-minibuffer)
     map)
   "Local map for completion list buffers.")
@@ -10124,12 +10124,33 @@ first-completion
 (defun last-completion ()
   "Move to the last item in the completions buffer."
   (interactive)
+  ;; Move to the last item in horizontal or one-column format.
   (goto-char (previous-single-property-change
               (point-max) 'mouse-face nil (point-min)))
-  ;; Move to the start of last one.
+  ;; Move to the start of the item.
   (unless (get-text-property (point) 'mouse-face)
     (when-let* ((pos (previous-single-property-change (point) 'mouse-face=
)))
-      (goto-char pos))))
+      (goto-char pos)))
+  ;; In vertical format the last item is in the last column even if its
+  ;; line number is less than that of the last item in earlier columns.
+  (when (eq completions-format 'vertical)
+    (let* ((pt (point))
+           (col (current-column))
+           (last (progn
+                   (first-completion)
+                   (goto-char (pos-eol))
+                   (goto-char (previous-single-property-change
+                               (point) 'mouse-face))
+                   (current-column))))
+      (when (> last col)
+        (while (=3D (current-column) last)
+          (forward-line)
+          (unless (eobp)
+            (goto-char (pos-eol))
+            (move-to-column last)
+            (when (=3D (current-column) last)
+              (setq pt (point))))))
+      (goto-char pt))))
=20
 (defun previous-completion (n)
   "Move to the previous item in the completions buffer.
@@ -10220,7 +10241,11 @@ next-completion
=20
 (defun previous-line-completion (&optional n)
   "Move to completion candidate on the previous line in the completions b=
uffer.
-With prefix argument N, move back N lines (negative N means move forward)=
.
+With prefix argument N, move back N lines (negative N means move
+forward).  In vertical format (see user option `completions-format')
+this command moves column-wise through all items in the completions
+buffer, in horizontal format movement is confined to the current column
+of completions.
=20
 Also see the `completion-auto-wrap' variable."
   (interactive "p")
@@ -10228,11 +10253,15 @@ previous-line-completion
=20
 (defun next-line-completion (&optional n)
   "Move to completion candidate on the next line in the completions buffe=
r.
-With prefix argument N, move N lines forward (negative N means move backw=
ard).
+With prefix argument N, move N lines forward (negative N means move
+backward).  In vertical format (see user option `completions-format')
+this command moves column-wise through all items in the completions
+buffer, in horizontal format movement is confined to the current column
+of completions.
=20
 Also see the `completion-auto-wrap' variable."
   (interactive "p")
-  (let (line column pos found)
+  (let (line column pos found last first)
     (when (and (bobp)
                (> n 0)
                (get-text-property (point) 'mouse-face)
@@ -10257,54 +10286,90 @@ next-line-completion
               ((< n 0) (first-completion)))))
=20
     (while (> n 0)
-      (setq found nil pos nil column (current-column) line (line-number-a=
t-pos))
-      (completion--move-to-candidate-end)
-      (while (and (not found)
-                  (eq (forward-line 1) 0)
-                  (not (eobp))
-                  (move-to-column column))
-        (when (get-text-property (point) 'mouse-face)
-          (setq found t)))
-      (when (not found)
-        (if (not completion-auto-wrap)
-            (last-completion)
-          (save-excursion
-            (goto-char (point-min))
-            (when (and (eq (move-to-column column) column)
-                       (get-text-property (point) 'mouse-face))
-              (setq pos (point)))
-            (while (and (not pos) (> line (line-number-at-pos)))
-              (forward-line 1)
+      (setq found nil pos nil column (current-column) line (line-number-a=
t-pos)
+            last (=3D (point) (save-excursion (last-completion) (point)))=
)
+      (if (and (eq completions-format 'vertical)
+               completion-auto-wrap last)
+          (first-completion)            ; Wrap from last to first item.
+        (completion--move-to-candidate-end)
+        (while (and (not found)
+                    (eq (forward-line 1) 0)
+                    (not (eobp))
+                    (move-to-column column))
+          (when (get-text-property (point) 'mouse-face)
+            (setq found t)))
+        (when (not found)
+          (if (and (not completion-auto-wrap)
+                   (when (eq completions-format 'vertical) last))
+              (last-completion)
+            (save-excursion
+              (goto-char (point-min))
               (when (and (eq (move-to-column column) column)
                          (get-text-property (point) 'mouse-face))
-                (setq pos (point)))))
-          (if pos (goto-char pos))))
+                (setq pos (point)))
+              (while (and (not pos) (> line (line-number-at-pos)))
+                (forward-line 1)
+                (when (and (eq (move-to-column column) column)
+                           (get-text-property (point) 'mouse-face))
+                  (setq pos (point)))))
+            (if pos (goto-char pos))
+            (when (eq completions-format 'vertical)
+              (next-completion 1)))))   ; Move to next column.
       (setq n (1- n)))
=20
     (while (< n 0)
-      (setq found nil pos nil column (current-column) line (line-number-a=
t-pos))
-      (completion--move-to-candidate-start)
-      (while (and (not found)
-                  (eq (forward-line -1) 0)
-                  (move-to-column column))
-        (when (get-text-property (point) 'mouse-face)
-          (setq found t)))
-      (when (not found)
-        (if (not completion-auto-wrap)
-            (first-completion)
-          (save-excursion
-            (goto-char (point-max))
-            (when (and (eq (move-to-column column) column)
-                       (get-text-property (point) 'mouse-face))
-              (setq pos (point)))
-            (while (and (not pos) (< line (line-number-at-pos)))
-              (forward-line -1)
+      (setq found nil pos nil column (current-column) line (line-number-a=
t-pos)
+            first (=3D (point) (save-excursion (first-completion) (point)=
)))
+      (if (and (eq completions-format 'vertical)
+               completion-auto-wrap first)
+          (last-completion)             ; Wrap from first to last item.
+        (completion--move-to-candidate-start)
+        (while (and (not found)
+                    (eq (forward-line -1) 0)
+                    (move-to-column column))
+          (when (get-text-property (point) 'mouse-face)
+            (setq found t)))
+        (when (not found)
+          (if (and (not completion-auto-wrap)
+                   (when (eq completions-format 'vertical) first))
+              (first-completion)
+            (save-excursion
+              (goto-char (point-max))
               (when (and (eq (move-to-column column) column)
                          (get-text-property (point) 'mouse-face))
-                (setq pos (point)))))
-          (if pos (goto-char pos))))
+                (setq pos (point)))
+              (while (and (not pos) (< line (line-number-at-pos)))
+                (forward-line -1)
+                (when (and (eq (move-to-column column) column)
+                           (get-text-property (point) 'mouse-face))
+                  (setq pos (point)))))
+            (if pos (goto-char pos))
+            (when (eq completions-format 'vertical)
+              (previous-completion 1)   ; Move to previous column.
+              (setq column (current-column))
+              ;; Move to last item in this column (previous column may
+              ;; have fewer items).
+              (while (not (eobp))
+                (move-to-column column)
+                (setq pos (point))
+                (forward-line))
+              (goto-char pos)))))
       (setq n (1+ n)))))
=20
+(defun next-completion-switch (&optional n)
+  "Move according to `completions-format' to next completion item."
+  (interactive "p")
+  (pcase completions-format
+    ('vertical (next-line-completion n))
+    (_ (next-completion n))))
+
+(defun previous-completion-switch (&optional n)
+  "Move according to `completions-format' to previous completion item."
+  (interactive "p")
+  (pcase completions-format
+    ('vertical (previous-line-completion n))
+    (_ (previous-completion n))))
+
 (defvar choose-completion-deselect-if-after nil
   "If non-nil, don't choose a completion candidate if point is right afte=
r it.
=20

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78959; Package emacs. Full text available.

Message received at 78959 <at> debbugs.gnu.org:


Received: (at 78959) by debbugs.gnu.org; 10 Jul 2025 18:51:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 10 14:51:47 2025
Received: from localhost ([127.0.0.1]:59655 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uZwMz-0006Ov-GF
	for submit <at> debbugs.gnu.org; Thu, 10 Jul 2025 14:51:47 -0400
Received: from mout-y-209.mailbox.org ([2001:67c:2050:103:465::209]:48604)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1uZwMu-0006N0-Nj
 for 78959 <at> debbugs.gnu.org; Thu, 10 Jul 2025 14:51:43 -0400
Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-y-209.mailbox.org (Postfix) with ESMTPS id 4bdP835xyXzB0Fm;
 Thu, 10 Jul 2025 20:51:31 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1752173491;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=KZDQAkMymA8UZE9lOIbytCbJzou6RBO4W7Z4LZkY89c=;
 b=14Dl5oItLxRgAoGusHkBDpmVWU/mTY2MeouB32Wrww/O324Ezf3ims7qD1BpQykhtQ+2Wl
 gQ1HkCIiT+KDQsg+KemQw6PA+LW7ODu1iQUHZvZn4yl8kX/2JTsInygfvv/3dazHjJR4ju
 XmDi0zAvHEi4/GZ69zYYbUlDCLHzgfl1lHmG4MLt5p5E1LagKM98I6ZdRY2SMeSewxfQI5
 ktlBTZ/J09r06tV14CB1Ti8XvJlA5Ts49unra4IGDImsHClljGhHf2j5e03/IpJKSOrUpB
 lJ1sLg924k5L7HcxKVV3wPsVrOaKwJMRFQm5Ojwn+xTiEal/N647MfcVHq4c+A==
From: Juri Linkov <juri@HIDDEN>
To: Stephen Berman <stephen.berman@HIDDEN>
Subject: Re: bug#78959: 31.0.50; *Completions* buffer navigation with 'n'
 and 'p'
In-Reply-To: <87a55cc9q9.fsf@HIDDEN>
Organization: LINKOV.NET
References: <CAH8Pv0hAOUwCxyHP_gJdWuuP16U+LYWWpAhopwbPVSDHukAURg@HIDDEN>
 <87ecuuwj7j.fsf@HIDDEN> <87o6tw4hbo.fsf@HIDDEN>
 <874ivo77vt.fsf@HIDDEN> <87wm8k2cjm.fsf@HIDDEN>
 <87ldozyt8r.fsf@HIDDEN> <875xg1sxxc.fsf@HIDDEN>
 <87a55cc9q9.fsf@HIDDEN>
Date: Thu, 10 Jul 2025 21:48:49 +0300
Message-ID: <87tt3jg9v2.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 78959
Cc: 78959 <at> debbugs.gnu.org, Dani Moncayo <dmoncayo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> Do I understand correctly that you mean such behavior:
>> when `next-line-completion' reaches the bottom of the column
>> it should wrap to the top of the next column?
>
> Yes.
>
>> If you will improve `next-line-completion', this will provide
>> symmetry between `next-completion' and `next-line-completion'.
>
> Ok, I've tried to do that in the attached patch.  This also required
> changes in `last-completion', which did not DTRT in vertical format.  I
> think this patch improves on my previous patch, in terms of both the
> code (which nevertheless remains rather convoluted) and the coverage (my
> previous patch did not work right in vertical format when all columns of
> completions have the same number of lines).  I've tested the patch with
> -Q and all combinations of values of `completions-format' and
> `completion-auto-wrap', and the resulting behavior seems sensible in
> each case.

I expected that the patch would be much simpler:
after wrapping to the top of the current column
would it be enough just to call `next-completion'
to go to the next column on the same first row?

And for `previous-line-completion' would it be simpler
to call `previous-completion' to go to the previous column,
and afterwards wrap to the bottom of the same column?

Then for `last-completion' is it possible to call
`first-completion', then `previous-completion'
will go to the last column, then `previous-line-completion'
could wrap to its bottom?

>> Or wrapping to the next column should be optional?
>> Then maybe in your `next-completion-switch',
>> `(next-line-completion n)' should be called with a new argument e.g.
>> `(next-line-completion n 'next-column)'?
>
> I decided not to implement this, because it doesn't seem very useful to
> me: the user can just stop hitting `n', `p', `down' or `up' to avoid
> wrapping (and `left' and `right' still move between columns).

So to achieve the previous behavior it is easy
to type `left' or `right' after wrapping to go
back to the original column?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78959; Package emacs. Full text available.

Message received at 78959 <at> debbugs.gnu.org:


Received: (at 78959) by debbugs.gnu.org; 10 Jul 2025 16:05:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 10 12:05:32 2025
Received: from localhost ([127.0.0.1]:58762 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uZtm6-0004Kx-QL
	for submit <at> debbugs.gnu.org; Thu, 10 Jul 2025 12:05:32 -0400
Received: from mout.gmx.net ([212.227.17.20]:55891)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <stephen.berman@HIDDEN>)
 id 1uZtm2-0004Jc-Fj
 for 78959 <at> debbugs.gnu.org; Thu, 10 Jul 2025 12:05:29 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net;
 s=s31663417; t=1752163520; x=1752768320; i=stephen.berman@HIDDEN;
 bh=TSNCQ8byo9eDSkv+5J4TcW4FxEG4EXuHRcb9PiVzspE=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date:
 Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=uIMtjFJGY75Hkc6DDIH1dlTrBJIs6aJnLF3kaklt2FAgTRa9tX8vvWhqOxjtBGMK
 qqSLClYC8cM4Ta3iOnj+PF8+hlkX3KfVGRziw3rrIEC4EyUnBBkJKAXmgnftq9SwN
 iq7Wcb9BnNHbq5HfweBdLdcrfKRwDvQiTmSbzlmVM26TpQKnqshp1j21MqvN3y+Cl
 gl9RVcuwsg7sLgS5HWY7KRmpOLPSiGxYzAesokikgjEAo1/cJcIJ0ikYzKNdE0ZKW
 DU9eybrHTxml3m2CUvpOAIY/lyK9UOUiBSbMLdl4S/dTmZeSQixgjUFE4u35UuFME
 8n9ahwtUZbow1xbAVA==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from strobelfs2 ([94.134.94.84]) by mail.gmx.net (mrgmx104
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N5GE1-1uh4ws2M2X-00r8ps; Thu, 10
 Jul 2025 18:05:19 +0200
From: Stephen Berman <stephen.berman@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#78959: 31.0.50; *Completions* buffer navigation with 'n'
 and 'p'
In-Reply-To: <875xg1sxxc.fsf@HIDDEN>
References: <CAH8Pv0hAOUwCxyHP_gJdWuuP16U+LYWWpAhopwbPVSDHukAURg@HIDDEN>
 <87ecuuwj7j.fsf@HIDDEN> <87o6tw4hbo.fsf@HIDDEN>
 <874ivo77vt.fsf@HIDDEN> <87wm8k2cjm.fsf@HIDDEN>
 <87ldozyt8r.fsf@HIDDEN> <875xg1sxxc.fsf@HIDDEN>
Date: Thu, 10 Jul 2025 18:05:18 +0200
Message-ID: <87a55cc9q9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Provags-ID: V03:K1:CisQftDb5QaBLhJPQnzTsjgm3C+QvkKjJgYg5C81VClnXHBDY0o
 +FO/NV9gFg0W6NH0S/F5bkGphbFE8YkKKGkJnMlTporI3EqsvQlrfaj7sgKcOMn5+MUFaT3
 YlxNEsB2Qom+O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0QpjBdky0ht5uja9Yjyuud4
 Pyb6P++kgJyFEnYb+zYhJwwmfSx5nMkpOA3LOqxSMRd4I1Iw7qFjxvntL33nNFjfm7CNbWfS7
 usNJLINTs+zJ8eR5p5MCMsX/8FSmzkchKirI59sUgwGfsp2EPjSDfDMe8jFCUT9FlXfsbAr5Z
 aoXSngOoySO6cFsQlD8HIKTpqL5mVpXav/72U7H7tY/Q9AwnCEU5WuH/Aq/SrH83121IUvLRx
 YJ5uz5eL5XHBq3dyKdOVlfG/X2mMGdllKdkdGRX0ZIEfVVdfwo1SuEmWoPRUrkQ5zBcYHngC6
 bUPkCR/+srFuaE0/AyzOkVHrG2QPcZCITyYcK7TDU39cnGzTDh8enA5q+EiRZASDbIK8IFdjF
 0n8jS5xPX/IWLGzMfCjCKeCXCG/nSf8fkEAWmKH0m6eFoUjdSMpb4gT1mX2UebMAatGLAALju
 wGCieFzJGL7ar1LbokeHz/bimsvuiIGUS1/o3Y2RXf8bNZgDepLqwDSyPzNO2OjpT5uwKHofX
 sUIIku6ya4B7+KdQgr2lfRF+VSHONejcsxhl/wkTlG7lGmVtEY/XGMVnGhBs1zGLuHAwbvouu
 2JbXjEjrOMRRaK5isr6loN2hbedBJBVx8wtUP/osE/wKiZpF3v6Jg6ojd73tSAA+HA==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 78959
Cc: 78959 <at> debbugs.gnu.org, Dani Moncayo <dmoncayo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain

On Wed, 09 Jul 2025 09:16:43 +0300 Juri Linkov <juri@HIDDEN> wrote:

>>> When the display is horizontal, 'n' and 'p' could use
>>> `next-completion' to `next-line-completion'.
>>> When the display is vertical, 'n' and 'p' could use
>>> `next-line-completion' and `previous-line-completion'.
>>
>> I think either I don't understand your proposal or you misunderstand the
>> issue.  If your proposal is correctedly implemented with the attached
>> patch, then it doesn't DTRT: setting `completions-format' to 'vertical,
>> typing `M-x auto- TAB M-v' and then typing `n' and `p' repeatedly only
>> moves between items in the first column of the *Completions* buffer.
>> What the OP wanted, and my patch provides, is movement column-wise
>> between all items.  I don't see how `{next,previous}-line-completion'
>> can do this as currently implemented.  If misunderstood your proposal,
>> please clarify it.
>
> Do I understand correctly that you mean such behavior:
> when `next-line-completion' reaches the bottom of the column
> it should wrap to the top of the next column?

Yes.

> If you will improve `next-line-completion', this will provide
> symmetry between `next-completion' and `next-line-completion'.

Ok, I've tried to do that in the attached patch.  This also required
changes in `last-completion', which did not DTRT in vertical format.  I
think this patch improves on my previous patch, in terms of both the
code (which nevertheless remains rather convoluted) and the coverage (my
previous patch did not work right in vertical format when all columns of
completions have the same number of lines).  I've tested the patch with
-Q and all combinations of values of `completions-format' and
`completion-auto-wrap', and the resulting behavior seems sensible in
each case.

> Or wrapping to the next column should be optional?
> Then maybe in your `next-completion-switch',
> `(next-line-completion n)' should be called with a new argument e.g.
> `(next-line-completion n 'next-column)'?

I decided not to implement this, because it doesn't seem very useful to
me: the user can just stop hitting `n', `p', `down' or `up' to avoid
wrapping (and `left' and `right' still move between columns).

Steve Berman


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment
Content-Description: next/previous completions patch
Content-Transfer-Encoding: quoted-printable

diff --git a/lisp/simple.el b/lisp/simple.el
index fa173b26289..d60b6a23e73 100644
=2D-- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -10041,8 +10041,8 @@ completion-list-mode-map
     (define-key map [M-down] 'minibuffer-next-completion)
     (define-key map "\M-\r" 'minibuffer-choose-completion)
     (define-key map "z" 'kill-current-buffer)
-    (define-key map "n" 'next-completion)
-    (define-key map "p" 'previous-completion)
+    (define-key map "n" 'next-completion-switch)
+    (define-key map "p" 'previous-completion-switch)
     (define-key map "\M-g\M-c" 'switch-to-minibuffer)
     map)
   "Local map for completion list buffers.")
@@ -10124,12 +10124,33 @@ first-completion
 (defun last-completion ()
   "Move to the last item in the completions buffer."
   (interactive)
+  ;; Move to the last item in horizontal or one-column format.
   (goto-char (previous-single-property-change
               (point-max) 'mouse-face nil (point-min)))
-  ;; Move to the start of last one.
+  ;; Move to the start of the item.
   (unless (get-text-property (point) 'mouse-face)
     (when-let* ((pos (previous-single-property-change (point) 'mouse-face=
)))
-      (goto-char pos))))
+      (goto-char pos)))
+  ;; In vertical format the last item is in the last column even if its
+  ;; line number is less than that of the last item in earlier columns.
+  (when (eq completions-format 'vertical)
+    (let* ((pt (point))
+           (col (current-column))
+           (last (progn
+                   (first-completion)
+                   (goto-char (pos-eol))
+                   (goto-char (previous-single-property-change
+                               (point) 'mouse-face))
+                   (current-column))))
+      (when (> last col)
+        (while (=3D (current-column) last)
+          (forward-line)
+          (unless (eobp)
+            (goto-char (pos-eol))
+            (move-to-column last)
+            (when (=3D (current-column) last)
+              (setq pt (point))))))
+      (goto-char pt))))
=20
 (defun previous-completion (n)
   "Move to the previous item in the completions buffer.
@@ -10228,11 +10249,15 @@ previous-line-completion
=20
 (defun next-line-completion (&optional n)
   "Move to completion candidate on the next line in the completions buffe=
r.
-With prefix argument N, move N lines forward (negative N means move backw=
ard).
+With prefix argument N, move N lines forward (negative N means move
+backward).  In vertical format (see user option `completions-format')
+this command moves column-wise through all items in the completions
+buffer, in horizontal format movement is confined to the current column
+of completions.
=20
 Also see the `completion-auto-wrap' variable."
   (interactive "p")
-  (let (line column pos found)
+  (let (line column pos found first)
     (when (and (bobp)
                (> n 0)
                (get-text-property (point) 'mouse-face)
@@ -10257,32 +10282,57 @@ next-line-completion
               ((< n 0) (first-completion)))))
=20
     (while (> n 0)
-      (setq found nil pos nil column (current-column) line (line-number-a=
t-pos))
+      (setq found nil pos (when (eq completions-format 'vertical) (point)=
)
+            column (current-column) line (line-number-at-pos)
+            first (save-excursion (first-completion) (point)))
       (completion--move-to-candidate-end)
       (while (and (not found)
                   (eq (forward-line 1) 0)
                   (not (eobp))
                   (move-to-column column))
         (when (get-text-property (point) 'mouse-face)
-          (setq found t)))
+          (setq found t pos (point))))
       (when (not found)
-        (if (not completion-auto-wrap)
+        (if (and (not completion-auto-wrap)
+                 (if (eq completions-format 'vertical)
+                     (=3D pos (save-excursion (last-completion) (point)))
+                   t))
             (last-completion)
-          (save-excursion
-            (goto-char (point-min))
-            (when (and (eq (move-to-column column) column)
-                       (get-text-property (point) 'mouse-face))
-              (setq pos (point)))
-            (while (and (not pos) (> line (line-number-at-pos)))
-              (forward-line 1)
-              (when (and (eq (move-to-column column) column)
-                         (get-text-property (point) 'mouse-face))
-                (setq pos (point)))))
-          (if pos (goto-char pos))))
+          (cond ((eq completions-format 'vertical)
+                 (goto-char pos)
+                 (move-to-column 0)
+                 (let ((cnt (count-lines (point) first)))
+                   (forward-line (- cnt)))
+                 (move-to-column column)
+                 (setq pos (point))
+                 (when (get-text-property pos 'mouse-face)
+                   (let ((pos1 (next-single-property-change pos 'mouse-fa=
ce))
+                         pos2)
+                     (when pos1 (goto-char pos1))
+                     (setq pos2 (next-single-property-change
+                                 pos1 'mouse-face nil (line-end-position)=
))
+                     (goto-char (if (=3D pos2 pos1) first pos2))
+                     (when (memq (point) (list first pos2))
+                       (setq pos (point))))))
+                (t
+                 (save-excursion
+                   (goto-char (point-min))
+                   (when (and (eq (move-to-column column) column)
+                              (get-text-property (point) 'mouse-face))
+                     (setq pos (point)))
+                   (while (and (not pos) (> line (line-number-at-pos)))
+                     (forward-line 1)
+                     (when (and (eq (move-to-column column) column)
+                                (get-text-property (point) 'mouse-face))
+                       (setq pos (point)))))))
+          (when pos (goto-char pos))))
       (setq n (1- n)))
=20
     (while (< n 0)
-      (setq found nil pos nil column (current-column) line (line-number-a=
t-pos))
+      (setq found nil pos (point) column (current-column)
+            line (line-number-at-pos) first (save-excursion
+                                              (first-completion)
+                                              (point)))
       (completion--move-to-candidate-start)
       (while (and (not found)
                   (eq (forward-line -1) 0)
@@ -10290,21 +10340,63 @@ next-line-completion
         (when (get-text-property (point) 'mouse-face)
           (setq found t)))
       (when (not found)
-        (if (not completion-auto-wrap)
+        (if (and (not completion-auto-wrap)
+                 (if (eq completions-format 'vertical)
+                     (=3D pos first)
+                   t))
             (first-completion)
-          (save-excursion
-            (goto-char (point-max))
-            (when (and (eq (move-to-column column) column)
-                       (get-text-property (point) 'mouse-face))
-              (setq pos (point)))
-            (while (and (not pos) (< line (line-number-at-pos)))
-              (forward-line -1)
-              (when (and (eq (move-to-column column) column)
-                         (get-text-property (point) 'mouse-face))
-                (setq pos (point)))))
+          (cond ((eq completions-format 'vertical)
+                 (goto-char pos)
+                 (let* ((wrap (=3D (point) first))
+                        (pos1 (previous-single-property-change pos 'mouse=
-face))
+                        (pos2 (if pos1
+                                  (progn
+                                    (goto-char pos1)
+                                    (previous-single-property-change
+                                     pos1 'mouse-face nil
+                                     (line-beginning-position)))
+                                pos))
+                          column)
+                   (when pos1
+                     (goto-char (if (=3D pos2 pos1) first pos2)))
+                   (when (memq (point) (list first pos2))
+                     (setq pos (point) column (current-column)))
+                   (while (not (eobp))
+                     (setq pos1 (point))
+                     (forward-line))
+                   (if wrap
+                       (last-completion)
+                     (goto-char pos1)
+                     (move-to-column column))
+                   (setq pos nil)))
+                (t
+                 (save-excursion
+                   (goto-char (point-max))
+                   (when (and (eq (move-to-column column) column)
+                              (get-text-property (point) 'mouse-face))
+                     (setq pos (point)))
+                   (while (and (not pos) (< line (line-number-at-pos)))
+                     (forward-line -1)
+                     (when (and (eq (move-to-column column) column)
+                                (get-text-property (point) 'mouse-face))
+                       (setq pos (point)))))))
           (if pos (goto-char pos))))
       (setq n (1+ n)))))
=20
+(defun next-completion-switch (&optional n)
+  "Move according to `completions-format' to next completion item."
+  (interactive "p")
+  (pcase completions-format
+    ('vertical (next-line-completion n))
+    (_ (next-completion n))))
+
+(defun previous-completion-switch (&optional n)
+  "Move according to `completions-format' to previous completion item."
+  (interactive "p")
+  (pcase completions-format
+    ('vertical (previous-line-completion n))
+    (_ (previous-completion n))))
+
 (defvar choose-completion-deselect-if-after nil
   "If non-nil, don't choose a completion candidate if point is right afte=
r it.
=20

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78959; Package emacs. Full text available.

Message received at 78959 <at> debbugs.gnu.org:


Received: (at 78959) by debbugs.gnu.org; 9 Jul 2025 06:19:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 09 02:19:16 2025
Received: from localhost ([127.0.0.1]:48005 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uZO9E-0006fO-1J
	for submit <at> debbugs.gnu.org; Wed, 09 Jul 2025 02:19:16 -0400
Received: from mout-y-209.mailbox.org ([91.198.250.237]:44274)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1uZO99-0006eN-Kq
 for 78959 <at> debbugs.gnu.org; Wed, 09 Jul 2025 02:19:12 -0400
Received: from smtp102.mailbox.org (smtp102.mailbox.org
 [IPv6:2001:67c:2050:b231:465::102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-y-209.mailbox.org (Postfix) with ESMTPS id 4bcSVH4thrzB0Wr;
 Wed,  9 Jul 2025 08:19:03 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1752041943;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=EacMxMu4dISnfTtd1oZWPyZ2t0jQdLuJ6Q85ENfZZnk=;
 b=Dq6FkW6xUB6rwZA/H+jVWRJOO/7wDuUiZXuRa9jfRVZFSupAaPYeWS3MNHxkqR+xI/gvtM
 KPr26jclw1NcfIjss/Vis4LVAu6QEBVBlaWqlJfXuuXA8OVXJCYQ2FK1fTfNKZ8CbmgUV8
 xMQ5rsliXpW5Lq1bEIwnk5SkBz3VLlv4FMyVrhfzAljGTXjYZGcAazJHiXNx4Fx08syLZe
 sX6qXieYY6drqGr9D1t2m/H+aHzRkMDGnm6mzrhRY9lGBE18L8YI1gCHIbqV1WZ6n88r2U
 RnYWsCKYp1iR7EMzpluISTFdMYKAXGhzV37KEUL8zuBi/HRPhew1lrh5Ir0Kkw==
Authentication-Results: outgoing_mbo_mout; dkim=none;
 spf=pass (outgoing_mbo_mout: domain of juri@HIDDEN designates
 2001:67c:2050:b231:465::102 as permitted sender)
 smtp.mailfrom=juri@HIDDEN
From: Juri Linkov <juri@HIDDEN>
To: Stephen Berman <stephen.berman@HIDDEN>
Subject: Re: bug#78959: 31.0.50; *Completions* buffer navigation with 'n'
 and 'p'
In-Reply-To: <87ldozyt8r.fsf@HIDDEN>
Organization: LINKOV.NET
References: <CAH8Pv0hAOUwCxyHP_gJdWuuP16U+LYWWpAhopwbPVSDHukAURg@HIDDEN>
 <87ecuuwj7j.fsf@HIDDEN> <87o6tw4hbo.fsf@HIDDEN>
 <874ivo77vt.fsf@HIDDEN> <87wm8k2cjm.fsf@HIDDEN>
 <87ldozyt8r.fsf@HIDDEN>
Date: Wed, 09 Jul 2025 09:16:43 +0300
Message-ID: <875xg1sxxc.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Rspamd-Queue-Id: 4bcSVH4thrzB0Wr
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 78959
Cc: 78959 <at> debbugs.gnu.org, Dani Moncayo <dmoncayo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> When the display is horizontal, 'n' and 'p' could use
>> `next-completion' to `next-line-completion'.
>> When the display is vertical, 'n' and 'p' could use
>> `next-line-completion' and `previous-line-completion'.
>
> I think either I don't understand your proposal or you misunderstand the
> issue.  If your proposal is correctedly implemented with the attached
> patch, then it doesn't DTRT: setting `completions-format' to 'vertical,
> typing `M-x auto- TAB M-v' and then typing `n' and `p' repeatedly only
> moves between items in the first column of the *Completions* buffer.
> What the OP wanted, and my patch provides, is movement column-wise
> between all items.  I don't see how `{next,previous}-line-completion'
> can do this as currently implemented.  If misunderstood your proposal,
> please clarify it.

Do I understand correctly that you mean such behavior:
when `next-line-completion' reaches the bottom of the column
it should wrap to the top of the next column?
If you will improve `next-line-completion', this will provide
symmetry between `next-completion' and `next-line-completion'.
Or wrapping to the next column should be optional?
Then maybe in your `next-completion-switch',
`(next-line-completion n)' should be called with a new argument e.g.
`(next-line-completion n 'next-column)'?

> @@ -10041,8 +10041,8 @@ completion-list-mode-map
> -    (define-key map "n" 'next-completion)
> -    (define-key map "p" 'previous-completion)
> +    (define-key map "n" 'next-completion-switch)
> +    (define-key map "p" 'previous-completion-switch)
> [...]
> +(defun next-completion-switch (&optional n)
> +  "Move according to `completions-format' to next completion item."
> +  (interactive "p")
> +  (pcase completions-format
> +    ('horizontal (next-completion n))
> +    ('vertical (next-line-completion n))))
> +
> +(defun previous-completion-switch (&optional n)
> +  "Move according to `completions-format' to previous completion item."
> +  (interactive "p")
> +  (pcase completions-format
> +    ('horizontal (previous-completion n))
> +    ('vertical (previous-line-completion n))))




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78959; Package emacs. Full text available.

Message received at 78959 <at> debbugs.gnu.org:


Received: (at 78959) by debbugs.gnu.org; 8 Jul 2025 16:36:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 08 12:36:52 2025
Received: from localhost ([127.0.0.1]:44237 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uZBJL-0003hf-8E
	for submit <at> debbugs.gnu.org; Tue, 08 Jul 2025 12:36:51 -0400
Received: from [212.227.17.21] (port=43047 helo=mout.gmx.net)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <stephen.berman@HIDDEN>)
 id 1uZ3oP-0004u2-BL
 for 78959 <at> debbugs.gnu.org; Tue, 08 Jul 2025 04:36:46 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net;
 s=s31663417; t=1751963765; x=1752568565; i=stephen.berman@HIDDEN;
 bh=1dALCtsyROGwi7As7gAWz5NU4c3S5L/nmH4g4IkGVmY=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date:
 Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=It8uGd3x8O5zd4chxtoWIk0U+t/i8QXNqRN6Qsf5lQcNdfBLgIMNUh5gj5Ud0eDi
 /Db0LjDFP0DA9A0Xeqr+u+5ZaroQQbYbKH3+MXsMMnkINd+cscHCpGaScnvszQGmj
 OkMdPlS2vLq6GBx6XZYzji6uQyKJhGvsxi04GFFQJorlGiv1ydUxzfaa2n3w/2kkx
 hDxH3vsn1vPT/rvsOreIYRDgWRlvxoABBM0nn6voXf8TRZq4q3Ot/GOAgQYQj1CPD
 AcO84g5tqKQ90L+2bk+sBAM5CoUlrjvbBD+yES9mfFfFdJ/pDY0opXNiKYwhOP02c
 XoUdzXvNE5bbJtCIWA==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from strobelfs2 ([88.130.48.245]) by mail.gmx.net (mrgmx104
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MpDNf-1v1GLD2qb9-00geEW; Tue, 08
 Jul 2025 10:36:04 +0200
From: Stephen Berman <stephen.berman@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#78959: 31.0.50; *Completions* buffer navigation with 'n'
 and 'p'
In-Reply-To: <87wm8k2cjm.fsf@HIDDEN>
References: <CAH8Pv0hAOUwCxyHP_gJdWuuP16U+LYWWpAhopwbPVSDHukAURg@HIDDEN>
 <87ecuuwj7j.fsf@HIDDEN> <87o6tw4hbo.fsf@HIDDEN>
 <874ivo77vt.fsf@HIDDEN> <87wm8k2cjm.fsf@HIDDEN>
Date: Tue, 08 Jul 2025 10:36:04 +0200
Message-ID: <87ldozyt8r.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-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ysN38olWNj6QV2vuk1UBeRQY+LqgLZtXW70sO/ovuJq01t05VHAcBiOdYCZg1fF
 w9Q0MCeqlEKLWSnOfejJMdAwGDXULaYwENARqB/YyX81wbapWf7TOxhANlzzhmOcu33WYiOBv
 DFUTBFgg9t2WJK6lBzd7NCCPZQEM9W/LUgvQwkyyEQTlfHkKp9Ftr42iAyoLKLCwU0c5OYb6a
 PhXfk8991r4gyya6jJtnNx+TOTVTs/8P8qZiiIXLiQtr9vlVhu1TU8JSQPYFPp+7TRPZUOWZ7
 0gxdNZHUjgRiyhHO5fwOZPaeAAeKoqmPGi3Wgv9w8PgJ0p8rnytechYUg7YPC/LqP4Rx9Zryi
 DcS/UxBZI3nB7gwPMmeba9hnC2GTN6s2krjre6kdkgahaDT9PWeVN+aMZUEtgWGIzfXJHmq9q
 HaoGda/L2Ul3gUomVVjsHZfmUuR/49UITWIoutJ6H5/VhG3IkWrd75DlyrtnP5Xx6yy6ve4Mu
 zUIWoXmUkR2waleWp+LAZzyD1GmKjUpKVOt1gDeJ/8z+iQuechgCIOVrR161Fm4K76m7zYnGT
 TzQQgMXjys3jafmYsiqu/M0W/QDkycnpKvOcwR7WKRkZ9jZfzxA6TIDCRnHylt7Mp4esro7BC
 Va0QgmDKqO4OF/lmnR2oXBuCOA15wwES4kZidmXsSElpdYjuZNbxXo2nrC3XE638ON/YRgjFv
 yC700/8kjzBpvqHv75+Hj0MbvJLOPEggIEGjnUWy8/ly+iNY+POggcrL2drtvZ5OuDkOiVu/L
 Dg==
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  On Mon, 07 Jul 2025 19:25:33 +0300 Juri Linkov wrote: >>>>>
 The same issue reported in this ticket applies to the keys M-<down> >>>>>
 and M-<up>, when typed from the minibuffer to navigate among >>>>> completion
 candidates. >>>> >>>> I tried to give it a [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (stephen.berman[at]gmx.net)
 0.0 T_SPF_TEMPERROR        SPF: test of record failed (temperror)
 0.0 T_SPF_HELO_TEMPERROR   SPF: test of HELO record failed (temperror)
 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS
 0.0 SPOOFED_FREEMAIL_NO_RDNS From SPOOFED_FREEMAIL and no rDNS
X-Debbugs-Envelope-To: 78959
Cc: 78959 <at> debbugs.gnu.org, Dani Moncayo <dmoncayo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.4 (/)

--=-=-=
Content-Type: text/plain

On Mon, 07 Jul 2025 19:25:33 +0300 Juri Linkov <juri@HIDDEN> wrote:

>>>>> The same issue reported in this ticket applies to the keys M-<down>
>>>>> and M-<up>, when typed from the minibuffer to navigate among
>>>>> completion candidates.
>>>>
>>>> I tried to give it a shot with the attached patch, which seems to DTRT
>>>> for your test case with `n', `p', `M-<down>' and `M-<up>'.  You might
>>>> give it a try and see if you find any problems with it.  (But maybe
>>>> don't look at the code too closely, it's ugly as hell....)
>>>
>>> Isn't this just about keybindings?  When completions-format is
>>> customizeed to `vertical', keybindings `n' and `p' could be
>>> just remapped from `next-completion' to `next-line-completion',
>>> and from `previous-completion' to `previous-line-completion'.
>>
>> Bindings for `next-line-completion' and `previous-line-completion'
>> already exist in `completions-list-mode-map' (<down> and <up>,
>> respectively), and using these keys with `completions-format' set to
>> 'vertical only moves point within the current column in the
>> *Completions* buffer.  You can move to the next or previous column with
>> <right> or <left> and then continue with <up> or <down>.  But this bug
>> report was about using the same keys to scroll through all completions
>> in the sorted order according to whether the display is horizontal or
>> vertical; `{next,previous}-line-completion', as currently implemented,
>> don't DTRT for that.
>
> When the display is horizontal, 'n' and 'p' could use
> `next-completion' to `next-line-completion'.
> When the display is vertical, 'n' and 'p' could use
> `next-line-completion' and `previous-line-completion'.

I think either I don't understand your proposal or you misunderstand the
issue.  If your proposal is correctedly implemented with the attached
patch, then it doesn't DTRT: setting `completions-format' to 'vertical,
typing `M-x auto- TAB M-v' and then typing `n' and `p' repeatedly only
moves between items in the first column of the *Completions* buffer.
What the OP wanted, and my patch provides, is movement column-wise
between all items.  I don't see how `{next,previous}-line-completion'
can do this as currently implemented.  If misunderstood your proposal,
please clarify it.

Steve Berman


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment
Content-Description: next/previous completions patch
Content-Transfer-Encoding: quoted-printable

diff --git a/lisp/simple.el b/lisp/simple.el
index fa173b26289..9af3fe15233 100644
=2D-- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -10041,8 +10041,8 @@ completion-list-mode-map
     (define-key map [M-down] 'minibuffer-next-completion)
     (define-key map "\M-\r" 'minibuffer-choose-completion)
     (define-key map "z" 'kill-current-buffer)
-    (define-key map "n" 'next-completion)
-    (define-key map "p" 'previous-completion)
+    (define-key map "n" 'next-completion-switch)
+    (define-key map "p" 'previous-completion-switch)
     (define-key map "\M-g\M-c" 'switch-to-minibuffer)
     map)
   "Local map for completion list buffers.")
@@ -10305,6 +10305,20 @@ next-line-completion
           (if pos (goto-char pos))))
       (setq n (1+ n)))))
=20
+(defun next-completion-switch (&optional n)
+  "Move according to `completions-format' to next completion item."
+  (interactive "p")
+  (pcase completions-format
+    ('horizontal (next-completion n))
+    ('vertical (next-line-completion n))))
+
+(defun previous-completion-switch (&optional n)
+  "Move according to `completions-format' to previous completion item."
+  (interactive "p")
+  (pcase completions-format
+    ('horizontal (previous-completion n))
+    ('vertical (previous-line-completion n))))
+
 (defvar choose-completion-deselect-if-after nil
   "If non-nil, don't choose a completion candidate if point is right afte=
r it.
=20

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78959; Package emacs. Full text available.

Message received at 78959 <at> debbugs.gnu.org:


Received: (at 78959) by debbugs.gnu.org; 7 Jul 2025 16:29:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 07 12:29:46 2025
Received: from localhost ([127.0.0.1]:37281 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uYoiv-0005xo-J6
	for submit <at> debbugs.gnu.org; Mon, 07 Jul 2025 12:29:45 -0400
Received: from mout-y-111.mailbox.org ([2001:67c:2050:103:465::111]:50886)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1uYoir-0005wc-Cg
 for 78959 <at> debbugs.gnu.org; Mon, 07 Jul 2025 12:29:42 -0400
Received: from smtp1.mailbox.org (smtp1.mailbox.org
 [IPv6:2001:67c:2050:b231:465::1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-y-111.mailbox.org (Postfix) with ESMTPS id 4bbV7Z5QFzz9ySQ;
 Mon,  7 Jul 2025 18:29:30 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1751905770;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=XhqAkYVjEzZQ/ZD49KMCezf90LwEbk3ZFtijxzqXHk8=;
 b=pJmfuTwfq2DZLckrmKYjzxNcDoFibbYYs/o5PftguqZObyXHX3g0W3zPekS3gtDhveqe5i
 sOafKAunxex4Uvi9mHvgMW2nw0+yxhicG9CgC4o0oKwjivSkCTmoFo5RUG6ahI8h3d3pRI
 5TasiUHAdDyz4GLcx/B3uJ7tVOtrVxfWM1eaB7sjDe9l8m7p812EenIUMJlz99PQ0npq08
 m7CzFL+hBim2pEgHY2FmMq36u/TN9AtNGlpBExjNDG46s8I1qXol+UOFDpl5ywBbRYcn8z
 lc5UHVkJMXr69ZxpTeWpjiTYO18p1nuK+AeDa3CfyZq745KXtLwL0/vh970/aQ==
From: Juri Linkov <juri@HIDDEN>
To: Stephen Berman <stephen.berman@HIDDEN>
Subject: Re: bug#78959: 31.0.50; *Completions* buffer navigation with 'n'
 and 'p'
In-Reply-To: <874ivo77vt.fsf@HIDDEN>
Organization: LINKOV.NET
References: <CAH8Pv0hAOUwCxyHP_gJdWuuP16U+LYWWpAhopwbPVSDHukAURg@HIDDEN>
 <87ecuuwj7j.fsf@HIDDEN> <87o6tw4hbo.fsf@HIDDEN>
 <874ivo77vt.fsf@HIDDEN>
Date: Mon, 07 Jul 2025 19:25:33 +0300
Message-ID: <87wm8k2cjm.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Rspamd-Queue-Id: 4bbV7Z5QFzz9ySQ
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 78959
Cc: 78959 <at> debbugs.gnu.org, Dani Moncayo <dmoncayo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>>>> The same issue reported in this ticket applies to the keys M-<down>
>>>> and M-<up>, when typed from the minibuffer to navigate among
>>>> completion candidates.
>>>
>>> I tried to give it a shot with the attached patch, which seems to DTRT
>>> for your test case with `n', `p', `M-<down>' and `M-<up>'.  You might
>>> give it a try and see if you find any problems with it.  (But maybe
>>> don't look at the code too closely, it's ugly as hell....)
>>
>> Isn't this just about keybindings?  When completions-format is
>> customizeed to `vertical', keybindings `n' and `p' could be
>> just remapped from `next-completion' to `next-line-completion',
>> and from `previous-completion' to `previous-line-completion'.
>
> Bindings for `next-line-completion' and `previous-line-completion'
> already exist in `completions-list-mode-map' (<down> and <up>,
> respectively), and using these keys with `completions-format' set to
> 'vertical only moves point within the current column in the
> *Completions* buffer.  You can move to the next or previous column with
> <right> or <left> and then continue with <up> or <down>.  But this bug
> report was about using the same keys to scroll through all completions
> in the sorted order according to whether the display is horizontal or
> vertical; `{next,previous}-line-completion', as currently implemented,
> don't DTRT for that.

When the display is horizontal, 'n' and 'p' could use
`next-completion' to `next-line-completion'.
When the display is vertical, 'n' and 'p' could use
`next-line-completion' and `previous-line-completion'.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78959; Package emacs. Full text available.

Message received at 78959 <at> debbugs.gnu.org:


Received: (at 78959) by debbugs.gnu.org; 7 Jul 2025 07:55:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 07 03:55:17 2025
Received: from localhost ([127.0.0.1]:60938 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uYgh3-0004Fc-3k
	for submit <at> debbugs.gnu.org; Mon, 07 Jul 2025 03:55:17 -0400
Received: from mout.gmx.net ([212.227.17.20]:47503)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <stephen.berman@HIDDEN>)
 id 1uYgh0-0004CA-4F
 for 78959 <at> debbugs.gnu.org; Mon, 07 Jul 2025 03:55:15 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net;
 s=s31663417; t=1751874903; x=1752479703; i=stephen.berman@HIDDEN;
 bh=ooSTxQdzPj64e8qo4WyY4H/8Kg2mTG6iKuFY2mZ0gL4=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date:
 Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=i+FxxRn+OFqhn6bqgB8rCKRvucqCFtIYI7I+bbQ1/HFWT7p/Q63oS2QZqZtw1aBJ
 mpbOPKONPj/7SD40LkTNxfmMCttPRs7xJcm3Bq0mj7rLty91xadO/zqgHofbXx9RN
 eZEj1ee2mF9sQdWNwuX1LvpcW1KrsjWKnbkED6hxhrhG/3d1DF52UIM2RDg9TLFWL
 GuozR/THhbJpSXpTfYjOFKObF2DZwKSalH8hXGQx2WJnaRKVTUuVuQKUyYeQecNFm
 vCj4v1ltCsAZJFnJW8P1ZSRkHgsHqpnCUbTGeh+8lI4LWHOWlxtnJ55WEIs9cYXUF
 vZeTVJ1mBUKanIDKXw==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from strobelfs2 ([94.134.95.252]) by mail.gmx.net (mrgmx104
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N7i8Y-1ulM9t2B7a-00wwJB; Mon, 07
 Jul 2025 09:55:03 +0200
From: Stephen Berman <stephen.berman@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#78959: 31.0.50; *Completions* buffer navigation with 'n'
 and 'p'
In-Reply-To: <87o6tw4hbo.fsf@HIDDEN>
References: <CAH8Pv0hAOUwCxyHP_gJdWuuP16U+LYWWpAhopwbPVSDHukAURg@HIDDEN>
 <87ecuuwj7j.fsf@HIDDEN> <87o6tw4hbo.fsf@HIDDEN>
Date: Mon, 07 Jul 2025 09:55:02 +0200
Message-ID: <874ivo77vt.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:ZsWVr2Xlis5OHHtwpb3rixhlad0wOCkwk4G3EE8XC0gKumqQUvK
 s3BWQafy7BfvVFnfqvhURJmtXNMxgq73r7r0OxUx/AuSNufnaRviPFxy4Rc/Y+LfdqwF0Bc
 /DPkFBZ6FrtwlNzYF+bhWt9BphJpgHUy32X+5JwSn5NhsUrQfS/LjHxDMUcukz3lgbv+EVd
 oSb2a5rhLWLG5wJhl1Mig==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:F9IGiq+4c3A=;NfuVnCSxodvL4JVWulenZBfcOHk
 HvXdvms0TU0s1C8GbKFAebRe70b6K4cgYsDEcoVdqUfbVY86D8BwSm07IdIJcimv3KgGKTaTl
 ZDk7RTrKoNBRKrNV3VsO+FEh+Kkl3BzTC819afB1Ei/l1F6GGhvp5x6TJSEYQKr7gzQEe7NbE
 VIjgOr5ACL7NH1Bc1n4OBZLjfvz3p3JKkM0WwOm1zQRHMg7Ewn4wAgrZpAzcIzNYsHw/igjv2
 gktZdVuW/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x
 QFdBCpNmk+3uxHVKet5ViepYvYs7wtX3iCXjcS44q5Hh/7nrW6wn7b8HdB8FSHP/of90SeL
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 78959
Cc: 78959 <at> debbugs.gnu.org, Dani Moncayo <dmoncayo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On Mon, 07 Jul 2025 09:49:23 +0300 Juri Linkov <juri@HIDDEN> wrote:

>>> The same issue reported in this ticket applies to the keys M-<down>
>>> and M-<up>, when typed from the minibuffer to navigate among
>>> completion candidates.
>>
>> I tried to give it a shot with the attached patch, which seems to DTRT
>> for your test case with `n', `p', `M-<down>' and `M-<up>'.  You might
>> give it a try and see if you find any problems with it.  (But maybe
>> don't look at the code too closely, it's ugly as hell....)
>
> Isn't this just about keybindings?  When completions-format is
> customizeed to `vertical', keybindings `n' and `p' could be
> just remapped from `next-completion' to `next-line-completion',
> and from `previous-completion' to `previous-line-completion'.

Bindings for `next-line-completion' and `previous-line-completion'
already exist in `completions-list-mode-map' (<down> and <up>,
respectively), and using these keys with `completions-format' set to
'vertical only moves point within the current column in the
*Completions* buffer.  You can move to the next or previous column with
<right> or <left> and then continue with <up> or <down>.  But this bug
report was about using the same keys to scroll through all completions
in the sorted order according to whether the display is horizontal or
vertical; `{next,previous}-line-completion', as currently implemented,
don't DTRT for that.

Steve Berman




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78959; Package emacs. Full text available.

Message received at 78959 <at> debbugs.gnu.org:


Received: (at 78959) by debbugs.gnu.org; 7 Jul 2025 07:00:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 07 03:00:47 2025
Received: from localhost ([127.0.0.1]:60886 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uYfqJ-0005cp-DJ
	for submit <at> debbugs.gnu.org; Mon, 07 Jul 2025 03:00:47 -0400
Received: from mout-y-111.mailbox.org ([91.198.250.236]:33108)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1uYfqF-0005c0-M7
 for 78959 <at> debbugs.gnu.org; Mon, 07 Jul 2025 03:00:44 -0400
Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-y-111.mailbox.org (Postfix) with ESMTPS id 4bbFW72Xbzz9xqF;
 Mon,  7 Jul 2025 09:00:35 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1751871635;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=tmvHu4+nNBIEzNIUhr+ReXjsCOeSDWWOexD7WSUEQOk=;
 b=U9Puq3NLH/qNB3z4cr3BeqsXyg2HJZAldxE7FM8wp3CAZ5diNlxHUiKuAEUEQ3LhhE+uoy
 6OJDZd02jDLh7Gmkc/DLrXeowKX5TNlZISseTQocYW0Y3HmocrR9FeJADVGKu3Z4aTUuJZ
 cn1hGbGYQNrOSk/XzjeiS4ARFIJPkIS88VqvT2VYVic4q+mv5x2TyyLv4fMfeOlT7wTT2b
 h14XKe+QO7m5eJZSWiO74sfnoIwRPZs2A61EaiFhRnLb5mkCpqRXpy0y2MhCr6J5I3rrGU
 D0uQtq3ne//5K6iKQbRUuHCa3OqW/c3D8vsK4mcPgrWzK9YU6VQ6NVyYi0RANg==
From: Juri Linkov <juri@HIDDEN>
To: Stephen Berman <stephen.berman@HIDDEN>
Subject: Re: bug#78959: 31.0.50; *Completions* buffer navigation with 'n'
 and 'p'
In-Reply-To: <87ecuuwj7j.fsf@HIDDEN>
Organization: LINKOV.NET
References: <CAH8Pv0hAOUwCxyHP_gJdWuuP16U+LYWWpAhopwbPVSDHukAURg@HIDDEN>
 <87ecuuwj7j.fsf@HIDDEN>
Date: Mon, 07 Jul 2025 09:49:23 +0300
Message-ID: <87o6tw4hbo.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 78959
Cc: 78959 <at> debbugs.gnu.org, Dani Moncayo <dmoncayo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> The same issue reported in this ticket applies to the keys M-<down>
>> and M-<up>, when typed from the minibuffer to navigate among
>> completion candidates.
>
> I tried to give it a shot with the attached patch, which seems to DTRT
> for your test case with `n', `p', `M-<down>' and `M-<up>'.  You might
> give it a try and see if you find any problems with it.  (But maybe
> don't look at the code too closely, it's ugly as hell....)

Isn't this just about keybindings?  When completions-format is
customizeed to `vertical', keybindings `n' and `p' could be
just remapped from `next-completion' to `next-line-completion',
and from `previous-completion' to `previous-line-completion'.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78959; Package emacs. Full text available.

Message received at 78959 <at> debbugs.gnu.org:


Received: (at 78959) by debbugs.gnu.org; 6 Jul 2025 11:34:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 06 07:34:59 2025
Received: from localhost ([127.0.0.1]:53270 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uYNe6-0005kb-PB
	for submit <at> debbugs.gnu.org; Sun, 06 Jul 2025 07:34:59 -0400
Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:54441)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <dmoncayo@HIDDEN>)
 id 1uYNe3-0005j4-SQ
 for 78959 <at> debbugs.gnu.org; Sun, 06 Jul 2025 07:34:56 -0400
Received: by mail-pj1-x102e.google.com with SMTP id
 98e67ed59e1d1-3135f3511bcso2164122a91.0
 for <78959 <at> debbugs.gnu.org>; Sun, 06 Jul 2025 04:34:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1751801690; x=1752406490; darn=debbugs.gnu.org;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=SsXJZOunyTg9COJsAEcoId2QJnQw+JIh8d9N3hAKbNA=;
 b=kT9RQWtE/BMHq/DsinJIfUQS6Spr0ZkUatYpCsF8UwwkexxJFXw+LyXSSGorj4tYBE
 jtIraC+m6NXfAojtTr7lykIYVJLVSgcYFU2ADYk/1/8b/tqbk+Ewtjg5KIi+LHjN1HY+
 yNRvR2cp9dh+iUa8AjaMq5hsW8J8mlmGyJMNosLrAb/RAbqPDjP45U2tzdDEa8CZ/M3X
 xyHmr3SLsa1zm5yR/0Yn8mYLOlgDQfhnhczkZemqzvkzkkHdRasW8qBipeanundzv4Bx
 WlKz2AYCxqlrqXDuvzRpsP/APV5oxsgIjJjvURQF7G74hmIPkspp1+CJE5gI9oRq7NLG
 Mdvg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1751801690; x=1752406490;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=SsXJZOunyTg9COJsAEcoId2QJnQw+JIh8d9N3hAKbNA=;
 b=ZUqwSfAGdiv6bX5Ys3IWLObOLPjpwDoM6osuvde//gvKsQE45DURQyXiX86PD/6h/C
 jwAAo6mlW00+ByHXAlN32kNw0ds9C3PQ2Aq6mO+UnOvJwkTP4Xo8zTVJR53wOKwWVYBG
 v+bsSPCOc+c9lUEKUfA13s/dG1v7Pbmw0IYSIFwL6KroR342brrWgG3qeUjSsqoJcrSV
 3gsp4+DxHWti6FsoBJBo1SKd1R4rFU5odOuFSrz+Za6Q6oPuPg2AGtfiCdpPd4494s7h
 5UecpxLY7LUcGbpnf6QqlnjKKH5Q4WKP12LEDMxnEiTVTQjZ9vQwYZXNJvBkNn/okMnC
 0jTw==
X-Gm-Message-State: AOJu0YzjK0MfbDAcuuo5Ggi/fEFMQU/4BQgrAmrc9ve0MkD8WnNT6ZYy
 7se7h1omi3tf2FPRw8Ke/4wL8lh+/lZJ/KeVl6ak20dwV2lRqhPR0BUgQGORDwc+WjgR17Nmlet
 Tix3KQaWQpPqJm1QnNxvES1O/Ud8oABQ=
X-Gm-Gg: ASbGncuPoHlNrdhJZRaOTrncM5Okmn43CHHAWe98UU2899yROs2vIEDhnHndsiay25c
 3+qo99qGcEZIkrV+z8y0WmHSVRKZFvfS36rxz+STc2V8n0DUG0AN9W8blulkmwVYnLLaEU6rOr+
 vvdOTtxfTVhyBLHx799Mq3ef2xC4rG4Vr2MYhq1qA8dTE=
X-Google-Smtp-Source: AGHT+IHznL4ozPEpb1auvOt92ZT1gPlz3GITCw5Vp5KdComcUFIDQIsHSPUr+2TyuCl8T2HZEz60zRkHhYarBoXQaCk=
X-Received: by 2002:a17:90b:2e50:b0:311:baa0:89ce with SMTP id
 98e67ed59e1d1-31aac448241mr16230795a91.12.1751801689683; Sun, 06 Jul 2025
 04:34:49 -0700 (PDT)
MIME-Version: 1.0
References: <CAH8Pv0hAOUwCxyHP_gJdWuuP16U+LYWWpAhopwbPVSDHukAURg@HIDDEN>
 <87ecuuwj7j.fsf@HIDDEN>
 <CAH8Pv0j6PprENwoXJUzqct0giE83BtyijPq5UHmzT1Yyr=G4iA@HIDDEN>
 <CAH8Pv0h7kB43Fjp0v6zYV5N5wSFnp9kfT0hUfRtiRt4AWov7Tg@HIDDEN>
 <87jz4l4q2m.fsf@HIDDEN>
In-Reply-To: <87jz4l4q2m.fsf@HIDDEN>
From: Dani Moncayo <dmoncayo@HIDDEN>
Date: Sun, 6 Jul 2025 13:34:38 +0200
X-Gm-Features: Ac12FXw6z3L9t6wohsj-ZrF0Gft7LuVfVRnKoQ4hgxohvTiJ-yDEUa3yyI6jLVU
Message-ID: <CAH8Pv0icoduUnD5mNcSV8hAszRWNvz_jZv=+vvs7+4OZHWdMkw@HIDDEN>
Subject: Re: bug#78959: 31.0.50;
 *Completions* buffer navigation with 'n' and 'p'
To: Stephen Berman <stephen.berman@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78959
Cc: 78959 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Sun, Jul 6, 2025 at 11:38=E2=80=AFAM Stephen Berman <stephen.berman@gmx.=
net> wrote:
>
> On Sun, 6 Jul 2025 09:22:37 +0200 Dani Moncayo <dmoncayo@HIDDEN> wrote=
:
>
> > On Sun, Jul 6, 2025 at 9:13=E2=80=AFAM Dani Moncayo <dmoncayo@HIDDEN=
> wrote:
> >>
> >> [...]
> >>
> >> I've just re-tested the recipe of the OP with your patch applied, and
> >> it seems to fix the problem.
> >
> > I just found a minor issue: with completions-format set to 'vertical, i=
f I type:
> >
> >   M-x a u t o - <TAB> M-<down>
> >
> > I get an error in the echo area ([No completion here]), and the cursor
> > in the *Completions* buffer is not placed in the first candidate (as
> > it should).  I have to type a second M-<down> to go to the first
> > candidate.
>
> Thanks for testing and finding this problem!  The attached patch
> (replacing, not modifying, my previous patch) should fix it.

With this one, all seems to work fine.

Thanks!

--=20
Dani Moncayo




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78959; Package emacs. Full text available.

Message received at 78959 <at> debbugs.gnu.org:


Received: (at 78959) by debbugs.gnu.org; 6 Jul 2025 09:38:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 06 05:38:22 2025
Received: from localhost ([127.0.0.1]:51832 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uYLpF-0002wd-Rj
	for submit <at> debbugs.gnu.org; Sun, 06 Jul 2025 05:38:22 -0400
Received: from mout.gmx.net ([212.227.15.19]:34575)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <stephen.berman@HIDDEN>)
 id 1uYLpB-0002vB-9q
 for 78959 <at> debbugs.gnu.org; Sun, 06 Jul 2025 05:38:18 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net;
 s=s31663417; t=1751794690; x=1752399490; i=stephen.berman@HIDDEN;
 bh=WT4ABcb7D0tPPXM6ZDH2w3/lnZZImx4ORmhVf/PbYn4=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date:
 Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=onssBKSSjDAJ0rQeaDxyZCxFdibHrSzEby03K8q/r+jlOsnlcx4yA18KEiObueCB
 WQnR5xhBICJ/huzwcpqeCO23qwZDiDiABQpE1C2VdW5lx6CepEZT6T5NjKvYYxF0B
 AhAxta2LuGxliI01M4VOkez/wE3eHZqJ2CoicSCFsSi0WK0YN0NPm+216mIeZaP7B
 k6yuTqu0fr2B8VhdciQzNcJsjG38amgehU6TuZX3vMtT/A3mr+LniNJoh1BkowuD0
 fcDKyh0Em+wiSupAfsIRPWQyoPs+q2vTTB71nKX8pq+mt1ITLox6FqV9qeDtVJgi5
 5OeXZzZMZAdRfw3BSQ==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from strobelfs2 ([94.134.95.231]) by mail.gmx.net (mrgmx005
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MIx3I-1uDwct3QSo-00Hf9M; Sun, 06
 Jul 2025 11:38:09 +0200
From: Stephen Berman <stephen.berman@HIDDEN>
To: Dani Moncayo <dmoncayo@HIDDEN>
Subject: Re: bug#78959: 31.0.50; *Completions* buffer navigation with 'n'
 and 'p'
In-Reply-To: <CAH8Pv0h7kB43Fjp0v6zYV5N5wSFnp9kfT0hUfRtiRt4AWov7Tg@HIDDEN>
References: <CAH8Pv0hAOUwCxyHP_gJdWuuP16U+LYWWpAhopwbPVSDHukAURg@HIDDEN>
 <87ecuuwj7j.fsf@HIDDEN>
 <CAH8Pv0j6PprENwoXJUzqct0giE83BtyijPq5UHmzT1Yyr=G4iA@HIDDEN>
 <CAH8Pv0h7kB43Fjp0v6zYV5N5wSFnp9kfT0hUfRtiRt4AWov7Tg@HIDDEN>
Date: Sun, 06 Jul 2025 11:38:09 +0200
Message-ID: <87jz4l4q2m.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Provags-ID: V03:K1:P749E0VVD7FIgqgJSwEwQBZ/5HO6fx1qWbQUUjwOHzBj+juf8e7
 0v/f4uXvuLxnfFXP1MPhqlLeaXamscAnaybBv9SZrul9Na4NIjx7S57GwAanPK3ruxIGec3
 UM5khAAtZ57RCW7UfRvFDwXi4RDTNHol9p+o5dOI5YLQFWJ9whxfU3Hb/CZuBFCppqVicLP
 n1dIr4b4eTMTmuXFUxhqA==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;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4HseZqHMkex3vg2tzLm69hYwyjjMKTIg1PfQy/e+dpl1Sl3ng39d0jVB6Wyad
 LCivRRqj+RlwcGDgcTM20lxn9WnNXanFmNbST54xkP2VxCyiwDQC+YtlOF8UU9/bztbCtsAZ8
 FwXRKtT7pgyLW8L0MNC1fIduHQmNC2sGqGocXhpdEkzGam1mbs1SMRsfPsZKACg79w62Q87rZ
 V125Mf/H2Aoc6F+kYd5Chf7rLbQg1oWc/qEU1VPTSUQhPPSL/zEyRzxT3Ihxx5hh5Z7YwTUVZ
 ESThoV3oxHUkc003gXCGFgRhC1qfEIaK26B58e2EoYzo0YNh9z3rWdfgdt/bEFFmPSXNH7Gvn
 W/hcLgt32TOfSCUmPoK4WBpfxYKrYX/Lg5b+fERwE=
X-Spam-Score: -0.5 (/)
X-Debbugs-Envelope-To: 78959
Cc: 78959 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.5 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Sun, 6 Jul 2025 09:22:37 +0200 Dani Moncayo <dmoncayo@HIDDEN> wrote:

> On Sun, Jul 6, 2025 at 9:13=E2=80=AFAM Dani Moncayo <dmoncayo@HIDDEN> =
wrote:
>>
>> [...]
>>
>> I've just re-tested the recipe of the OP with your patch applied, and
>> it seems to fix the problem.
>
> I just found a minor issue: with completions-format set to 'vertical, if =
I type:
>
>   M-x a u t o - <TAB> M-<down>
>
> I get an error in the echo area ([No completion here]), and the cursor
> in the *Completions* buffer is not placed in the first candidate (as
> it should).  I have to type a second M-<down> to go to the first
> candidate.

Thanks for testing and finding this problem!  The attached patch
(replacing, not modifying, my previous patch) should fix it.

Steve Berman


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment
Content-Description: next-completion patch
Content-Transfer-Encoding: quoted-printable

diff --git a/lisp/simple.el b/lisp/simple.el
index fa173b26289..c5e70170751 100644
=2D-- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -10177,17 +10177,38 @@ next-completion
         ;; If in a completion, move to the end of it.
         (when (get-text-property pos 'mouse-face)
           (setq pos (next-single-property-change pos 'mouse-face)))
-        (when pos (setq pos (next-single-property-change pos 'mouse-face)=
))
-        (if pos
-            ;; Move to the start of next one.
-            (goto-char pos)
-          ;; If at the last completion option, wrap or skip
-          ;; to the minibuffer, if requested.
-          (when completion-auto-wrap
-            (if (and (eq completion-auto-select t) tabcommand
-                     (minibufferp completion-reference-buffer))
-                (throw 'bound nil)
-              (first-completion))))
+        (if (eq completions-format 'vertical)
+            (let ((goal-column (current-column)))
+              (if (bobp)
+                  (progn
+                    (goto-char (first-completion))
+                    (setq goal-column (current-column)))
+                (next-line))
+              (cond ((eq (char-after) 10)
+                     (first-completion))
+                    ((eobp)
+                     (goto-char pos)
+                     (let ((cnt (count-lines (point) (save-excursion
+                                                   (first-completion)
+                                                   (point)))))
+                       (previous-line (1- cnt)))
+                     (setq pos (point))
+                     (when (get-text-property pos 'mouse-face)
+                       (setq pos (next-single-property-change pos 'mouse-=
face))
+                       (when pos (goto-char pos))
+                       (setq pos (next-single-property-change pos 'mouse-=
face))
+                       (when pos (goto-char pos))))))
+          (when pos (setq pos (next-single-property-change pos 'mouse-fac=
e)))
+          (if pos
+              ;; Move to the start of next one.
+              (goto-char pos)
+            ;; If at the last completion option, wrap or skip
+            ;; to the minibuffer, if requested.
+            (when completion-auto-wrap
+              (if (and (eq completion-auto-select t) tabcommand
+                       (minibufferp completion-reference-buffer))
+                  (throw 'bound nil)
+                (first-completion)))))
         (setq n (1- n)))
=20
       (while (< n 0)
@@ -10197,22 +10218,55 @@ next-completion
                    (not (bobp))
                    (get-text-property (1- pos) 'mouse-face))
           (setq pos (previous-single-property-change pos 'mouse-face)))
-        (when pos (setq pos (previous-single-property-change pos 'mouse-f=
ace)))
-        (if pos
-            (progn
-              (goto-char pos)
-              ;; Move to the start of that one.
-              (unless (get-text-property (point) 'mouse-face)
-                (goto-char (previous-single-property-change
-                            (point) 'mouse-face nil (point-min)))))
-          ;; If at the first completion option, wrap or skip
-          ;; to the minibuffer, if requested.
-          (when completion-auto-wrap
-            (if (and (eq completion-auto-select t) tabcommand
-                     (minibufferp completion-reference-buffer))
-                (progn
-                  (throw 'bound nil))
-              (last-completion))))
+        (if (eq completions-format 'vertical)
+            (let ((goal-column (current-column)))
+              (cond ((save-excursion
+                       (equal (buffer-substring-no-properties
+                               (point)
+                               (next-single-property-change (point) 'mous=
e-face))
+                              (buffer-substring-no-properties
+                               (first-completion)
+                               (next-single-property-change (point) 'mous=
e-face))))
+                     (end-of-line)
+                     (goto-char (previous-single-property-change
+                                 (point) 'mouse-face))
+                     (let ((goal-column (current-column))
+                           p)
+                       (while (not (or (eobp) (eq (char-after) 10)))
+                         (setq p (point))
+                         (next-line))
+                       (goto-char p)))
+                    (t
+                     (previous-line)))
+              (when (eq (char-after) 10)
+                (goto-char pos)
+                (when (get-text-property pos 'mouse-face)
+                  (setq pos (previous-single-property-change pos 'mouse-f=
ace))
+                  (when pos (goto-char pos))
+                  (setq pos (previous-single-property-change pos 'mouse-f=
ace))
+                  (when pos (goto-char pos)))
+                (let ((goal-column (current-column)))
+                  (while (not (or (eobp) (eq (char-after) 10)))
+                    (setq p (point))
+                    (next-line))
+                  (goto-char p))))
+          (when pos
+            (setq pos (previous-single-property-change pos 'mouse-face)))
+          (if pos
+              (progn
+                (goto-char pos)
+                ;; Move to the start of that one.
+                (unless (get-text-property (point) 'mouse-face)
+                  (goto-char (previous-single-property-change
+                              (point) 'mouse-face nil (point-min)))))
+            ;; If at the first completion option, wrap or skip
+            ;; to the minibuffer, if requested.
+            (when completion-auto-wrap
+              (if (and (eq completion-auto-select t) tabcommand
+                       (minibufferp completion-reference-buffer))
+                  (progn
+                    (throw 'bound nil))
+                (last-completion)))))
         (setq n (1+ n))))
=20
     (when (/=3D 0 n)

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78959; Package emacs. Full text available.

Message received at 78959 <at> debbugs.gnu.org:


Received: (at 78959) by debbugs.gnu.org; 6 Jul 2025 07:22:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 06 03:22:59 2025
Received: from localhost ([127.0.0.1]:50408 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uYJiF-0000Gr-2T
	for submit <at> debbugs.gnu.org; Sun, 06 Jul 2025 03:22:59 -0400
Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:55360)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <dmoncayo@HIDDEN>)
 id 1uYJiB-0000FM-T0
 for 78959 <at> debbugs.gnu.org; Sun, 06 Jul 2025 03:22:56 -0400
Received: by mail-pj1-x102f.google.com with SMTP id
 98e67ed59e1d1-313154270bbso2200873a91.2
 for <78959 <at> debbugs.gnu.org>; Sun, 06 Jul 2025 00:22:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1751786569; x=1752391369; darn=debbugs.gnu.org;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=FaHzX0Xxf4xgO+v+R7bQvukwLR+36x69N6FRzqtlcKA=;
 b=cHIr39YD9R/0w/azKUGfCZO5x7JRE35Wan4//XdOho0BzQYfxtFtgW7r4Dq3KGBoG/
 i5ZTCki9272YmtgywqIb3mpTDxHBnN6rAVxkRmdrV0vffHAGktEBTTzfIvlIZ42D64AL
 EjpdszvkmuCdlHKOV4zf/3FHyoj2IEH+0vZB5Bs4PY4g3UXR0R03PSMHyrD4r0NVNRgJ
 6QEH6yeX4uogfdOLpdC+EzOVHWjp/Imjih+rEN/U5u7/PYsECY/4Iph1jBIgBa/z6UAp
 lhCjnOSy8PwrPA8Hz6vrdX07JvA3LN22YQUtyCPZcuItePEqvWFwE6O6+RSO6UrSXl8P
 mNgQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1751786569; x=1752391369;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=FaHzX0Xxf4xgO+v+R7bQvukwLR+36x69N6FRzqtlcKA=;
 b=BS347b+aV4vk06WO6nCipHtx6MHf2eMoaaFownnz36kEovKQ6Nzma2Rbdaw1+8H1SK
 d1um5CbQKsUMtexTt8L8Iu03zkWnmX2yrnVkwB0y58V7VgY+9Jhbvgq1+QFgPY7y0Z8m
 bsSXuGYmbnDZ3dhmPDg/UHjGf/zOwdDOFpJV0pQlajMY9LDT8s3lVyBKAlNKCqURMhG6
 0SsDkk/JLf7VqHDJy+6oueR7I0D7V90O9nXkcmBr+EYwO3VFSNrDV92B+vP4KENjNEYm
 Wu2Xzn0XowtfPxNg6R8kZFMeF0/j/Sh3+bqZZ+wUbqTZg1tiKQ3OGksSrVqY4zOE9Ggw
 F5zQ==
X-Gm-Message-State: AOJu0YypZaMbGmTfkRZpTWTwR7YrGwJUjQNlSfJYPCtPb+631a8DyD3b
 w5xyJOQRVYmDjjigahd1rTBCS4iGg9p6k7u/AQ+PTur7el3Is5BxJaXpjjbltq08Bg+/ojQjeux
 4O081KfWyfsQZlcJ1XvX2Sn15zEbu+h+VVPKa
X-Gm-Gg: ASbGncu4f4UIgs7tZNLqZU4b/AvLj5FRqXs1fRd2FlZa+2WzggaBDM2RetpRftkeji0
 yKq+oGIoksY0HVq5/sJVgKdKGoWikMJ9YTkzXunqMrIH0raEvNbDMtqbkqM+bUY0tlKvG501hUR
 7A56Q4y8J2s2qiy59dfOAUfHyriZeitNQFx4o8HP+5ifo=
X-Google-Smtp-Source: AGHT+IFK/zZZaHFx1+owg9J3gk8tHppiC5eOqylP22a7xkfzHSbL86r11x3XebSRr0HsYGgyh47yKhMVcfNaMOKLnxs=
X-Received: by 2002:a17:90b:3c8f:b0:312:1d2d:18e2 with SMTP id
 98e67ed59e1d1-31aac4b2f1cmr12609678a91.20.1751786569426; Sun, 06 Jul 2025
 00:22:49 -0700 (PDT)
MIME-Version: 1.0
References: <CAH8Pv0hAOUwCxyHP_gJdWuuP16U+LYWWpAhopwbPVSDHukAURg@HIDDEN>
 <87ecuuwj7j.fsf@HIDDEN>
 <CAH8Pv0j6PprENwoXJUzqct0giE83BtyijPq5UHmzT1Yyr=G4iA@HIDDEN>
In-Reply-To: <CAH8Pv0j6PprENwoXJUzqct0giE83BtyijPq5UHmzT1Yyr=G4iA@HIDDEN>
From: Dani Moncayo <dmoncayo@HIDDEN>
Date: Sun, 6 Jul 2025 09:22:37 +0200
X-Gm-Features: Ac12FXzcYAAN7OKidkfq1wuz7gmm3KRPDlt6KdA91DuT2MdMDZmNANjq7ZpnqNI
Message-ID: <CAH8Pv0h7kB43Fjp0v6zYV5N5wSFnp9kfT0hUfRtiRt4AWov7Tg@HIDDEN>
Subject: Re: bug#78959: 31.0.50;
 *Completions* buffer navigation with 'n' and 'p'
To: Stephen Berman <stephen.berman@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78959
Cc: 78959 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Sun, Jul 6, 2025 at 9:13=E2=80=AFAM Dani Moncayo <dmoncayo@HIDDEN> wr=
ote:
>
> [...]
>
> I've just re-tested the recipe of the OP with your patch applied, and
> it seems to fix the problem.

I just found a minor issue: with completions-format set to 'vertical, if I =
type:

  M-x a u t o - <TAB> M-<down>

I get an error in the echo area ([No completion here]), and the cursor
in the *Completions* buffer is not placed in the first candidate (as
it should).  I have to type a second M-<down> to go to the first
candidate.


--=20
Dani Moncayo




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78959; Package emacs. Full text available.

Message received at 78959 <at> debbugs.gnu.org:


Received: (at 78959) by debbugs.gnu.org; 6 Jul 2025 07:14:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 06 03:14:13 2025
Received: from localhost ([127.0.0.1]:50321 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uYJZl-0007QW-AJ
	for submit <at> debbugs.gnu.org; Sun, 06 Jul 2025 03:14:13 -0400
Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:60624)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <dmoncayo@HIDDEN>)
 id 1uYJZi-0007PP-6J
 for 78959 <at> debbugs.gnu.org; Sun, 06 Jul 2025 03:14:10 -0400
Received: by mail-pj1-x102e.google.com with SMTP id
 98e67ed59e1d1-313f68bc519so1618439a91.0
 for <78959 <at> debbugs.gnu.org>; Sun, 06 Jul 2025 00:14:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1751786044; x=1752390844; darn=debbugs.gnu.org;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=dQfDLmVDb7/6armr3AsIJrSwsQu2VQsL528y21xFz8Q=;
 b=kli/4HYorwBzZ5KCu4qoXt85Z9mjBLl9w9ccXPG1330Zo1wtpv/R8A8IdCcsRybqUb
 WLMKkZpoapqrXEIIVykcr0qghC6HT/FpQtCpOpCQYH+2z8kt7KDtGQRmbcp13xM2xB4a
 yk5MesLJS2+M9LFXU2NnUXd9Cy6ZOg2OrWwoUiGKqhERhtq9+oaPYS+DEZu4Qp0nWbDy
 XnmKDXriHubjdgVG8RYGbRHmks8eMtf8gLUYOr4JfIZjcX9jIK61x0ODU2GOvbXAyOk6
 ryTTcooPmg1bPlPyAlRZiJdhZTTPSw/PwfrApOtUab4f1Od1fCqCrkWMcBnRalHk2G8I
 ya2A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1751786044; x=1752390844;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=dQfDLmVDb7/6armr3AsIJrSwsQu2VQsL528y21xFz8Q=;
 b=a2Nggn0fxXlS0tPiErQxFSncDYjAorydrOUkShwndJhYZ4G+DVZrPonF7+SZHkWSA1
 ST3O2U6eq2vqZxyqNBfJCPY18mUBMAdq9jfrfKKOvlMdt6lh7pseri20SZnUw5ez/1JX
 34GINeAhGjtRB/hlkqpEPELD1iUfvPzqOhBlzBWDcuzP24pBu8s182XueyieH6cN7Lax
 gwBzw5TbLIb4jL09qzJGmJArkd8ziYXT0ziLTXmCp7l9h0jSIT6FWcAehHNtftMzW+Eu
 1X7VOuZNWycHThNILX97/mqTTG1r9QlZPCw24yDOm8umz8Qq8TWcHdEdmdwCCfGaFIdL
 7cfQ==
X-Gm-Message-State: AOJu0YyskSZcKY5ekN/qTM5jtGedLTiOp+fZgPS5bD0Rw/9bqkbIvie4
 tZtSpqD2uIF1+BD2q0GfaebC3h448mxgEeb6UG1xohZafBR3v6ZNc05wW45XDEpV5jL48tyqB9w
 U5eMlcOfY/7krXLQsiF5lsebpO2gGoAY=
X-Gm-Gg: ASbGnctUJjLVwNHKhU+hHY0MRscWL7XDxXrTyU3K4MkHXDqggmO7bjiBYlZP+gYPjf9
 oct7rOiM1+cLz9nC+Kc2Zmg15BIeaAIu85j7idBL17yCvyUOnYvdhHPQsP+/Z7uvQRVL2wJjFQB
 7kYQMW0CguUYyfIOnoUdyGew/bRAqDKJ8fIVX5jqjyKzo=
X-Google-Smtp-Source: AGHT+IFOXSVlzRyyk8zE8XNNSJbR35S4ou11SDzNAPWwI628jJR71qP+nRaZDExEAWTxWrZlLnU/PwQwx6TSPw1lpJY=
X-Received: by 2002:a17:90b:584e:b0:312:db8:dbdd with SMTP id
 98e67ed59e1d1-31aadd9ffccmr11761377a91.28.1751786043839; Sun, 06 Jul 2025
 00:14:03 -0700 (PDT)
MIME-Version: 1.0
References: <CAH8Pv0hAOUwCxyHP_gJdWuuP16U+LYWWpAhopwbPVSDHukAURg@HIDDEN>
 <87ecuuwj7j.fsf@HIDDEN>
In-Reply-To: <87ecuuwj7j.fsf@HIDDEN>
From: Dani Moncayo <dmoncayo@HIDDEN>
Date: Sun, 6 Jul 2025 09:13:52 +0200
X-Gm-Features: Ac12FXy9ZXirFZtBDBS59UT6IBkJC_tUW2nKMSNVpJD6s-hnaNxlXoozdpJPBlo
Message-ID: <CAH8Pv0j6PprENwoXJUzqct0giE83BtyijPq5UHmzT1Yyr=G4iA@HIDDEN>
Subject: Re: bug#78959: 31.0.50;
 *Completions* buffer navigation with 'n' and 'p'
To: Stephen Berman <stephen.berman@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78959
Cc: 78959 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Sat, Jul 5, 2025 at 9:06=E2=80=AFPM Stephen Berman <stephen.berman@HIDDEN=
et> wrote:
>
> [...]
>
> I tried to give it a shot with the attached patch, which seems to DTRT
> for your test case with `n', `p', `M-<down>' and `M-<up>'.  You might
> give it a try and see if you find any problems with it.  (But maybe
> don't look at the code too closely, it's ugly as hell....)

I've just re-tested the recipe of the OP with your patch applied, and
it seems to fix the problem.

(I can't say almost anything about the code, cause I lack the needed
knowledge to assess it).

Thanks!

--=20
Dani Moncayo




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78959; Package emacs. Full text available.

Message received at 78959 <at> debbugs.gnu.org:


Received: (at 78959) by debbugs.gnu.org; 5 Jul 2025 19:06:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 05 15:06:51 2025
Received: from localhost ([127.0.0.1]:47326 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uY8Dq-00077j-P9
	for submit <at> debbugs.gnu.org; Sat, 05 Jul 2025 15:06:51 -0400
Received: from mout.gmx.net ([212.227.17.22]:47869)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <stephen.berman@HIDDEN>)
 id 1uY8Do-00077J-LI
 for 78959 <at> debbugs.gnu.org; Sat, 05 Jul 2025 15:06:49 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net;
 s=s31663417; t=1751742401; x=1752347201; i=stephen.berman@HIDDEN;
 bh=BFWbB1nXbGiWvA/WUeNGmj4SpY7e7Gdw/4djmYTSchg=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date:
 Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=bTcax66IoIa3Jg7lcTZaLLmk/26JxXydYhy72apjONHwFMu5lRfRXwj4MZitwwgJ
 TR84fKIRQXf3K+/5uRlRv/benhq80GiQEJ03sIvTMK+HAdMfNEDE1Oni/yh9KeV5p
 7UqOaQj0SGiOL1Eu5wKfSI6lQcKAFDpjivUN3ZGnulI1Wwjc9sXmVsWKtEqAIKG6A
 hrRJMlQdnMUlGJuLrhBlKzg4Hp7OkrPIlRNLX1S0zeId7TCc1caaQsJx21g9c8hXB
 molU5+R6lQf0f9BRKj3Xf5sQlY58R6kfaiBybEm95QtzjsBivIRIPC6uP1EVoQ1fc
 v6Q/culBGK6qxXicJQ==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from strobelfs2 ([94.134.95.218]) by mail.gmx.net (mrgmx105
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M26r3-1uVfFQ0LqT-009j9Q; Sat, 05
 Jul 2025 21:06:41 +0200
From: Stephen Berman <stephen.berman@HIDDEN>
To: Dani Moncayo <dmoncayo@HIDDEN>
Subject: Re: bug#78959: 31.0.50; *Completions* buffer navigation with 'n'
 and 'p'
In-Reply-To: <CAH8Pv0hAOUwCxyHP_gJdWuuP16U+LYWWpAhopwbPVSDHukAURg@HIDDEN>
References: <CAH8Pv0hAOUwCxyHP_gJdWuuP16U+LYWWpAhopwbPVSDHukAURg@HIDDEN>
Date: Sat, 05 Jul 2025 21:06:40 +0200
Message-ID: <87ecuuwj7j.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Provags-ID: V03:K1:k1cokfZi0lNlo1elFYu4I02LnsTC4icV1BIqcYmp3Vj2pigj+Ex
 uroi2P1BhdnWZLTaSumixuEVldM47JwgtjqeK2Zd8GfDSiF1OHziBC3OPlgiUJeyLdCgxfY
 xDhrjydWJekHkkxDoyR9cmX1vOK8/dF0Lx9/hFmc31wm8QwZg4Ot3haneD/mhXSSfwb2J3O
 UEMIDtuJ7QVf/O5ZO4EyQ==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:gOdalGe9KI4=;JKVDe2/pa9azdAOVkqqfLTC7j5C
 snWFhE/OToAgEHb1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zXxQwMKOdNfPcbF6nzsd82ZYino5k7LgEs5dAlnTVuG7Oi63uZcIH79sHteK8CGxSZiLhzHZ
 BXrcUbThjBmqu+017byCcG7o0gonJYQoc5r5lVhJEqLz7E5RQcwcPUNmlImppqqTwojZN5Vw0
 6B/oHct+Mubdpcj/jeOFs3LtqRaMeVh6N6i+C2O3D1EO0BuImoMCkWi6X7gPxqg/l4q8y1eP5
 OmvoSW6PbjDnko41RhmZSBv4KluRVmilxsgFDSn1IRFyGPR82xGNt0ztcpitUCfNouxlRfEh6
 EsCh1V0cKiQkvcmMTBmo+C7IpFFTRl/QcnIKN31ifCvjomS/rqSNFaQqyKUIUg
X-Spam-Score: -0.5 (/)
X-Debbugs-Envelope-To: 78959
Cc: 78959 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.5 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Sat, 5 Jul 2025 10:21:34 +0200 Dani Moncayo <dmoncayo@HIDDEN> wrote:

> Starting from =E2=80=98emacs -Q=E2=80=99, type this: M-x a u t o - <TAB>
>
> That should create a *Completions* buffer with some completion
> alternatives sorted alphabetically and arranged in several columns.
>
> OK, now type 'M-v' to select that buffer and try to move around
> completion alternatives with =E2=80=98n=E2=80=99 and =E2=80=98p=E2=80=99.=
  Note that these keys move
> among the completion alternatives in alphabetical order, as expected.
>
> Now, repeat the experiment after setting =E2=80=98completions-format=E2=
=80=99 to 'vertical:
>   (setq completions-format 'vertical)
>
> This time, =E2=80=98n=E2=80=99 and =E2=80=98p=E2=80=99 do _not_ move in a=
lphabetical order, as (I think)
> they should.

On Sat, 5 Jul 2025 11:39:07 +0200 Dani Moncayo <dmoncayo@HIDDEN> wrote:

> A couple of further remarks.
>
> In general, the navigation among candidates should be consistent with
> the 'completions-sort' setting, I think.
>
> The same issue reported in this ticket applies to the keys M-<down>
> and M-<up>, when typed from the minibuffer to navigate among
> completion candidates.

I tried to give it a shot with the attached patch, which seems to DTRT
for your test case with `n', `p', `M-<down>' and `M-<up>'.  You might
give it a try and see if you find any problems with it.  (But maybe
don't look at the code too closely, it's ugly as hell....)

Steve Berman


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment
Content-Description: next-completion patch
Content-Transfer-Encoding: quoted-printable

diff --git a/lisp/simple.el b/lisp/simple.el
index fa173b26289..afd6eafe1f4 100644
=2D-- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -10177,17 +10177,34 @@ next-completion
         ;; If in a completion, move to the end of it.
         (when (get-text-property pos 'mouse-face)
           (setq pos (next-single-property-change pos 'mouse-face)))
-        (when pos (setq pos (next-single-property-change pos 'mouse-face)=
))
-        (if pos
-            ;; Move to the start of next one.
-            (goto-char pos)
-          ;; If at the last completion option, wrap or skip
-          ;; to the minibuffer, if requested.
-          (when completion-auto-wrap
-            (if (and (eq completion-auto-select t) tabcommand
-                     (minibufferp completion-reference-buffer))
-                (throw 'bound nil)
-              (first-completion))))
+        (if (eq completions-format 'vertical)
+            (let ((goal-column (current-column)))
+              (next-line)
+              (cond ((eq (char-after) 10)
+                     (first-completion))
+                    ((eobp)
+                     (goto-char pos)
+                     (let ((cnt (count-lines (point) (save-excursion
+                                                   (first-completion)
+                                                   (point)))))
+                       (previous-line (1- cnt)))
+                     (setq pos (point))
+                     (when (get-text-property pos 'mouse-face)
+                       (setq pos (next-single-property-change pos 'mouse-=
face))
+                       (when pos (goto-char pos))
+                       (setq pos (next-single-property-change pos 'mouse-=
face))
+                       (when pos (goto-char pos))))))
+          (when pos (setq pos (next-single-property-change pos 'mouse-fac=
e)))
+          (if pos
+              ;; Move to the start of next one.
+              (goto-char pos)
+            ;; If at the last completion option, wrap or skip
+            ;; to the minibuffer, if requested.
+            (when completion-auto-wrap
+              (if (and (eq completion-auto-select t) tabcommand
+                       (minibufferp completion-reference-buffer))
+                  (throw 'bound nil)
+                (first-completion)))))
         (setq n (1- n)))
=20
       (while (< n 0)
@@ -10197,22 +10214,55 @@ next-completion
                    (not (bobp))
                    (get-text-property (1- pos) 'mouse-face))
           (setq pos (previous-single-property-change pos 'mouse-face)))
-        (when pos (setq pos (previous-single-property-change pos 'mouse-f=
ace)))
-        (if pos
-            (progn
-              (goto-char pos)
-              ;; Move to the start of that one.
-              (unless (get-text-property (point) 'mouse-face)
-                (goto-char (previous-single-property-change
-                            (point) 'mouse-face nil (point-min)))))
-          ;; If at the first completion option, wrap or skip
-          ;; to the minibuffer, if requested.
-          (when completion-auto-wrap
-            (if (and (eq completion-auto-select t) tabcommand
-                     (minibufferp completion-reference-buffer))
-                (progn
-                  (throw 'bound nil))
-              (last-completion))))
+        (if (eq completions-format 'vertical)
+            (let ((goal-column (current-column)))
+              (cond ((save-excursion
+                       (equal (buffer-substring-no-properties
+                               (point)
+                               (next-single-property-change (point) 'mous=
e-face))
+                              (buffer-substring-no-properties
+                               (first-completion)
+                               (next-single-property-change (point) 'mous=
e-face))))
+                     (end-of-line)
+                     (goto-char (previous-single-property-change
+                                 (point) 'mouse-face))
+                     (let ((goal-column (current-column))
+                           p)
+                       (while (not (or (eobp) (eq (char-after) 10)))
+                         (setq p (point))
+                         (next-line))
+                       (goto-char p)))
+                    (t
+                     (previous-line)))
+              (when (eq (char-after) 10)
+                (goto-char pos)
+                (when (get-text-property pos 'mouse-face)
+                  (setq pos (previous-single-property-change pos 'mouse-f=
ace))
+                  (when pos (goto-char pos))
+                  (setq pos (previous-single-property-change pos 'mouse-f=
ace))
+                  (when pos (goto-char pos)))
+                (let ((goal-column (current-column)))
+                  (while (not (or (eobp) (eq (char-after) 10)))
+                    (setq p (point))
+                    (next-line))
+                  (goto-char p))))
+          (when pos
+            (setq pos (previous-single-property-change pos 'mouse-face)))
+          (if pos
+              (progn
+                (goto-char pos)
+                ;; Move to the start of that one.
+                (unless (get-text-property (point) 'mouse-face)
+                  (goto-char (previous-single-property-change
+                              (point) 'mouse-face nil (point-min)))))
+            ;; If at the first completion option, wrap or skip
+            ;; to the minibuffer, if requested.
+            (when completion-auto-wrap
+              (if (and (eq completion-auto-select t) tabcommand
+                       (minibufferp completion-reference-buffer))
+                  (progn
+                    (throw 'bound nil))
+                (last-completion)))))
         (setq n (1+ n))))
=20
     (when (/=3D 0 n)

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78959; Package emacs. Full text available.

Message received at 78959 <at> debbugs.gnu.org:


Received: (at 78959) by debbugs.gnu.org; 5 Jul 2025 09:39:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 05 05:39:29 2025
Received: from localhost ([127.0.0.1]:40631 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uXzMm-0004BB-QX
	for submit <at> debbugs.gnu.org; Sat, 05 Jul 2025 05:39:29 -0400
Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]:53602)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <dmoncayo@HIDDEN>)
 id 1uXzMj-00049c-Aw
 for 78959 <at> debbugs.gnu.org; Sat, 05 Jul 2025 05:39:26 -0400
Received: by mail-pj1-x102d.google.com with SMTP id
 98e67ed59e1d1-313a001d781so1288896a91.3
 for <78959 <at> debbugs.gnu.org>; Sat, 05 Jul 2025 02:39:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1751708358; x=1752313158; darn=debbugs.gnu.org;
 h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
 :date:message-id:reply-to;
 bh=RSq+cVSMBbXJmq8tzS7V+DLjE4QaudeQJ0RXKZqQ1fQ=;
 b=Iu3nqmxUM+zM9l+PBgTbNr0DS0QMdRKhPK32U7oMlM4/+TJmuPp90+hOqlXXItN+0j
 n3fyF+L5ETfZ9cDGQxw/1G/cmvc1MbVZ+BxYdYyWMSOQVLctIO/iL7dTK+ZX2zvsazQ3
 MQDJ1pT4vEPFWNu/ubACaQf6Pb3xdMEFnqxqa48x2bm05d1gRX5eQTFqXtSmMtA9RtdO
 xLzfxbzqKHqxIeuu1XHWYgELYFSmktRGJCR5Q+elS0AeFbn1aRDfBMhVvBfOkUuvYjNS
 LDznY19OdWYL+74M+z8poNX74UR/SrShlSEaI7T+y3OixUfD7MwF732os0Hy3CNqJWxl
 cQmQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1751708358; x=1752313158;
 h=to:subject:message-id:date:from:mime-version:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=RSq+cVSMBbXJmq8tzS7V+DLjE4QaudeQJ0RXKZqQ1fQ=;
 b=PKoIs/m6o4P53/4I+j1V2uz81N+eP4gOHz1C1sKLXdT9zDxROmgCH02u2JF51CH0oT
 elB+uZhjsrzPBNSNIBzixPBVdCwFiNJQKler2m1TAm1uTnbk2KfMuC4U8q4+VcqMl85G
 +KGkIB85x5SYWddAPnEM5DasLRjCiizZs1uWx8M6eEmYpxBZzff3bxPn4vXw3TchYjZo
 ARUm0F+oc2LWWV1CHEGAGdwclwXg+/x7GneyHGZ8//OuHfngxKPTaOMzpVP02DXoiBhH
 u4mS2a0YuD8lMSmyDr1WZrtNR8rQGiMujFr3FGpdhXta9J7nEihLWwoOiiiADJsN4OK1
 mCPw==
X-Gm-Message-State: AOJu0Ywry3ljRXQyxEatyPufHqi4ondqLjNgSD2PkomeNfk4Xo4ItI+V
 4ak5sXtCbGewSFgJFIZySaR+iPnG8l3F3WVhgbWAJS0j4RNW+eutzH1r8pDQEw/CVXUwKsiF5Hq
 YVx1AGwdXbA7BYSz9PJ50xCqZOfUT4luPag3v
X-Gm-Gg: ASbGncvqOxV92eqhWsyMwzDoWqfgrE0hq4DrVqnj0xOuvQDu5sjn6RLH+voouXzv98B
 AnC0GDK84M3BBSkS/v+Uob2r/jTTXurU4oTfIFu7tyB6QrMFBhdafsKab4W1aoj0zjSncGbISQC
 Mh0SWTCZr/VFqNjVJIKAySqBQXODAy0ttgggpGvjFyiV0=
X-Google-Smtp-Source: AGHT+IH5PbjRsRjkjJ4TY8ZAvS9jvBtpGzQHeUV0NzT+Ju2KwHuP0JWJCpio500+lJGDuYZVBUlvf5EXhEGCObA+R2I=
X-Received: by 2002:a17:90b:1d52:b0:315:f140:91a8 with SMTP id
 98e67ed59e1d1-31aac4ba08dmr8886867a91.16.1751708358386; Sat, 05 Jul 2025
 02:39:18 -0700 (PDT)
MIME-Version: 1.0
From: Dani Moncayo <dmoncayo@HIDDEN>
Date: Sat, 5 Jul 2025 11:39:07 +0200
X-Gm-Features: Ac12FXwOOJGFMcN_wE-0Wxoy-8CtoAbXZyGbtan1Xi8BdBkZ40AAwAYpQFxRkH4
Message-ID: <CAH8Pv0gMkGFuVtc2Z=sB+xf7g1dRxasRuRFrPt_O5wNgRXJp7A@HIDDEN>
Subject: 31.0.50; *Completions* buffer navigation with 'n' and 'p'
To: 78959 <at> debbugs.gnu.org
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78959
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

A couple of further remarks.

In general, the navigation among candidates should be consistent with
the 'completions-sort' setting, I think.

The same issue reported in this ticket applies to the keys M-<down>
and M-<up>, when typed from the minibuffer to navigate among
completion candidates.

Thanks.

-- 
Dani Moncayo




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78959; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 5 Jul 2025 08:21:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 05 04:21:59 2025
Received: from localhost ([127.0.0.1]:39643 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uXy9m-0000y8-MM
	for submit <at> debbugs.gnu.org; Sat, 05 Jul 2025 04:21:59 -0400
Received: from lists.gnu.org ([2001:470:142::17]:53148)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <dmoncayo@HIDDEN>)
 id 1uXy9k-0000xC-As
 for submit <at> debbugs.gnu.org; Sat, 05 Jul 2025 04:21:56 -0400
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 <dmoncayo@HIDDEN>)
 id 1uXy9d-0000bI-Ht
 for bug-gnu-emacs@HIDDEN; Sat, 05 Jul 2025 04:21:49 -0400
Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <dmoncayo@HIDDEN>)
 id 1uXy9b-0003bH-RD
 for bug-gnu-emacs@HIDDEN; Sat, 05 Jul 2025 04:21:49 -0400
Received: by mail-pj1-x1036.google.com with SMTP id
 98e67ed59e1d1-313a188174fso2197237a91.1
 for <bug-gnu-emacs@HIDDEN>; Sat, 05 Jul 2025 01:21:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1751703706; x=1752308506; darn=gnu.org;
 h=content-transfer-encoding:to:subject:message-id:date:from
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=dsL+qaiLFu9dwSoprL8BVNfjpFfCldktjyy47uYh96M=;
 b=lCcN/fwYIG/LhOVbZ5fmOTHM9nIwfSHbVeHaTt1TNXnrd77GvWZ0w+ZIkWDiOzmon+
 VPjYgSn0HE4d3lZ6piY9gd/woSRZVnBU1p3V1vfLHjPmNyARzAIQ8OEuHQh4cBdZYKd6
 ijmnHA/BefqAWP1+9a3zx9fERQUqFAZgffcMJ0LpyxLw8B2oryQLqMR/lMaj5wPbFR/R
 FLJYn71DE1QBpr2aRDrkKHblza12712A0yokPAaKlpW+2/ANQtflKENNBt4rVNGh0dz3
 jIC7jIhMOk2vnSmNid7V2iJJjEX2Yf0d20l8kQ6iE7auvix2VqNmBeRLJ8Pvq/Y1jzLD
 VqCg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1751703706; x=1752308506;
 h=content-transfer-encoding:to:subject:message-id:date:from
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=dsL+qaiLFu9dwSoprL8BVNfjpFfCldktjyy47uYh96M=;
 b=OrefyrAvBgIOSurCW6IU4bTqtdVdgHp6wFpnKHcGHULuXx8jRgSD9rEaf3LgRi1W/N
 dJZhRhfAZySMMScAoILcmVHlbjcfXQ7c13YlfeZIS91ej5aZ1juGQZQUsftYDFKHR9Vx
 OFUo5SBnWSoL6J8z2vR714sPaYBIYYzMxPfXYZGfDzaQ5zJQQagOijgbcgMdjmmKXdxv
 naIG4vdRg04MAb7mrtotwYSZnB226I1d4kyJtlN949mUJL/F3aIZLL/6VEvvZKagOt5A
 N+e1i5lG3hB1MZfanZF5vyUWxp6twMpodBPZ8npN4UxCje7YKXGVqTPu9P8Im1EUYNC2
 DOfw==
X-Gm-Message-State: AOJu0Yw9bWUJWzHojScUnBGrYfNShHk9tDllNDWIzJ+32j0TCuTWLRs3
 clgYpBPv3i65LfU6/Q2rvAyv4FnnZtLkMIjg+/NDx0ONcms2VUrrRPHfSddrxRnaOSM4K9DKvna
 ZanAiYRHSEdS8TNG28n7RCLZYI/kMsRNl4j4i
X-Gm-Gg: ASbGncti3eFjMw7wxN+kgPCbNncpglyMjThh/oIQIqP1wtG0TN6Z+CUuBMPYOUZwDWD
 vwDADWO8dN56vYe7k6stvo7EChQDKX/Ughg2dmavjxp0d/s/rtRdsjvvRzeXzodfSbraybl99qD
 GRNhQIEuybXa5i23u7mGUjZpFm7dgFxyUVhhzzVpZzPCc=
X-Google-Smtp-Source: AGHT+IE5NBQGBuMAbYYYohFRL3gARW3HDBugHme5SKpuio/YicSTlG43VrqnU5t6N9Dp9UusGRIZdNSSLBsjEDPrKv0=
X-Received: by 2002:a17:90b:53c5:b0:315:9624:37db with SMTP id
 98e67ed59e1d1-31aab8371e9mr6938810a91.3.1751703705570; Sat, 05 Jul 2025
 01:21:45 -0700 (PDT)
MIME-Version: 1.0
From: Dani Moncayo <dmoncayo@HIDDEN>
Date: Sat, 5 Jul 2025 10:21:34 +0200
X-Gm-Features: Ac12FXyLLkruzBY4Mxl4JTwchimg3kZikE-nLAFDyE8qi4RmSejL1XXxCngO680
Message-ID: <CAH8Pv0hAOUwCxyHP_gJdWuuP16U+LYWWpAhopwbPVSDHukAURg@HIDDEN>
Subject: 31.0.50; *Completions* buffer navigation with 'n' and 'p'
To: bug-gnu-emacs <bug-gnu-emacs@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=2607:f8b0:4864:20::1036;
 envelope-from=dmoncayo@HIDDEN; helo=mail-pj1-x1036.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Starting from =E2=80=98emacs -Q=E2=80=99, type this: M-x a u t o - <TAB>

That should create a *Completions* buffer with some completion
alternatives sorted alphabetically and arranged in several columns.

OK, now type 'M-v' to select that buffer and try to move around
completion alternatives with =E2=80=98n=E2=80=99 and =E2=80=98p=E2=80=99.  =
Note that these keys move
among the completion alternatives in alphabetical order, as expected.

Now, repeat the experiment after setting =E2=80=98completions-format=E2=80=
=99 to 'vertical:
  (setq completions-format 'vertical)

This time, =E2=80=98n=E2=80=99 and =E2=80=98p=E2=80=99 do _not_ move in alp=
habetical order, as (I think)
they should.

--=20
Dani Moncayo

In GNU Emacs 31.0.50 (build 46, x86_64-pc-linux-gnu, GTK+ Version
 3.24.41, cairo version 1.18.0) of 2025-07-04 built on C11-Q8YAKWONJX0
Repository revision: 763c3cd081a833940961373a73705640b1808636
Repository branch: master
Windowing system distributor 'Microsoft Corporation', version 11.0.12010000
System Description: Ubuntu 24.04.2 LTS

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG
LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG SECCOMP SOUND
THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINERAMA
XINPUT2 XPM XRANDR GTK3 ZLIB

Important settings:
  value of $LANG: C.UTF-8
  locale-coding-system: utf-8-unix




Acknowledgement sent to Dani Moncayo <dmoncayo@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#78959; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 11 Jul 2025 11:30:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.