Subject: bug#67455: (Record source position, etc., in doc strings, and use this in *Help* and backtraces.)

From: Stefan Monnier <[email-masked]>
Date: Mon, 03 Jun 2024 00:52:07 -0400

> The solution now seems obvious: In loadup.el, we should load
> backquote.el before byte-run.el, and rewrite all our hand expanded
> backquotes in byte-run.el (including in byte-run--posify-defining-form)
> as actual backquote forms.
>
> backquote.el doesn't actually need anything in byte-run.el bar the macro
> defun itself.  It would be a simple job to replace each (defun
> backquote-foo ...) in the file with (defalias 'backquote-foo #'(lambda
> ....)).

Well, it uses both `defun` and `defmacro`.
But rather than hand-expand them, we might be able to get the same
result by prepending some minimal definitions of those two, as in:

    (if (fboundp 'defun) nil
      ;; This file is loaded before `byte-run.el' so when loading the .el
      ;; file, defun/defmacro may not be defined yet, so we provide
      ;; some minimalist fallback replacement.
      (fset 'defmacro
            (cons 'macro
                  #'(lambda (name args &rest body)
                      (list 'defalias (list 'quote name)
                            (list 'cons ''macro
                                  (list 'function
                                        (cons 'lambda (cons args body))))))))
      (defmacro defun (name args &rest body)
        (list 'defalias (list 'quote name)
              (list 'function (cons 'lambda (cons args body))))))

These would be used only at the beginning of the bootstrap and thus
shouldn't affect the final `src/emacs`.

        Stefan