From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Sebastien Vauban" Newsgroups: gmane.emacs.help Subject: Re: Using the same custom file in two different OSes Date: Wed, 16 Jan 2013 09:58:41 +0100 Organization: Sebastien Vauban Message-ID: <86r4llec72.fsf@somewhere.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1358326816 10882 80.91.229.3 (16 Jan 2013 09:00:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Jan 2013 09:00:16 +0000 (UTC) To: help-gnu-emacs-mXXj517/zsQ@public.gmane.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Wed Jan 16 10:00:34 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 1TvOrJ-00013d-D5 for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Jan 2013 10:00:33 +0100 Original-Received: from localhost ([::1]:52615 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvOr1-0002NC-M3 for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Jan 2013 04:00:15 -0500 X-Received: by 10.180.94.8 with SMTP id cy8mr1496020wib.1.1358326728178; Wed, 16 Jan 2013 00:58:48 -0800 (PST) Original-Path: usenet.stanford.edu!m1no1590569wiv.0!news-out.google.com!o9ni836wio.1!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.103.MISMATCH!feeder3.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.131.MISMATCH!xlned.com!feeder3.xlned.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 43 Injection-Info: mx04.eternal-september.org; posting-host="5da807328d6a3351ee2b595083918cf6"; logging-data="5439"; mail-complaints-to="abuse-VVbKFVtnif8H+i2N2EyTrmui9UKz+5OX@public.gmane.org"; posting-account="U2FsdGVkX189fI+Zkd9lm2XJ21QtP2Mu" User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.91 (windows-nt) X-Archive: encrypt Cancel-Lock: sha1:pKeGILekUrT2pkgyuAJkh5m7z+c= sha1:doXRDCjkNRAh7BHTBMfWs8KMGBQ= X-Url: Under construction... Original-Xref: usenet.stanford.edu gnu.emacs.help:196348 X-BeenThere: help-gnu-emacs-mXXj517/zsQ@public.gmane.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-mXXj517/zsQ@public.gmane.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Xref: news.gmane.org gmane.emacs.help:88644 Archived-At: Hi Dani, Dani Moncayo wrote: >> 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) I would do something like this: #+begin_src emacs-lisp ;; set default font for all frames (when window-system (cond ((font-info "Courier New") (modify-all-frames-parameters '((font . "Courier New-8")))) ((font-info "Ubuntu Mono") (modify-all-frames-parameters '((font . "Ubuntu Mono-9")))))) #+end_src Please check the accuracy of the font names... Best regards, Seb -- Sebastien Vauban