# HG changeset patch # User aidan # Date 1192445749 0 # Node ID ce594b233b2066e98437037fdabc3ada99a471b8 # Parent dd9c1d5f5319455574424991967a10ae257efa3e [xemacs-hg @ 2007-10-15 10:55:49 by aidan] Add a correct version of the (featurep 'xemacs) optimisation. diff -r dd9c1d5f5319 -r ce594b233b20 lisp/ChangeLog --- a/lisp/ChangeLog Mon Oct 15 10:53:34 2007 +0000 +++ b/lisp/ChangeLog Mon Oct 15 10:55:49 2007 +0000 @@ -1,3 +1,14 @@ +2007-10-01 Aidan Kehoe + + * byte-optimize.el: + * byte-optimize.el (byte-optimize-ever-present-features): New. + * byte-optimize.el (byte-optimize-featurep): New. + Optimise calls to (featurep 'xemacs) to t, since our byte code + refuses to run on GNU Emacs. Also optimises away checks for cl, + cl-extra, cl-19 and backquote, a conservative list of those + features that have been available in every XEmacs build since the + last time our opcodes changed. + 2007-10-14 Aidan Kehoe * coding.el: diff -r dd9c1d5f5319 -r ce594b233b20 lisp/byte-optimize.el --- a/lisp/byte-optimize.el Mon Oct 15 10:53:34 2007 +0000 +++ b/lisp/byte-optimize.el Mon Oct 15 10:55:49 2007 +0000 @@ -1169,6 +1169,21 @@ (eval form) form))) +(defvar byte-optimize-ever-present-features + '(xemacs cl cl-extra cl-19 backquote)) + +(put 'featurep 'byte-optimizer 'byte-optimize-featurep) +(defun byte-optimize-featurep (form) + (let ((to-check (cdr-safe form))) + (if (memq (car-safe + (cdr-safe + (car-safe + (cdr-safe + form)))) + byte-optimize-ever-present-features) + t + form))) + ;;; enumerating those functions which need not be called if the returned ;;; value is not used. That is, something like