emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden: font-lock applied to comint prompts]


From: Michael Mauger
Subject: Re: address@hidden: font-lock applied to comint prompts]
Date: Thu, 30 Nov 2006 16:02:48 -0800 (PST)


Richard Stallman wrote:
> 
> [I sent this message a week ago but did not get a response.]
> 
> It's possible that this is something that fundamentally cannot be
> fixed, but maybe not.  Would someone please take a look, DTRT, and
> then ack?
> 
> 
> ------- Start of forwarded message -------
> To: address@hidden
> From: Michael Mauger <address@hidden>
> Date: Mon, 20 Nov 2006 21:04:08 +0000 (UTC)
> Mime-Version: 1.0
> Content-Type: text/plain; charset=us-ascii
> Subject: font-lock applied to comint prompts
> X-Spam-Status: No, score=2.2 required=5.0 tests=FORGED_YAHOO_RCVD 
>       autolearn=no version=3.0.4
> 
> Please write in English if possible, because the Emacs maintainers
> usually do not have translators to read other languages for them.
> 
> Your bug report will be posted to the address@hidden mailing
> list.
> 
> Please describe exactly what actions triggered the bug
> and the precise symptoms of the bug:
> 
> 
> * emacs -Q
> * M-x shell RET
> (assuming sh-type command interpreter)
> * in *shell* buffer: 
> 
>   $ PS1='x -y $ '
>   x -y $ ls -l >/dev/null
>   x -y $ 
> 
> Once the ls command is entered on the second line, the -y in the
> prompt gets highlighted the same way that the -l in the ls command
> gets highlighted.  
> 
> doing `C-u C-x =' on the `y' in the prompt on the last line gives:
>     character: y (121, #o171, #x79, U+0079)
>       charset: ascii (ASCII (ISO646 IRV))
>    code point: #x79
>        syntax: w      which means: word
>      category: a:ASCII l:Latin
>   buffer code: #x79
>     file code: #x79 (encoded by coding system iso-latin-1-unix)
>       display: by this font (glyph code)
>        -outline-Bitstream Vera Sans
> Mono-normal-i-normal-normal-11-82-96-96-c-*-
> iso8859-1 (#x79)
> 
>   There is an overlay here:
>    From 240 to 247
>     font-lock-face       comint-highlight-prompt
> 
> 
>   There are text properties here:
>     face                 font-lock-comment-face
>     field                output
>     fontified            t
>     inhibit-line-move-field-capture t
>     rear-nonsticky       t
> 
> Doing the same on the second, now fontified, prompt gives:
>     character: y (121, #o171, #x79, U+0079)
>       charset: ascii (ASCII (ISO646 IRV))
>    code point: #x79
>        syntax: w      which means: word
>      category: a:ASCII l:Latin
>   buffer code: #x79
>     file code: #x79 (encoded by coding system iso-latin-1-unix)
>       display: by this font (glyph code)
>        -outline-Bitstream Vera Sans
> Mono-normal-r-normal-normal-11-82-96-96-c-*-
> iso8859-1 (#x79)
> 
>   There are text properties here:
>     face                 font-lock-comment-face
>     field                output
>     font-lock-face       comint-highlight-prompt
>     fontified            t
>     inhibit-line-move-field-capture t
>     rear-nonsticky       t
> 
> I've seen this in other comint-like buffers as well (*sql*).  Is there
> a way to protect/prevent the prompt string from being font-lock'd?
> 
> 

The following patch seems to fix the problem by adding the face property to
the overlay as well.

*** emacs/lisp/comint.el        Thu Nov 30 01:14:03 2006
--- emacs/lisp/comint.el.new    Thu Nov 30 18:34:47 2006
***************
*** 1787,1792 ****
--- 1787,1794 ----
                  (setq comint-last-prompt-overlay
                        (make-overlay prompt-start (point)))
                  (overlay-put comint-last-prompt-overlay
+                              'face 'comint-highlight-prompt)
+                 (overlay-put comint-last-prompt-overlay
                               'font-lock-face 'comint-highlight-prompt))))
  
            (goto-char saved-point)))))))

-- 
View this message in context: 
http://www.nabble.com/-mmaug%40yahoo.com%3A-font-lock-applied-to-comint-prompts--tf2729392.html#a7630872
Sent from the Emacs - Dev mailing list archive at Nabble.com.





reply via email to

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