emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-24 6f2971a: * lisp/comint.el (comint-line-beginning-


From: Juri Linkov
Subject: [Emacs-diffs] emacs-24 6f2971a: * lisp/comint.el (comint-line-beginning-position): Revert searching for
Date: Thu, 19 Feb 2015 19:29:24 +0000

branch: emacs-24
commit 6f2971ab761e62e649892bd3fe5c08983420c5ae
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>

    * lisp/comint.el (comint-line-beginning-position): Revert searching for
    the prompt when comint-use-prompt-regexp is non-nil because it
    doesn't distinguish input from output.  Check the field property
    `output' for the case when comint-use-prompt-regexp is nil.
    
    Fixes: debbugs:19710
---
 lisp/ChangeLog |    8 ++++++++
 lisp/comint.el |    7 ++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6373df6..22e952a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
+2015-02-19  Juri Linkov  <address@hidden>
+
+       * comint.el (comint-line-beginning-position): Revert searching for
+       the prompt when comint-use-prompt-regexp is non-nil because it
+       doesn't distinguish input from output.  Check the field property
+       `output' for the case when comint-use-prompt-regexp is nil.
+       (Bug#19710)
+
 2015-02-15  Jérémy Compostella  <address@hidden>
 
        * net/tramp-sh.el (tramp-remote-process-environment): Disable paging
diff --git a/lisp/comint.el b/lisp/comint.el
index c81551a..68b8edb 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -2267,8 +2267,6 @@ a buffer local variable."
       ;; Use comint-prompt-regexp
       (save-excursion
        (beginning-of-line)
-       (unless (looking-at comint-prompt-regexp)
-         (re-search-backward comint-prompt-regexp nil t))
        (comint-skip-prompt)
        (point))
     ;; Use input fields.  Note that, unlike the behavior of
@@ -2278,7 +2276,10 @@ a buffer local variable."
     ;; if there are two fields on a line, then the first one is the
     ;; prompt, and the second one is an input field, and is front-sticky
     ;; (as input fields should be).
-    (constrain-to-field (field-beginning) (line-end-position))))
+    (constrain-to-field (if (eq (field-at-pos (point)) 'output)
+                            (line-beginning-position)
+                          (field-beginning))
+                        (line-end-position))))
 
 (defun comint-bol (&optional arg)
   "Go to the beginning of line, then skip past the prompt, if any.



reply via email to

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