aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorChong Yidong2011-01-31 18:54:50 -0500
committerChong Yidong2011-01-31 18:54:50 -0500
commit14beddf4711854b01d400f36166dc71eb39435bb (patch)
tree04fd96bb0f5dcf5f3aa4e9f39a537edc61038f83 /lisp/progmodes
parent2a4466ca2001c29fd654420b081b780981333dc5 (diff)
parent113ef437f21c6ea1b65abe668feb86f1622a9f2e (diff)
downloademacs-14beddf4711854b01d400f36166dc71eb39435bb.tar.gz
emacs-14beddf4711854b01d400f36166dc71eb39435bb.zip
Merge changes from emacs-23 branch
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/cc-cmds.el33
-rw-r--r--lisp/progmodes/cc-engine.el13
2 files changed, 33 insertions, 13 deletions
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 327ebea40cc..ec913e05c7e 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -2440,13 +2440,15 @@ function does not require the declaration to contain a brace block."
2440 (goto-char last) 2440 (goto-char last)
2441 (throw 'done '(nil . nil))) 2441 (throw 'done '(nil . nil)))
2442 2442
2443 ;; Stop if we encounter a preprocessor line. 2443 ;; Stop if we encounter a preprocessor line. Continue if we
2444 ((and (not macro-end) 2444 ;; hit a naked #
2445 ((and c-opt-cpp-prefix
2446 (not macro-end)
2445 (eq (char-after) ?#) 2447 (eq (char-after) ?#)
2446 (= (point) (c-point 'boi))) 2448 (= (point) (c-point 'boi)))
2447 (goto-char last) 2449 (if (= (point) here) ; Not a macro, therefore naked #.
2448 ;(throw 'done (cons (eq (point) here) 'macro-boundary))) ; Changed 2003/3/26 2450 (forward-char)
2449 (throw 'done '(t . macro-boundary))) 2451 (throw 'done '(t . macro-boundary))))
2450 2452
2451 ;; Stop after a ';', '}', or "};" 2453 ;; Stop after a ';', '}', or "};"
2452 ((looking-at ";\\|};?") 2454 ((looking-at ";\\|};?")
@@ -2560,14 +2562,21 @@ be more \"DWIM:ey\"."
2560 (c-backward-syntactic-ws)) 2562 (c-backward-syntactic-ws))
2561 (or (bobp) (c-after-statement-terminator-p))))))) 2563 (or (bobp) (c-after-statement-terminator-p)))))))
2562 ;; Are we about to move backwards into or out of a 2564 ;; Are we about to move backwards into or out of a
2563 ;; preprocessor command? If so, locate it's beginning. 2565 ;; preprocessor command? If so, locate its beginning.
2564 (when (eq (cdr res) 'macro-boundary) 2566 (when (eq (cdr res) 'macro-boundary)
2565 (save-excursion 2567 (setq macro-fence
2566 (beginning-of-line) 2568 (save-excursion
2567 (setq macro-fence 2569 (if macro-fence
2568 (and (not (bobp)) 2570 (progn
2569 (progn (c-skip-ws-backward) (c-beginning-of-macro)) 2571 (end-of-line)
2570 (point))))) 2572 (and (not (eobp))
2573 (progn (c-skip-ws-forward)
2574 (c-beginning-of-macro))
2575 (progn (c-end-of-macro)
2576 (point))))
2577 (and (not (eobp))
2578 (c-beginning-of-macro)
2579 (progn (c-end-of-macro) (point)))))))
2571 ;; Are we about to move backwards into a literal? 2580 ;; Are we about to move backwards into a literal?
2572 (when (memq (cdr res) '(macro-boundary literal)) 2581 (when (memq (cdr res) '(macro-boundary literal))
2573 (setq range (c-ascertain-preceding-literal))) 2582 (setq range (c-ascertain-preceding-literal)))
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 406ee1a91d9..f90d29bf009 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -5371,6 +5371,8 @@ comment at the start of cc-engine.el for more info."
5371;; cc-mode requires cc-fonts. 5371;; cc-mode requires cc-fonts.
5372(declare-function c-fontify-recorded-types-and-refs "cc-fonts" ()) 5372(declare-function c-fontify-recorded-types-and-refs "cc-fonts" ())
5373 5373
5374(defvar c-forward-<>-arglist-recur-depth)
5375
5374(defun c-forward-<>-arglist (all-types) 5376(defun c-forward-<>-arglist (all-types)
5375 ;; The point is assumed to be at a "<". Try to treat it as the open 5377 ;; The point is assumed to be at a "<". Try to treat it as the open
5376 ;; paren of an angle bracket arglist and move forward to the 5378 ;; paren of an angle bracket arglist and move forward to the
@@ -5396,7 +5398,8 @@ comment at the start of cc-engine.el for more info."
5396 ;; If `c-record-type-identifiers' is set then activate 5398 ;; If `c-record-type-identifiers' is set then activate
5397 ;; recording of any found types that constitute an argument in 5399 ;; recording of any found types that constitute an argument in
5398 ;; the arglist. 5400 ;; the arglist.
5399 (c-record-found-types (if c-record-type-identifiers t))) 5401 (c-record-found-types (if c-record-type-identifiers t))
5402 (c-forward-<>-arglist-recur--depth 0))
5400 (if (catch 'angle-bracket-arglist-escape 5403 (if (catch 'angle-bracket-arglist-escape
5401 (setq c-record-found-types 5404 (setq c-record-found-types
5402 (c-forward-<>-arglist-recur all-types))) 5405 (c-forward-<>-arglist-recur all-types)))
@@ -5413,6 +5416,14 @@ comment at the start of cc-engine.el for more info."
5413 nil))) 5416 nil)))
5414 5417
5415(defun c-forward-<>-arglist-recur (all-types) 5418(defun c-forward-<>-arglist-recur (all-types)
5419
5420 ;; Temporary workaround for Bug#7722.
5421 (when (boundp 'c-forward-<>-arglist-recur--depth)
5422 (if (> c-forward-<>-arglist-recur--depth 200)
5423 (error "Max recursion depth reached in <> arglist")
5424 (setq c-forward-<>-arglist-recur--depth
5425 (1+ c-forward-<>-arglist-recur--depth))))
5426
5416 ;; Recursive part of `c-forward-<>-arglist'. 5427 ;; Recursive part of `c-forward-<>-arglist'.
5417 ;; 5428 ;;
5418 ;; This function might do hidden buffer changes. 5429 ;; This function might do hidden buffer changes.