changeset 20136:d8732d6e6aeb

(c-initialize-builtin-style): 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.
author Karl Heuer <kwzh@gnu.org>
date Thu, 23 Oct 1997 07:32:07 +0000
parents ecb78a6ccd8d
children 8e6a173fcd9f
files lisp/progmodes/cc-styles.el
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/cc-styles.el	Thu Oct 23 07:31:46 1997 +0000
+++ b/lisp/progmodes/cc-styles.el	Thu Oct 23 07:32:07 1997 +0000
@@ -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 @@
   ;; 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