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: Wed, 16 Jan 2013 21:35:49 +0100 Message-ID: References: <86r4llec72.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1358368556 28823 80.91.229.3 (16 Jan 2013 20:35:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Jan 2013 20:35:56 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Sebastien Vauban Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 16 21:36: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 1TvZiX-00059n-Q0 for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Jan 2013 21:36:13 +0100 Original-Received: from localhost ([::1]:48656 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvZiH-0005Ir-6g for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Jan 2013 15:35:57 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:42767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvZiB-0005IY-HV for help-gnu-emacs@gnu.org; Wed, 16 Jan 2013 15:35:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvZiA-0003JG-AY for help-gnu-emacs@gnu.org; Wed, 16 Jan 2013 15:35:51 -0500 Original-Received: from mail-ob0-f181.google.com ([209.85.214.181]:40024) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvZiA-0003J6-5e for help-gnu-emacs@gnu.org; Wed, 16 Jan 2013 15:35:50 -0500 Original-Received: by mail-ob0-f181.google.com with SMTP id oi10so1779455obb.40 for ; Wed, 16 Jan 2013 12:35:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=tMc4rWC1o+SGFrIb/nchNXqLH6Uf5lkHLZVjnZzDIrU=; b=a0ifSSdTDbS+BHsQxBOoWqWA1RlxXY8cVH1CUVnHMPMn4OwOw0gaTSSecL0jZ5jggf WeNF3+FB8Mx6XYGGZ5oLuon85tQCajrIK+7NyJDeRTYB6wgkLCLatvt6vpXSdiZR6LqZ fyXbLLmNhzTlm3q4jCjI5JEwe3E33z71OEQaEe7ukAZVz3Iltsr88Ywfp2oF6PKm8OFI H9GjH1qxmgueTkj+X2o5xDmGiwOIEhBfr2fDILTU38YyUjZYsZdTvGCOmLBGvVWdY7Fq +AdMX4o56/oYvlCu/A9mYe9e901tD6P+ygtEGq6iEL6jYOGTRdJwJSDgmdrg2KU9I5tg Ypgg== X-Received: by 10.60.1.168 with SMTP id 8mr1987485oen.46.1358368549288; Wed, 16 Jan 2013 12:35:49 -0800 (PST) Original-Received: by 10.60.11.39 with HTTP; Wed, 16 Jan 2013 12:35:49 -0800 (PST) In-Reply-To: <86r4llec72.fsf@somewhere.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.214.181 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:88651 Archived-At: On Wed, Jan 16, 2013 at 9:58 AM, Sebastien Vauban wrote: > Hi Dani, Hi >>> 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... That works, thanks, but it sets only the family and size of the font. Would it be possible to specify other properties like the background color? -- Dani Moncayo