Spelling fixes.
[bpt/emacs.git] / lisp / progmodes / cc-mode.el
index 3a5a643..a6bf241 100644 (file)
@@ -93,6 +93,7 @@
 (cc-require 'cc-cmds)
 (cc-require 'cc-align)
 (cc-require 'cc-menus)
+(cc-require 'cc-guess)
 
 ;; Silence the compiler.
 (cc-bytecomp-defvar adaptive-fill-first-line-regexp) ; Emacs
 ;   '
 (require 'cc-fonts) ;)
 
-;; cc-langs isn't loaded when we're byte compiled, so add autoload
-;; directives for the interface functions.
-(autoload 'c-make-init-lang-vars-fun "cc-langs")
-(autoload 'c-init-language-vars "cc-langs" nil nil 'macro)
-
 \f
 ;; Other modes and packages which depend on CC Mode should do the
 ;; following to make sure everything is loaded and available for their
@@ -553,11 +549,7 @@ that requires a literal mode spec at compile time."
   (c-clear-found-types)
 
   ;; now set the mode style based on default-style
-  (let ((style (if (stringp default-style)
-                  default-style
-                (or (cdr (assq mode default-style))
-                    (cdr (assq 'other default-style))
-                    "gnu"))))
+  (let ((style (cc-choose-style-for-mode mode default-style)))
     ;; Override style variables if `c-old-style-variable-behavior' is
     ;; set.  Also override if we are using global style variables,
     ;; have already initialized a style once, and are switching to a
@@ -692,7 +684,8 @@ This function is called from the hook `before-hack-local-variables-hook'."
                   (c-count-cfss file-local-variables-alist))
                  (cfs-in-dir-count (c-count-cfss dir-local-variables-alist)))
              (c-set-style stile
-                          (= cfs-in-file-and-dir-count cfs-in-dir-count)))
+                          (and (= cfs-in-file-and-dir-count cfs-in-dir-count)
+                               'keep-defaults)))
          (c-set-style stile)))
       (when offsets
        (mapc
@@ -1194,6 +1187,7 @@ Key bindings:
        abbrev-mode t)
   (use-local-map c-mode-map)
   (c-init-language-vars-for 'c-mode)
+  (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ;
   (c-common-init 'c-mode)
   (easy-menu-add c-c-menu)
   (cc-imenu-init cc-imenu-c-generic-expression)
@@ -1253,6 +1247,7 @@ Key bindings:
        abbrev-mode t)
   (use-local-map c++-mode-map)
   (c-init-language-vars-for 'c++-mode)
+  (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ;
   (c-common-init 'c++-mode)
   (easy-menu-add c-c++-menu)
   (cc-imenu-init cc-imenu-c++-generic-expression)
@@ -1310,6 +1305,7 @@ Key bindings:
        abbrev-mode t)
   (use-local-map objc-mode-map)
   (c-init-language-vars-for 'objc-mode)
+  (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ;
   (c-common-init 'objc-mode)
   (easy-menu-add c-objc-menu)
   (cc-imenu-init nil 'cc-imenu-objc-function)
@@ -1552,6 +1548,10 @@ initialization, then `awk-mode-hook'.
 
 Key bindings:
 \\{awk-mode-map}"
+  ;; We need the next line to stop the macro defining
+  ;; `awk-mode-syntax-table'.  This would mask the real table which is
+  ;; declared in cc-awk.el and hasn't yet been loaded.
+  :syntax-table nil
   (require 'cc-awk)                    ; Added 2003/6/10.
   (c-initialize-cc-mode t)
   (set-syntax-table awk-mode-syntax-table)