]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix the case in first-completion revealed by minibuffer-tests
authorJuri Linkov <juri@linkov.net>
Sat, 14 Jan 2023 18:56:33 +0000 (20:56 +0200)
committerJuri Linkov <juri@linkov.net>
Sat, 14 Jan 2023 18:56:33 +0000 (20:56 +0200)
* 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
test/lisp/minibuffer-tests.el

index e23ee961879d8a1d89a6da66a42d1fb754239fd3..bb0ed092b7001008fdb9185067ae270f4379b1f2 100644 (file)
@@ -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))))
 
index 2ac5e0f29d6425e47129410244f35993f618968f..1de8e56cbd4afa6ce430809b57291716ae0a8af6 100644 (file)
       (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)))