diff options
| author | Martin Stjernholm | 2003-09-24 13:55:23 +0000 |
|---|---|---|
| committer | Martin Stjernholm | 2003-09-24 13:55:23 +0000 |
| commit | 449a2b0d2eb2d9d65ca5d1a5e6d6e5b9ebd963ed (patch) | |
| tree | 29fa4e625c4f1c354d5b6e78aab4b7b23f5d9711 | |
| parent | d858963e6b6f92dc3099eff3752fdcb4efcf1ea1 (diff) | |
| download | emacs-449a2b0d2eb2d9d65ca5d1a5e6d6e5b9ebd963ed.tar.gz emacs-449a2b0d2eb2d9d65ca5d1a5e6d6e5b9ebd963ed.zip | |
(c-parse-state): Fixed bug that could cause errors when the state
cache contains info on parts that have been narrowed out.
(c-forward-keyword-clause): Fixed error handling. This bug could
cause interactive font locking to bail out.
(c-just-after-func-arglist-p): Handle paren-style types in Pike. Also
fixed some cases of insufficient handling of unbalanced parens.
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 0abb5121d5b..51e58c76ba1 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -1740,10 +1740,10 @@ This function does not do any hidden buffer changes." | |||
| 1740 | ;; If point-min has moved forward then we just need to cut | 1740 | ;; If point-min has moved forward then we just need to cut |
| 1741 | ;; off a bit of the tail. | 1741 | ;; off a bit of the tail. |
| 1742 | (let ((ptr (cons nil c-state-cache)) elem) | 1742 | (let ((ptr (cons nil c-state-cache)) elem) |
| 1743 | (while (and (setq elem (cdr ptr)) | 1743 | (while (and (setq elem (car-safe (cdr ptr))) |
| 1744 | (>= (if (consp elem) (car elem) elem) | 1744 | (>= (if (consp elem) (car elem) elem) |
| 1745 | (point-min))) | 1745 | (point-min))) |
| 1746 | (setq ptr elem)) | 1746 | (setq ptr (cdr ptr))) |
| 1747 | (when (consp ptr) | 1747 | (when (consp ptr) |
| 1748 | (if (eq (cdr ptr) c-state-cache) | 1748 | (if (eq (cdr ptr) c-state-cache) |
| 1749 | (setq c-state-cache nil) | 1749 | (setq c-state-cache nil) |
| @@ -3499,8 +3499,8 @@ This function does not do any hidden buffer changes." | |||
| 3499 | (setq safe-pos (point))) | 3499 | (setq safe-pos (point))) |
| 3500 | 3500 | ||
| 3501 | ((and (c-keyword-member kwd-sym 'c-nonsymbol-sexp-kwds) | 3501 | ((and (c-keyword-member kwd-sym 'c-nonsymbol-sexp-kwds) |
| 3502 | (not (looking-at c-symbol-start))) | 3502 | (not (looking-at c-symbol-start)) |
| 3503 | (c-forward-sexp) | 3503 | (c-safe (c-forward-sexp) t)) |
| 3504 | (c-forward-syntactic-ws) | 3504 | (c-forward-syntactic-ws) |
| 3505 | (setq safe-pos (point)))) | 3505 | (setq safe-pos (point)))) |
| 3506 | 3506 | ||
| @@ -4251,7 +4251,7 @@ brace." | |||
| 4251 | (c-search-uplist-for-classkey paren-state)))) | 4251 | (c-search-uplist-for-classkey paren-state)))) |
| 4252 | 4252 | ||
| 4253 | (defun c-just-after-func-arglist-p (&optional lim) | 4253 | (defun c-just-after-func-arglist-p (&optional lim) |
| 4254 | ;; Return t if we are between a function's argument list closing | 4254 | ;; Return non-nil if we are between a function's argument list closing |
| 4255 | ;; paren and its opening brace. Note that the list close brace | 4255 | ;; paren and its opening brace. Note that the list close brace |
| 4256 | ;; could be followed by a "const" specifier or a member init hanging | 4256 | ;; could be followed by a "const" specifier or a member init hanging |
| 4257 | ;; colon. LIM is used as bound for some backward buffer searches; | 4257 | ;; colon. LIM is used as bound for some backward buffer searches; |
| @@ -4299,20 +4299,25 @@ brace." | |||
| 4299 | (or (not (c-beginning-of-macro)) | 4299 | (or (not (c-beginning-of-macro)) |
| 4300 | (and (c-forward-to-cpp-define-body) | 4300 | (and (c-forward-to-cpp-define-body) |
| 4301 | (< (point) checkpoint))) | 4301 | (< (point) checkpoint))) |
| 4302 | ;; check if we are looking at an ObjC method def | 4302 | ;; Check if we are looking at an ObjC method def or a class |
| 4303 | (or (not c-opt-method-key) | 4303 | ;; category. |
| 4304 | (progn | 4304 | (not (and c-opt-method-key |
| 4305 | (goto-char checkpoint) | 4305 | (progn |
| 4306 | (c-forward-sexp -1) | 4306 | (goto-char checkpoint) |
| 4307 | (forward-char -1) | 4307 | (c-safe (c-backward-sexp) t)) |
| 4308 | (c-backward-syntactic-ws lim) | 4308 | (progn |
| 4309 | (not (or (memq (char-before) '(?- ?+)) | 4309 | (c-backward-syntactic-ws lim) |
| 4310 | ;; or a class category | 4310 | (or (memq (char-before) '(?- ?+)) |
| 4311 | (progn | 4311 | (and (c-safe (c-forward-sexp -2) t) |
| 4312 | (c-forward-sexp -2) | 4312 | (looking-at c-class-key)))))) |
| 4313 | (looking-at c-class-key)) | 4313 | ;; Pike has compound types that include parens, |
| 4314 | ))))) | 4314 | ;; e.g. "array(string)". Check that we aren't after one. |
| 4315 | ))) | 4315 | (not (and (c-major-mode-is 'pike-mode) |
| 4316 | (progn | ||
| 4317 | (goto-char checkpoint) | ||
| 4318 | (c-safe (c-backward-sexp 2) t)) | ||
| 4319 | (looking-at c-primitive-type-key))) | ||
| 4320 | )))) | ||
| 4316 | 4321 | ||
| 4317 | (defun c-in-knr-argdecl (&optional lim) | 4322 | (defun c-in-knr-argdecl (&optional lim) |
| 4318 | ;; Return the position of the first argument declaration if point is | 4323 | ;; Return the position of the first argument declaration if point is |