diff options
author | Richard M. Stallman <rms@gnu.org> | 1994-11-28 16:53:54 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1994-11-28 16:53:54 +0000 |
commit | 9e9f82a8e85f74c41e8d2799897b95ff79c31a7f (patch) | |
tree | 61a53884e1e3d83031abcbcbf5acf965326ccf25 /lisp/progmodes/c-mode.el | |
parent | 8b6e34893f58fd9c10d445b90cf47df265713781 (diff) | |
download | emacs-9e9f82a8e85f74c41e8d2799897b95ff79c31a7f.tar.gz |
(calculate-c-indent): Handle a top-level decl with multiple paren groups.
Diffstat (limited to 'lisp/progmodes/c-mode.el')
-rw-r--r-- | lisp/progmodes/c-mode.el | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/progmodes/c-mode.el b/lisp/progmodes/c-mode.el index da04930e12b..114bec7d480 100644 --- a/lisp/progmodes/c-mode.el +++ b/lisp/progmodes/c-mode.el @@ -718,11 +718,17 @@ Returns nil if line starts inside a string, t if in a comment." (looking-at "[^\"\n=(]*(") (progn (goto-char (1- (match-end 0))) - (setq lim (point)) - (condition-case nil - (forward-sexp 1) - (error)) - (skip-chars-forward " \t\f") + ;; Skip any number of paren-groups. + ;; Consider typedef int (*fcn) (int); + (while (= (following-char) ?\() + (setq lim (point)) + (condition-case nil + (forward-sexp 1) + (error)) + (skip-chars-forward " \t\f")) + ;; Have we reached something + ;; that shows this isn't a function + ;; definition? (and (< (point) indent-point) (not (memq (following-char) '(?\, ?\;))))) |