aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/comint.el
diff options
context:
space:
mode:
authorEli Zaretskii2018-06-18 19:21:09 +0300
committerEli Zaretskii2018-06-18 19:21:09 +0300
commitbfc1dfd459c431e95ef685e7cd39f8a8a90d2377 (patch)
tree070ed8dc518550f8bf7bb1ba63f81b38d83e2cec /lisp/comint.el
parent3e2215642bbca3d1335155278eace39d0a87c267 (diff)
downloademacs-bfc1dfd459c431e95ef685e7cd39f8a8a90d2377.tar.gz
emacs-bfc1dfd459c431e95ef685e7cd39f8a8a90d2377.zip
Improve documentation of recent changes in Comint
* lisp/comint.el (comint-insert-previous-argument) (comint-arguments, comint-insert-previous-argument-from-end): Doc fixes. (comint-insert-previous-argument-from-end): Add :version. * doc/emacs/misc.texi (Shell Ring): Fix a typo in the name of 'comint-insert-previous-argument'. Document 'comint-insert-previous-argument-from-end'. (Bug#25271) * etc/NEWS: Reformat and rephrase the entry for recent Comint changes.
Diffstat (limited to 'lisp/comint.el')
-rw-r--r--lisp/comint.el25
1 files changed, 14 insertions, 11 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 82c547c9760..71a2b5eca55 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1682,8 +1682,9 @@ characters), and are not considered to be delimiters."
1682 1682
1683(defun comint-arguments (string nth mth) 1683(defun comint-arguments (string nth mth)
1684 "Return from STRING the NTH to MTH arguments. 1684 "Return from STRING the NTH to MTH arguments.
1685NTH and/or MTH can be nil, which means the last argument. NTH 1685NTH and/or MTH can be nil, which means the last argument.
1686and MTH can be <0 to count from the end; -1 means last argument. 1686NTH and MTH can be negative to count from the end; -1 means
1687the last argument.
1687Returned arguments are separated by single spaces. We assume 1688Returned arguments are separated by single spaces. We assume
1688whitespace separates arguments, except within quotes and except 1689whitespace separates arguments, except within quotes and except
1689for a space or tab that immediately follows a backslash. Also, a 1690for a space or tab that immediately follows a backslash. Also, a
@@ -2660,14 +2661,15 @@ text matching `comint-prompt-regexp'."
2660(defvar-local comint-insert-previous-argument-last-index nil) 2661(defvar-local comint-insert-previous-argument-last-index nil)
2661 2662
2662(defcustom comint-insert-previous-argument-from-end nil 2663(defcustom comint-insert-previous-argument-from-end nil
2663 "If nil, the INDEX argument to 2664 "If non-nil, `comint-insert-previous-argument' counts args from the end.
2664`comint-insert-previous-argument' refers to the INDEX-th 2665If this variable is nil, the default, `comint-insert-previous-argument'
2665argument, counting from the beginning; if non-nil, counting from 2666counts the arguments from the beginning; if non-nil, it counts from
2666the end. This exists to emulate the bahavior of `M-number M-.' 2667the end instead. This allows to emulate the behavior of `ESC-NUM ESC-.'
2667in bash and zsh: in bash, `number' counts from the 2668in both Bash and zsh: in Bash, `number' counts from the
2668beginning (variable in nil), while in zsh it counts from the end." 2669beginning (variable is nil), while in zsh, it counts from the end."
2669 :type 'boolean 2670 :type 'boolean
2670 :group 'comint) 2671 :group 'comint
2672 :version "27.1")
2671 2673
2672(defun comint-insert-previous-argument (index) 2674(defun comint-insert-previous-argument (index)
2673 "Insert the INDEXth argument from the previous Comint command-line at point. 2675 "Insert the INDEXth argument from the previous Comint command-line at point.
@@ -2676,8 +2678,9 @@ necessary to ensure that it's separated from adjacent arguments.
2676Interactively, if no prefix argument is given, the last argument is inserted. 2678Interactively, if no prefix argument is given, the last argument is inserted.
2677Repeated interactive invocations will cycle through the same argument 2679Repeated interactive invocations will cycle through the same argument
2678from progressively earlier commands (using the value of INDEX specified 2680from progressively earlier commands (using the value of INDEX specified
2679with the first command). Values of INDEX<0 count from the end, so INDEX=-1 2681with the first command). Values of INDEX < 0 count from the end, so
2680is the last argument. This command is like `M-.' in bash and zsh." 2682INDEX = -1 is the last argument. This command is like `M-.' in
2683Bash and zsh."
2681 (interactive "P") 2684 (interactive "P")
2682 (unless (null index) 2685 (unless (null index)
2683 (setq index (prefix-numeric-value index))) 2686 (setq index (prefix-numeric-value index)))