unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: phillip.lord@russet.org.uk (Phillip Lord)
To: Glenn Morris <rgm@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: autoloading entire function
Date: Mon, 13 Jun 2016 21:07:12 +0100	[thread overview]
Message-ID: <87fusgg8en.fsf@russet.org.uk> (raw)
In-Reply-To: <50h9cxt2if.fsf@fencepost.gnu.org> (Glenn Morris's message of "Mon, 13 Jun 2016 13:36:08 -0400")

Glenn Morris <rgm@gnu.org> writes:

> Simply wrap your defun in a progn.
> See eg the examples in Emacs sources such as cvs-dired-noselect
> (simply search for ^(defun in loaddefs.el).

Ah, yes, hadn't thought of that.

Unfortunately, I have another issue. The source file is lexically bound,
and the function uses this feature (it returns closures). This breaks
in the autoload file.

I've tried using eval like so:

;;;###autoload
(eval
   (defun fname())
 t)

which solves both problems.

Any better way?

Phil



      reply	other threads:[~2016-06-13 20:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13 15:43 autoloading entire function Phillip Lord
2016-06-13 17:36 ` Glenn Morris
2016-06-13 20:07   ` Phillip Lord [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87fusgg8en.fsf@russet.org.uk \
    --to=phillip.lord@russet.org.uk \
    --cc=help-gnu-emacs@gnu.org \
    --cc=rgm@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.
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).