(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)))
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))
(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))
(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"))
(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))
(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))))
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))
(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)))
"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)
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))))
"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)
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)
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))
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)))
"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)
"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
(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)
(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)