From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dani Moncayo Newsgroups: gmane.emacs.help Subject: Re: Using the same custom file in two different OSes Date: Tue, 15 Jan 2013 21:27:45 +0100 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1358281687 29635 80.91.229.3 (15 Jan 2013 20:28:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Jan 2013 20:28:07 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jan 15 21:28:14 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 1TvD7C-0001pk-EK for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Jan 2013 21:28:10 +0100 Original-Received: from localhost ([::1]:49181 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvD6w-00034P-0v for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Jan 2013 15:27:54 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:54757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvD6q-00034K-Oc for help-gnu-emacs@gnu.org; Tue, 15 Jan 2013 15:27:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvD6p-0006dX-7O for help-gnu-emacs@gnu.org; Tue, 15 Jan 2013 15:27:48 -0500 Original-Received: from mail-ob0-f175.google.com ([209.85.214.175]:36548) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvD6p-0006dF-2U for help-gnu-emacs@gnu.org; Tue, 15 Jan 2013 15:27:47 -0500 Original-Received: by mail-ob0-f175.google.com with SMTP id vb8so589102obc.6 for ; Tue, 15 Jan 2013 12:27:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Tv+cn0f6apVLIkFfpNXjTLoPJS+KKpFpcC04EM2pPAY=; b=pest2z7mvauElBcU89G37Ztw6bDFc+xuakHDs3DTRrQNr5qJQXQ8bsMKda6RaxEU6z Hxkr05P5HLz15ehFMLH5LrCNpFLR73UTciL+62eHmD5bPP8L9sy2gpdSXnlj4hZsgZ4U CJKPmPV5frIzPdMtvM8XruvmP8+aav1qW1Ved0DANW3mmlpst8VyBbFqpsDlscdqBCjn 3fbc7HdWrycHfILr/vxO+kf45Hd2iJFzJPFvBPTBFlmbUa4di/GnznyaYzjBTdDVulRn obtzuG02Pld3PXmYsuSKPEehUOFR/ShnPYqyr0+28q4EI/XS2TTWtzO+cz658dwBnsbF SL6A== Original-Received: by 10.60.169.105 with SMTP id ad9mr19752195oec.99.1358281666023; Tue, 15 Jan 2013 12:27:46 -0800 (PST) Original-Received: by 10.60.11.39 with HTTP; Tue, 15 Jan 2013 12:27:45 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.214.175 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:88634 Archived-At: > 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. That looks like a simple a good solution, but it doesn't work for me. I have this fragment in my init file: (add-to-list 'face-font-family-alternatives '("Courier New" "Ubuntu Mono")) (setq custom-file "my-custom-file.el") (load custom-file) (The family "Courier New" exists in Windows and "Ubuntu Mono" exists in Ubuntu) And my-custom-file.el has this line (among other): '(default ((t (:inherit nil :stipple nil :background "gray72" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry "unknown" :family "Courier New")))) When I start Emacs, I see that the value of `face-font-family-alternatives' looks fine: (("Courier New" "Ubuntu Mono") ("Monospace" "courier" "fixed") ("courier" "CMU Typewriter Text" "fixed") ("Sans Serif" "helv" "helvetica" "arial" "fixed") ("helv" "helvetica" "arial" "fixed")) On Windows, the "Courier New" family is chosen as expected, but on Ubuntu Emacs doesn't choose "Ubuntu Mono" as expected, but another face (similar to Courier New, BTW). If I do "M-x customize-face RET default RET", the family that I see is "TlwgMono". -- Dani Moncayo