help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: loading specific .emacs file on command line?


From: Robert Marshall
Subject: Re: loading specific .emacs file on command line?
Date: Fri, 14 Feb 2003 06:59:05 +0000
User-agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.3.50

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


reply via email to

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