From 8220e74cf278becb547a5cd27e4c076b6fee8a8d Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Thu, 23 Oct 1997 07:32:07 +0000 Subject: [PATCH] (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. --- lisp/progmodes/cc-styles.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index cbe89033b1c..4adb0ac3870 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el @@ -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 -- 2.39.2