[Top][All Lists]

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

Re: autoload

From: Oleksandr Gavenko
Subject: Re: autoload
Date: Mon, 24 Jan 2011 14:38:29 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20101207 Thunderbird/3.1.7

On 24.01.2011 2:40, Perry Smith wrote:
I have a .emacs.d directory with various elisp files I've either written myself 
over the years or pulled down from the net.

I just spent the past few hours constructing various scripts to automatically 
byte compile the new files and also create a myautoloads.el file that I load at 
startup.  It just seems to me that I must be recreating the wheel.

What do others do?

I store all my *.el files under DVCS (Mercurial) and install it from Makefile.

From '.emacs':

(defvar my-lisp-dir
  (expand-file-name "~/.emacs.d/my-lisp")
  "Here live my lisp packages.")
(add-to-list 'load-path my-lisp-dir t)

(defvar my-autoload (concat my-lisp-dir "/autoload-my.el")
  "Path to autoload for mode files.")

(if (file-exists-p my-autoload)
    (load my-autoload))

From 'Makefile':

FILES_MODE_EL := $(wildcard *-mode.el)

.PHONY: install
install: .emacs $(FILES_MODE_EL)
        cp .emacs $(HOME)/.emacs
        rm -f -r $(HOME)/.emacs.d/my-lisp
        mkdir -p $(HOME)/.emacs.d/my-lisp
        for file in $(FILES_MODE_EL); do \
                cp -f $$file $(HOME)/.emacs.d/my-lisp; \
        $(EMACS) --batch \
--eval='(let ( (generated-autoload-file "~/.emacs.d/my-lisp/autoload-my.el") ) (update-directory-autoloads "~/.emacs.d/my-lisp") )'

Look at last Makefile command - it generate autoload file automatically.
Compilation I don't use as my *-mode.el files are very short.

reply via email to

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