From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Using the same custom file in two different OSes Date: Tue, 15 Jan 2013 08:27:03 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1358256443 5017 80.91.229.3 (15 Jan 2013 13:27:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Jan 2013 13:27:23 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jan 15 14:27:41 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tv6YG-00056b-Fi for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Jan 2013 14:27:40 +0100 Original-Received: from localhost ([::1]:48285 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv6Y0-0007Rz-4C for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Jan 2013 08:27:24 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv6Xt-0007Qa-HE for help-gnu-emacs@gnu.org; Tue, 15 Jan 2013 08:27:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tv6Xs-0004o0-Eo for help-gnu-emacs@gnu.org; Tue, 15 Jan 2013 08:27:17 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:41736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv6Xs-0004nu-8A for help-gnu-emacs@gnu.org; Tue, 15 Jan 2013 08:27:16 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Tv6Y5-0004vW-He for help-gnu-emacs@gnu.org; Tue, 15 Jan 2013 14:27:29 +0100 Original-Received: from 69-165-154-85.dsl.teksavvy.com ([69.165.154.85]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 15 Jan 2013 14:27:29 +0100 Original-Received: from monnier by 69-165-154-85.dsl.teksavvy.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 15 Jan 2013 14:27:29 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 28 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 69-165-154-85.dsl.teksavvy.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:XnD/67Tfmr76K5aFid1AvP7wPaM= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:88632 Archived-At: > 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