(progmodes/cc-mode.el) c-extend-region-for-CPP: Fix an off-by-one error
authorAlan Mackenzie <acm@muc.de>
Thu, 29 Apr 2010 14:48:32 +0000 (14:48 +0000)
committerAlan Mackenzie <acm@muc.de>
Thu, 29 Apr 2010 14:48:32 +0000 (14:48 +0000)
(in end of macro position).

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

index b1964d3..d752fd3 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-29  Alan Mackenzie  <acm@muc.de>
+
+       * progmodes/cc-mode.el (c-extend-region-for-CPP): Fix an
+       off-by-one error (in end of macro position).
+
 2010-04-29  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * net/browse-url.el (browse-url-firefox-program): Use iceweasel if
index 7f9ed64..ed17e6f 100644 (file)
@@ -818,8 +818,10 @@ Note that the style variables are always made local to the buffer."
   (setq c-old-BOM (point))
 
   (goto-char end)
-  (if (c-beginning-of-macro)
-    (c-end-of-macro))
+  (when (c-beginning-of-macro)
+    (c-end-of-macro)
+    (or (eobp) (forward-char)))         ; Over the terminating NL which may be marked
+                                ; with a c-cpp-delimiter category property
   (setq c-old-EOM (point)))
 
 (defun c-neutralize-CPP-line (beg end)