]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve some docstrings in minibuffer.el
authorEshel Yaron <me@eshelyaron.com>
Sat, 13 Jul 2024 11:24:44 +0000 (13:24 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 13 Jul 2024 11:24:44 +0000 (13:24 +0200)
lisp/minibuffer.el

index df0049fae3a32b3e02e220f9945b507434655923..fc7092c0e5cee0231b890e749e9f0f4f59487ad3 100644 (file)
@@ -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)