Merge from emacs-23; up to 2010-06-09T17:54:28Z!albinus@detlef.
[bpt/emacs.git] / lisp / emacs-lisp / cl-extra.el
index 094b21f..7468a02 100644 (file)
@@ -1,17 +1,17 @@
-;;; cl-extra.el --- Common Lisp features, part 2 -*-byte-compile-dynamic: t;-*-
+;;; cl-extra.el --- Common Lisp features, part 2
 
-;; Copyright (C) 1993, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 2000-2011  Free Software Foundation, Inc.
 
 ;; Author: Dave Gillespie <daveg@synaptics.com>
 ;; Keywords: extensions
+;; Package: emacs
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,9 +19,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -687,7 +685,7 @@ PROPLIST is a list of the sort returned by `symbol-plist'.
     (setq last (point))
     (goto-char (1+ pt))
     (while (search-forward "(quote " last t)
-      (delete-backward-char 7)
+      (delete-char -7)
       (insert "'")
       (forward-sexp)
       (delete-char 1))
@@ -768,20 +766,15 @@ This also does some trivial optimizations to make the form prettier."
                                (eq (car-safe (car body)) 'interactive))
                       (push (list 'quote (pop body)) decls))
                     (put (car (last cl-closure-vars)) 'used t)
-                    (append
-                     (list 'list '(quote lambda) '(quote (&rest --cl-rest--)))
-                     (sublis sub (nreverse decls))
-                     (list
-                      (list* 'list '(quote apply)
-                             (list 'function
-                                   (list* 'lambda
-                                          (append new (cadadr form))
-                                          (sublis sub body)))
-                             (nconc (mapcar (function
-                                             (lambda (x)
-                                               (list 'list '(quote quote) x)))
-                                            cl-closure-vars)
-                                    '((quote --cl-rest--)))))))
+                     `(list 'lambda '(&rest --cl-rest--)
+                            ,@(sublis sub (nreverse decls))
+                            (list 'apply
+                                  (list 'quote
+                                        #'(lambda ,(append new (cadadr form))
+                                            ,@(sublis sub body)))
+                                  ,@(nconc (mapcar (lambda (x) `(list 'quote ,x))
+                                                   cl-closure-vars)
+                                           '((quote --cl-rest--))))))
                 (list (car form) (list* 'lambda (cadadr form) body))))
           (let ((found (assq (cadr form) env)))
             (if (and found (ignore-errors
@@ -822,8 +815,9 @@ This also does some trivial optimizations to make the form prettier."
 (run-hooks 'cl-extra-load-hook)
 
 ;; Local variables:
+;; byte-compile-dynamic: t
+;; byte-compile-warnings: (not cl-functions)
 ;; generated-autoload-file: "cl-loaddefs.el"
 ;; End:
 
-;; arch-tag: bcd03437-0871-43fb-a8f1-ad0e0b5427ed
 ;;; cl-extra.el ends here