2012-06-13 Stefan Monnier <monnier@iro.umontreal.ca>
+ * emacs-lisp/byte-opt.el (featurep): Move compiler-macro...
+ * emacs-lisp/bytecomp.el (featurep): ...here (bug#11692).
+
* emacs-lisp/autoload.el (make-autoload): Accept nil doc-string-elt
(bug#11649). Add cl-defun and cl-defmacro.
;; optimize string-as-unibyte, string-as-multibyte, string-make-unibyte,
;; string-make-multibyte for constant args.
-(put 'featurep 'compiler-macro
- (lambda (form &rest _ignore)
- ;; Emacs-21's byte-code doesn't run under XEmacs or SXEmacs anyway, so
- ;; we can safely optimize away this test.
- (if (member (cdr-safe form) '(((quote xemacs)) ((quote sxemacs))))
- nil
- (if (member (cdr-safe form) '(((quote emacs))))
- t
- form))))
-
(put 'set 'byte-optimizer 'byte-optimize-set)
(defun byte-optimize-set (form)
(let ((var (car-safe (cdr-safe form))))
(setq command-line-args-left (cdr command-line-args-left)))
(kill-emacs 0))
+;;; Core compiler macros.
+
+(put 'featurep 'compiler-macro
+ (lambda (form feature &rest _ignore)
+ ;; Emacs-21's byte-code doesn't run under XEmacs or SXEmacs anyway, so
+ ;; we can safely optimize away this test.
+ (if (member feature '('xemacs 'sxemacs 'emacs))
+ (eval form)
+ form)))
+
(provide 'byte-compile)
(provide 'bytecomp)