help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

proper setting of default font (and string-handling in elisp?)


From: Tom Roche
Subject: proper setting of default font (and string-handling in elisp?)
Date: Tue, 25 Aug 2009 22:11:44 -0400 (EDT)

summary:

I'm running an emacs-23 and am wanting to set my default font for
every frame in init.el. How to do so properly?

details:

This morning I was happily running an up-to-date ubuntu 9.04 (jaunty)
and its stock emacs=22.2.1 when installing the Sun JRE somehow broke
my default emacs font. After much googling and twiddling of emacs=22,
some posts convinced me to go to emacs=23 for

mainmenu>Options>Set Default Font...

So I installed emacs-snapshot-gtk, and it indeed works as advertised.
Unfortunately

0 I want to set the default font automagically on each start of emacs.
  Putting

(setq tlr-default-font "Courier 10 Pitch-9")
(if (>= emacs-major-version 23)
  (progn
    (set-frame-font tlr-default-font)))

  in my init.el sorta fixes that, except ...

1 I would like emacs to come up showing the default font I set. If
  it's possible to make that happen via init.el (rather than, e.g.,
  `emacs --font=...`) I'd like to know. However this is not as
  important to me as the next item ...

2 I also want every new frame I open (with e.g. C-x 5 b) to use my
  default font. From googling, my impression is that I should do
  something like

(setq tlr-default-font "Courier 10 Pitch-9")
(if (>= emacs-major-version 23)
  (progn
    (set-frame-font tlr-default-font)
;    (add-to-list 'default-frame-alist '(font . tlr-default-font))
;    (add-to-list 'default-frame-alist '(font . 'tlr-default-font))
))

  but the commented lines fail. Is this solely an elisp problem (which
  I'd like to know how to fix anyway)? Or is there also a better way
  to set the default font for every frame I open?

TIA, Tom Roche <Tom_Roche@pobox.com>




reply via email to

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