Mercurial > hg > xemacs-beta
diff lisp/cc-mode/cc-styles.el @ 189:489f57a838ef r20-3b21
Import from CVS: tag r20-3b21
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:57:07 +0200 |
parents | b405438285a2 |
children | 850242ba4a81 |
line wrap: on
line diff
--- a/lisp/cc-mode/cc-styles.el Mon Aug 13 09:56:30 2007 +0200 +++ b/lisp/cc-mode/cc-styles.el Mon Aug 13 09:57:07 2007 +0200 @@ -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. @@ -570,14 +570,23 @@ ;; variables first to the `cc-mode' style before instituting the new ;; style. Only do this once! (or (assoc "cc-mode" c-style-alist) - (progn + (let (copyfunc) + ;; 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 (lambda (var) (let ((val (symbol-value var))) - (cons var (if (atom val) val - (copy-sequence val) + (cons var (if (atom val) + val + (funcall copyfunc val) )) ))) '(c-backslash-column