Variable: byte-compile-initial-macro-environment

byte-compile-initial-macro-environment is a variable defined in bytecomp.el.gz.

Value

((declare-function . byte-compile-macroexpand-declare-function)
 (eval-when-compile .
		    #[128 "\300C\301\302!\303\304\"\"\210\305\242D\207"
			  [nil byte-compile-recurse-toplevel macroexp-progn make-closure
			       #[257 "	\n\300\303\304\305\306!!!!\240*\207"
				     [V0 byte-compile-unresolved-functions byte-compile-new-defuns byte-compile-eval byte-run-strip-symbol-positions byte-compile-top-level byte-compile-preprocess]
				     7 "\n\n(fn FORM)"]
			       quote]
			  7 "\n\n(fn &rest BODY)"])
 (eval-and-compile .
		   #[128 "\300\301!\302\"\207"
			 [byte-compile-recurse-toplevel macroexp-progn
							#[257 "\303\304\305	\"!\306\n\")\210\207"
							      [print-symbols-bare macroexpand-all-environment lexical-binding t byte-run-strip-symbol-positions macroexpand--all-toplevel eval]
							      5 "\n\n(fn FORM)"]]
			 4 "\n\n(fn &rest BODY)"])
 (with-suppressed-warnings .
   #[385 "\302\"\303\304D\305\306B	\")E\207"
	 [byte-compile--suppressed-warnings macroexpand-all-environment append internal--with-suppressed-warnings quote macroexpand-all progn]
	 7 "\n\n(fn WARNINGS &rest BODY)"]))

Documentation

The default macro-environment passed to macroexpand by the compiler.

Placing a macro here will cause a macro to have different semantics when expanded by the compiler as when expanded by the interpreter.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/bytecomp.el.gz
(defconst byte-compile-initial-macro-environment
  `(
    ;; (byte-compiler-options . (lambda (&rest forms)
    ;;                         (apply 'byte-compiler-options-handler forms)))
    (declare-function . byte-compile-macroexpand-declare-function)
    (eval-when-compile . ,(lambda (&rest body)
                            (let ((result nil))
                              (byte-compile-recurse-toplevel
                               (macroexp-progn body)
                               (lambda (form)
                                 ;; Insulate the following variables
                                 ;; against changes made in the
                                 ;; subsidiary compilation.  This
                                 ;; prevents spurious warning
                                 ;; messages: "not defined at runtime"
                                 ;; etc.
                                 (let ((byte-compile-unresolved-functions
                                        byte-compile-unresolved-functions)
                                       (byte-compile-new-defuns
                                        byte-compile-new-defuns))
                                   (setf result
                                         (byte-compile-eval
                                          (byte-run-strip-symbol-positions
                                           (byte-compile-top-level
                                            (byte-compile-preprocess form))))))))
                              (list 'quote result))))
    (eval-and-compile . ,(lambda (&rest body)
                           (byte-compile-recurse-toplevel
                            (macroexp-progn body)
                            (lambda (form)
                              ;; Don't compile here, since we don't know
                              ;; whether to compile as byte-compile-form
                              ;; or byte-compile-file-form.
                              (let* ((print-symbols-bare t) ; Possibly redundant binding.
                                     (expanded
                                      (byte-run-strip-symbol-positions
                                       (macroexpand--all-toplevel
                                        form
                                        macroexpand-all-environment))))
                                (eval expanded lexical-binding)
                                expanded)))))
    (with-suppressed-warnings
        . ,(lambda (warnings &rest body)
             ;; We let-bind `byte-compile--suppressed-warnings' here in order
             ;; to affect warnings emitted during macroexpansion.
             ;; Later `internal--with-suppressed-warnings' binds it again, this
             ;; time in order to affect warnings emitted during the
             ;; compilation itself.
             (let ((byte-compile--suppressed-warnings
                    (append warnings byte-compile--suppressed-warnings)))
               ;; This function doesn't exist, but is just a placeholder
               ;; symbol to hook up with the
               ;; `byte-hunk-handler'/`byte-defop-compiler-1' machinery.
               `(internal--with-suppressed-warnings
                 ',warnings
                 ,(macroexpand-all `(progn ,@body)
                                   macroexpand-all-environment))))))
  "The default macro-environment passed to macroexpand by the compiler.
Placing a macro here will cause a macro to have different semantics when
expanded by the compiler as when expanded by the interpreter.")