1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-16 02:50:26 -08:00

; Improve doc strings of minibuffer-history commands

* lisp/simple.el (goto-history-element, next-history-element)
(previous-history-element): Doc fixes.  (Bug#60103)
This commit is contained in:
Eli Zaretskii 2022-12-16 17:32:05 +02:00
parent 80f410d281
commit c26ab22cf4

View file

@ -2929,11 +2929,12 @@ that was current when the minibuffer was activated."
(window-buffer (minibuffer-selected-window)))) (window-buffer (minibuffer-selected-window))))
(defun goto-history-element (nabs) (defun goto-history-element (nabs)
"Puts element of the minibuffer history in the minibuffer. "Insert into the minibuffer the element of minibuffer history specified by NABS.
The argument NABS specifies the absolute history position in Interactively, NABS is the prefix numeric argument, and defaults to 1.
descending order, where 0 means the current element and a It specifies the absolute history position in descending order,
positive number N means the Nth previous element. NABS being a where 0 means the current element and a positive number N means
negative number -N means the Nth entry of \"future history.\"" the Nth previous element. NABS that is a negative number -N means
the Nth entry of \"future history.\""
(interactive "p") (interactive "p")
(when (and (not minibuffer-default-add-done) (when (and (not minibuffer-default-add-done)
(functionp minibuffer-default-add-function) (functionp minibuffer-default-add-function)
@ -2989,17 +2990,17 @@ negative number -N means the Nth entry of \"future history.\""
(goto-char (or minibuffer-temporary-goal-position (point-max))))) (goto-char (or minibuffer-temporary-goal-position (point-max)))))
(defun next-history-element (n) (defun next-history-element (n)
"Puts next element of the minibuffer history in the minibuffer. "Insert into the minibuffer the Nth next element of minibuffer history.
With argument N, it uses the Nth following element. The position Interactively, N is the prefix numeric argument and defaults to 1.
in the history can go beyond the current position and invoke \"future The value N can go beyond the current position in the minibuffer
history.\"" history, and invoke \"future history.\""
(interactive "p") (interactive "p")
(or (zerop n) (or (zerop n)
(goto-history-element (- minibuffer-history-position n)))) (goto-history-element (- minibuffer-history-position n))))
(defun previous-history-element (n) (defun previous-history-element (n)
"Puts previous element of the minibuffer history in the minibuffer. "Insert into the minibuffer the Nth previous element of minibuffer history.
With argument N, it uses the Nth previous element." Interactively, N is the prefix numeric argument and defaults to 1."
(interactive "p") (interactive "p")
(or (zerop n) (or (zerop n)
(goto-history-element (+ minibuffer-history-position n)))) (goto-history-element (+ minibuffer-history-position n))))