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 | |
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')
-rw-r--r-- | lisp/ChangeLog | 5 | ||||
-rw-r--r-- | lisp/comint.el | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 57b89b973f1..32e46b2c172 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca> + + * comint.el (comint-get-old-input-default): Fix use-prompt-regexp case + (bug#9865). + 2011-10-24 Glenn Morris <rgm@gnu.org> * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix. (Bug#9819) 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))))) |