From: Richard M. Stallman Date: Mon, 28 Nov 1994 16:53:54 +0000 (+0000) Subject: (calculate-c-indent): Handle a top-level decl with multiple paren groups. X-Git-Tag: emacs-19.34~5780 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=caeb79ef07ed5baf1418fd3cc8644ac1bc21b13e;p=emacs.git (calculate-c-indent): Handle a top-level decl with multiple paren groups. --- 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) '(?\, ?\;)))))