aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/cc-styles.el16
1 files changed, 13 insertions, 3 deletions
diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el
index 08b5fae35f6..5d467e669f7 100644
--- a/lisp/progmodes/cc-styles.el
+++ b/lisp/progmodes/cc-styles.el
@@ -570,14 +570,24 @@ offset for that syntactic element. Optional ADD says to add SYMBOL to
570 ;; variables first to the `cc-mode' style before instituting the new 570 ;; variables first to the `cc-mode' style before instituting the new
571 ;; style. Only do this once! 571 ;; style. Only do this once!
572 (or (assoc "cc-mode" c-style-alist) 572 (or (assoc "cc-mode" c-style-alist)
573 (progn 573 (let (copyfunc)
574 ;; use built-in copy-tree if its there.
575 (if (fboundp 'copy-tree)
576 (setq copyfunc (symbol-function 'copy-tree))
577 (setq copyfunc (lambda (tree)
578 (if (consp tree)
579 (cons (funcall copyfunc (car tree))
580 (funcall copyfunc (cdr tree)))
581 tree))))
574 (c-add-style "cc-mode" 582 (c-add-style "cc-mode"
575 (mapcar 583 (mapcar
576 (function 584 (function
577 (lambda (var) 585 (lambda (var)
578 (let ((val (symbol-value var))) 586 (let ((val (symbol-value var)))
579 (cons var (if (atom val) val 587 (cons var (if (atom val)
580 (copy-sequence val))) 588 val
589 (funcall copyfunc val)
590 ))
581 ))) 591 )))
582 '(c-backslash-column 592 '(c-backslash-column
583 c-basic-offset 593 c-basic-offset