summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-defs.el
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2015-11-24 19:44:34 +0000
committerAlan Mackenzie <acm@muc.de>2015-11-24 19:44:34 +0000
commit7233767e3c7362b36828e5e6f68d45a411a9e3a1 (patch)
treeed9613ea1f1216ffd26a41dbf8a60663429c3801 /lisp/progmodes/cc-defs.el
parent33ec2ff0f8b77f3c10af395d3e8979508cd78c0a (diff)
downloademacs-7233767e3c7362b36828e5e6f68d45a411a9e3a1.tar.gz
CC Mode: eliminate almost all byte compilation warnings
* lisp/progmodes/cc-bytecomp.el (cc-bytecomp-noruntime-functions): Remove. (cc-require): Remove the crude hack that saved and restored byte-compile-noruntime-functions. (cc-conditional-require, cc-conditional-require-after-load): New macros. * lisp/progmodes/cc-defs.el (top level): Reformulate code which loaded cc-fix.el using the new macros in cc-bytecomp.el. * lisp/progmodes/cc-langs.el (c++-template-syntax-table) (c-no-parens-syntax-table): Add extra "(eval ..)"s around "'(lambda ..)" forms to remove the superflous quotes.
Diffstat (limited to 'lisp/progmodes/cc-defs.el')
-rw-r--r--lisp/progmodes/cc-defs.el47
1 files changed, 16 insertions, 31 deletions
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index 6bd58159fce..ac4aa19e565 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -75,37 +75,22 @@
;; cc-fix.el contains compatibility macros that should be used if
;; needed.
-(eval-and-compile
- (if (or (/= (regexp-opt-depth "\\(\\(\\)\\)") 2)
- (not (fboundp 'push)))
- (cc-load "cc-fix")))
-
-(when (featurep 'xemacs) ; There is now (2005/12) code in GNU Emacs CVS
- ; to make the call to f-l-c-k throw an error.
- (eval-after-load "font-lock"
- '(if (and (not (featurep 'cc-fix)) ; only load the file once.
- (let (font-lock-keywords)
- (font-lock-compile-keywords '("\\<\\>"))
- font-lock-keywords)) ; did the previous call foul this up?
- (load "cc-fix"))))
-
-;; The above takes care of the delayed loading, but this is necessary
-;; to ensure correct byte compilation.
-(eval-when-compile
- (if (and (featurep 'xemacs)
- (not (featurep 'cc-fix))
- (progn
- (require 'font-lock)
- (let (font-lock-keywords)
- (font-lock-compile-keywords '("\\<\\>"))
- font-lock-keywords)))
- (cc-load "cc-fix")))
-
-;; XEmacs 21.4 doesn't have `delete-dups'.
-(eval-and-compile
- (if (and (not (fboundp 'delete-dups))
- (not (featurep 'cc-fix)))
- (cc-load "cc-fix")))
+(cc-conditional-require
+ 'cc-fix (or (/= (regexp-opt-depth "\\(\\(\\)\\)") 2)
+ (not (fboundp 'push))
+ ;; XEmacs 21.4 doesn't have `delete-dups'.
+ (not (fboundp 'delete-dups))))
+
+(cc-conditional-require-after-load
+ 'cc-fix "font-lock"
+ (and
+ (featurep 'xemacs)
+ (progn
+ (require 'font-lock)
+ (let (font-lock-keywords)
+ (font-lock-compile-keywords '("\\<\\>"))
+ font-lock-keywords))))
+
;;; Variables also used at compile time.