aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1997-10-23 07:32:07 +0000
committerKarl Heuer1997-10-23 07:32:07 +0000
commit8220e74cf278becb547a5cd27e4c076b6fee8a8d (patch)
tree9003fe51da0f52a28b4e2434fb1304982f2a4d4b
parentdc2b4c5f0f7504f96be6f35f7b1fd22194f38415 (diff)
downloademacs-8220e74cf278becb547a5cd27e4c076b6fee8a8d.tar.gz
emacs-8220e74cf278becb547a5cd27e4c076b6fee8a8d.zip
(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.
-rw-r--r--lisp/progmodes/cc-styles.el15
1 files 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 @@
7;; 1985 Richard M. Stallman 7;; 1985 Richard M. Stallman
8;; Maintainer: cc-mode-help@python.org 8;; Maintainer: cc-mode-help@python.org
9;; Created: 22-Apr-1997 (split from cc-mode.el) 9;; Created: 22-Apr-1997 (split from cc-mode.el)
10;; Version: 5.17 10;; Version: 5.18
11;; Keywords: c languages oop 11;; Keywords: c languages oop
12 12
13;; This file is part of GNU Emacs. 13;; This file is part of GNU Emacs.
@@ -571,11 +571,14 @@ offset for that syntactic element. Optional ADD says to add SYMBOL to
571 ;; style. Only do this once! 571 ;; style. Only do this once!
572 (or (assoc "cc-mode" c-style-alist) 572 (or (assoc "cc-mode" c-style-alist)
573 (let (copyfunc) 573 (let (copyfunc)
574 (setq copyfunc (lambda (tree) 574 ;; use built-in copy-tree if its there.
575 (if (consp tree) 575 (if (fboundp 'copy-tree)
576 (cons (funcall copyfunc (car tree)) 576 (setq copyfunc (symbol-function 'copy-tree))
577 (funcall copyfunc (cdr tree))) 577 (setq copyfunc (lambda (tree)
578 tree))) 578 (if (consp tree)
579 (cons (funcall copyfunc (car tree))
580 (funcall copyfunc (cdr tree)))
581 tree))))
579 (c-add-style "cc-mode" 582 (c-add-style "cc-mode"
580 (mapcar 583 (mapcar
581 (function 584 (function