]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/cc-styles.el
(font-lock-comment-face, font-lock-set-defaults, font-lock-string-face):
[gnu-emacs] / lisp / progmodes / cc-styles.el
index 498ccc4d7826ec3748e9fadce9b5062058a242d3..f0a7a2c4b7cff333a74b680aaa4671bfc693e1ce 100644 (file)
@@ -1,6 +1,6 @@
 ;;; cc-styles.el --- support for styles in CC Mode
 
-;; Copyright (C) 1985,1987,1992-2003 Free Software Foundation, Inc.
+;; Copyright (C) 1985,1987,1992-2003, 2004, 2005 Free Software Foundation, Inc.
 
 ;; Authors:    1998- Martin Stjernholm
 ;;             1992-1999 Barry A. Warsaw
@@ -25,8 +25,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
@@ -48,6 +48,7 @@
 
 ;; Silence the compiler.
 (cc-bytecomp-defvar adaptive-fill-first-line-regexp) ; Emacs
+(cc-bytecomp-obsolete-fun make-local-hook) ; Marked obsolete in Emacs 21.1.
 
 \f
 (defvar c-style-alist
@@ -355,6 +356,8 @@ when used elsewhere."
              (completing-read prompt c-style-alist nil t
                               (cons c-indentation-style 0)
                               'c-set-style-history))))))
+  (or (stringp stylename)
+      (error "Argument to c-set-style was not a string"))
   (c-initialize-builtin-style)
   (let ((vars (c-get-style-variables stylename nil)))
     (unless dont-override
@@ -484,13 +487,17 @@ variables."
   ;;
   ;; This function does not do any hidden buffer changes.
 
+  (interactive)
+
   (setq c-current-comment-prefix
        (if (listp c-comment-prefix-regexp)
            (cdr-safe (or (assoc major-mode c-comment-prefix-regexp)
                          (assoc 'other c-comment-prefix-regexp)))
          c-comment-prefix-regexp))
+
   (let ((comment-line-prefix
         (concat "[ \t]*\\(" c-current-comment-prefix "\\)[ \t]*")))
+
     (setq paragraph-start (concat comment-line-prefix
                                  c-paragraph-start
                                  "\\|"
@@ -508,6 +515,7 @@ variables."
                              (default-value 'adaptive-fill-regexp)
                              "\\)")
                    "")))
+
     (when (boundp 'adaptive-fill-first-line-regexp)
       ;; XEmacs (20.x) adaptive fill mode doesn't have this.
       (make-local-variable 'adaptive-fill-first-line-regexp)