emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 a8eb9dd400: Fix the case in first-completion revealed by minibu


From: Juri Linkov
Subject: emacs-29 a8eb9dd400: Fix the case in first-completion revealed by minibuffer-tests
Date: Sat, 14 Jan 2023 13:57:16 -0500 (EST)

branch: emacs-29
commit a8eb9dd40069d3555a59ec2f692f64f9b8679ae7
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    Fix the case in first-completion revealed by minibuffer-tests
    
    * lisp/simple.el (first-completion): Add the text-property 
'first-completion'
    when the first completion is at the beginning of the buffer.
    
    * test/lisp/minibuffer-tests.el (completions-header-format-test):
    Revert the recent change.
---
 lisp/simple.el                | 6 +++++-
 test/lisp/minibuffer-tests.el | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index e23ee96187..bb0ed092b7 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -9722,7 +9722,11 @@ the completions is popped up and down."
   "Move to the first item in the completion list."
   (interactive)
   (goto-char (point-min))
-  (unless (get-text-property (point) 'mouse-face)
+  (if (get-text-property (point) 'mouse-face)
+      (unless (get-text-property (point) 'first-completion)
+        (let ((inhibit-read-only t))
+          (add-text-properties (point) (min (1+ (point)) (point-max))
+                               '(first-completion t))))
     (when-let ((pos (next-single-property-change (point) 'mouse-face)))
       (goto-char pos))))
 
diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el
index 2ac5e0f29d..1de8e56cbd 100644
--- a/test/lisp/minibuffer-tests.el
+++ b/test/lisp/minibuffer-tests.el
@@ -421,7 +421,7 @@
       (switch-to-completions)
       ;; Fixed in bug#55430
       (should (equal "aa" (get-text-property (point) 'completion--string)))
-      (next-completion 3)
+      (next-completion 2)
       (should (equal "ac" (get-text-property (point) 'completion--string)))
       (previous-completion 2)
       (should (equal "aa" (get-text-property (point) 'completion--string)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]