]> git.eshelyaron.com Git - emacs.git/commitdiff
(c-initialize-builtin-style):
authorRichard M. Stallman <rms@gnu.org>
Fri, 19 Sep 1997 04:30:28 +0000 (04:30 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 19 Sep 1997 04:30:28 +0000 (04:30 +0000)
Copy the whole tree instead of just copy-sequence.

lisp/progmodes/cc-styles.el

index 08b5fae35f66dc41974bb35bf19bbdb65446fd80..5d467e669f7e76e8e6f13bdda72682503aa5f7f1 100644 (file)
@@ -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