]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow non-interactive uses of minibuffer-next-completion
authorJuri Linkov <juri@linkov.net>
Sun, 10 Apr 2022 07:37:55 +0000 (10:37 +0300)
committerJuri Linkov <juri@linkov.net>
Sun, 10 Apr 2022 07:37:55 +0000 (10:37 +0300)
* lisp/minibuffer.el (minibuffer-previous-completion)
(minibuffer-next-completion): Use 1 for n by default.

lisp/minibuffer.el

index c79c5a7a5d6f412dadfce9d93d6a682f64e693e7..68b167ccc782b21c5375adce0051d2e1bc4f407f 100644 (file)
@@ -4362,7 +4362,7 @@ and execute the forms."
   (with-minibuffer-completions-window
     (when completions-highlight-face
       (setq-local cursor-face-highlight-nonselected-window t))
-    (previous-completion n)))
+    (previous-completion (or n 1))))
 
 (defun minibuffer-next-completion (&optional n)
   "Run `next-completion' from the minibuffer in its completions window."
@@ -4370,7 +4370,7 @@ and execute the forms."
   (with-minibuffer-completions-window
     (when completions-highlight-face
       (setq-local cursor-face-highlight-nonselected-window t))
-    (next-completion n)))
+    (next-completion (or n 1))))
 
 (defun minibuffer-choose-previous-completion (&optional n)
   "Run `previous-completion' from the minibuffer in its completions window.