From b355d19e7da3d0eb6a6a92fbb39b44a54dca8887 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Sat, 13 Jul 2024 13:24:44 +0200 Subject: [PATCH] Improve some docstrings in minibuffer.el --- lisp/minibuffer.el | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index df0049fae3a..fc7092c0e5c 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -4415,7 +4415,10 @@ possible completions." (add-hook 'minibuffer-setup-hook #'minibuffer-update-prompt-indicators 95) (defun minibuffer-action (&optional alt) - "Return the minibuffer action function for the current minibuffer." + "Return the minibuffer action function for the current minibuffer. + +If optional argument ALT is non-nil and there is an alternative +minibuffer action, return the alternative action instead." (or (and alt minibuffer-alternative-action) minibuffer-action (when-let* ((cmd current-minibuffer-command) @@ -4423,7 +4426,15 @@ possible completions." (when (symbolp cmd) (minibuffer--get-action cmd))))) (defun minibuffer-apply (input &optional prefix alt) - "Apply action to current minibuffer INPUT prefixed by PREFIX." + "Apply minibuffer action to current INPUT. + +Optional argument PREFIX, if non-nil, is a string to prepend to INPUT +before passing it to the action function. If optional argument ALT is +non-nil and there is an alternative minibuffer action, apply the +alternative action instead. + +Interactively, INPUT is the current minibuffer input sans the completion +base, PREFIX is the completion base, and ALT is nil." (interactive (let* ((input-prefix (minibuffer-current-input)) (input (car input-prefix)) (prefix (cdr input-prefix))) @@ -4452,7 +4463,16 @@ possible completions." 'completions-used-input))))))) (defun minibuffer-apply-alt (input &optional prefix) - "Apply action to current minibuffer INPUT prefixed by PREFIX." + "Apply alternative minibuffer action to current INPUT. + +If there is no alternative action, apply the regular (non-alternative) +action instead. + +Optional argument PREFIX, if non-nil, is a string to prepend to INPUT +before passing it to the action function. + +Interactively, INPUT is the current minibuffer input sans the completion +base, and PREFIX is the completion base." (interactive (let* ((input-prefix (minibuffer-current-input)) (input (car input-prefix)) (prefix (cdr input-prefix))) @@ -4461,7 +4481,10 @@ possible completions." (minibuffer-apply input prefix t)) (defun minibuffer-query-apply (&optional alt) - "Suggest applying the minibuffer action to each completion candidate in turn." + "Suggest applying the minibuffer action to each completion candidate in turn. + +If optional argument ALT is non-nil and there is an alternative +minibuffer action, apply the alternative action instead." (interactive "P" minibuffer-mode) (with-minibuffer-completions-window (let (prev all done) @@ -5871,6 +5894,7 @@ description without prompting." nil t nil nil default)))) (defun minibuffer-predicate-description-to-function (desc) + "Return predicate function the DESC describes, or nil." (catch 'stop (advice-function-mapc (lambda (a p) @@ -5880,7 +5904,7 @@ description without prompting." nil)) (defun minibuffer-latest-predicate-description () - "Return the completion predicate you added most recently." + "Return the completion predicate you added most recently, or nil." (catch 'stop (advice-function-mapc (lambda (_ p) -- 2.39.2