diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-10-24 22:19:17 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-10-24 22:19:17 -0400 |
commit | 410488d3aeae877ff13c005a9c4141d1d7ec9c91 (patch) | |
tree | 18ed2738559152694f4b419622ee66c861e75d62 /lisp/comint.el | |
parent | 958ad48682256150c5cde455fe21752ab1ea3afb (diff) | |
download | emacs-410488d3aeae877ff13c005a9c4141d1d7ec9c91.tar.gz |
* lisp/comint.el (comint-get-old-input-default): Fix use-prompt-regexp case.
Fixes: debbugs:9865
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 591be5e2d9d..dc3cdd9fa7a 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 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))))) |