unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Herbert Euler" <herberteuler@hotmail.com>
To: herberteuler@hotmail.com, acm@muc.de
Cc: emacs-devel@gnu.org
Subject: RE: C++ mode and c-beginning-of-current-token
Date: Sat, 12 May 2007 23:30:07 +0800	[thread overview]
Message-ID: <BAY143-F1081814BBBFFDD91659709DA380@phx.gbl> (raw)
In-Reply-To: <BAY143-F4587B96A2C1ACDBB94E57DA380@phx.gbl>

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 <iostream>
    #include <vector>

and no errors have been signaled.  Now I type C-o, the buffer content
is now

    -!-
    #include <iostream>
    #include <vector>

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 <iostream>-!-
    #include <iostream>
    #include <vector>

The second #include <iostream> 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 <iostream>
    int
    main ()
    {
    }
    -!-
    #include <iostream>
    #include <vector>

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/

  parent reply	other threads:[~2007-05-12 15:30 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-12 10:39 C++ mode and c-beginning-of-current-token Herbert Euler
2007-05-12 13:19 ` Alan Mackenzie
2007-05-12 14:30   ` Herbert Euler
2007-05-12 14:33   ` Herbert Euler
2007-05-12 16:02   ` Herbert Euler
2007-05-12 15:30 ` Herbert Euler [this message]
2007-05-12 18:49   ` Alan Mackenzie
2007-05-13  0:51     ` Herbert Euler
2007-05-13 10:01 ` Alan Mackenzie
2007-05-14  2:00   ` Herbert Euler
2007-05-14  8:50     ` Alan Mackenzie
2007-05-14  9:24       ` Herbert Euler
2007-05-14 16:58 ` Stefan Monnier
2007-05-15  3:45   ` Herbert Euler
2007-05-15  6:39     ` martin rudalics
2007-05-16 16:15     ` Stefan Monnier
2007-05-15 13:30   ` Herbert Euler
2007-05-16  8:01     ` Herbert Euler
2007-05-16  8:05       ` Herbert Euler
2007-05-17  2:12         ` Kenichi Handa
2007-05-17 10:18           ` martin rudalics
2007-05-17 12:52             ` Herbert Euler
2007-05-17 13:51               ` martin rudalics
2007-05-17 21:40                 ` martin rudalics
2007-05-17 14:32               ` Stefan Monnier
2007-05-17 14:45                 ` martin rudalics
2007-05-18 13:00                 ` Richard Stallman
2007-05-18 23:39                   ` Herbert Euler
2007-05-19 22:31                     ` Richard Stallman
2007-05-19 12:59                   ` martin rudalics
2007-05-19 15:18                     ` Stefan Monnier
2007-05-19 17:48                       ` martin rudalics
2007-05-21 13:01                       ` Kenichi Handa
2007-05-21 14:00                         ` Stefan Monnier
2007-05-22  1:37                           ` Kenichi Handa
2007-05-22 10:26                             ` Stefan Monnier
2007-05-22 12:08                               ` Kenichi Handa
2007-05-20  6:50                     ` Richard Stallman
2007-05-16  9:00       ` martin rudalics
2007-05-16 11:12         ` Herbert Euler
2007-05-16 12:21           ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BAY143-F1081814BBBFFDD91659709DA380@phx.gbl \
    --to=herberteuler@hotmail.com \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).