[Top][All Lists]

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

RE: Using the same custom file in two different OSes

From: Drew Adams
Subject: RE: Using the same custom file in two different OSes
Date: Mon, 14 Jan 2013 11:13:25 -0800

> That works, but I've observed that each time I save any customization,
> my custom file is regenerated with _all_ the customization loaded at
> that time, and the platform-specific stuff that I removed from my
> custom file is then reinserted.

That should not happen.  If that is the case then it is likely because your
custom file was restored to its original state after the session where you
modified it.  Try modifying it in a separate session - even an emacs -Q session.

Check your custom file after you have quit the Emacs session where you modified
it.  You need to have it be as you wanted it: without the stuff you removed.

You might need to fiddle a bit, to ensure that.  Once that is the case, the
stuff you removed will never be added again. 

> Therefore, in my init file I must put the platform-specific customization
> _after_ the loading of the custom file:
>   (setq custom-file "my-custom-file.el")
>   (load custom-file)
>   (if (eq system-type 'windows-nt)
>       (custom-set-faces <windows-specific stuff>)
>     (custom-set-faces <ubuntu-specific stuff>)

That's OK, but you should not need that workaround.  See above.

> Thank you so much for your help.

You're welcome.  Keeping Customize stuff relegated to a separate file
(`custom-file') is something that I think everyone should consider doing.  It's
asking for trouble to mix code that you write with code that is automatically
written by Customize.

After separating out the Customize stuff, the question arises as when to load
`custom-file' in one's init file.  Often it is appropriate to load it at or near
the end, but it really depends on the libraries that your init file loads.

For instance, I load Icicles at the very end, just after loading `custom-file',
so that Icicles picks up certain option values and current key definitions.

reply via email to

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