comparison lisp/progmodes/cc-styles.el @ 20147:481af10544cc

(c-initialize-builtin-style): Only use copy-tree if it is funcall-able. This is the right patch, and was given by Erik Naggum <erik@naggum.no>
author Karl Heuer <kwzh@gnu.org>
date Thu, 23 Oct 1997 07:50:28 +0000
parents d8732d6e6aeb
children 8e64bd5b1b5f
comparison
equal deleted inserted replaced
20146:d7ea5d1fa91b 20147:481af10544cc
5 ;; Authors: 1992-1997 Barry A. Warsaw 5 ;; Authors: 1992-1997 Barry A. Warsaw
6 ;; 1987 Dave Detlefs and Stewart Clamen 6 ;; 1987 Dave Detlefs and Stewart Clamen
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.18 10 ;; Version: See cc-mode.el
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.
14 14
15 ;; GNU Emacs is free software; you can redistribute it and/or modify 15 ;; GNU Emacs is free software; you can redistribute it and/or modify
570 ;; variables first to the `cc-mode' style before instituting the new 570 ;; variables first to the `cc-mode' style before instituting the new
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 ;; use built-in copy-tree if its there. 574 ;; use built-in copy-tree if its there.
575 (if (fboundp 'copy-tree) 575 (if (and (fboundp 'copy-tree)
576 (functionp (symbol-function 'copy-tree)))
576 (setq copyfunc (symbol-function 'copy-tree)) 577 (setq copyfunc (symbol-function 'copy-tree))
577 (setq copyfunc (lambda (tree) 578 (setq copyfunc (lambda (tree)
578 (if (consp tree) 579 (if (consp tree)
579 (cons (funcall copyfunc (car tree)) 580 (cons (funcall copyfunc (car tree))
580 (funcall copyfunc (cdr tree))) 581 (funcall copyfunc (cdr tree)))