diff lisp/byte-optimize.el @ 4228:ce594b233b20

[xemacs-hg @ 2007-10-15 10:55:49 by aidan] Add a correct version of the (featurep 'xemacs) optimisation.
author aidan
date Mon, 15 Oct 2007 10:55:49 +0000
parents effc49a3bfb9
children 9eb558ffe8ff
line wrap: on
line diff
--- 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