Unify local variable section, and set
[bpt/emacs.git] / lisp / emacs-lisp / cl-macs.el
index 2615a8f..f3f28de 100644 (file)
@@ -1,4 +1,4 @@
-;;; cl-macs.el --- Common Lisp macros -*-byte-compile-dynamic: t;-*-
+;;; cl-macs.el --- Common Lisp macros
 
 ;; Copyright (C) 1993, 2001, 2002, 2003, 2004, 2005, 2006, 2007
 ;;   Free Software Foundation, Inc.
@@ -11,7 +11,7 @@
 
 ;; 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 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -272,15 +272,19 @@ its argument list allows full Common Lisp conventions."
             (nconc (nreverse simple-args)
                    (list '&rest (car (pop bind-lets))))
             (nconc (let ((hdr (nreverse header)))
-                     (require 'help-fns)
-                     (cons (help-add-fundoc-usage
-                            (if (stringp (car hdr)) (pop hdr))
-                            ;; orig-args can contain &cl-defs (an internal CL
-                            ;; thingy that I do not understand), so remove it.
-                            (let ((x (memq '&cl-defs orig-args)))
-                              (if (null x) orig-args
-                                (delq (car x) (remq (cadr x) orig-args)))))
-                           hdr))
+                      ;; Macro expansion can take place in the middle of
+                      ;; apparently harmless computation, so it should not
+                      ;; touch the match-data.
+                      (save-match-data
+                        (require 'help-fns)
+                        (cons (help-add-fundoc-usage
+                               (if (stringp (car hdr)) (pop hdr))
+                               ;; orig-args can contain &cl-defs (an internal
+                               ;; CL thingy I don't understand), so remove it.
+                               (let ((x (memq '&cl-defs orig-args)))
+                                 (if (null x) orig-args
+                                   (delq (car x) (remq (cadr x) orig-args)))))
+                              hdr)))
                    (list (nconc (list 'let* bind-lets)
                                 (nreverse bind-forms) body)))))))
 
@@ -1550,15 +1554,11 @@ values.  For compatibility, (values A B C) is a synonym for (list A B C).
                            byte-compile-delete-errors (nth 1 safety)))))
 
        ((and (eq (car-safe spec) 'warn) (boundp 'byte-compile-warnings))
-        (if (eq byte-compile-warnings t)
-            (setq byte-compile-warnings byte-compile-warning-types))
         (while (setq spec (cdr spec))
           (if (consp (car spec))
               (if (eq (cadar spec) 0)
-                  (setq byte-compile-warnings
-                        (delq (caar spec) byte-compile-warnings))
-                (setq byte-compile-warnings
-                      (adjoin (caar spec) byte-compile-warnings)))))))
+                   (byte-compile-disable-warning (caar spec))
+                 (byte-compile-enable-warning (caar spec)))))))
   nil)
 
 ;;; Process any proclamations made before cl-macs was loaded.
@@ -2724,7 +2724,8 @@ surrounded by (block NAME ...).
 (run-hooks 'cl-macs-load-hook)
 
 ;; Local variables:
-;; byte-compile-warnings: (redefine callargs free-vars unresolved obsolete noruntime)
+;; byte-compile-dynamic: t
+;; byte-compile-warnings: (not cl-functions)
 ;; generated-autoload-file: "cl-loaddefs.el"
 ;; End: