[Top][All Lists]

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

Re: customize versus own expressions in .emacs

From: Tim X
Subject: Re: customize versus own expressions in .emacs
Date: Mon, 11 Apr 2005 19:47:19 +1000
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

address@hidden (J. David Boyd) writes:

> Tim X <address@hidden> writes:
>> address@hidden (J. David Boyd) writes:
>>> Tim X <address@hidden> writes:
>>>> What I found works well for me is to put a bit of elisp at the beginning
>>>> of my .emacs file which tells emacs to look in my own .emacs.d directory
>>>> and load the files in that directory.
>>> And you aren't going to share this piece of code?  We have to work it out
>>> for ourselves? :->
>> Hey, half the fun of emacs is working that sort of stuff out yourself!
>> However, if someone really does want my bit of unworthy code, I'll provide
>> it.
> I want it.  I'm not looking for fun, I'm using Emacs! :->

OK - if you want it, you get it. I've used a number of 'incantations'
at the beginning of my .emacs to load my own files. As previously
mentioned, I now just use (provide 'xxx) at the end of each of my
emacs files and then just put a (require 'xxx) in my .emacs to load
them. However, before doing that, I used 

(defvar my-load-dir "~/.emacs.d")

(let ((files (directory-files (expand-file-name my-load-dir) t ".*\\.el$")))
  (mapcar (lambda (file)
                        (load-file file)

which works OK, but doesn't really have enough (any) error checking. I
then decided to see what other solutions I could find and stumbled on
the debian-run-directories, which is included in debian-startup.el on
all debian Linux based systems. This did what I wanted a little more
robustly than my simple 'mapcar' approach. then I moved to using
provide/require - which is where I am at now.

The thing I discovered from this process was that for a large number
of things you will probably find either the answer or some code which
is close to what you need right there on your system already. Use
apropos and the sources and you will rarely need to be original!


Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you 
really need to send mail, you should be able to work it out!

reply via email to

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