From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "paul r" Newsgroups: gmane.emacs.devel Subject: Feature Request : autoload-form Date: Fri, 28 Mar 2008 21:05:09 +0100 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1206734727 15260 80.91.229.12 (28 Mar 2008 20:05:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Mar 2008 20:05:27 +0000 (UTC) To: "Emacs Devel" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 28 21:05:57 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JfKpn-0006Qc-6u for ged-emacs-devel@m.gmane.org; Fri, 28 Mar 2008 21:05:55 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JfKpB-0008HO-Ok for ged-emacs-devel@m.gmane.org; Fri, 28 Mar 2008 16:05:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JfKp7-0008Gx-Fm for emacs-devel@gnu.org; Fri, 28 Mar 2008 16:05:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JfKp6-0008GX-1B for emacs-devel@gnu.org; Fri, 28 Mar 2008 16:05:13 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JfKp5-0008GU-PW for emacs-devel@gnu.org; Fri, 28 Mar 2008 16:05:11 -0400 Original-Received: from fk-out-0910.google.com ([209.85.128.185]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JfKp5-0000QW-76 for emacs-devel@gnu.org; Fri, 28 Mar 2008 16:05:11 -0400 Original-Received: by fk-out-0910.google.com with SMTP id 26so508656fkx.10 for ; Fri, 28 Mar 2008 13:05:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=Npxe4M2GuP0ibp/wBCtFWCSgd53ipHq0sXuLRdxb9Vw=; b=jp/os73mN18+tpNjCr2BmMawrhhwNqaKzg3aheJvHnlqZCSdpXb0icYo9ar1WNPHe0P+4Cl7FBqqdPF0TN93ywh+uCnF0OBRNq3zMIHLG/hQhcyRvmhtSFsZIfU32vqX8qmAElonuG9/0VhX3qRzvx+XWfCRU9GNoMbF7HvsXuk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=XQZ/vmA5xG7ke8Jx6YA0aB5Zs8xxFOHEc9Qu4U4wVs9Nf5VF2rXOibCeOUEP8FdPeMzdhJ3rj87yPwSd0JDAV4NZUXOOFYJvvND0rGi8EZW2Jga7kDjvat8ZXPHfVFzgUX9Vw8mM2eMSRGelSuueYGQISSpfUKF8tHgL3aWm76w= Original-Received: by 10.82.136.8 with SMTP id j8mr6533719bud.31.1206734709877; Fri, 28 Mar 2008 13:05:09 -0700 (PDT) Original-Received: by 10.82.175.3 with HTTP; Fri, 28 Mar 2008 13:05:09 -0700 (PDT) Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:93709 Archived-At: Dear list, autoload is a very convenient feature to pseudo-defun a function until it is called for real for the first time. I have been using it happily until today, when I came accross a need I can not suit with autoload. Here is why : There is a file B that does some (require ...) and some (load ...). In one of the loaded files, function F will be defined. There is a file A that changes the load-path, which is required before loading B. B does not depend on a predefined A file, therefore I can not put a (load A) in B. The only way I have to carry a proper load is to do (load A)(load B). After that, I'm sure F will be defined the way I want. I can really not do that with a single file. Hence my need : I think it would be convenient to have a variant of autoload, let's call it 'autoload-form'. Its look would be : (autoload-form function form &optional docstring interactive type) IOW, exactly the same as autoload, except that FILE becomes FORM. It is a kind a generalization of autoload, in which it is up to FORM to do what is needed to provide a side-effect of having FUNCTION defined. To make sure I am clear, the following two lines have the same effect (autoload foo "bar.el") (autoload-form foo (load-file "bar.el")) With that, I could do a (autoload-form F (load-file "A")(load-file "B")) Without, the only alternative I see is to write (load-file "A")(load-file "B") in a dummy file, then register it with autoload. I really want to do that myself, but autoload belongs to the C part of emacs, and I lack knowledge to change anything in it. I do not know how to do this in emacs lisp, whenever it is possible. I would like to know what you think about that. If you think I can do something clean in lisp, please give me some hints, I do not know where to start. Regards, -- Paul