From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Mauger Newsgroups: gmane.emacs.devel Subject: Re: [mmaug@yahoo.com: font-lock applied to comint prompts] Date: Thu, 30 Nov 2006 16:02:48 -0800 (PST) Message-ID: <7630872.post@talk.nabble.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1164931393 25332 80.91.229.2 (1 Dec 2006 00:03:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 1 Dec 2006 00:03:13 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 01 01:03:10 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Gpvrq-00011D-9m for ged-emacs-devel@m.gmane.org; Fri, 01 Dec 2006 01:03:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gpvrq-0008RX-0d for ged-emacs-devel@m.gmane.org; Thu, 30 Nov 2006 19:03:02 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gpvre-0008Ob-N3 for emacs-devel@gnu.org; Thu, 30 Nov 2006 19:02:50 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gpvre-0008O7-88 for Emacs-devel@gnu.org; Thu, 30 Nov 2006 19:02:50 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gpvre-0008Nw-5Y for Emacs-devel@gnu.org; Thu, 30 Nov 2006 19:02:50 -0500 Original-Received: from [72.21.53.35] (helo=talk.nabble.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Gpvrd-0003j2-JT for Emacs-devel@gnu.org; Thu, 30 Nov 2006 19:02:49 -0500 Original-Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1Gpvrc-0006s3-Ng for Emacs-devel@gnu.org; Thu, 30 Nov 2006 16:02:48 -0800 Original-To: Emacs-devel@gnu.org In-Reply-To: X-Nabble-From: mmaug@yahoo.com X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:63174 Archived-At: 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: emacs-pretest-bug@gnu.org > From: Michael Mauger > 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 emacs-pretest-bug@gnu.org 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.