emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-26 55c9bb9 2/2: Fix comint-get-old-input-default for


From: Noam Postavsky
Subject: [Emacs-diffs] emacs-26 55c9bb9 2/2: Fix comint-get-old-input-default for output field case (Bug#25028)
Date: Mon, 4 Jun 2018 20:36:31 -0400 (EDT)

branch: emacs-26
commit 55c9bb9f3c2971e347caeea1402f97fb603c4210
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Fix comint-get-old-input-default for output field case (Bug#25028)
    
    * lisp/comint.el (comint-get-old-input-default): Don't return whole
    field when point was on an output field.
---
 lisp/comint.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/comint.el b/lisp/comint.el
index 1e4c0d3..122291b 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -2248,14 +2248,16 @@ 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)
+  (let (field-prop bof)
     (if (and (not comint-use-prompt-regexp)
              ;; Make sure we're in an input rather than output field.
-             (null (get-char-property (setq bof (field-beginning)) 'field)))
+             (not (setq field-prop (get-char-property
+                                    (setq bof (field-beginning)) 'field))))
        (field-string-no-properties bof)
       (comint-bol)
       (buffer-substring-no-properties (point)
-                                     (if comint-use-prompt-regexp
+                                      (if (or comint-use-prompt-regexp
+                                              (eq field-prop 'output))
                                          (line-end-position)
                                        (field-end))))))
 



reply via email to

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