> Put the following in a fubar.cpp:

> class Fubar :
> public Foo,   // Foo fontified as a type, at first
> public Bar    // Bar fontified as a type, at first
> {
> Foo bar(Snafu snafu,  // Types, function, variable fontified, at first
> Foo foo,
> Bar bar);
> Foo bar(Snafu *snafu, // Types, function, variable fontified, at first
> Foo foo,
> Bar bar);
> };

> Then emacs -Q fubar.cpp.  I see Foo, Bar and Snafu fontified as types
> even where declaring functions and variables.  The corresponding
> functions and variables are fontified correctly.  This is great!

> Then do the following.

> 1.  Append a space to the first (or second) commented line.  Bug:
> fontification of Foo (or Bar) is removed from that line.

> 2.  Append a space to the third commented line.  Bug: fontification of Foo
> and bar is removed from that line.

> 3.  Append a space to the fourth commented line.  Bug: fontification of Foo,
> bar, Snafu and snafu is removed from that line.

The patch below seems to fix number 2 and 3 for me.  Someone who understands
cc-fonts.el better than me and thus knows where the two "public XXX" lines
are handled could probably do a similar adjustment for them.


        Stefan


--- orig/lisp/progmodes/cc-fonts.el
+++ mod/lisp/progmodes/cc-fonts.el
@@ -1111,6 +1111,10 @@
                ;; False alarm.  Return t to go on to the next check.
                t
 
+              (let ((beg (max (1- match-pos) (point-min))))
+                (if (< beg (line-beginning-position))
+                    (put-text-property beg (point) 'font-lock-multiline t)))
+
              (if (eq decl-or-cast 'cast)
                  ;; Save the position after the previous cast so we can feed
                  ;; it to `c-forward-decl-or-cast-1' in the next round.  That


_______________________________________________
emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Reply via email to