bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#16010: [patch] 24.3.50; Typing in comint buffers inherits prompt tex


From: Vitalie Spinu
Subject: bug#16010: [patch] 24.3.50; Typing in comint buffers inherits prompt text properties
Date: Sat, 30 Nov 2013 00:31:31 -0800

Hi, 

If comint-use-prompt-regexp is t typing in comint buffers inherits text
properties from the prompt. See this screencast: 
http://screencast.com/t/xYa9KVWu7 

You can also reproduce it by setting comint-use-prompt-regexp to t in
shell buffers. 

Attached is the fix with minor reformatting of the adjacent code for the
readability reasons.

This was probably recently introduced when eliminating the overlays from
comint buffers.
   

Vitalie

>From 36dd963f3e7eb3a6775879aa98a24ca2221079bb Mon Sep 17 00:00:00 2001
From: Vitalie Spinu <spinuvit@gmail.com>
Date: Fri, 29 Nov 2013 23:25:55 -0800
Subject: [PATCH] add rear-nonsticky t to comint prompt

    make sure typing in comint buffers doesn't inherit
    comint-highlight-prompt face and other prompt properties.
---
 lisp/comint.el | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/lisp/comint.el b/lisp/comint.el
index 3aff313..ee83918 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -2063,20 +2063,18 @@ Make backspaces delete the previous character."
                 (with-silent-modifications
                   (or (= (point-min) prompt-start)
                       (get-text-property (1- prompt-start) 'read-only)
-                      (put-text-property
-                       (1- prompt-start) prompt-start 'read-only 'fence))
-                  (add-text-properties
-                   prompt-start (point)
-                   '(read-only t rear-nonsticky t front-sticky (read-only)))))
+                      (put-text-property (1- prompt-start) prompt-start
+                                         'read-only 'fence))
+                  (add-text-properties prompt-start (point)
+                                       '(read-only t front-sticky 
(read-only)))))
              (when comint-last-prompt
                (remove-text-properties (car comint-last-prompt)
                                        (cdr comint-last-prompt)
                                        '(font-lock-face)))
              (setq comint-last-prompt
                    (cons (copy-marker prompt-start) (point-marker)))
-             (add-text-properties (car comint-last-prompt)
-                                  (cdr comint-last-prompt)
-                                  '(font-lock-face comint-highlight-prompt)))
+             (add-text-properties prompt-start (point)
+                                  '(rear-nonsticky t font-lock-face 
comint-highlight-prompt)))
            (goto-char saved-point)))))))
 
 (defun comint-preinput-scroll-to-bottom ()
-- 
1.8.1.2


reply via email to

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