From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?iso-8859-1?q?Francisco_Miguel_Cola=E7o?= Newsgroups: gmane.emacs.help Subject: Re: An alternative to a monolithic ~/.emacs init file Date: 11 Nov 2007 00:09:47 GMT Organization: PT.com - Comunicacoes Interactivas, SA Message-ID: <4736484b$0$25509$a729d347@news.telepac.pt> References: <1194455637.485972.177570@s15g2000prm.googlegroups.com> <1194544126.425679.261670@e9g2000prf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1194750708 11794 80.91.229.12 (11 Nov 2007 03:11:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 11 Nov 2007 03:11:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 11 04:11:52 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ir3El-0006Zb-6n for geh-help-gnu-emacs@m.gmane.org; Sun, 11 Nov 2007 04:11:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ir3EZ-0000Jh-Dk for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Nov 2007 22:11:39 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsinpeer00.lnd.ops.eu.uu.net!bnewsinpeer00.bru.ops.eu.uu.net!emea.uu.net!newshub.netvisao.pt!nntp.cprm.net!brown.telepac.pt!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Pan/0.129 (Benson & Hedges Moscow Gold) Original-Lines: 64 Original-NNTP-Posting-Host: 81.193.90.139 Original-X-Trace: 1194739787 news.telepac.pt 25509 81.193.90.139:41480 Original-X-Complaints-To: abuse@mail.telepac.pt Original-Xref: shelby.stanford.edu gnu.emacs.help:153670 X-Mailman-Approved-At: Sat, 10 Nov 2007 22:10:37 -0500 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:49129 Archived-At: Thu, 08 Nov 2007 11:53:08 -0800, rustom wrote: > On Nov 8, 6:08 pm, Sebastian Tennant wrote: >> Quoth rustom : >> >> > Could you please elaborate on how this works a little? [...] I >> > really would like to have a tiny little .emacs file and a bunch of >> > files and directories containing unrelated stuff >> >> If you don't care about autoloads (or you're not sure what they are) >> and you just want a small ~/.emacs, then all you need is this: >> >> ;;; load dotemacs/*.el >> (mapc (lambda (f) (load f)) >> (split-string >> (shell-command-to-string "find ~/elisp/dotemacs -name *.el"))) >> I use the following .emacs: (set-language-environment "UTF-8") (setq user-full-name "ABCDE" user-initials "abc" user-mail-address "abc@cde.com" user-dir-library "~/.local/share/emacs" user-dir-configuration "~/.config/emacs" user-dir-cache "~/.cache/emacs" ) (setq load-path (append load-path (expand-file-name user-dir-library))) ;;; Define some needed functions. (defun user-conf-filename (filename) "Gets the path of a configuration file, whose name is given. FILENAME is path appended to 'user-dir-configuration'. " (concat user-dir-configuration "/" filename)) ;;; Load the user configuration. (load (user-conf-filename "conf-user.el")) Well, this puts all files within ~/.config/emacs. Even ~/.emacs is a symlink to ~/.config/emacs/dotemacs. This way: 1. I can zip all my emacs configuration by zipping one directory. 2. all I have to do is put in conf-user.el expressions like: (load (user-conf-filename "conf-fonts.el")) Of couse, I also maintain custom.el in the ~/.config/emacs directory by issuing, in .config/emacs/conf-user.el: (setq custom-file (user-conf-filename "custom.el")) (load custom-file) and all the emacs-specific files like ~/.projects.ede are moved intyo the directory by issuing the correspondent customize commands or setting their names in .emacs Works like a charm. Francisco Colaço