emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/bytecomp.el,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/emacs-lisp/bytecomp.el,v
Date: Tue, 12 Jun 2007 21:03:33 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        07/06/12 21:03:33

Index: emacs-lisp/bytecomp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emacs-lisp/bytecomp.el,v
retrieving revision 2.200
retrieving revision 2.201
diff -u -b -r2.200 -r2.201
--- emacs-lisp/bytecomp.el      10 Jun 2007 16:14:18 -0000      2.200
+++ emacs-lisp/bytecomp.el      12 Jun 2007 21:03:31 -0000      2.201
@@ -853,13 +853,11 @@
                (when (and (consp s) (eq t (car s)))
                  (push (cdr s) old-autoloads)))))))
       (when (memq 'cl-functions byte-compile-warnings)
-       (let ((hist-new load-history)
-             (hist-nil-new current-load-list))
+       (let ((hist-new load-history))
          ;; Go through load-history, look for newly loaded files
          ;; and mark all the functions defined therein.
          (while (and hist-new (not (eq hist-new hist-orig)))
-           (let ((xs (pop hist-new))
-                 old-autoloads)
+           (let ((xs (pop hist-new)))
              ;; Make sure the file was not already loaded before.
              (when (and (equal (car xs) "cl") (not (assoc (car xs) hist-orig)))
                (byte-compile-find-cl-functions)))))))))
@@ -881,6 +879,7 @@
 (defvar byte-compile-current-form nil)
 (defvar byte-compile-dest-file nil)
 (defvar byte-compile-current-file nil)
+(defvar byte-compile-current-group nil)
 (defvar byte-compile-current-buffer nil)
 
 ;; Log something that isn't a warning.
@@ -1265,7 +1264,7 @@
             (get (car form) 'byte-compile-format-like))
     (let ((nfields (with-temp-buffer
                     (insert (nth 1 form))
-                    (goto-char 1)
+                    (goto-char (point-min))
                     (let ((n 0))
                       (while (re-search-forward "%." nil t)
                         (unless (eq ?% (char-after (1+ (match-beginning 0))))
@@ -1282,6 +1281,10 @@
 
 ;; Warn if a custom definition fails to specify :group.
 (defun byte-compile-nogroup-warn (form)
+  (if (and (memq (car form) '(custom-declare-face custom-declare-variable))
+           byte-compile-current-group)
+      ;; The group will be provided implicitly.
+      nil
   (let ((keyword-args (cdr (cdr (cdr (cdr form)))))
        (name (cadr form)))
     (or (not (eq (car-safe name) 'quote))
@@ -1295,7 +1298,12 @@
                    '((custom-declare-group . defgroup)
                      (custom-declare-face . defface)
                      (custom-declare-variable . defcustom))))
-        (cadr name)))))
+           (cadr name)))
+      ;; Update the current group, if needed.
+      (if (and byte-compile-current-file ;Only when byte-compiling a whole 
file.
+               (eq (car form) 'custom-declare-group)
+               (eq (car-safe name) 'quote))
+          (setq byte-compile-current-group (cadr name))))))
 
 ;; Warn if the function or macro is being redefined with a different
 ;; number of arguments.
@@ -1657,6 +1665,7 @@
   ;; Force logging of the file name for each file compiled.
   (setq byte-compile-last-logged-file nil)
   (let ((byte-compile-current-file filename)
+        (byte-compile-current-group nil)
        (set-auto-coding-for-load t)
        target-file input-buffer output-buffer
        byte-compile-dest-file)
@@ -1834,9 +1843,8 @@
        ;;                                 byte-compile-warnings))
        )
     (byte-compile-close-variables
-     (save-excursion
-       (setq outbuffer
-            (set-buffer (get-buffer-create " *Compiler Output*")))
+     (with-current-buffer
+         (setq outbuffer (get-buffer-create " *Compiler Output*"))
        (set-buffer-multibyte t)
        (erase-buffer)
        ;;       (emacs-lisp-mode)
@@ -1850,9 +1858,8 @@
        (setq overwrite-mode 'overwrite-mode-binary))
      (displaying-byte-compile-warnings
       (and filename (byte-compile-insert-header filename inbuffer outbuffer))
-      (save-excursion
-       (set-buffer inbuffer)
-       (goto-char 1)
+      (with-current-buffer inbuffer
+       (goto-char (point-min))
 
        ;; Compile the forms from the input buffer.
        (while (progn
@@ -1920,7 +1927,7 @@
   (let ((dynamic-docstrings byte-compile-dynamic-docstrings)
        (dynamic byte-compile-dynamic))
     (set-buffer outbuffer)
-    (goto-char 1)
+    (goto-char (point-min))
     ;; The magic number of .elc files is ";ELC", or 0x3B454C43.  After
     ;; that is the file-format version number (18, 19 or 20) as a
     ;; byte, followed by some nulls.  The primary motivation for doing
@@ -2241,8 +2248,7 @@
 
 (put 'require 'byte-hunk-handler 'byte-compile-file-form-require)
 (defun byte-compile-file-form-require (form)
-  (let ((old-load-list current-load-list)
-       (args (mapcar 'eval (cdr form))))
+  (let ((args (mapcar 'eval (cdr form))))
     (apply 'require args)
     ;; Detect (require 'cl) in a way that works even if cl is already loaded.
     (if (member (car args) '("cl" cl))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]