From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@russet.org.uk (Phillip Lord) Newsgroups: gmane.emacs.help Subject: Re: autoloading entire function Date: Mon, 13 Jun 2016 21:07:12 +0100 Message-ID: <87fusgg8en.fsf@russet.org.uk> References: <87mvmpf62b.fsf@russet.org.uk> <50h9cxt2if.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1465848500 22582 80.91.229.3 (13 Jun 2016 20:08:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 13 Jun 2016 20:08:20 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Glenn Morris Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 13 22:08:10 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bCY9Y-0002PB-HQ for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Jun 2016 22:08:08 +0200 Original-Received: from localhost ([::1]:58972 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCY9X-0005eA-K0 for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Jun 2016 16:08:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCY8x-0005d9-Sh for help-gnu-emacs@gnu.org; Mon, 13 Jun 2016 16:07:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCY8v-0002yU-W1 for help-gnu-emacs@gnu.org; Mon, 13 Jun 2016 16:07:30 -0400 Original-Received: from cloud103.planethippo.com ([31.216.48.48]:41907) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCY8p-0002xa-30; Mon, 13 Jun 2016 16:07:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=russet.org.uk; s=default; h=Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From; bh=HduIvBkUs55eM4/C6d9yDUvHKypYzOdwsfCydk2A7Sc=; b=DTnA6sHYZ88JMJ2hDWF2kAxiYz 3CdDhcQV4EbyPrwKGvXl2h1oiLYll6tPEHzYkuofZA8mylRpcYdfuJorvyLZyOx5I5W1dsjwU+9Yv 7mU/QAb5SNrHQUTmAM0tHvPKJlBwkZw+7T7Gwn3ocB2hTTN+mRAoVzXnB+YrRkyy457ZLTSSbSAgQ JAwvZbN5zWcD7OpnQUEEImnMX33WvnZs1DhL6EIi0XofU036675uvuUrxQ/TmH+gJgQD/gyOhPpOM HZKLPUFRIgH5Bx4Fe9Bnrf4QERLVSIOMg0bxR+wsgaOuIaeHOxN6vaWxfgUN8saUrHHhJIY/UwRDD VtmCrnIA==; Original-Received: from cpc1-benw10-2-0-cust373.gate.cable.virginm.net ([77.98.219.118]:33191 helo=russet.org.uk) by cloud103.planethippo.com with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.86_1) (envelope-from ) id 1bCY8n-0029ri-G0; Mon, 13 Jun 2016 21:07:22 +0100 In-Reply-To: <50h9cxt2if.fsf@fencepost.gnu.org> (Glenn Morris's message of "Mon, 13 Jun 2016 13:36:08 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cloud103.planethippo.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - russet.org.uk X-Get-Message-Sender-Via: cloud103.planethippo.com: authenticated_id: phillip.lord@russet.org.uk X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@russet.org.uk X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 31.216.48.48 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:110434 Archived-At: Glenn Morris 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