I just discovered that autoload is broken in the following example: ;;;autoload (iter-defun i () (iter-yield 1)) The form is copied verbatim to the output and fails because of no lexical-binding.
Leo Liu <sdl.web@gmail.com> writes: > I just discovered that autoload is broken in the following example: > > ;;;autoload > (iter-defun i () (iter-yield 1)) > > The form is copied verbatim to the output and fails because of no > lexical-binding. In emacs-28, the loaddefs files also have lexical binding, so this should be fixed now. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no
On 2022-03-31 13:16 +0200, Lars Ingebrigtsen wrote:
> In emacs-28, the loaddefs files also have lexical binding, so this
> should be fixed now.
I think the bigger issue is copying the definition verbatim to loaddefs.
It should be handled like `defun' i.e. only the name is copied.
Leo
Leo Liu <sdl.web@gmail.com> writes: > I think the bigger issue is copying the definition verbatim to loaddefs. > It should be handled like `defun' i.e. only the name is copied. Yeah, that's true, I guess. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no
[-- Attachment #1: Type: text/plain, Size: 283 bytes --] Lars Ingebrigtsen <larsi@gnus.org> writes: > Leo Liu <sdl.web@gmail.com> writes: > > > I think the bigger issue is copying the definition verbatim to loaddefs. > > It should be handled like `defun' i.e. only the name is copied. > > Yeah, that's true, I guess. This seems to work: [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-WIP-Fix-54648.patch --] [-- Type: text/x-diff, Size: 972 bytes --] From 933e969c95e95cf8612b0dd99836f1c0d6b7e3d1 Mon Sep 17 00:00:00 2001 From: Michael Heerdegen <michael_heerdegen@web.de> Date: Sat, 2 Apr 2022 00:56:09 +0200 Subject: [PATCH] WIP: Fix 54648 --- lisp/emacs-lisp/autoload.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 1e4b2c14a0..82956375bd 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -168,7 +168,7 @@ make-autoload define-globalized-minor-mode defun defmacro easy-mmode-define-minor-mode define-minor-mode define-inline cl-defun cl-defmacro cl-defgeneric - cl-defstruct pcase-defmacro)) + cl-defstruct pcase-defmacro iter-defun)) (macrop car) (setq expand (let ((load-true-file-name file) (load-file-name file)) -- 2.30.2 [-- Attachment #3: Type: text/plain, Size: 11 bytes --] Michael.
On 2022-04-02 00:58 +0200, Michael Heerdegen wrote:
> This seems to work.
Looks good. Forgot only whitelisted macros are expanded. BTW could you
also include cl-iter-defun there?
Thanks,
Leo
Michael Heerdegen <michael_heerdegen@web.de> writes: > This seems to work: Looks good to me. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Michael Heerdegen <michael_heerdegen@web.de> writes:
>
>> This seems to work:
>
> Looks good to me.
How about pushing this fix to master. Michael?
Stefan Kangas <stefan@marxist.se> writes:
> How about pushing this fix to master. Michael?
Done. I've also added the `cl-iter-defun' as had been suggested.
Michael.