From: Eshel Yaron Date: Mon, 17 Jun 2024 10:45:27 +0000 (+0200) Subject: New command 'minibuffer-apply-and-cycle-completion' X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=57eb4bbaef09b515d93a54b009233d6bbbcbb21b;p=emacs.git New command 'minibuffer-apply-and-cycle-completion' --- 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