diff options
| author | Alan Mackenzie | 2008-01-26 22:26:18 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2008-01-26 22:26:18 +0000 |
| commit | 9bb1a1d66cfef977eab4129895ca7290be40ecfa (patch) | |
| tree | 19350c75e1529c1edb0e55f5676ab71467f41e00 | |
| parent | 00a72a6cb97e26f29157da7ae568c49c394a684d (diff) | |
| download | emacs-9bb1a1d66cfef977eab4129895ca7290be40ecfa.tar.gz emacs-9bb1a1d66cfef977eab4129895ca7290be40ecfa.zip | |
Introduce elements for the syntactic symbol arglist-cont-nonempty into
c-hanging-braces-alist. Amend pertinent functions and 5 styles.
| -rw-r--r-- | lisp/progmodes/cc-cmds.el | 6 | ||||
| -rw-r--r-- | lisp/progmodes/cc-styles.el | 15 | ||||
| -rw-r--r-- | lisp/progmodes/cc-vars.el | 6 |
3 files changed, 19 insertions, 8 deletions
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index e2bc7d55dc9..7afe6e6c243 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el | |||
| @@ -524,7 +524,11 @@ inside a literal or a macro, nothing special happens." | |||
| 524 | ;; This is the list of brace syntactic symbols that can hang. | 524 | ;; This is the list of brace syntactic symbols that can hang. |
| 525 | ;; If any new ones are added to c-offsets-alist, they should be | 525 | ;; If any new ones are added to c-offsets-alist, they should be |
| 526 | ;; added here as well. | 526 | ;; added here as well. |
| 527 | '(class-open class-close defun-open defun-close | 527 | ;; |
| 528 | ;; The order of this list is important; if SYNTAX has several | ||
| 529 | ;; elements, the element that "wins" is the earliest in SYMS. | ||
| 530 | '(arglist-cont-nonempty ; e.g. an array literal. | ||
| 531 | class-open class-close defun-open defun-close | ||
| 528 | inline-open inline-close | 532 | inline-open inline-close |
| 529 | brace-list-open brace-list-close | 533 | brace-list-open brace-list-close |
| 530 | brace-list-intro brace-entry-open | 534 | brace-list-intro brace-entry-open |
diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index 7c80f66e277..02240400b1e 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el | |||
| @@ -58,7 +58,8 @@ | |||
| 58 | '(("gnu" | 58 | '(("gnu" |
| 59 | (c-basic-offset . 2) | 59 | (c-basic-offset . 2) |
| 60 | (c-comment-only-line-offset . (0 . 0)) | 60 | (c-comment-only-line-offset . (0 . 0)) |
| 61 | (c-hanging-braces-alist . ((substatement-open before after))) | 61 | (c-hanging-braces-alist . ((substatement-open before after) |
| 62 | (arglist-cont-nonempty))) | ||
| 62 | (c-offsets-alist . ((statement-block-intro . +) | 63 | (c-offsets-alist . ((statement-block-intro . +) |
| 63 | (knr-argdecl-intro . 5) | 64 | (knr-argdecl-intro . 5) |
| 64 | (substatement-open . +) | 65 | (substatement-open . +) |
| @@ -170,7 +171,8 @@ | |||
| 170 | (case-label . +) | 171 | (case-label . +) |
| 171 | (access-label . -) | 172 | (access-label . -) |
| 172 | (inclass . ++) | 173 | (inclass . ++) |
| 173 | (inline-open . 0)))) | 174 | (inline-open . 0) |
| 175 | (arglist-cont-nonempty)))) | ||
| 174 | 176 | ||
| 175 | ("linux" | 177 | ("linux" |
| 176 | (c-basic-offset . 8) | 178 | (c-basic-offset . 8) |
| @@ -178,7 +180,8 @@ | |||
| 178 | (c-hanging-braces-alist . ((brace-list-open) | 180 | (c-hanging-braces-alist . ((brace-list-open) |
| 179 | (brace-entry-open) | 181 | (brace-entry-open) |
| 180 | (substatement-open after) | 182 | (substatement-open after) |
| 181 | (block-close . c-snug-do-while))) | 183 | (block-close . c-snug-do-while) |
| 184 | (arglist-cont-nonempty))) | ||
| 182 | (c-cleanup-list . (brace-else-brace)) | 185 | (c-cleanup-list . (brace-else-brace)) |
| 183 | (c-offsets-alist . ((statement-block-intro . +) | 186 | (c-offsets-alist . ((statement-block-intro . +) |
| 184 | (knr-argdecl-intro . 0) | 187 | (knr-argdecl-intro . 0) |
| @@ -200,7 +203,8 @@ | |||
| 200 | (brace-list-close) | 203 | (brace-list-close) |
| 201 | (brace-entry-open) | 204 | (brace-entry-open) |
| 202 | (substatement-open after) | 205 | (substatement-open after) |
| 203 | (block-close . c-snug-do-while))) | 206 | (block-close . c-snug-do-while) |
| 207 | (arglist-cont-nonempty))) | ||
| 204 | (c-block-comment-prefix . "")) | 208 | (c-block-comment-prefix . "")) |
| 205 | 209 | ||
| 206 | ("java" | 210 | ("java" |
| @@ -230,7 +234,8 @@ | |||
| 230 | (c-hanging-braces-alist . ((defun-open after) | 234 | (c-hanging-braces-alist . ((defun-open after) |
| 231 | (defun-close . c-snug-1line-defun-close) | 235 | (defun-close . c-snug-1line-defun-close) |
| 232 | (substatement-open after) | 236 | (substatement-open after) |
| 233 | (block-close . c-snug-do-while))) | 237 | (block-close . c-snug-do-while) |
| 238 | (arglist-cont-nonempty))) | ||
| 234 | (c-hanging-semi&comma-criteria . nil) | 239 | (c-hanging-semi&comma-criteria . nil) |
| 235 | (c-cleanup-list . nil) ; You might want one-liner-defun here. | 240 | (c-cleanup-list . nil) ; You might want one-liner-defun here. |
| 236 | (c-offsets-alist . ((statement-block-intro . +) | 241 | (c-offsets-alist . ((statement-block-intro . +) |
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el index 425dddf16a0..f9c891de6c8 100644 --- a/lisp/progmodes/cc-vars.el +++ b/lisp/progmodes/cc-vars.el | |||
| @@ -718,7 +718,8 @@ involve auto-newline inserted newlines: | |||
| 718 | (module-open after) | 718 | (module-open after) |
| 719 | (composition-open after) | 719 | (composition-open after) |
| 720 | (inexpr-class-open after) | 720 | (inexpr-class-open after) |
| 721 | (inexpr-class-close before)) | 721 | (inexpr-class-close before) |
| 722 | (arglist-cont-nonempty)) | ||
| 722 | "*Controls the insertion of newlines before and after braces | 723 | "*Controls the insertion of newlines before and after braces |
| 723 | when the auto-newline feature is active. This variable contains an | 724 | when the auto-newline feature is active. This variable contains an |
| 724 | association list with elements of the following form: | 725 | association list with elements of the following form: |
| @@ -772,7 +773,8 @@ syntactic context for the brace line." | |||
| 772 | namespace-open namespace-close | 773 | namespace-open namespace-close |
| 773 | module-open module-close | 774 | module-open module-close |
| 774 | composition-open composition-close | 775 | composition-open composition-close |
| 775 | inexpr-class-open inexpr-class-close))) | 776 | inexpr-class-open inexpr-class-close |
| 777 | arglist-cont-nonempty))) | ||
| 776 | :group 'c) | 778 | :group 'c) |
| 777 | 779 | ||
| 778 | (defcustom c-max-one-liner-length 80 | 780 | (defcustom c-max-one-liner-length 80 |