[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r112790: cc-bytecomp tweaks for sake
From: |
Glenn Morris |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r112790: cc-bytecomp tweaks for sake of byte-compiler |
Date: |
Thu, 30 May 2013 19:20:05 -0400 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 112790
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Thu 2013-05-30 19:20:05 -0400
message:
cc-bytecomp tweaks for sake of byte-compiler
* lisp/progmodes/cc-bytecomp.el (cc-bytecomp-noruntime-functions): New.
(cc-require): Suppress spurious "noruntime" warnings.
(cc-require-when-compile): Use fboundp, for sake of compiler.
modified:
lisp/ChangeLog
lisp/progmodes/cc-bytecomp.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-05-30 23:18:39 +0000
+++ b/lisp/ChangeLog 2013-05-30 23:20:05 +0000
@@ -1,5 +1,9 @@
2013-05-30 Glenn Morris <address@hidden>
+ * progmodes/cc-bytecomp.el (cc-bytecomp-noruntime-functions): New.
+ (cc-require): Suppress spurious "noruntime" warnings.
+ (cc-require-when-compile): Use fboundp, for sake of compiler.
+
* progmodes/cc-mode.el: Move load of cc-vars before that of
cc-langs (which in turn loads cc-vars), to quieten compiler.
=== modified file 'lisp/progmodes/cc-bytecomp.el'
--- a/lisp/progmodes/cc-bytecomp.el 2013-01-01 09:11:05 +0000
+++ b/lisp/progmodes/cc-bytecomp.el 2013-05-30 23:20:05 +0000
@@ -232,6 +232,9 @@
(cc-bytecomp-setup-environment)
t))))
+(defvar cc-bytecomp-noruntime-functions nil
+ "Saved value of `byte-compile-noruntime-functions'.")
+
(defmacro cc-require (cc-part)
"Force loading of the corresponding .el file in the current directory
during compilation, but compile in a `require'. Don't use within
@@ -240,7 +243,16 @@
Having cyclic cc-require's will result in infinite recursion. That's
somewhat intentional."
`(progn
- (eval-when-compile (cc-bytecomp-load (symbol-name ,cc-part)))
+ (eval-when-compile
+ (setq cc-bytecomp-noruntime-functions byte-compile-noruntime-functions)
+ (cc-bytecomp-load (symbol-name ,cc-part)))
+ ;; Hack to suppress spurious "might not be defined at runtime" warnings.
+ ;; The basic issue is that
+ ;; (eval-when-compile (require 'foo))
+ ;; (require 'foo)
+ ;; produces bogus noruntime warnings about functions from foo.
+ (eval-when-compile
+ (setq byte-compile-noruntime-functions cc-bytecomp-noruntime-functions))
(require ,cc-part)))
(defmacro cc-provide (feature)
@@ -266,7 +278,7 @@
during compilation, but do a compile time `require' otherwise. Don't
use within `eval-when-compile'."
`(eval-when-compile
- (if (and (featurep 'cc-bytecomp)
+ (if (and (fboundp 'cc-bytecomp-is-compiling)
(cc-bytecomp-is-compiling))
(if (or (not load-in-progress)
(not (featurep ,cc-part)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r112790: cc-bytecomp tweaks for sake of byte-compiler,
Glenn Morris <=