emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Generating autoloads for libraries in contrib


From: Jambunathan K
Subject: Re: [O] Generating autoloads for libraries in contrib
Date: Tue, 26 Jul 2011 23:32:57 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (windows-nt)

suvayu ali <address@hidden> 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,

-- 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]