diff options
| author | Richard M. Stallman | 1994-11-28 16:53:54 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-11-28 16:53:54 +0000 |
| commit | caeb79ef07ed5baf1418fd3cc8644ac1bc21b13e (patch) | |
| tree | 809b198cabf79b7630e67da23d40933d293c55db | |
| parent | d390e294f59145e240c96ba8b795e1ef9a65abd9 (diff) | |
| download | emacs-caeb79ef07ed5baf1418fd3cc8644ac1bc21b13e.tar.gz emacs-caeb79ef07ed5baf1418fd3cc8644ac1bc21b13e.zip | |
(calculate-c-indent): Handle a top-level decl with multiple paren groups.
| -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." | |||
| 718 | (looking-at "[^\"\n=(]*(") | 718 | (looking-at "[^\"\n=(]*(") |
| 719 | (progn | 719 | (progn |
| 720 | (goto-char (1- (match-end 0))) | 720 | (goto-char (1- (match-end 0))) |
| 721 | (setq lim (point)) | 721 | ;; Skip any number of paren-groups. |
| 722 | (condition-case nil | 722 | ;; Consider typedef int (*fcn) (int); |
| 723 | (forward-sexp 1) | 723 | (while (= (following-char) ?\() |
| 724 | (error)) | 724 | (setq lim (point)) |
| 725 | (skip-chars-forward " \t\f") | 725 | (condition-case nil |
| 726 | (forward-sexp 1) | ||
| 727 | (error)) | ||
| 728 | (skip-chars-forward " \t\f")) | ||
| 729 | ;; Have we reached something | ||
| 730 | ;; that shows this isn't a function | ||
| 731 | ;; definition? | ||
| 726 | (and (< (point) indent-point) | 732 | (and (< (point) indent-point) |
| 727 | (not (memq (following-char) | 733 | (not (memq (following-char) |
| 728 | '(?\, ?\;))))) | 734 | '(?\, ?\;))))) |