summaryrefslogtreecommitdiff
path: root/lisp/comint.el
diff options
context:
space:
mode:
authorDima Kogan <dima@secretsauce.net>2016-12-25 11:49:44 -0800
committerDima Kogan <dima@secretsauce.net>2018-06-17 22:59:21 -0700
commitba2ddadb5378351e8003c8e172b52bfabaa27554 (patch)
tree8c62c3f64a6af263bddb6777ab3fa2fb71ca1a26 /lisp/comint.el
parent74f377b3955198d6f66afa34bbbf6d004aad134a (diff)
downloademacs-ba2ddadb5378351e8003c8e172b52bfabaa27554.tar.gz
comint-insert-previous-argument doesn't detect and ignore trailing &
This function is invoked in shell-mode by the user, and is meant to emulate what M-. does in zsh and bash: it inserts an argument from a previous command. Neither zsh nor bash treat a trailing & specially: M-. simply inserts it if it is encountered. Emacs DID have extra logic to detect and discard trailing &, but this logic was buggy, and a && anywhere in the sequence would confuse it. This patch simply removes that logic to fix the bug and to emulate zsh and bash more closely * lisp/comint.el (comint-insert-previous-argument): don't detect and ignore trailing & (Bug#25271) * etc/NEWS: Document this.
Diffstat (limited to 'lisp/comint.el')
-rw-r--r--lisp/comint.el3
1 files changed, 0 insertions, 3 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index f66e40b150b..82c547c9760 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -2705,9 +2705,6 @@ is the last argument. This command is like `M-.' in bash and zsh."
(set-marker comint-insert-previous-argument-last-start-pos (point))
;; Insert the argument.
(let ((input-string (comint-previous-input-string 0)))
- (when (string-match "[ \t\n]*&" input-string)
- ;; strip terminating '&'
- (setq input-string (substring input-string 0 (match-beginning 0))))
(insert (comint-arguments input-string index index)))
;; Make next invocation return arg from previous input
(setq comint-input-ring-index (1+ (or comint-input-ring-index 0)))