From: Alan Mackenzie Date: Thu, 29 Apr 2010 14:48:32 +0000 (+0000) Subject: (progmodes/cc-mode.el) c-extend-region-for-CPP: Fix an off-by-one error X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~342 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3d14bb734b6d2c58d042ffe7e62762527e5048ca;p=emacs.git (progmodes/cc-mode.el) c-extend-region-for-CPP: Fix an off-by-one error (in end of macro position). --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b1964d3a673..d752fd3fb69 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-04-29 Alan Mackenzie + + * 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 * net/browse-url.el (browse-url-firefox-program): Use iceweasel if diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 7f9ed6436f4..ed17e6f34e6 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -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)