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

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

Re: Selecting diferent init file from command switch


From: Pascal J. Bourguignon
Subject: Re: Selecting diferent init file from command switch
Date: Sun, 24 Aug 2008 19:22:58 +0200
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.2 (gnu/linux)

David Hansen <david.hansen@gmx.net> writes:

>> So I created 2 different init files: .emacs-ide, .emacs-editor!
>>
>> But I do I tell emacs, that it should not loa ~/.emacs but i.E.
>> ~/.emacs-ide???
>
> You can set $HOME to get emacs load a ".emacs" from another directory.


I would rather propose a different solution.

You can have one ~/.emacs  that will check the command-line-args
variable for arguments specific to each usage:


(let ((pname (file-namestring (first command-line-args))))
 (cond
  ((string= "emacs-ide" pname)
   
    ;; do ide specific initialization

    )
  ((string= "emacs-quick-edit" pname)
   
    ;; do quick-edit specific initialization

    )
  (t
    
    ;; do default emacs specific initialization

    )))

and use symbolic links to emacs named emacs-ide and emacs-quick-edit.



If you really want to keep your initializations in different files,
then you can use in ~/.emacs:

(let ((pname (file-namestring (first command-line-args))))
  (cond
    ((string= pname "emacs")
      
      ;; do default emacs specific initialization

      )
    (t
      (load (format nil "~/.%s" pname)))))
    

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

"This statement is false."            In Lisp: (defun Q () (eq nil (Q)))


reply via email to

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