emacs-devel
[Top][All Lists]
Advanced

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

Re: font-lock-comment-delimiter-face


From: Stefan Monnier
Subject: Re: font-lock-comment-delimiter-face
Date: Wed, 11 May 2005 15:51:01 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>     Seems odd to introduce a new face whose name refers to "comment" even
>     though the only two known uses for it are not for comments but for
>     email citations.

> Those were the only uses yet implemented for it,
> but now I've changed font-lock-fontify-syntactically-region
> to use it for comment delimiters.  I think this will work
> for all modes.  It works for C mode and Lisp mode.

For C++ mode, it doesn't quite work:

   foo // comment1
   bar /* comment2 */

The // and /* are put in font-lock-comment-delimiter-face (which I find to
be useless clutter and makes the text less legible without helping
understand the structure), but the */ is left with just
font-lock-comment-face.

In SML mode I see another problem:

   (* comment 1 start
      (* nested comment *)
      comment 1 end *)

The first (* is in f-l-c-d-f, the second isn't.  That's correct.
OTOH depending on how the text is refontified, not only the second *)
but sometimes also the first *) gets the new f-l-c-d-f.

> It would be cleaner, in some ways, to use font-lock-comment-face for
> the delimiters and use font-lock-comment-text-face for the comment
> contents.  The improvement is that this would not involve any change
> in what font-lock-comment-face looks like.  It would just involve
> adding font-lock-comment-text-face and using it.

I don't understand the above.  In what way does the current code change what
font-lock-comment-face looks like?

> However, the method that works in font-lock-fontify-syntactically-region
> for font-lock-comment-delimiter-face does not work when adapted to
> font-lock-comment-text-face.  I can't figure out why,
> but it seems to relate to jit-lock.

Here also, I seem to be missing something.


        Stefan "who dislikes this new gaudier font-locking, again for the
                same reason that it is lexical rather than syntactic
                highlighting"




reply via email to

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