GNU bug report logs - #67455
Record source position, etc., in doc strings, and use this in *Help* and backtraces.

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Sun, 26 Nov 2023 14:31:02 UTC

Severity: wishlist

Full log


Message #196 received at 67455 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Alan Mackenzie <acm <at> muc.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 67455 <at> debbugs.gnu.org
Subject: Re: bug#67455: (Record source position, etc., in doc strings, and
 use this in *Help* and backtraces.)
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





This bug report was last modified 1 year and 12 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.