aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-09-19 04:30:28 +0000
committerRichard M. Stallman1997-09-19 04:30:28 +0000
commitf4a4c856ec299b6517b47a057fbd86c2d98d57f8 (patch)
tree5a3a25239f6f613719079ad9a496aac167cfc62b
parent03d9b139a3d8cfd20997b01d6f03fe197f709f70 (diff)
downloademacs-f4a4c856ec299b6517b47a057fbd86c2d98d57f8.tar.gz
emacs-f4a4c856ec299b6517b47a057fbd86c2d98d57f8.zip
(c-initialize-builtin-style):
Copy the whole tree instead of just copy-sequence.
-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