unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#54648: 27.2; Cannot autoload iter-defun
@ 2022-03-31  7:41 Leo Liu
  2022-03-31 11:16 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Leo Liu @ 2022-03-31  7:41 UTC (permalink / raw)
  To: 54648

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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#54648: 27.2; Cannot autoload iter-defun
  2022-03-31  7:41 bug#54648: 27.2; Cannot autoload iter-defun Leo Liu
@ 2022-03-31 11:16 ` Lars Ingebrigtsen
  2022-03-31 12:19   ` Leo Liu
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2022-03-31 11:16 UTC (permalink / raw)
  To: Leo Liu; +Cc: 54648

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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#54648: 27.2; Cannot autoload iter-defun
  2022-03-31 11:16 ` Lars Ingebrigtsen
@ 2022-03-31 12:19   ` Leo Liu
  2022-03-31 12:20     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Leo Liu @ 2022-03-31 12:19 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 54648

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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#54648: 27.2; Cannot autoload iter-defun
  2022-03-31 12:19   ` Leo Liu
@ 2022-03-31 12:20     ` Lars Ingebrigtsen
  2022-04-01 22:58       ` Michael Heerdegen
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2022-03-31 12:20 UTC (permalink / raw)
  To: Leo Liu; +Cc: 54648

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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#54648: 27.2; Cannot autoload iter-defun
  2022-03-31 12:20     ` Lars Ingebrigtsen
@ 2022-04-01 22:58       ` Michael Heerdegen
  2022-04-02 11:15         ` Leo Liu
  2022-04-02 13:04         ` Lars Ingebrigtsen
  0 siblings, 2 replies; 9+ messages in thread
From: Michael Heerdegen @ 2022-04-01 22:58 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 54648, Leo Liu

[-- 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.

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#54648: 27.2; Cannot autoload iter-defun
  2022-04-01 22:58       ` Michael Heerdegen
@ 2022-04-02 11:15         ` Leo Liu
  2022-04-02 13:04         ` Lars Ingebrigtsen
  1 sibling, 0 replies; 9+ messages in thread
From: Leo Liu @ 2022-04-02 11:15 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Lars Ingebrigtsen, 54648

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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#54648: 27.2; Cannot autoload iter-defun
  2022-04-01 22:58       ` Michael Heerdegen
  2022-04-02 11:15         ` Leo Liu
@ 2022-04-02 13:04         ` Lars Ingebrigtsen
  2022-06-19 19:04           ` Stefan Kangas
  1 sibling, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-02 13:04 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 54648, Leo Liu

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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#54648: 27.2; Cannot autoload iter-defun
  2022-04-02 13:04         ` Lars Ingebrigtsen
@ 2022-06-19 19:04           ` Stefan Kangas
  2022-06-21 17:58             ` Michael Heerdegen
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Kangas @ 2022-06-19 19:04 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Michael Heerdegen, 54648, Leo Liu

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?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#54648: 27.2; Cannot autoload iter-defun
  2022-06-19 19:04           ` Stefan Kangas
@ 2022-06-21 17:58             ` Michael Heerdegen
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Heerdegen @ 2022-06-21 17:58 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Lars Ingebrigtsen, 54648-done, Leo Liu

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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-06-21 17:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-31  7:41 bug#54648: 27.2; Cannot autoload iter-defun Leo Liu
2022-03-31 11:16 ` Lars Ingebrigtsen
2022-03-31 12:19   ` Leo Liu
2022-03-31 12:20     ` Lars Ingebrigtsen
2022-04-01 22:58       ` Michael Heerdegen
2022-04-02 11:15         ` Leo Liu
2022-04-02 13:04         ` Lars Ingebrigtsen
2022-06-19 19:04           ` Stefan Kangas
2022-06-21 17:58             ` Michael Heerdegen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).