]> code.delx.au - gnu-emacs/commitdiff
* lisp/comint.el (comint-get-old-input-default): Fix use-prompt-regexp case.
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 25 Oct 2011 02:19:17 +0000 (22:19 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 25 Oct 2011 02:19:17 +0000 (22:19 -0400)
Fixes: debbugs:9865
lisp/ChangeLog
lisp/comint.el

index 57b89b973f1f779a4bcaad7cd07c23eeef4b5694..32e46b2c172bcb40bd0586888a05f8636cafa87b 100644 (file)
@@ -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)
index 591be5e2d9db17c6d6c1b750af2a5d75f253e1e1..dc3cdd9fa7a058468efe1b4e9a3d2129a6a2278f 100644 (file)
@@ -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)))))