]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/cc-styles.el
2012-01-05 Michael R. Mauger <mmaug@yahoo.com>
[gnu-emacs] / lisp / progmodes / cc-styles.el
index e161eb6d0f507a076ad3f256df386bd4a6548870..96cb15f2a72edda304dbc9de28fb28f975f70f96 100644 (file)
@@ -650,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)