unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Selecting diferent init file from command switch
@ 2008-08-24 10:48 TheLonelyStar
  2008-08-24 11:36 ` Bernardo Bacic
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: TheLonelyStar @ 2008-08-24 10:48 UTC (permalink / raw)
  To: Help-gnu-emacs


Hello,

I use emacs:
a) As an IDE
b) As an simple Editor for my configs

For the IDE I am loading a lot of stuff like cedet and ecb.
For the simple Editor, I do not/need that.

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???

Thanks!
Nathan
-- 
View this message in context: http://www.nabble.com/Selecting-diferent-init-file-from-command-switch-tp19129531p19129531.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Selecting diferent init file from command switch
  2008-08-24 10:48 TheLonelyStar
@ 2008-08-24 11:36 ` Bernardo Bacic
  2008-08-24 12:11 ` Peter Dyballa
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Bernardo Bacic @ 2008-08-24 11:36 UTC (permalink / raw)
  To: Help-gnu-emacs

looking at "emacs --help" output, i'd say "emacs -Q --load <some_dot_emacs>" 
should work

it was a dark and stormy night when TheLonelyStar said,
> Hello,
> 
> I use emacs:
> a) As an IDE
> b) As an simple Editor for my configs
> 
> For the IDE I am loading a lot of stuff like cedet and ecb.
> For the simple Editor, I do not/need that.
> 
> 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???
> 
> Thanks!
> Nathan





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Selecting diferent init file from command switch
  2008-08-24 10:48 TheLonelyStar
  2008-08-24 11:36 ` Bernardo Bacic
@ 2008-08-24 12:11 ` Peter Dyballa
  2008-08-24 16:15 ` David Hansen
       [not found] ` <mailman.17464.1219595022.18990.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2008-08-24 12:11 UTC (permalink / raw)
  To: TheLonelyStar; +Cc: Help-gnu-emacs


Am 24.08.2008 um 12:48 schrieb TheLonelyStar:

> But I do I tell emacs, that it should not loa ~/.emacs but i.E.
> ~/.emacs-ide???

emacs -d that none of your init files is loaded, then add -l <file>.

A simple emacs --help can be so helpful!

--
Greetings

   Pete

Only useless documentation transcends the first two laws.
				– Arnold's Third Law of Documentation





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Selecting diferent init file from command switch
  2008-08-24 10:48 TheLonelyStar
  2008-08-24 11:36 ` Bernardo Bacic
  2008-08-24 12:11 ` Peter Dyballa
@ 2008-08-24 16:15 ` David Hansen
       [not found] ` <mailman.17464.1219595022.18990.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 6+ messages in thread
From: David Hansen @ 2008-08-24 16:15 UTC (permalink / raw)
  To: help-gnu-emacs


> 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.

David





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Selecting diferent init file from command switch
       [not found] ` <mailman.17464.1219595022.18990.help-gnu-emacs@gnu.org>
@ 2008-08-24 17:22   ` Pascal J. Bourguignon
  0 siblings, 0 replies; 6+ messages in thread
From: Pascal J. Bourguignon @ 2008-08-24 17:22 UTC (permalink / raw)
  To: help-gnu-emacs

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)))


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Selecting diferent init file from command switch
       [not found] <mailman.17457.1219574924.18990.help-gnu-emacs@gnu.org>
@ 2008-08-24 19:05 ` Chat
  0 siblings, 0 replies; 6+ messages in thread
From: Chat @ 2008-08-24 19:05 UTC (permalink / raw)
  To: help-gnu-emacs

TheLonelyStar <nabble@lonely-star.org> writes:

> Hello,
>
> I use emacs:
> a) As an IDE
> b) As an simple Editor for my configs
>
> For the IDE I am loading a lot of stuff like cedet and ecb.
> For the simple Editor, I do not/need that.
>
> 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???
>
> Thanks!
> Nathan
> -- 
> View this message in context: http://www.nabble.com/Selecting-diferent-init-file-from-command-switch-tp19129531p19129531.html
> Sent from the Emacs - Help mailing list archive at Nabble.com.
I prefer to keep a .emacs file for common customizations and load or not load
files depending on the requirement.

To avoid loading gnuserv with multiple instances, I invoke as
emacs --val "(setq nobs 1)"

and in my .emacs
(when (not (boundp 'nobs))
      ;; gnuserv specific code
)


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-08-24 19:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.17457.1219574924.18990.help-gnu-emacs@gnu.org>
2008-08-24 19:05 ` Selecting diferent init file from command switch Chat
2008-08-24 10:48 TheLonelyStar
2008-08-24 11:36 ` Bernardo Bacic
2008-08-24 12:11 ` Peter Dyballa
2008-08-24 16:15 ` David Hansen
     [not found] ` <mailman.17464.1219595022.18990.help-gnu-emacs@gnu.org>
2008-08-24 17:22   ` Pascal J. Bourguignon

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).