Commit 8220e74c authored by Karl Heuer's avatar Karl Heuer
Browse files


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.
parent dc2b4c5f
......@@ -7,7 +7,7 @@
;; 1985 Richard M. Stallman
;; Maintainer:
;; 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)))
;; 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)))
(c-add-style "cc-mode"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment