diff options
author | Richard M. Stallman <rms@gnu.org> | 1997-09-19 04:30:28 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1997-09-19 04:30:28 +0000 |
commit | 9cb3c2e565414869c8f80dba90e271bf984371d9 (patch) | |
tree | cf3d078afb568b835c84166cebf22e54538eccf2 | |
parent | 1c840db0a0ef1dd5c0ff336a7f21ace322056b5a (diff) | |
download | emacs-9cb3c2e565414869c8f80dba90e271bf984371d9.tar.gz |
(c-initialize-builtin-style):
Copy the whole tree instead of just copy-sequence.
-rw-r--r-- | lisp/progmodes/cc-styles.el | 16 |
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 ;; variables first to the `cc-mode' style before instituting the new ;; style. Only do this once! (or (assoc "cc-mode" c-style-alist) - (progn + (let (copyfunc) + ;; use built-in copy-tree if its there. + (if (fboundp 'copy-tree) + (setq copyfunc (symbol-function 'copy-tree)) + (setq copyfunc (lambda (tree) + (if (consp tree) + (cons (funcall copyfunc (car tree)) + (funcall copyfunc (cdr tree))) + tree)))) (c-add-style "cc-mode" (mapcar (function (lambda (var) (let ((val (symbol-value var))) - (cons var (if (atom val) val - (copy-sequence val))) + (cons var (if (atom val) + val + (funcall copyfunc val) + )) ))) '(c-backslash-column c-basic-offset |