emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r106181: * lisp/comint.el (comint-get


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106181: * lisp/comint.el (comint-get-old-input-default): Fix use-prompt-regexp case.
Date: Mon, 24 Oct 2011 22:19:17 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106181
fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9865
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Mon 2011-10-24 22:19:17 -0400
message:
  * lisp/comint.el (comint-get-old-input-default): Fix use-prompt-regexp case.
modified:
  lisp/ChangeLog
  lisp/comint.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-10-24 17:37:03 +0000
+++ b/lisp/ChangeLog    2011-10-25 02:19:17 +0000
@@ -1,3 +1,8 @@
+2011-10-25  Stefan Monnier  <address@hidden>
+
+       * comint.el (comint-get-old-input-default): Fix use-prompt-regexp case
+       (bug#9865).
+
 2011-10-24  Glenn Morris  <address@hidden>
 
        * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix.  (Bug#9819)

=== modified file 'lisp/comint.el'
--- a/lisp/comint.el    2011-10-17 17:14:04 +0000
+++ b/lisp/comint.el    2011-10-25 02:19:17 +0000
@@ -2151,8 +2151,10 @@
 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)))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]