From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: customize versus own expressions in .emacs Date: Mon, 11 Apr 2005 19:47:19 +1000 Message-ID: <87hdid3as8.fsf@tiger.rapttech.com.au> References: <87vf75243e.fsf@tiger.rapttech.com.au> <81zmwefys7.fsf@adboyd.com> <87is2yylbj.fsf@tiger.rapttech.com.au> <81mzsau5o1.fsf@adboyd.com> Reply-To: timx@spamto.devnul.com NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1113213257 18939 80.91.229.2 (11 Apr 2005 09:54:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 11 Apr 2005 09:54:17 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 11 11:54:13 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DKvbW-0002TD-4U for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Apr 2005 11:53:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DKvBb-0005gQ-0T for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Apr 2005 05:26:27 -0400 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:/0RN4YI+NYFm+lXCK/fI1jEWLIo= Original-NNTP-Posting-Host: ppp211-240.lns2.syd3.internode.on.net Original-X-Trace: duster.adelaide.on.net 1113212839 203.122.211.240 (11 Apr 2005 19:17:19 +0950) Original-Lines: 60 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news3.google.com!news.glorb.com!newsfeed-east.nntpserver.com!nntpserver.com!newsfeed-west.nntpserver.com!news1.optus.net.au!optus!news.mel.connect.com.au!news-north.connect.com.au!news-south.connect.com.au!duster.adelaide.on.net!not-for-mail Original-Xref: shelby.stanford.edu gnu.emacs.help:129985 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:25549 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:25549 dave@adboyd.com (J. David Boyd) writes: > Tim X writes: > >> dave@adboyd.com (J. David Boyd) writes: >> >> >>> Tim X 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) files))) 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 -- 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!