aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2013-05-22 00:50:30 -0700
committerGlenn Morris2013-05-22 00:50:30 -0700
commitca5995ecca6b6bb281dd548d7cc2c5582fa635b9 (patch)
tree69aca76436de3f9366394c78731fe06aacd8b986
parentaf7422480399d1b58e778c5d25891b70cb1f43ed (diff)
downloademacs-ca5995ecca6b6bb281dd548d7cc2c5582fa635b9.tar.gz
emacs-ca5995ecca6b6bb281dd548d7cc2c5582fa635b9.zip
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.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/emacs-lisp/bytecomp.el29
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 @@
12013-05-22 Glenn Morris <rgm@gnu.org> 12013-05-22 Glenn Morris <rgm@gnu.org>
2 2
3 * emacs-lisp/bytecomp.el (byte-compile-file-form-autoload):
4 Always delete the autoloaded function from the noruntime and
5 unresolved functions lists.
6
3 * allout.el: No need to load epa, epg, overlay when compiling. 7 * allout.el: No need to load epa, epg, overlay when compiling.
4 (epg-context-set-passphrase-callback, epg-list-keys) 8 (epg-context-set-passphrase-callback, epg-list-keys)
5 (epg-decrypt-string, epg-encrypt-string, epg-user-id-string) 9 (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.
2213 (when (and (consp (nth 1 form)) 2213 (when (and (consp (nth 1 form))
2214 (eq (car (nth 1 form)) 'quote) 2214 (eq (car (nth 1 form)) 'quote)
2215 (consp (cdr (nth 1 form))) 2215 (consp (cdr (nth 1 form)))
2216 (symbolp (nth 1 (nth 1 form))) 2216 (symbolp (nth 1 (nth 1 form))))
2217 ;; Don't add it if it's already defined. Otherwise, it might 2217 ;; Don't add it if it's already defined. Otherwise, it might
2218 ;; hide the actual definition. 2218 ;; hide the actual definition. However, do remove any entry from
2219 (not (fboundp (nth 1 (nth 1 form))))) 2219 ;; byte-compile-noruntime-functions, in case we have an autoload
2220 (push (cons (nth 1 (nth 1 form)) 2220 ;; of foo-func following an (eval-when-compile (require 'foo)).
2221 (cons 'autoload (cdr (cdr form)))) 2221 (unless (fboundp (nth 1 (nth 1 form)))
2222 byte-compile-function-environment) 2222 (push (cons (nth 1 (nth 1 form))
2223 (cons 'autoload (cdr (cdr form))))
2224 byte-compile-function-environment))
2223 ;; If an autoload occurs _before_ the first call to a function, 2225 ;; If an autoload occurs _before_ the first call to a function,
2224 ;; byte-compile-callargs-warn does not add an entry to 2226 ;; byte-compile-callargs-warn does not add an entry to
2225 ;; byte-compile-unresolved-functions. Here we mimic the logic 2227 ;; byte-compile-unresolved-functions. Here we mimic the logic
@@ -2227,11 +2229,14 @@ list that represents a doc string reference.
2227 ;; autoload comes _after_ the function call. 2229 ;; autoload comes _after_ the function call.
2228 ;; Alternatively, similar logic could go in 2230 ;; Alternatively, similar logic could go in
2229 ;; byte-compile-warn-about-unresolved-functions. 2231 ;; byte-compile-warn-about-unresolved-functions.
2230 (or (memq (nth 1 (nth 1 form)) byte-compile-noruntime-functions) 2232 (if (memq (nth 1 (nth 1 form)) byte-compile-noruntime-functions)
2231 (setq byte-compile-unresolved-functions 2233 (setq byte-compile-noruntime-functions
2232 (delq (assq (nth 1 (nth 1 form)) 2234 (delq (nth 1 (nth 1 form)) byte-compile-noruntime-functions)
2233 byte-compile-unresolved-functions) 2235 byte-compile-noruntime-functions)
2234 byte-compile-unresolved-functions)))) 2236 (setq byte-compile-unresolved-functions
2237 (delq (assq (nth 1 (nth 1 form))
2238 byte-compile-unresolved-functions)
2239 byte-compile-unresolved-functions))))
2235 (if (stringp (nth 3 form)) 2240 (if (stringp (nth 3 form))
2236 form 2241 form
2237 ;; No doc string, so we can compile this as a normal form. 2242 ;; No doc string, so we can compile this as a normal form.