]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/cc-styles.el
(which-function): Be robust in the face of an
[gnu-emacs] / lisp / progmodes / cc-styles.el
index 498ccc4d7826ec3748e9fadce9b5062058a242d3..1a26e54bf06996306be9e3f49406bfd1a66b0170 100644 (file)
@@ -355,6 +355,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 +486,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 +514,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)