aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2018-05-11 07:05:53 -0400
committerNoam Postavsky2018-06-04 19:42:22 -0400
commit55c9bb9f3c2971e347caeea1402f97fb603c4210 (patch)
tree96ab6c3018c1e52b427b6493ddaf627bc33f0497
parent26819cd1c0eb91e827c87ad56a7ce965afff5ed2 (diff)
downloademacs-55c9bb9f3c2971e347caeea1402f97fb603c4210.tar.gz
emacs-55c9bb9f3c2971e347caeea1402f97fb603c4210.zip
Fix comint-get-old-input-default for output field case (Bug#25028)
* lisp/comint.el (comint-get-old-input-default): Don't return whole field when point was on an output field.
-rw-r--r--lisp/comint.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 1e4c0d33ee9..122291bcf9c 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -2248,14 +2248,16 @@ current line, if point is on an output field.
2248If `comint-use-prompt-regexp' is non-nil, then return 2248If `comint-use-prompt-regexp' is non-nil, then return
2249the current line with any initial string matching the regexp 2249the current line with any initial string matching the regexp
2250`comint-prompt-regexp' removed." 2250`comint-prompt-regexp' removed."
2251 (let (bof) 2251 (let (field-prop bof)
2252 (if (and (not comint-use-prompt-regexp) 2252 (if (and (not comint-use-prompt-regexp)
2253 ;; Make sure we're in an input rather than output field. 2253 ;; Make sure we're in an input rather than output field.
2254 (null (get-char-property (setq bof (field-beginning)) 'field))) 2254 (not (setq field-prop (get-char-property
2255 (setq bof (field-beginning)) 'field))))
2255 (field-string-no-properties bof) 2256 (field-string-no-properties bof)
2256 (comint-bol) 2257 (comint-bol)
2257 (buffer-substring-no-properties (point) 2258 (buffer-substring-no-properties (point)
2258 (if comint-use-prompt-regexp 2259 (if (or comint-use-prompt-regexp
2260 (eq field-prop 'output))
2259 (line-end-position) 2261 (line-end-position)
2260 (field-end)))))) 2262 (field-end))))))
2261 2263