help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Using the same custom file in two different OSes


From: Stefan Monnier
Subject: Re: Using the same custom file in two different OSes
Date: Tue, 15 Jan 2013 08:27:03 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> I'd like to use the same Emacs custom file in two different OSes:
> MS-Windows and Ubuntu, but I have one problem: I want to define the
> :family property of the `default' and `variable-pitch' faces based on
> the `system-type' (because my favorite family on MS-Windows isn't
> available on Ubuntu and vice-versa), but without having to duplicate
> my custom file (one for each system-type), so that I can tweak my
> customization at any time, in any OS, and get an updated custom file
> that is still valid for both OSes.

Of course, having the power of Elisp to write your .emacs, it's easy to
use `if' and whatnot to say very precisely how you want it to behave.
But admittedly, for face customization it's more tricky because there is
no convenient and robust way to configure faces other than through
Custom and Custom does not let you use Elisp's power.

Luckily, in the specific case of wanting different families on different
systems, you can use face-font-family-alternatives: i.e. in Custom set
the "family" to "default-family" and then do

  (add-to-list 'face-font-family-alternatives
               `("default-family" ,(if (foo) "fixed" "courier")))

in my cases, I don't even need an `if': I just list the font families in
the order I prefer so Emacs picks the best one among those available.


        Stefan
        




reply via email to

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