From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Robert Marshall Newsgroups: gmane.emacs.help Subject: Re: loading specific .emacs file on command line? Date: Fri, 14 Feb 2003 06:59:05 +0000 Organization: The first against the wall Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <3E4C229B.6040905@ihs.com> Reply-To: robert@chezmarshall.freeserve.co.uk NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1045206827 24460 80.91.224.249 (14 Feb 2003 07:13:47 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 14 Feb 2003 07:13:47 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18ja2c-0006MF-00 for ; Fri, 14 Feb 2003 08:13:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18ja4I-0003Sl-01 for gnu-help-gnu-emacs@m.gmane.org; Fri, 14 Feb 2003 02:15:30 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!gr.189.13.66.dial.global.net.UK!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 39 Original-NNTP-Posting-Host: gr.189.13.66.dial.global.net.uk (80.189.13.66) Original-X-Trace: fu-berlin.de 1045206848 46689900 80.189.13.66 (16 [66208]) X-Orig-Path: jailhouse.chezmarshall.freeserve.co.uk!not-for-mail X-Home-Page: http://www.chezmarshall.freeserve.co.uk User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.3.50 Cancel-Lock: sha1:riLAIKs87sW93LpegwFaUVxQXGc= Original-Xref: shelby.stanford.edu gnu.emacs.help:110169 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:6672 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:6672 On Thu, 13 Feb 2003, kevin.rodgers@ihs.com wrote: > You could break your .emacs file into multiple *.el files, > byte-compile them if you want, and either load them from your .emacs > file: > > (if foo > (load-file "~/foo")) > (if bar > (load-file "~/bar")) > > or load them explicitly on the command line: > > emacs > emacs -l ~/foo Or for another approach - having broken up the emacs file I use the name parameter on the command line and use the following defun (defun rajm-get-emacs-class () (let ((emacs-class (cdr (assoc 'name initial-frame-alist)))) (cond ((not emacs-class) 'full-class) ((string-equal "VM" emacs-class) 'vm-class) ((string-equal "rajm" emacs-class) 'full-class) ((string-equal "Root" emacs-class) 'root-class) ((string-equal "Gnus" emacs-class) 'fs-agent-class) ((string-equal "default" emacs-class) 'nil) (t 'remote-class)))) (defvar rajm-emacs-class (rajm-get-emacs-class)) And then load files in .emacs based upon rajm-emacs-class Robert -- Take me to the world A world that smiles With streets instead of aisles