diff options
Diffstat (limited to 'lisp/comint.el')
-rw-r--r-- | lisp/comint.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index 591be5e2d9..b91b82adb2 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -2151,8 +2151,10 @@ current line, if point is on an output field. If `comint-use-prompt-regexp' is non-nil, then return the current line with any initial string matching the regexp `comint-prompt-regexp' removed." - (let ((bof (field-beginning))) - (if (null (get-char-property bof 'field)) ;Not `output'. + (let (bof) + (if (and (not comint-use-prompt-regexp) + ;; Make sure we're in an input rather than output field. + (null (get-char-property (setq bof (field-beginning)) 'field))) (field-string-no-properties bof) (comint-bol) (buffer-substring-no-properties (point) (line-end-position))))) |