From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Herbert Euler" Newsgroups: gmane.emacs.devel Subject: RE: C++ mode and c-beginning-of-current-token Date: Sat, 12 May 2007 23:30:07 +0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: sea.gmane.org 1178983823 24598 80.91.229.12 (12 May 2007 15:30:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 12 May 2007 15:30:23 +0000 (UTC) Cc: emacs-devel@gnu.org To: herberteuler@hotmail.com, acm@muc.de Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 12 17:30:21 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HmtY2-0000lU-A3 for ged-emacs-devel@m.gmane.org; Sat, 12 May 2007 17:30:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HmtfZ-0001Ba-TD for ged-emacs-devel@m.gmane.org; Sat, 12 May 2007 11:38:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HmtfW-0001BV-9k for emacs-devel@gnu.org; Sat, 12 May 2007 11:38:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HmtfT-0001BJ-RZ for emacs-devel@gnu.org; Sat, 12 May 2007 11:38:01 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HmtfT-0001BG-PF for emacs-devel@gnu.org; Sat, 12 May 2007 11:37:59 -0400 Original-Received: from bay0-omc1-s15.bay0.hotmail.com ([65.54.246.87]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HmtXv-0004AE-9p for emacs-devel@gnu.org; Sat, 12 May 2007 11:30:11 -0400 Original-Received: from hotmail.com ([65.55.154.90]) by bay0-omc1-s15.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Sat, 12 May 2007 08:30:10 -0700 Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sat, 12 May 2007 08:30:10 -0700 Original-Received: from 65.55.154.123 by by143fd.bay143.hotmail.msn.com with HTTP; Sat, 12 May 2007 15:30:07 GMT X-Originating-IP: [221.223.220.175] X-Originating-Email: [herberteuler@hotmail.com] X-Sender: herberteuler@hotmail.com In-Reply-To: X-OriginalArrivalTime: 12 May 2007 15:30:10.0460 (UTC) FILETIME=[6D6D9DC0:01C794AA] X-detected-kernel: Windows 2000 SP4, XP SP1+ 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:70898 Archived-At: I found some additional strange behaviors. First, the error in a buffer would only be signaled once. If an error is already signaled, typing again does not cause another same error get signaled, but font-lock is broken after that. Normally, characters are assigned with face property as they are typed. For example, when I type #include in a c++-mode buffer, the whole word is assigned with font-lock-preprocessor-face after the first letter, l, is typed (when # is typed, face are not set). However, in the C++ buffer in which an error has been signaled, font-lock does not work on the erroneous region. The erroneous starts with the beginning of the buffer (where the original error is signaled), and ends with a statement (defined with `c-beginning-of-statement' and `c-end-of-statement'). For example, suppose the first line of a buffer is as below (-!- is the point position): -!-#include #include and no errors have been signaled. Now I type C-o, the buffer content is now -!- #include #include Now I type #, an error is signaled (this is slightly different from typing in an empty buffer, in such a case the error is signaled when typing i, rather than #). Now if I finish the first line as below: #include -!- #include #include The second #include and content follows it is still colored, while the first one is not. Text properties on the first line are (c-in-sws t auto-composed t fontified t). If other content are typed now, for example the following: #include int main () { } -!- #include #include all of them are not colored; text properties of the non-colored content but the first line are (c-is-sws t auto-composed t fontified t), and of the first line is changed to (c-is-sws t c-in-sws t auto-composed t fontified t). If I invoke `font-lock-fontify-region' on non-colored region manually, they will be fontified correctly. Font-lock in other parts of the buffer works, but is abnormal as usual. And there are other strange behaviors, but they are too complicated for me to describe, so I intend to describe only if you need. Hope the above information helps. Thanks. Regards, Guanpeng Xu _________________________________________________________________ FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/