From c4c8444a78a7a292331ee9eb6dc1f535f05e6c15 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 13 Jun 2012 09:16:34 -0400 Subject: [PATCH] * lisp/emacs-lisp/byte-opt.el (featurep): Move compiler-macro... * lisp/emacs-lisp/bytecomp.el (featurep): ...here. Fixes: debbugs:11692 --- lisp/ChangeLog | 3 +++ lisp/emacs-lisp/byte-opt.el | 10 ---------- lisp/emacs-lisp/bytecomp.el | 10 ++++++++++ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0ad97e58935..920c9efb874 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-06-13 Stefan Monnier + * 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. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index ab0e22fb5ce..92a10dff774 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1158,16 +1158,6 @@ ;; 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)))) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index a65a355bfdf..934c0f01fcd 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -4539,6 +4539,16 @@ and corresponding effects." (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) -- 2.39.2