diff options
| author | Kenichi Handa | 2011-02-02 11:16:53 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2011-02-02 11:16:53 +0900 |
| commit | 15d73a19fc9f52899e803625dc31cbc90c13fba0 (patch) | |
| tree | 575d0fb929a1b242869c6149de9887159cc9d4ec /lisp/progmodes | |
| parent | ea2460a0d88ffbc96a8897d754d6cdd08e117ed6 (diff) | |
| parent | 29feb0e9b580626b79a990cf9dbd1577c354dc46 (diff) | |
| download | emacs-15d73a19fc9f52899e803625dc31cbc90c13fba0.tar.gz emacs-15d73a19fc9f52899e803625dc31cbc90c13fba0.zip | |
merge emacs-23
Diffstat (limited to 'lisp/progmodes')
| -rw-r--r-- | lisp/progmodes/cc-cmds.el | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 241fb0cf04f..3f719aedb62 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el | |||
| @@ -2458,13 +2458,15 @@ function does not require the declaration to contain a brace block." | |||
| 2458 | (goto-char last) | 2458 | (goto-char last) |
| 2459 | (throw 'done '(nil . nil))) | 2459 | (throw 'done '(nil . nil))) |
| 2460 | 2460 | ||
| 2461 | ;; Stop if we encounter a preprocessor line. | 2461 | ;; Stop if we encounter a preprocessor line. Continue if we |
| 2462 | ((and (not macro-end) | 2462 | ;; hit a naked # |
| 2463 | ((and c-opt-cpp-prefix | ||
| 2464 | (not macro-end) | ||
| 2463 | (eq (char-after) ?#) | 2465 | (eq (char-after) ?#) |
| 2464 | (= (point) (c-point 'boi))) | 2466 | (= (point) (c-point 'boi))) |
| 2465 | (goto-char last) | 2467 | (if (= (point) here) ; Not a macro, therefore naked #. |
| 2466 | ;(throw 'done (cons (eq (point) here) 'macro-boundary))) ; Changed 2003/3/26 | 2468 | (forward-char) |
| 2467 | (throw 'done '(t . macro-boundary))) | 2469 | (throw 'done '(t . macro-boundary)))) |
| 2468 | 2470 | ||
| 2469 | ;; Stop after a ';', '}', or "};" | 2471 | ;; Stop after a ';', '}', or "};" |
| 2470 | ((looking-at ";\\|};?") | 2472 | ((looking-at ";\\|};?") |
| @@ -2578,14 +2580,21 @@ be more \"DWIM:ey\"." | |||
| 2578 | (c-backward-syntactic-ws)) | 2580 | (c-backward-syntactic-ws)) |
| 2579 | (or (bobp) (c-after-statement-terminator-p))))))) | 2581 | (or (bobp) (c-after-statement-terminator-p))))))) |
| 2580 | ;; Are we about to move backwards into or out of a | 2582 | ;; Are we about to move backwards into or out of a |
| 2581 | ;; preprocessor command? If so, locate it's beginning. | 2583 | ;; preprocessor command? If so, locate its beginning. |
| 2582 | (when (eq (cdr res) 'macro-boundary) | 2584 | (when (eq (cdr res) 'macro-boundary) |
| 2583 | (save-excursion | 2585 | (setq macro-fence |
| 2584 | (beginning-of-line) | 2586 | (save-excursion |
| 2585 | (setq macro-fence | 2587 | (if macro-fence |
| 2586 | (and (not (bobp)) | 2588 | (progn |
| 2587 | (progn (c-skip-ws-backward) (c-beginning-of-macro)) | 2589 | (end-of-line) |
| 2588 | (point))))) | 2590 | (and (not (eobp)) |
| 2591 | (progn (c-skip-ws-forward) | ||
| 2592 | (c-beginning-of-macro)) | ||
| 2593 | (progn (c-end-of-macro) | ||
| 2594 | (point)))) | ||
| 2595 | (and (not (eobp)) | ||
| 2596 | (c-beginning-of-macro) | ||
| 2597 | (progn (c-end-of-macro) (point))))))) | ||
| 2589 | ;; Are we about to move backwards into a literal? | 2598 | ;; Are we about to move backwards into a literal? |
| 2590 | (when (memq (cdr res) '(macro-boundary literal)) | 2599 | (when (memq (cdr res) '(macro-boundary literal)) |
| 2591 | (setq range (c-ascertain-preceding-literal))) | 2600 | (setq range (c-ascertain-preceding-literal))) |