diff options
author | Glenn Morris <rgm@gnu.org> | 2009-08-25 07:28:16 +0000 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2009-08-25 07:28:16 +0000 |
commit | bac9c66cc78624f5cd7868258308e0ae5a916650 (patch) | |
tree | 42a665f7ac50d1b512a8b170683907c219e079a9 /lisp/emacs-lisp | |
parent | 0d722f983c873435de5b6d920f4d7db39db8b9ba (diff) | |
download | emacs-bac9c66cc78624f5cd7868258308e0ae5a916650.tar.gz emacs-bac9c66cc78624f5cd7868258308e0ae5a916650.tar.bz2 emacs-bac9c66cc78624f5cd7868258308e0ae5a916650.zip |
(byte-compile-eval): Fix test for cl in load-history for absolute file-names.
(byte-compile-file-form-require): Warn about use of the cl package.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 4ab701bf55c..70557d5e247 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -902,8 +902,10 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." (while (and hist-new (not (eq hist-new hist-orig))) (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))))))))) + (and (stringp (car xs)) + (string-match "^cl\\>" (file-name-nondirectory (car xs))) + (not (assoc (car xs) hist-orig)) + (byte-compile-find-cl-functions))))))))) (defun byte-compile-eval-before-compile (form) "Evaluate FORM for `eval-and-compile'." @@ -2322,8 +2324,10 @@ list that represents a doc string reference. (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)) - (byte-compile-disable-warning 'cl-functions))) + (when (member (car args) '("cl" cl)) + (if (byte-compile-warning-enabled-p 'cl-functions) + (byte-compile-warn "cl package required at runtime")) + (byte-compile-disable-warning 'cl-functions))) (byte-compile-keep-pending form 'byte-compile-normal-call)) (put 'progn 'byte-hunk-handler 'byte-compile-file-form-progn) |