]> git.eshelyaron.com Git - emacs.git/commitdiff
(c-extend-region-for-CPP): always set c-old-EOM.
authorAlan Mackenzie <acm@muc.de>
Wed, 20 Feb 2008 22:18:28 +0000 (22:18 +0000)
committerAlan Mackenzie <acm@muc.de>
Wed, 20 Feb 2008 22:18:28 +0000 (22:18 +0000)
lisp/progmodes/cc-mode.el

index 6f184a399f9795275792752ca1a6a6716fa38b82..9a1a66010b14aa89ea26f384785b5584f90c6eb1 100644 (file)
@@ -767,8 +767,8 @@ Note that the style variables are always made local to the buffer."
 (make-variable-buffer-local 'c-old-EOM)
 
 (defun c-extend-region-for-CPP (beg end)
-  ;; If either BEG or END is inside a preprocessor (logical) line, set
-  ;; c-old-BOM or c-ole-EOM respectively to the beginning/end of the line.
+  ;; Set c-old-BOM or c-old-EOM respectively to BEG, END, each extended to the
+  ;; beginning/end of any preprocessor construct they may be in.
   ;;
   ;; Point is undefined both before and after this function call; the buffer
   ;; has already been widened, and match-data saved.  The return value is
@@ -782,9 +782,9 @@ Note that the style variables are always made local to the buffer."
   (setq c-old-BOM (point))
 
   (goto-char end)
-  (when (c-beginning-of-macro)
-    (c-end-of-macro)
-    (setq c-old-EOM (point))))
+  (if (c-beginning-of-macro)
+    (c-end-of-macro))
+  (setq c-old-EOM (point)))
 
 (defun c-neutralize-CPP-line (beg end)
   ;; BEG and END bound a preprocessor line.  Put a "punctuation" syntax-table