dgnushack-compile."
(dgnushack-compile t))
-(defun dgnushack-compile (&optional warn)
+(defun dgnushack-compile-error-on-warn ()
+ "Call dgnushack-compile with minimal warnings, but with error-on-warn ENABLED.
+This means that every warning will be reported as an error."
+ (unless (dgnushack-compile nil t)
+ (error "Error during byte compilation (warnings were reported as errors!).")))
+
+(defun dgnushack-compile (&optional warn error-on-warn)
;;(setq byte-compile-dynamic t)
(unless warn
(setq byte-compile-warnings
'(free-vars unresolved callargs redefine suspicious)))
(let ((files (directory-files srcdir nil "^[^=].*\\.el$"))
+ (compilesuccess t)
;;(byte-compile-generate-call-tree t)
file elc)
;; Avoid barfing (from gnus-xmas) because the etc directory is not yet
(when (or (not (file-exists-p
(setq elc (concat (file-name-nondirectory file) "c"))))
(file-newer-than-file-p file elc))
- (ignore-errors
- (byte-compile-file file))))))
+ (if error-on-warn
+ (let ((byte-compile-error-on-warn t))
+ (unless (ignore-errors
+ (byte-compile-file file))
+ (setq compilesuccess nil)))
+ (ignore-errors
+ (byte-compile-file file)))))
+ compilesuccess))
(defun dgnushack-recompile ()
(require 'gnus)