]> git.eshelyaron.com Git - emacs.git/commitdiff
(calculate-c-indent): Handle a top-level decl with multiple paren groups.
authorRichard M. Stallman <rms@gnu.org>
Mon, 28 Nov 1994 16:53:54 +0000 (16:53 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 28 Nov 1994 16:53:54 +0000 (16:53 +0000)
lisp/progmodes/c-mode.el

index da04930e12bb62c024859f79f04c3f554fa295b6..114bec7d480cd36a92dd87dd818723d1eb6fed3b 100644 (file)
@@ -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)
                                                       '(?\, ?\;)))))