all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
To: emacs-devel <emacs-devel@gnu.org>
Subject: Re: autoload cl-defstruct constructor?
Date: Fri, 06 Sep 2019 15:25:29 -0700	[thread overview]
Message-ID: <86a7bh83l2.fsf@stephe-leake.org> (raw)
In-Reply-To: <jwvwoelmwc1.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Fri, 06 Sep 2019 08:47:49 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> If I add an autoload cookie to a cl-defstruct, running
>> update-directory-autoloads on the above gives:
>>
>> ---
>>
>> ;;; Generated autoloads from gnat-core.el
>>
>> (cl-defstruct gnat-compiler "\
>> Used with wisi-compiler-* generic functions." gpr-file run-buffer-name
>> project-path target runtime gnat-stub-opts gnat-stub-cargs)
>
> Oh, right, because when the autoloads are generated `cl-defstruct` is
> not defined at all.  If you run update-directory-autoloads from within
> a running Emacs where cl-lib is loaded, it will give you a result that's
> much closer to what you want.

Hmm. To build autoloads.el for ada-mode in my development tree, I run:

emacs -Q -batch --eval "(progn (require 'autoload)(require 'cl-lib)(setq generated-autoload-file (expand-file-name \"../autoloads.el\"))(update-directory-autoloads \"../\"))"

I just added the (require 'cl-lib), but I still get the same result for
a cl-defstruct:

--- autoloads.el

;;; Generated autoloads from gnat-core.el

(cl-defstruct gnat-compiler "\
Used with wisi-compiler-* generic functions." gpr-file run-buffer-name project-path target runtime gnat-stub-opts gnat-stub-cargs)

(autoload 'create-gnat-compiler "gnat-core" "\
---

What am I missing?

We'll need to ensure package.el does the same when it generates
autoloads. Or is that done on the elpa server?

> Making cl-defstruct into an autoloaded macro would solve this part of
> the problem.

I guess that means adding a special case in make-autoload?

-- 
-- Stephe



  reply	other threads:[~2019-09-06 22:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-04 18:53 autoload cl-defstruct constructor? Stephen Leake
2019-09-04 19:03 ` Stefan Monnier
2019-09-05 23:36   ` Stephen Leake
2019-09-06 12:47     ` Stefan Monnier
2019-09-06 22:25       ` Stephen Leake [this message]
2019-09-07 14:29         ` Stefan Monnier
2019-09-09 19:12           ` Stephen Leake
2019-09-09 19:35             ` Stephen Leake
2019-09-09 21:38             ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86a7bh83l2.fsf@stephe-leake.org \
    --to=stephen_leake@stephe-leake.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.