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
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
`----
On Thu, Sep 13, 2012 at 07:42:59PM +0530, Jambunathan K wrote:
> 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
> `----
On Thu, Sep 13, 2012 at 7:38 AM, Suvayu Ali <fatkasuvayu+li...@gmail.com> wrote:
> On Thu, Sep 13, 2012 at 07:42:59PM +0530, Jambunathan K wrote:
>> 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
>> `----
> To elaborate with an example:
> $ emacs -q -l ~/special-config.el
> or,
> $ 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
-PJ
Gehm's Corollary to Clark's Law: Any technology distinguishable from
magic is insufficiently advanced.
> 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. ;-)
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.
On Thu, Sep 13, 2012 at 9:43 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.
> 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.
On Fri, Sep 14, 2012 at 09:02:09AM -0700, Drew Adams wrote:
> > 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
To add an example to what Drew said; you can look at my init file here: