]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/cc-styles.el
* lisp/progmodes/cperl-mode.el (cperl-update-syntaxification):
[gnu-emacs] / lisp / progmodes / cc-styles.el
index abc413f4d880351dee743b2efbbc3324121cd900..cf628e44de0df026efa98d3213d33b7c40eec258 100644 (file)
@@ -1,7 +1,6 @@
 ;;; cc-styles.el --- support for styles in CC Mode
 
-;; Copyright (C) 1985, 1987, 1992-2011
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2012  Free Software Foundation, Inc.
 
 ;; Authors:    2004- Alan Mackenzie
 ;;             1998- Martin Stjernholm
@@ -651,6 +650,15 @@ any reason to call this function directly."
       (setq c-style-variables-are-local-p t))
     ))
 
+(defun cc-choose-style-for-mode (mode default-style)
+  "Return suitable style for MODE from DEFAULT-STYLE.
+DEFAULT-STYLE has the same format as `c-default-style'."
+  (if (stringp default-style)
+      default-style
+    (or (cdr (assq mode default-style))
+       (cdr (assq 'other default-style))
+       "gnu")))
+
 
 \f
 (cc-provide 'cc-styles)