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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16010 in the body.
You can then email your comments to 16010 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#16010; Package emacs. (Sat, 30 Nov 2013 08:32:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vitalie Spinu <spinuvit <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 30 Nov 2013 08:32:05 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

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 1 (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


Reply sent to Chong Yidong <cyd <at> gnu.org>:
You have taken responsibility. (Fri, 20 Dec 2013 06:27:02 GMT) Full text and rfc822 format available.

Notification sent to Vitalie Spinu <spinuvit <at> gmail.com>:
bug acknowledged by developer. (Fri, 20 Dec 2013 06:27:04 GMT) Full text and rfc822 format available.

Message #10 received at 16010-done <at> debbugs.gnu.org (full text, mbox):

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.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 17 Jan 2014 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 122 days ago.

Previous Next


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