From ca5995ecca6b6bb281dd548d7cc2c5582fa635b9 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 22 May 2013 00:50:30 -0700 Subject: [PATCH] Tweak byte-compile-file-form-autoload warnings * emacs-lisp/bytecomp.el (byte-compile-file-form-autoload): Always delete the autoloaded function from the noruntime and unresolved functions lists. --- lisp/ChangeLog | 4 ++++ lisp/emacs-lisp/bytecomp.el | 29 +++++++++++++++++------------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0e3fbb89976..f0c1bcb7a8b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2013-05-22 Glenn Morris + * emacs-lisp/bytecomp.el (byte-compile-file-form-autoload): + Always delete the autoloaded function from the noruntime and + unresolved functions lists. + * allout.el: No need to load epa, epg, overlay when compiling. (epg-context-set-passphrase-callback, epg-list-keys) (epg-decrypt-string, epg-encrypt-string, epg-user-id-string) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 0b00c038acc..5e20bba2ddb 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -2213,13 +2213,15 @@ list that represents a doc string reference. (when (and (consp (nth 1 form)) (eq (car (nth 1 form)) 'quote) (consp (cdr (nth 1 form))) - (symbolp (nth 1 (nth 1 form))) - ;; Don't add it if it's already defined. Otherwise, it might - ;; hide the actual definition. - (not (fboundp (nth 1 (nth 1 form))))) - (push (cons (nth 1 (nth 1 form)) - (cons 'autoload (cdr (cdr form)))) - byte-compile-function-environment) + (symbolp (nth 1 (nth 1 form)))) + ;; Don't add it if it's already defined. Otherwise, it might + ;; hide the actual definition. However, do remove any entry from + ;; byte-compile-noruntime-functions, in case we have an autoload + ;; of foo-func following an (eval-when-compile (require 'foo)). + (unless (fboundp (nth 1 (nth 1 form))) + (push (cons (nth 1 (nth 1 form)) + (cons 'autoload (cdr (cdr form)))) + byte-compile-function-environment)) ;; If an autoload occurs _before_ the first call to a function, ;; byte-compile-callargs-warn does not add an entry to ;; byte-compile-unresolved-functions. Here we mimic the logic @@ -2227,11 +2229,14 @@ list that represents a doc string reference. ;; autoload comes _after_ the function call. ;; Alternatively, similar logic could go in ;; byte-compile-warn-about-unresolved-functions. - (or (memq (nth 1 (nth 1 form)) byte-compile-noruntime-functions) - (setq byte-compile-unresolved-functions - (delq (assq (nth 1 (nth 1 form)) - byte-compile-unresolved-functions) - byte-compile-unresolved-functions)))) + (if (memq (nth 1 (nth 1 form)) byte-compile-noruntime-functions) + (setq byte-compile-noruntime-functions + (delq (nth 1 (nth 1 form)) byte-compile-noruntime-functions) + byte-compile-noruntime-functions) + (setq byte-compile-unresolved-functions + (delq (assq (nth 1 (nth 1 form)) + byte-compile-unresolved-functions) + byte-compile-unresolved-functions)))) (if (stringp (nth 3 form)) form ;; No doc string, so we can compile this as a normal form. -- 2.11.4.GIT