# HG changeset patch # User Alan Mackenzie # Date 1203545908 0 # Node ID 3e4f6980296da30eb8231e9c3d335ba17196822d # Parent 4a375bdd751d3c6ac4fa7d6b76943967c7d53b1f (c-extend-region-for-CPP): always set c-old-EOM. diff -r 4a375bdd751d -r 3e4f6980296d lisp/progmodes/cc-mode.el --- a/lisp/progmodes/cc-mode.el Wed Feb 20 22:16:05 2008 +0000 +++ b/lisp/progmodes/cc-mode.el Wed Feb 20 22:18:28 2008 +0000 @@ -767,8 +767,8 @@ (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 @@ (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