]> git.eshelyaron.com Git - emacs.git/commitdiff
(c-initialize-builtin-style):
authorKarl Heuer <kwzh@gnu.org>
Thu, 23 Oct 1997 07:32:07 +0000 (07:32 +0000)
committerKarl Heuer <kwzh@gnu.org>
Thu, 23 Oct 1997 07:32:07 +0000 (07:32 +0000)
Use existing copy-tree if it's defined.

copy-sequence doesn't work; the
c-offsets-alist must be copied recursively.  Use copy-tree solution
given by Simon Marshall.

lisp/progmodes/cc-styles.el

index cbe89033b1cd46b3418e6166a166579e905b9c91..4adb0ac38708f8f71a43f68cf567ad916aa3ad8e 100644 (file)
@@ -7,7 +7,7 @@
 ;;             1985 Richard M. Stallman
 ;; Maintainer: cc-mode-help@python.org
 ;; Created:    22-Apr-1997 (split from cc-mode.el)
-;; Version:    5.17
+;; Version:    5.18
 ;; Keywords:   c languages oop
 
 ;; This file is part of GNU Emacs.
@@ -571,11 +571,14 @@ offset for that syntactic element.  Optional ADD says to add SYMBOL to
   ;; style.  Only do this once!
   (or (assoc "cc-mode" c-style-alist)
       (let (copyfunc)
-       (setq copyfunc (lambda (tree)
-                        (if (consp tree)
-                            (cons (funcall copyfunc (car tree))
-                                  (funcall copyfunc (cdr tree)))
-                          tree)))
+       ;; 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