From: Eshel Yaron Date: Fri, 14 Jun 2024 12:24:28 +0000 (+0200) Subject: Mark some minibuffer-specific commands as such X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=325592ef91814eedcbe989c864cdd4aef2c868b7;p=emacs.git Mark some minibuffer-specific commands as such --- diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 1bb9042d3af..86541815218 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1033,7 +1033,7 @@ If the current buffer is not a minibuffer, return everything before point." (defun delete-minibuffer-contents () "Delete all user input in a minibuffer. If the current buffer is not a minibuffer, erase its entire contents." - (interactive) + (interactive "" minibuffer-mode) ;; We used to do `delete-field' here, but when file name shadowing ;; is on, the field doesn't cover the entire minibuffer contents. (delete-region (minibuffer-prompt-end) (point-max))) @@ -2052,7 +2052,7 @@ If `minibuffer-completion-confirm' is `confirm-after-completion', preceding minibuffer command was a member of `minibuffer-confirm-exit-commands', and accept the input otherwise." - (interactive) + (interactive "" minibuffer-mode) (completion-complete-and-exit (minibuffer--completion-prompt-end) (point-max) #'exit-minibuffer)) @@ -2838,7 +2838,7 @@ completions list." (defun minibuffer-completion-help (&optional start end) "Display a list of possible completions of the current minibuffer contents." - (interactive) + (interactive "" minibuffer-mode) (let* ((start (or start (minibuffer--completion-prompt-end))) (end (or end (point-max))) (string (buffer-substring start end)) @@ -3141,13 +3141,13 @@ function as described in the documentation of `completion-metadata'." (defun minibuffer-hide-completions () "Get rid of an out-of-date *Completions* buffer." - (interactive) + (interactive "" minibuffer-mode) (let ((win (get-buffer-window completions-buffer-name 0))) (if win (with-selected-window win (bury-buffer))))) (defun exit-minibuffer () "Terminate this minibuffer argument." - (interactive) + (interactive "" minibuffer-mode) (when (minibufferp) (when (not (minibuffer-innermost-command-loop-p)) (error "%s" "Not in most nested command loop")) @@ -4286,7 +4286,7 @@ possible completions." (defun minibuffer-query-apply () "Suggest applying the minibuffer action to each completion candidate in turn." - (interactive nil minibuffer-mode) + (interactive "" minibuffer-mode) (with-minibuffer-completions-window (let (prev all done) (goto-char (point-min)) @@ -5331,7 +5331,7 @@ See `completing-read' for the meaning of the arguments." (defun minibuffer-insert-file-name-at-point () "Get a file name at point in original buffer and insert it to minibuffer." - (interactive) + (interactive "" minibuffer-mode) (let ((file-name-at-point (with-current-buffer (window-buffer (minibuffer-selected-window)) (run-hook-with-args-until-success 'file-name-at-point-functions)))) @@ -5344,7 +5344,7 @@ This command behaves like `beginning-of-buffer', but if point is after the end of the prompt, move to the end of the prompt. Otherwise move to the start of the buffer." (declare (interactive-only "use `(goto-char (point-min))' instead.")) - (interactive "^P") + (interactive "^P" minibuffer-mode) (or (consp arg) (region-active-p) (push-mark)) @@ -5377,31 +5377,31 @@ the minibuffer was activated, and execute the forms." (defun minibuffer-recenter-top-bottom (&optional arg) "Run `recenter-top-bottom' from the minibuffer in its original window." - (interactive "P") + (interactive "P" minibuffer-mode) (with-minibuffer-selected-window (recenter-top-bottom arg))) (defun minibuffer-scroll-up-command (&optional arg) "Run `scroll-up-command' from the minibuffer in its original window." - (interactive "^P") + (interactive "^P" minibuffer-mode) (with-minibuffer-selected-window (scroll-up-command arg))) (defun minibuffer-scroll-down-command (&optional arg) "Run `scroll-down-command' from the minibuffer in its original window." - (interactive "^P") + (interactive "^P" minibuffer-mode) (with-minibuffer-selected-window (scroll-down-command arg))) (defun minibuffer-scroll-other-window (&optional arg) "Run `scroll-other-window' from the minibuffer in its original window." - (interactive "P") + (interactive "^P" minibuffer-mode) (with-minibuffer-selected-window (scroll-other-window arg))) (defun minibuffer-scroll-other-window-down (&optional arg) "Run `scroll-other-window-down' from the minibuffer in its original window." - (interactive "^P") + (interactive "^P" minibuffer-mode) (with-minibuffer-selected-window (scroll-other-window-down arg))) @@ -5444,14 +5444,14 @@ after executing BODY." "Move to the first item in the completions window from the minibuffer. When `minibuffer-completion-auto-choose' is non-nil, then also insert the selected completion candidate to the minibuffer." - (interactive nil minibuffer-mode) + (interactive "" minibuffer-mode) (minibuffer-completions-motion (first-completion))) (defun minibuffer-last-completion () "Move to the last item in the completions window from the minibuffer. When `minibuffer-completion-auto-choose' is non-nil, then also insert the selected completion candidate to the minibuffer." - (interactive nil minibuffer-mode) + (interactive "" minibuffer-mode) (minibuffer-completions-motion (last-completion))) (defun minibuffer-next-completion (&optional n vertical) @@ -5461,7 +5461,7 @@ to the next item on the next line using `next-line-completion'. Otherwise, move to the next item horizontally using `next-completion'. When `minibuffer-completion-auto-choose' is non-nil, then also insert the selected completion candidate to the minibuffer." - (interactive "p") + (interactive "p" minibuffer-mode) (minibuffer-completions-motion (funcall (if vertical #'next-line-completion #'next-completion) (or n 1)))) @@ -5469,7 +5469,7 @@ insert the selected completion candidate to the minibuffer." "Move to the previous item in the completions window from the minibuffer. When `minibuffer-completion-auto-choose' is non-nil, then also insert the selected completion candidate to the minibuffer." - (interactive "p") + (interactive "p" minibuffer-mode) (minibuffer-next-completion (- (or n 1)))) (defun minibuffer-next-line-completion (&optional n) @@ -5478,7 +5478,7 @@ This means to move to the completion candidate on the next line in the *Completions* buffer while point stays in the minibuffer. When `minibuffer-completion-auto-choose' is non-nil, then also insert the selected completion candidate to the minibuffer." - (interactive "p") + (interactive "p" minibuffer-mode) (minibuffer-next-completion (or n 1) t)) (defun minibuffer-previous-line-completion (&optional n) @@ -5487,18 +5487,18 @@ This means to move to the completion candidate on the previous line in the *Completions* buffer while point stays in the minibuffer. When `minibuffer-completion-auto-choose' is non-nil, then also insert the selected completion candidate to the minibuffer." - (interactive "p") + (interactive "p" minibuffer-mode) (minibuffer-next-completion (- (or n 1)) t)) (defun minibuffer-next-line-or-completion (&optional arg) "Move cursor down ARG lines, or to the next completion candidate." - (interactive "^p") + (interactive "^p" minibuffer-mode) (or arg (setq arg 1)) (minibuffer-next-line-or-call #'minibuffer-next-completion arg)) (defun minibuffer-previous-line-or-completion (&optional arg) "Move cursor up ARG lines, or to the previous completion candidate." - (interactive "^p") + (interactive "^p" minibuffer-mode) (or arg (setq arg 1)) (minibuffer-previous-line-or-call #'minibuffer-previous-completion arg)) @@ -5510,7 +5510,7 @@ is not provided, then whether to exit the minibuffer depends on the value of `completion-no-auto-exit'. If NO-QUIT is non-nil, insert the completion candidate at point to the minibuffer, but don't quit the completions window." - (interactive "P") + (interactive "P" minibuffer-mode) (with-minibuffer-completions-window (choose-completion nil no-exit no-quit))) @@ -5518,7 +5518,7 @@ minibuffer, but don't quit the completions window." "Complete the minibuffer history as far as possible. Like `minibuffer-complete' but completes on the history items instead of the default completion table." - (interactive) + (interactive "" minibuffer-mode) (let* ((history (symbol-value minibuffer-history-variable)) (completions (if (listp history) @@ -5540,7 +5540,7 @@ instead of the default completion table." "Complete minibuffer defaults as far as possible. Like `minibuffer-complete' but completes on the default items instead of the completion table." - (interactive) + (interactive "" minibuffer-mode) (when (and (not minibuffer-default-add-done) (functionp minibuffer-default-add-function)) (setq minibuffer-default-add-done t @@ -5713,7 +5713,7 @@ members of the minibuffer history list." (defun minibuffer-toggle-exceptional-candidates () "Toggle display of exceptional completion candidates." - (interactive nil minibuffer-mode) + (interactive "" minibuffer-mode) (setq-local completions-exclude-exceptional-candidates (not completions-exclude-exceptional-candidates)) (when (get-buffer-window completions-buffer-name 0) @@ -5724,7 +5724,7 @@ members of the minibuffer history list." (defun minibuffer-toggle-completions-annotations () "Toggle display of annotations for completion candidates." - (interactive nil minibuffer-mode) + (interactive "" minibuffer-mode) (setq-local minibuffer-completion-annotations (not minibuffer-completion-annotations)) (when (get-buffer-window completions-buffer-name 0)