X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fdgnushack.el;h=34248d39171a997e00bbf8ee1fa682f5cff0d010;hb=ae00ae88f84af9b21708cbb2ac32e2d2498d193c;hp=d5f8d01ccfcf82e2a8725e9873416c0e6b553cfa;hpb=4c0611be7b8cf4b34d42531534d14b88ba60c9ca;p=gnus diff --git a/lisp/dgnushack.el b/lisp/dgnushack.el index d5f8d01cc..34248d391 100644 --- a/lisp/dgnushack.el +++ b/lisp/dgnushack.el @@ -143,6 +143,13 @@ (when (featurep 'xemacs) (unless (fboundp 'defadvice) (autoload 'defadvice "advice" nil nil 'macro)) + (unless (boundp 'help-echo-owns-message) + (defvar help-echo-owns-message)) + (unless (fboundp 'url-retrieve-synchronously) + (defalias 'url-retrieve-synchronously 'url-retrieve)) + (unless (fboundp 'url-queue-retrieve) + (defun url-queue-retrieve (url callback &optional cbargs silent) + (url-retrieve url callback cbargs))) (autoload 'Info-directory "info" nil t) (autoload 'Info-index "info" nil t) (autoload 'Info-index-next "info" nil t) @@ -246,7 +253,8 @@ in `defcustom' forms." (search-forward " 'foo '(byte-code " nil t)) (kill-buffer outbuf))))) -(when (dgnushack-emacs-compile-defcustom-p) +(when (and (featurep 'xemacs) + (dgnushack-emacs-compile-defcustom-p)) (maybe-fbind '(defined-colors face-attribute)) (maybe-bind '(idna-program installation-directory))) @@ -267,12 +275,19 @@ dgnushack-compile-verbosely. All other users should continue to use 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 @@ -325,8 +340,14 @@ dgnushack-compile." (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)