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. That is because comment-end is empty in C++ mode. I see there is a variable comment-end-skip, whose doc string suggests it ought to be useful for this (but the doc string is not entirely clear tome). But it doesn't seem to be set up in C++ mode. Should it be? 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. I don't see how to handle nested comments easily. I don't understand the above. In what way does the current code change what font-lock-comment-face looks like? When I added font-lock-comment-delimiter-face, I copied the definition of font-lock-comment-face into it, then changed the definition o font-lock-comment-face. It would be cleaner to leave font-lock-comment-face unchanged and define font-lock-comment-text-face with the modified value. However, I couldn't make that work. Adapting the code in font-lock-fontify-syntactically-region in a straightforward way resulted in incorrect results, and I don't know why. _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel