emacs-devel
[Top][All Lists]
Advanced

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

Re: Should require and provide be symmetrical?


From: Harald Hanche-Olsen
Subject: Re: Should require and provide be symmetrical?
Date: Wed, 10 Feb 2010 14:12:12 -0500 (EST)

+ Andreas Schwab <address@hidden>:

> Nathaniel Flath <address@hidden> writes:
> 
> > I ran into this whil splitting up my personal configuration - I was
> > attempting to mirror the packages I was loading, so for example org.el
> > in my directory would contain customizations for org-mode.
> 
> You can use eval-after-load for that.

>From my .emacs (this is ancient code, not necessarily an example of
good coding style):

(setf HOME (expand-file-name "~hanche"))
(setf my-libdir (concat HOME "/lib/emacs"))
(push my-libdir load-path)
(let ((fixes (mapcar #'(lambda (s) (cons (substring s 4 -3) (substring s 0 -3)))
                     (directory-files my-libdir nil "^fix-.*[.]el$"))))
  (while fixes
    (let ((fix (first fixes)))
      (eval-after-load (car fix) (list 'load (cdr fix))))
    (setf fixes (rest fixes))))

So, if there is a file named fix-org.el in my-libdir, the above will
automatically do (eval-after-load "org" '(load "fix-org")). I use it
more for bugfixes than customizations, but it has served me well over
the years.

- Harald




reply via email to

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