From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: Re: Generating autoloads for libraries in contrib Date: Tue, 26 Jul 2011 23:32:57 +0530 Message-ID: <81d3gw6hta.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:51372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QllyO-0004tk-SD for emacs-orgmode@gnu.org; Tue, 26 Jul 2011 14:03:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QllyN-0006Gb-CZ for emacs-orgmode@gnu.org; Tue, 26 Jul 2011 14:03:16 -0400 Received: from mail-yi0-f41.google.com ([209.85.218.41]:58389) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QllyN-0006GV-86 for emacs-orgmode@gnu.org; Tue, 26 Jul 2011 14:03:15 -0400 Received: by yia13 with SMTP id 13so544309yia.0 for ; Tue, 26 Jul 2011 11:03:14 -0700 (PDT) In-Reply-To: (suvayu ali's message of "Tue, 26 Jul 2011 15:12:52 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: suvayu ali Cc: org-mode mailing list suvayu ali writes: > Hi, > > Does anyone know how to generate autoloads for libraries in the > contrib directory? I was hoping generating autoloads would let me > remove some of the (require 'library) from my setup. (To satisfy my own curiosity) IIRC, Achim has added support for the above. I am unable to find the link right now. The below snippet is stolen from Makefile and adopted for interactive use. If you call the below command from the rootdir of installation, it would create an autoload file in contrib/lisp/org-contrib-install.el. Note: Finding out the right paths is left as an exercise to the reader. --8<---------------cut here---------------start------------->8--- (defun my-org-contrib-autoloads () (interactive) (unless (featurep 'autoload) (require 'autoload)) (let ((file "contrib/lisp/org-contrib-install.el")) (with-current-buffer (find-file-noselect file) (when (equal (point-min) (point-max)) (save-excursion (insert "\n(provide 'org-contrib-install)\n"))) (goto-char (point-min)) (call-interactively 'generate-file-autoloads) (save-buffer) (kill-buffer)))) --8<---------------cut here---------------end--------------->8--- or If you look at the above org-contrib-install.el file it simply calls (autoload ...) for the autoloaded things. So if you often invoke a certain library through just a single command then you can simply add the (autoload ...) for just that command to .emacs. > > Thanks, --