changeset 79936:996fec9cb719

Introduce elements for the syntactic symbol arglist-cont-nonempty into c-hanging-braces-alist. Amend pertinent functions and 5 styles.
author Alan Mackenzie <acm@muc.de>
date Sat, 26 Jan 2008 22:26:18 +0000
parents cfe1f3b29423
children c8e7c8ab6ded
files lisp/progmodes/cc-cmds.el lisp/progmodes/cc-styles.el lisp/progmodes/cc-vars.el
diffstat 3 files changed, 19 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/cc-cmds.el	Sat Jan 26 22:14:34 2008 +0000
+++ b/lisp/progmodes/cc-cmds.el	Sat Jan 26 22:26:18 2008 +0000
@@ -524,7 +524,11 @@
 	;; This is the list of brace syntactic symbols that can hang.
 	;; If any new ones are added to c-offsets-alist, they should be
 	;; added here as well.
-	'(class-open class-close defun-open defun-close
+	;; 
+	;; The order of this list is important; if SYNTAX has several
+	;; elements, the element that "wins" is the earliest in SYMS.
+	'(arglist-cont-nonempty		; e.g. an array literal.
+		     class-open class-close defun-open defun-close
 		     inline-open inline-close
 		     brace-list-open brace-list-close
 		     brace-list-intro brace-entry-open
--- a/lisp/progmodes/cc-styles.el	Sat Jan 26 22:14:34 2008 +0000
+++ b/lisp/progmodes/cc-styles.el	Sat Jan 26 22:26:18 2008 +0000
@@ -58,7 +58,8 @@
   '(("gnu"
      (c-basic-offset . 2)
      (c-comment-only-line-offset . (0 . 0))
-     (c-hanging-braces-alist     . ((substatement-open before after)))
+     (c-hanging-braces-alist     . ((substatement-open before after)
+				    (arglist-cont-nonempty)))
      (c-offsets-alist . ((statement-block-intro . +)
 			 (knr-argdecl-intro . 5)
 			 (substatement-open . +)
@@ -170,7 +171,8 @@
                          (case-label           . +)
                          (access-label         . -)
                          (inclass              . ++)
-			 (inline-open          . 0))))
+			 (inline-open          . 0)
+			 (arglist-cont-nonempty))))
 
     ("linux"
      (c-basic-offset  . 8)
@@ -178,7 +180,8 @@
      (c-hanging-braces-alist . ((brace-list-open)
 				(brace-entry-open)
 				(substatement-open after)
-				(block-close . c-snug-do-while)))
+				(block-close . c-snug-do-while)
+				(arglist-cont-nonempty)))
      (c-cleanup-list . (brace-else-brace))
      (c-offsets-alist . ((statement-block-intro . +)
 			 (knr-argdecl-intro     . 0)
@@ -200,7 +203,8 @@
 				(brace-list-close)
 				(brace-entry-open)
 				(substatement-open after)
-				(block-close . c-snug-do-while)))
+				(block-close . c-snug-do-while)
+				(arglist-cont-nonempty)))
      (c-block-comment-prefix . ""))
 
     ("java"
@@ -230,7 +234,8 @@
      (c-hanging-braces-alist . ((defun-open after)
 				(defun-close . c-snug-1line-defun-close)
 				(substatement-open after)
-				(block-close . c-snug-do-while)))
+				(block-close . c-snug-do-while)
+				(arglist-cont-nonempty)))
      (c-hanging-semi&comma-criteria . nil)
      (c-cleanup-list . nil)		; You might want one-liner-defun here.
      (c-offsets-alist . ((statement-block-intro . +)
--- a/lisp/progmodes/cc-vars.el	Sat Jan 26 22:14:34 2008 +0000
+++ b/lisp/progmodes/cc-vars.el	Sat Jan 26 22:26:18 2008 +0000
@@ -718,7 +718,8 @@
 					       (module-open after)
 					       (composition-open after)
 					       (inexpr-class-open after)
-					       (inexpr-class-close before))
+					       (inexpr-class-close before)
+					       (arglist-cont-nonempty))
   "*Controls the insertion of newlines before and after braces
 when the auto-newline feature is active.  This variable contains an
 association list with elements of the following form:
@@ -772,7 +773,8 @@
 	      namespace-open namespace-close
 	      module-open module-close
 	      composition-open composition-close
-	      inexpr-class-open inexpr-class-close)))
+	      inexpr-class-open inexpr-class-close
+	      arglist-cont-nonempty)))
     :group 'c)
 
 (defcustom c-max-one-liner-length 80