unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tim X <timx@spamto.devnul.com>
Subject: Re: customize versus own expressions in .emacs
Date: Mon, 11 Apr 2005 19:47:19 +1000	[thread overview]
Message-ID: <87hdid3as8.fsf@tiger.rapttech.com.au> (raw)
In-Reply-To: 81mzsau5o1.fsf@adboyd.com

dave@adboyd.com (J. David Boyd) writes:

> Tim X <timx@spamto.devnul.com> writes:
>
>> dave@adboyd.com (J. David Boyd) writes:
>>
>>
>>> Tim X <timx@spamto.devnul.com> 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!

  parent reply	other threads:[~2005-04-11  9:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.353.1111951880.28103.help-gnu-emacs@gnu.org>
2005-03-29 14:55 ` customize versus own expressions in .emacs Stefan Monnier
2005-04-02  4:29 ` Tim X
2005-04-04 13:39   ` J. David Boyd
2005-04-07  9:42     ` Tim X
2005-04-07 11:42       ` Pascal Bourguignon
2005-04-07 12:34       ` J. David Boyd
2005-04-07 16:45         ` Joe Corneli
2005-04-11  9:47         ` Tim X [this message]
2005-03-27 19:22 Sebastian Luque
     [not found] ` <87d5tklwr5.fsf-by2PdLBuqAc@public.gmane.org>
2005-03-27 21:39   ` Jochen Küpper
2005-03-29 10:11 ` Peter Dyballa
     [not found] ` <mailman.484.1112092111.28103.help-gnu-emacs@gnu.org>
2005-03-29 11:33   ` Thien-Thi Nguyen
2005-03-29 14:47     ` Joe Corneli
2005-03-29 14:57   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87hdid3as8.fsf@tiger.rapttech.com.au \
    --to=timx@spamto.devnul.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).