emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/progmodes/cc-mode.el,v


From: Alan Mackenzie
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/cc-mode.el,v
Date: Tue, 04 Mar 2008 22:15:40 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Alan Mackenzie <acmacm> 08/03/04 22:15:39

Index: cc-mode.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/cc-mode.el,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -b -r1.68 -r1.69
--- cc-mode.el  1 Mar 2008 01:28:29 -0000       1.68
+++ cc-mode.el  4 Mar 2008 22:15:39 -0000       1.69
@@ -832,7 +832,7 @@
   ;; This function is the C/C++/ObjC value of `c-before-font-lock-function'.
   ;;
   ;; This function might do invisible changes.
-  (c-save-buffer-state (limits mbeg beg end)
+  (c-save-buffer-state (limits mbeg+1 beg end)
     ;; First calculate the region, possibly to be extended.
     (setq beg (min begg c-old-BOM))
     (goto-char endd)
@@ -844,15 +844,14 @@
     (c-clear-char-property-with-value beg end 'syntax-table '(1))
 
     (goto-char beg)
-    ;; If we're inside a string/comment, go to its end.
+    (while (and (< (point) end)
+               (search-forward-regexp c-anchored-cpp-prefix end t))
+      ;; If we've found a "#" inside a string/comment, ignore it.
     (if (setq limits (c-literal-limits))
-       (goto-char (cdr limits)))
-
-    (while (search-forward-regexp c-anchored-cpp-prefix end t)
-      (when (c-beginning-of-macro)    ; Guard against being in a 
string/comment.
-       (setq mbeg (point))
+         (goto-char (cdr limits))
+       (setq mbeg+1 (point))
        (c-end-of-macro)          ; Do we need to go forward 1 char here?  No!
-       (c-neutralize-CPP-line mbeg (point)))))) ; We might still be in a 
comment - this is OK.
+       (c-neutralize-CPP-line mbeg+1 (point))))))
 
 (defun c-before-change (beg end)
   ;; Function to be put on `before-change-function'.  Primarily, this calls




reply via email to

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