Commit 1df1040b authored by Chong Yidong's avatar Chong Yidong
Browse files

Fix 2011-01-31 change; patch supplied by acm was applied incorrectly.

* lisp/progmodes/cc-cmds.el (c-beginning-of-statement): Fix 2011-01-31
change; patch supplied by Alan Mackenzie was applied incorrectly.
parent c6678f29
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
2011-03-07 Chong Yidong <cyd@stupidchicken.com> 2011-03-07 Chong Yidong <cyd@stupidchicken.com>
* progmodes/cc-cmds.el (c-beginning-of-statement): Revert * progmodes/cc-cmds.el (c-beginning-of-statement): Fix 2011-01-31
2011-01-31 change. change; patch supplied by Alan Mackenzie was applied incorrectly.
2011-02-26 Eli Zaretskii <eliz@gnu.org> 2011-02-26 Eli Zaretskii <eliz@gnu.org>
......
...@@ -2458,13 +2458,15 @@ function does not require the declaration to contain a brace block." ...@@ -2458,13 +2458,15 @@ function does not require the declaration to contain a brace block."
(goto-char last) (goto-char last)
(throw 'done '(nil . nil))) (throw 'done '(nil . nil)))
;; Stop if we encounter a preprocessor line. ;; Stop if we encounter a preprocessor line. Continue if we
((and (not macro-end) ;; hit a naked #
((and c-opt-cpp-prefix
(not macro-end)
(eq (char-after) ?#) (eq (char-after) ?#)
(= (point) (c-point 'boi))) (= (point) (c-point 'boi)))
(goto-char last) (if (= (point) here) ; Not a macro, therefore naked #.
;(throw 'done (cons (eq (point) here) 'macro-boundary))) ; Changed 2003/3/26 (forward-char)
(throw 'done '(t . macro-boundary))) (throw 'done '(t . macro-boundary))))
;; Stop after a ';', '}', or "};" ;; Stop after a ';', '}', or "};"
((looking-at ";\\|};?") ((looking-at ";\\|};?")
...@@ -2663,14 +2665,19 @@ sentence motion in or near comments and multiline strings." ...@@ -2663,14 +2665,19 @@ sentence motion in or near comments and multiline strings."
;; Are we about to move forward into or out of a ;; Are we about to move forward into or out of a
;; preprocessor command? ;; preprocessor command?
(when (eq (cdr res) 'macro-boundary) (when (eq (cdr res) 'macro-boundary)
(save-excursion (setq macro-fence
(end-of-line) (save-excursion
(setq macro-fence (if macro-fence
(and (not (eobp)) (progn
(progn (c-skip-ws-forward) (end-of-line)
(c-beginning-of-macro)) (and (not (eobp))
(progn (c-end-of-macro) (progn (c-skip-ws-forward)
(point)))))) (c-beginning-of-macro))
(progn (c-end-of-macro)
(point))))
(and (not (eobp))
(c-beginning-of-macro)
(progn (c-end-of-macro) (point)))))))
;; Are we about to move forward into a literal? ;; Are we about to move forward into a literal?
(when (memq (cdr res) '(macro-boundary literal)) (when (memq (cdr res) '(macro-boundary literal))
(setq range (c-ascertain-following-literal))) (setq range (c-ascertain-following-literal)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment