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: Sebastien Vauban
Subject: Re: Using the same custom file in two different OSes
Date: Wed, 16 Jan 2013 09:58:41 +0100
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.91 (windows-nt)

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


reply via email to

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