X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fdgnushack.el;h=83c0f205292ce45dd87db28972092a96b17c54ee;hb=609e9daf5a06f5d39ca20cc6718f72a414866870;hp=c0ab694f5b2bb6d4fc25893390f1526a5198c940;hpb=ac4a39fde85a35caeb7c1e33970deed9dadd4532;p=gnus diff --git a/lisp/dgnushack.el b/lisp/dgnushack.el index c0ab694f5..83c0f2052 100644 --- a/lisp/dgnushack.el +++ b/lisp/dgnushack.el @@ -113,6 +113,29 @@ than subr.el." (put 'car 'side-effect-free tmp))) ad-do-it)))) +(when (and (not (featurep 'xemacs)) + (byte-optimize-form '(and (> 0 1) foo) t)) + (defadvice byte-optimize-form-code-walker + (around fix-bug-in-and/or-forms (form for-effect) activate) + "Optimize the rest of the and/or forms. +It has been fixed in XEmacs before releasing 21.4 and also has been +fixed in Emacs after 21.3." + (if (and for-effect (memq (car-safe form) '(and or))) + (let ((fn (car form)) + (backwards (reverse (cdr form)))) + (while (and backwards + (null (setcar backwards + (byte-optimize-form (car backwards) t)))) + (setq backwards (cdr backwards))) + (if (and (cdr form) (null backwards)) + (byte-compile-log + " all subforms of %s called for effect; deleted" form)) + (when backwards + (setcdr backwards + (mapcar 'byte-optimize-form (cdr backwards)))) + (setq ad-return-value (cons fn (nreverse backwards)))) + ad-do-it))) + (push srcdir load-path) (load (expand-file-name "lpath.el" srcdir) nil t) @@ -132,11 +155,6 @@ than subr.el." (eval-and-compile (when (featurep 'xemacs) - ;; XEmacs 21.1 needs some extra hand holding - (when (eq emacs-minor-version 1) - (autoload 'custom-declare-face "cus-face" nil t) - (autoload 'cl-compile-time-init "cl-macs" nil t) - (autoload 'defadvice "advice" nil nil 'macro)) (unless (fboundp 'defadvice) (autoload 'defadvice "advice" nil nil 'macro)) (autoload 'Info-directory "info" nil t) @@ -153,6 +171,7 @@ than subr.el." (autoload 'dolist "cl-macs" nil nil 'macro) (autoload 'enriched-decode "enriched") (autoload 'executable-find "executable") + (autoload 'font-lock-fontify-buffer "font-lock" nil t) (autoload 'info "info" nil t) (autoload 'make-annotation "annotations") (autoload 'make-display-table "disp-table") @@ -199,14 +218,6 @@ dgnushack-compile." (unless warn (setq byte-compile-warnings '(free-vars unresolved callargs redefine))) - (unless (locate-library "cus-edit") - (error "You do not seem to have Custom installed. -Fetch it from . -You also then need to add the following to the lisp/dgnushack.el file: - - (push \"~/lisp/custom\" load-path) - -Modify to suit your needs.")) (let ((files (directory-files srcdir nil "^[^=].*\\.el$")) ;;(byte-compile-generate-call-tree t) file elc) @@ -237,7 +248,8 @@ Modify to suit your needs.")) (dolist (file (if (featurep 'xemacs) '("md5.el") - '("gnus-xmas.el" "messagexmas.el" "nnheaderxm.el"))) + '("gnus-xmas.el" "messagexmas.el" "nnheaderxm.el" + "run-at-time.el"))) (setq files (delete file files))) (dolist (file files)