GNU bug report logs - #16010
[patch] 24.3.50; Typing in comint buffers inherits prompt text properties

Previous Next

Package: emacs;

Reported by: Vitalie Spinu <spinuvit <at> gmail.com>

Date: Sat, 30 Nov 2013 08:32:03 UTC

Severity: normal

Tags: patch

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Chong Yidong <cyd <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#16010: closed ([patch] 24.3.50; Typing in comint buffers
 inherits prompt text properties)
Date: Fri, 20 Dec 2013 06:27:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 20 Dec 2013 14:25:52 +0800
with message-id <87r49811jj.fsf <at> gnu.org>
and subject line Re: bug#16010: [patch] 24.3.50; Typing in comint buffers inherits prompt text properties
has caused the debbugs.gnu.org bug report #16010,
regarding [patch] 24.3.50; Typing in comint buffers inherits prompt text properties
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
16010: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16010
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Vitalie Spinu <spinuvit <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [patch] 24.3.50;
 Typing in comint buffers inherits prompt text properties
Date: Sat, 30 Nov 2013 00:31:31 -0800
[Message part 3 (text/plain, inline)]
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

[0001-add-rear-nonsticky-t-to-comint-prompt.patch (text/x-diff, inline)]
From 36dd963f3e7eb3a6775879aa98a24ca2221079bb Mon Sep 17 00:00:00 2001
From: Vitalie Spinu <spinuvit <at> 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

[Message part 5 (message/rfc822, inline)]
From: Chong Yidong <cyd <at> gnu.org>
To: Vitalie Spinu <spinuvit <at> gmail.com>
Cc: 16010-done <at> debbugs.gnu.org
Subject: Re: bug#16010: [patch] 24.3.50;
 Typing in comint buffers inherits prompt text properties
Date: Fri, 20 Dec 2013 14:25:52 +0800
Vitalie Spinu <spinuvit <at> gmail.com> writes:

> 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.

Thanks, look correct; committed to trunk.


This bug report was last modified 11 years and 240 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.