Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to specify customized configuration file rather than "~/.emacs" ?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  11 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Z C  
View profile  
 More options Sep 13 2012, 9:44 am
Newsgroups: gnu.emacs.help
From: Z C <zcn...@gmail.com>
Date: Thu, 13 Sep 2012 21:43:45 +0800
Local: Thurs, Sep 13 2012 9:43 am
Subject: How to specify customized configuration file rather than "~/.emacs" ?

I just want emacs to load another file as the configuration file, and
ignore the default file ("~/.emacs").

Note that I don't want to change the original "~/.emacs" file.

I've tried to change "$HOME" env variable, but it doesn't work.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vineet Naik  
View profile  
 More options Sep 13 2012, 10:04 am
Newsgroups: gnu.emacs.help
From: Vineet Naik <naik...@gmail.com>
Date: Thu, 13 Sep 2012 19:33:55 +0530
Local: Thurs, Sep 13 2012 10:03 am
Subject: Re: How to specify customized configuration file rather than "~/.emacs" ?

On Thu, Sep 13, 2012 at 7:13 PM, Z C <zcn...@gmail.com> wrote:
> I just want emacs to load another file as the configuration file, and
> ignore the default file ("~/.emacs").

> Note that I don't want to change the original "~/.emacs" file.

> I've tried to change "$HOME" env variable, but it doesn't work.

If you mean you want to have emacs save the customization settings into
some other file, then
you need to add this code to ~/.emacs

(setq custom-file "~/.emacs-custom.el")
(load custom-file)

More info here:
http://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Custo...

HTH.

Regards,
Vineet


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jambunathan K  
View profile  
 More options Sep 13 2012, 10:12 am
Newsgroups: gnu.emacs.help
From: Jambunathan K <kjambunat...@gmail.com>
Date: Thu, 13 Sep 2012 19:42:59 +0530
Local: Thurs, Sep 13 2012 10:12 am
Subject: Re: How to specify customized configuration file rather than "~/.emacs" ?

Z C <zcn...@gmail.com> writes:
> I just want emacs to load another file as the configuration file, and
> ignore the default file ("~/.emacs").

> Note that I don't want to change the original "~/.emacs" file.

> I've tried to change "$HOME" env variable, but it doesn't work.

Load emacs with custom options.

,----
| $ emacs --help | grep load
|
| --no-desktop                do not load a saved desktop
| --no-init-file, -q          load neither ~/.emacs nor default.el
| --no-site-file              do not load site-start.el
| --user, -u USER             load ~USER/.emacs instead of your own
| --directory, -L DIR     add DIR to variable load-path
| --load, -l FILE         load Emacs Lisp FILE using the load function
`----

--


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Suvayu Ali  
View profile  
 More options Sep 13 2012, 10:39 am
Newsgroups: gnu.emacs.help
From: Suvayu Ali <fatkasuvayu+li...@gmail.com>
Date: Thu, 13 Sep 2012 16:38:35 +0200
Local: Thurs, Sep 13 2012 10:38 am
Subject: Re: How to specify customized configuration file rather than "~/.emacs" ?

To elaborate with an example:

  $ emacs -q -l ~/special-config.el

or,

  $ emacs -Q -l ~/special-config.el

--
Suvayu

Open source is the future. It sets us free.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pascal J. Bourguignon  
View profile  
 More options Sep 13 2012, 10:42 am
Newsgroups: gnu.emacs.help
From: "Pascal J. Bourguignon" <p...@informatimago.com>
Date: Thu, 13 Sep 2012 16:42:29 +0200
Local: Thurs, Sep 13 2012 10:42 am
Subject: Re: How to specify customized configuration file rather than "~/.emacs" ?

Z C <zcn...@gmail.com> writes:
> I just want emacs to load another file as the configuration file, and ignore the default file ("~/.emacs").

> Note that I don't want to change the original "~/.emacs" file.

> I've tried to change "$HOME" env variable, but it doesn't work.

man emacs

emacs -q -l other-configuration.el

--
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
PJ Weisberg  
View profile  
 More options Sep 13 2012, 11:27 am
Newsgroups: gnu.emacs.help
From: PJ Weisberg <p...@irregularexpressions.net>
Date: Thu, 13 Sep 2012 08:27:46 -0700
Local: Thurs, Sep 13 2012 11:27 am
Subject: Re: How to specify customized configuration file rather than "~/.emacs" ?

You'll probably also want to put (setq user-init-file
"~/special-config.el") in that file, or Emacs will refuse to save
customizations

-PJ

Gehm's Corollary to Clark's Law: Any technology distinguishable from
magic is insufficiently advanced.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "How to specify customized configuration file rather than"~/.emacs" ?" by Drew Adams
Drew Adams  
View profile  
 More options Sep 13 2012, 12:04 pm
Newsgroups: gnu.emacs.help
From: "Drew Adams" <drew.ad...@oracle.com>
Date: Thu, 13 Sep 2012 09:04:28 -0700
Local: Thurs, Sep 13 2012 12:04 pm
Subject: RE: How to specify customized configuration file rather than"~/.emacs" ?

> >   $ emacs -Q -l ~/special-config.el

> You'll probably also want to put (setq user-init-file
> "~/special-config.el") in that file, or Emacs will refuse to save
> customizations

That's all well and good, but to me the simplest and long-standard approach is
simply to set option `custom-file' and load it from your ~/.emacs file (early or
late in the file, depending on what you want/need).

Dunno why anyone would let Customize diddle with their ~/.emacs.

The _default_ for Emacs should be for Customize to save customizations to a
reasonable default `custom-file', just like we do for bookmark files and all the
rest.  Whoever let Customize mess with ~/.emacs in the first place should long
ago have been sent back to GnuLand for regrooving. ;-)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "How to specify customized configuration file rather than "~/.emacs" ?" by Z C
Z C  
View profile  
 More options Sep 14 2012, 11:30 am
Newsgroups: gnu.emacs.help
From: Z C <zcn...@gmail.com>
Date: Fri, 14 Sep 2012 23:29:29 +0800
Local: Fri, Sep 14 2012 11:29 am
Subject: Re: How to specify customized configuration file rather than "~/.emacs" ?

What I specifically need is that, let emacs treat another file as the
"~/.emacs" file.
This file should behaves EXACTLY as "~/.emacs" except that they have
different file name.

*That means, if I click Options -> Save Options, emacs would write changes
to this specific file.*

Start up option "-q" and "-l" doesn't solve this specific requirement.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "How to specify customized configuration file rather than"~/.emacs" ?" by Drew Adams
Drew Adams  
View profile  
 More options Sep 14 2012, 12:02 pm
Newsgroups: gnu.emacs.help
From: "Drew Adams" <drew.ad...@oracle.com>
Date: Fri, 14 Sep 2012 09:02:09 -0700
Local: Fri, Sep 14 2012 12:02 pm
Subject: RE: How to specify customized configuration file rather than"~/.emacs" ?

> What I specifically need is that, let emacs treat another
> file as the "~/.emacs" file.

> This file should behaves EXACTLY as "~/.emacs" except that
> they have different file name.

> That means, if I click Options -> Save Options, emacs
> would write changes to this specific file.

No, the last two sentences do not say the same thing.

If you want what you say in the second sentence, then use option `custome-file',
as I said before.  Then just put (load-file custom-file) in your .emacs.

This way, you still have your .emacs file for any non-Customize customizations
you might want to make.  And you can choose at which point in your .emacs you
want to load the customizations provided by Customize, by placing (load-file
custom-file) wherever you want.

Please read the Emacs manual about `custom-file':

C-h r
i custom-file


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "How to specify customized configuration file rather than "~/.emacs" ?" by Peter Dyballa
Peter Dyballa  
View profile  
 More options Sep 14 2012, 4:01 pm
Newsgroups: gnu.emacs.help
From: Peter Dyballa <Peter_Dyba...@Web.DE>
Date: Fri, 14 Sep 2012 22:01:25 +0200
Local: Fri, Sep 14 2012 4:01 pm
Subject: Re: How to specify customized configuration file rather than "~/.emacs" ?

Am 14.09.2012 um 17:29 schrieb Z C:

> *That means, if I click Options -> Save Options, emacs would write changes
> to this specific file.*

> Start up option "-q" and "-l" doesn't solve this specific requirement.

Launching GNU Emacs with -q means that you won't have an option to save customisation – that's inherent to the meaning of -q: without customisation.

--
Greetings

  Pete

You can never know too little of what is not worth knowing at all.
                        – Anon.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "How to specify customized configuration file rather than"~/.emacs" ?" by Suvayu Ali
Suvayu Ali  
View profile  
 More options Sep 15 2012, 10:06 am
Newsgroups: gnu.emacs.help
From: Suvayu Ali <fatkasuvayu+li...@gmail.com>
Date: Sat, 15 Sep 2012 16:05:55 +0200
Local: Sat, Sep 15 2012 10:05 am
Subject: Re: How to specify customized configuration file rather than"~/.emacs" ?
Hi,

To add an example to what Drew said; you can look at my init file here:

<https://github.com/suvayu/.emacs.d/blob/master/init.el#L29>

Hope this helps.

--
Suvayu

Open source is the future. It sets us free.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »