]> git.eshelyaron.com Git - emacs.git/commitdiff
New command 'minibuffer-apply-and-cycle-completion'
authorEshel Yaron <me@eshelyaron.com>
Mon, 17 Jun 2024 10:45:27 +0000 (12:45 +0200)
committerEshel Yaron <me@eshelyaron.com>
Mon, 17 Jun 2024 10:45:27 +0000 (12:45 +0200)
lisp/minibuffer.el

index 6cbea950667cfe3788d220427bed9773bcaaaa32..6c09aecdeed9df24d12c4bb4970eadccd0abcebe 100644 (file)
@@ -2023,10 +2023,18 @@ Interactively, ARG is the prefix argument, and it defaults to 1."
                    '(universal-argument
                      negative-argument
                      digit-argument
-                     minibuffer-cycle-completion)))
+                     minibuffer-cycle-completion
+                     minibuffer-apply-and-cycle-completion)))
          (lambda ()
            (setq completion-all-sorted-completions nil))))))))
 
+(defun minibuffer-apply-and-cycle-completion (n)
+  "Apply minibuffer action to current input and cycle N candidates forward."
+  (interactive "p" minibuffer-mode)
+  (let ((input-prefix (minibuffer-current-input)))
+    (minibuffer-apply (car input-prefix) (cdr input-prefix)))
+  (minibuffer-cycle-completion n))
+
 (defvar minibuffer-confirm-exit-commands
   '(completion-at-point minibuffer-complete)
   "List of commands which cause an immediately following
@@ -3448,6 +3456,7 @@ The completion method is determined by `completion-at-point-functions'."
   :parent minibuffer-local-map
   "TAB"       #'minibuffer-complete
   "C-o"       #'minibuffer-cycle-completion
+  "C-M-o"     #'minibuffer-apply-and-cycle-completion
   "C-l"       #'minibuffer-restore-completion-input
   "C-S-a"     #'minibuffer-toggle-completion-ignore-case
   "?"         #'minibuffer-completion-help