X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fdgnushack.el;h=83c0f205292ce45dd87db28972092a96b17c54ee;hb=48f15755c484de2e4b8b1c89cd3590455e791f72;hp=4bc684b332b77b50269f7b22c25da5d2114040ee;hpb=ff9e989cccc88041fd7a45b69d1feaaed5e4b62e;p=gnus diff --git a/lisp/dgnushack.el b/lisp/dgnushack.el index 4bc684b33..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) @@ -195,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)