From 57eb4bbaef09b515d93a54b009233d6bbbcbb21b Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Mon, 17 Jun 2024 12:45:27 +0200 Subject: [PATCH] New command 'minibuffer-apply-and-cycle-completion' --- lisp/minibuffer.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 6cbea950667..6c09aecdeed 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -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 -- 2.39.2