diff options
author | Robin Templeton <[email protected]> | 2014-08-11 06:59:28 -0400 |
---|---|---|
committer | Robin Templeton <[email protected]> | 2015-04-20 00:29:03 -0400 |
commit | 568b1feb58c0a7d9e0fb163ab216a92abd74acf4 (patch) | |
tree | fe9ea4cb6d73f1aca58dd37d1b80e7b5a9c1800c /lisp | |
parent | a596546c691f256f6176aa0c7a38ebc490ad96a5 (diff) |
guile-elisp eval-when
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 26 | ||||
-rw-r--r-- | lisp/emacs-lisp/cl.el | 1 |
2 files changed, 1 insertions, 26 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index e4725f53ec..d48ab7d80a 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -586,8 +586,6 @@ its argument list allows full Common Lisp conventions." ;;; The `cl-eval-when' form. -(defvar cl--not-toplevel nil) - ;;;###autoload (defmacro cl-eval-when (when &rest body) "Control when BODY is evaluated. @@ -597,29 +595,7 @@ If `eval' is in WHEN, BODY is evaluated when interpreted or at non-top-level. \(fn (WHEN...) BODY...)" (declare (indent 1) (debug (sexp body))) - (if (and (fboundp 'cl--compiling-file) (cl--compiling-file) - (not cl--not-toplevel) (not (boundp 'for-effect))) ;Horrible kludge. - (let ((comp (or (memq 'compile when) (memq :compile-toplevel when))) - (cl--not-toplevel t)) - (if (or (memq 'load when) (memq :load-toplevel when)) - (if comp (cons 'progn (mapcar 'cl--compile-time-too body)) - `(if nil nil ,@body)) - (progn (if comp (eval (cons 'progn body))) nil))) - (and (or (memq 'eval when) (memq :execute when)) - (cons 'progn body)))) - -(defun cl--compile-time-too (form) - (or (and (symbolp (car-safe form)) (get (car-safe form) 'byte-hunk-handler)) - (setq form (macroexpand - form (cons '(cl-eval-when) byte-compile-macro-environment)))) - (cond ((eq (car-safe form) 'progn) - (cons 'progn (mapcar 'cl--compile-time-too (cdr form)))) - ((eq (car-safe form) 'cl-eval-when) - (let ((when (nth 1 form))) - (if (or (memq 'eval when) (memq :execute when)) - `(cl-eval-when (compile ,@when) ,@(cddr form)) - form))) - (t (eval form) form))) + `(eval-when ,when ,@body)) ;;;###autoload (defmacro cl-load-time-value (form &optional _read-only) diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index fa77810e2e..182c01a573 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -248,7 +248,6 @@ ecase case load-time-value - eval-when destructuring-bind gentemp gensym |