all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to specify customized configuration file rather than "~/.emacs" ?
@ 2012-09-13 13:43 Z C
  2012-09-13 14:03 ` Vineet Naik
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Z C @ 2012-09-13 13:43 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 237 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 355 bytes --]

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

* Re: How to specify customized configuration file rather than "~/.emacs" ?
  2012-09-13 13:43 How to specify customized configuration file rather than "~/.emacs" ? Z C
@ 2012-09-13 14:03 ` Vineet Naik
  2012-09-13 14:12 ` Jambunathan K
  2012-09-14 15:29 ` How to specify customized configuration file rather than "~/.emacs" ? Z C
  2 siblings, 0 replies; 11+ messages in thread
From: Vineet Naik @ 2012-09-13 14:03 UTC (permalink / raw)
  To: Z C; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 630 bytes --]

On Thu, Sep 13, 2012 at 7:13 PM, Z C <zcnnbb@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-Customizations.html

HTH.

Regards,
Vineet

[-- Attachment #2: Type: text/html, Size: 1233 bytes --]

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

* Re: How to specify customized configuration file rather than "~/.emacs" ?
  2012-09-13 13:43 How to specify customized configuration file rather than "~/.emacs" ? Z C
  2012-09-13 14:03 ` Vineet Naik
@ 2012-09-13 14:12 ` Jambunathan K
  2012-09-13 14:38   ` Suvayu Ali
  2012-09-14 15:29 ` How to specify customized configuration file rather than "~/.emacs" ? Z C
  2 siblings, 1 reply; 11+ messages in thread
From: Jambunathan K @ 2012-09-13 14:12 UTC (permalink / raw)
  To: Z C; +Cc: help-gnu-emacs

Z C <zcnnbb@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
`----

-- 



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

* Re: How to specify customized configuration file rather than "~/.emacs" ?
  2012-09-13 14:12 ` Jambunathan K
@ 2012-09-13 14:38   ` Suvayu Ali
  2012-09-13 15:27     ` PJ Weisberg
  0 siblings, 1 reply; 11+ messages in thread
From: Suvayu Ali @ 2012-09-13 14:38 UTC (permalink / raw)
  To: help-gnu-emacs

On Thu, Sep 13, 2012 at 07:42:59PM +0530, Jambunathan K wrote:
> Z C <zcnnbb@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

-- 
Suvayu

Open source is the future. It sets us free.



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

* Re: How to specify customized configuration file rather than "~/.emacs" ?
       [not found] <mailman.8775.1347543860.855.help-gnu-emacs@gnu.org>
@ 2012-09-13 14:42 ` Pascal J. Bourguignon
  0 siblings, 0 replies; 11+ messages in thread
From: Pascal J. Bourguignon @ 2012-09-13 14:42 UTC (permalink / raw)
  To: help-gnu-emacs

Z C <zcnnbb@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
\f
emacs -q -l other-configuration.el


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


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

* Re: How to specify customized configuration file rather than "~/.emacs" ?
  2012-09-13 14:38   ` Suvayu Ali
@ 2012-09-13 15:27     ` PJ Weisberg
  2012-09-13 16:04       ` How to specify customized configuration file rather than"~/.emacs" ? Drew Adams
  0 siblings, 1 reply; 11+ messages in thread
From: PJ Weisberg @ 2012-09-13 15:27 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: help-gnu-emacs

On Thu, Sep 13, 2012 at 7:38 AM, Suvayu Ali <fatkasuvayu+linux@gmail.com> wrote:
> On Thu, Sep 13, 2012 at 07:42:59PM +0530, Jambunathan K wrote:
>> Z C <zcnnbb@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.



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

* RE: How to specify customized configuration file rather than"~/.emacs" ?
  2012-09-13 15:27     ` PJ Weisberg
@ 2012-09-13 16:04       ` Drew Adams
  0 siblings, 0 replies; 11+ messages in thread
From: Drew Adams @ 2012-09-13 16:04 UTC (permalink / raw)
  To: 'PJ Weisberg', 'Suvayu Ali'; +Cc: help-gnu-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. ;-)




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

* Re: How to specify customized configuration file rather than "~/.emacs" ?
  2012-09-13 13:43 How to specify customized configuration file rather than "~/.emacs" ? Z C
  2012-09-13 14:03 ` Vineet Naik
  2012-09-13 14:12 ` Jambunathan K
@ 2012-09-14 15:29 ` Z C
  2012-09-14 16:02   ` How to specify customized configuration file rather than"~/.emacs" ? Drew Adams
  2012-09-14 20:01   ` How to specify customized configuration file rather than "~/.emacs" ? Peter Dyballa
  2 siblings, 2 replies; 11+ messages in thread
From: Z C @ 2012-09-14 15:29 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 664 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1160 bytes --]

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

* RE: How to specify customized configuration file rather than"~/.emacs" ?
  2012-09-14 15:29 ` How to specify customized configuration file rather than "~/.emacs" ? Z C
@ 2012-09-14 16:02   ` Drew Adams
  2012-09-15 14:05     ` Suvayu Ali
  2012-09-14 20:01   ` How to specify customized configuration file rather than "~/.emacs" ? Peter Dyballa
  1 sibling, 1 reply; 11+ messages in thread
From: Drew Adams @ 2012-09-14 16:02 UTC (permalink / raw)
  To: 'Z C', help-gnu-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




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

* Re: How to specify customized configuration file rather than "~/.emacs" ?
  2012-09-14 15:29 ` How to specify customized configuration file rather than "~/.emacs" ? Z C
  2012-09-14 16:02   ` How to specify customized configuration file rather than"~/.emacs" ? Drew Adams
@ 2012-09-14 20:01   ` Peter Dyballa
  1 sibling, 0 replies; 11+ messages in thread
From: Peter Dyballa @ 2012-09-14 20:01 UTC (permalink / raw)
  To: Z C; +Cc: help-gnu-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.





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

* Re: How to specify customized configuration file rather than"~/.emacs" ?
  2012-09-14 16:02   ` How to specify customized configuration file rather than"~/.emacs" ? Drew Adams
@ 2012-09-15 14:05     ` Suvayu Ali
  0 siblings, 0 replies; 11+ messages in thread
From: Suvayu Ali @ 2012-09-15 14:05 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

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:

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

Hope this helps.

-- 
Suvayu

Open source is the future. It sets us free.



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

end of thread, other threads:[~2012-09-15 14:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-13 13:43 How to specify customized configuration file rather than "~/.emacs" ? Z C
2012-09-13 14:03 ` Vineet Naik
2012-09-13 14:12 ` Jambunathan K
2012-09-13 14:38   ` Suvayu Ali
2012-09-13 15:27     ` PJ Weisberg
2012-09-13 16:04       ` How to specify customized configuration file rather than"~/.emacs" ? Drew Adams
2012-09-14 15:29 ` How to specify customized configuration file rather than "~/.emacs" ? Z C
2012-09-14 16:02   ` How to specify customized configuration file rather than"~/.emacs" ? Drew Adams
2012-09-15 14:05     ` Suvayu Ali
2012-09-14 20:01   ` How to specify customized configuration file rather than "~/.emacs" ? Peter Dyballa
     [not found] <mailman.8775.1347543860.855.help-gnu-emacs@gnu.org>
2012-09-13 14:42 ` Pascal J. Bourguignon

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.