]> git.eshelyaron.com Git - emacs.git/commitdiff
Indent statements in macros following "##" correctly.
authorAlan Mackenzie <acm@muc.de>
Sun, 27 Oct 2013 21:24:17 +0000 (21:24 +0000)
committerAlan Mackenzie <acm@muc.de>
Sun, 27 Oct 2013 21:24:17 +0000 (21:24 +0000)
* progmodes/cc-engine.el (c-crosses-statement-barrier-p): Modify
the "#" arm of a cond form to handle "#" and "##" operators.

lisp/ChangeLog
lisp/progmodes/cc-engine.el

index 47d6463e1880ff0fd5b699eec4afbc69678d4056..b9541322ac0cb93c2da1e8fa900195b8f0f518e8 100644 (file)
@@ -1,3 +1,9 @@
+2013-10-27  Alan Mackenzie  <acm@muc.de>
+
+       Indent statements in macros following "##" correctly.
+       * progmodes/cc-engine.el (c-crosses-statement-barrier-p): Modify
+       the "#" arm of a cond form to handle "#" and "##" operators.
+
 2013-10-27  Nathan Trapuzzano  <nbtrap@nbtrap.com>  (tiny change)
 
        * linum.el (linum-update-window): Fix boundary test (bug#13446).
index 8cdb3379f664c938eacb3de37102e15ce2417a10..973ed916694a19199e2cc1bc75d786147fd76b77 100644 (file)
@@ -1261,12 +1261,15 @@ comment at the start of cc-engine.el for more info."
              ;; looking for more : and ?.
              (setq c-maybe-labelp nil
                    skip-chars (substring c-stmt-delim-chars 0 -2)))
-            ;; At a CPP construct?
-            ((and c-opt-cpp-symbol (looking-at c-opt-cpp-symbol)
-                  (save-excursion
-                    (forward-line 0)
-                    (looking-at c-opt-cpp-prefix)))
-             (c-end-of-macro))
+            ;; At a CPP construct or a "#" or "##" operator?
+            ((and c-opt-cpp-symbol (looking-at c-opt-cpp-symbol))
+             (if (save-excursion
+                   (skip-chars-backward " \t")
+                   (and (bolp)
+                        (or (bobp)
+                            (not (eq (char-before (1- (point))) ?\\)))))
+                 (c-end-of-macro)
+               (skip-chars-forward c-opt-cpp-symbol)))
             ((memq (char-after) non-skip-list)
              (throw 'done (point)))))
          ;; In trailing space after an as yet undetected virtual semicolon?