all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: proper setting of default font (and string-handling in elisp?)
@ 2009-08-26 12:59 Tom Roche
  2009-08-26 13:45 ` Peter Dyballa
  0 siblings, 1 reply; 6+ messages in thread
From: Tom Roche @ 2009-08-26 12:59 UTC (permalink / raw)
  To: help-gnu-emacs


Tom Roche Tue, 25 Aug 2009 22:11:44 -0400 (EDT)
>> [I'm] wanting to set my default font for every frame[,] in init.el.
>> How to do so properly?

Peter Dyballa Wed, 26 Aug 2009 09:44:36 +0200
> (setq initial-frame-alist
>       (append (list
>         '(border-color      . "#4e3832")
>         '(foreground-color  . "grey10")
>         '(background-color  . "AliceBlue")
>         '(active-alpha      . 0.875)
>         '(inactive-alpha    . 0.75)
>         '(font . "fontset-10pt_lucidatypewriter")
>         '(top . 136) '(left . 666) '(width . 100) '(height . 57)
>       ) initial-frame-alist))

> There is also default-frame-alist.

Thanks, that looks good. However I'm still confused about

* font syntax: how to translate the font spec format that works for
  set-frame-font (e.g. "Courier 10 Pitch-9") to that used for
  initial-frame-alist and default-frame-alist (e.g.
  "fontset-10pt_lucidatypewriter")? I've looked @, e.g.,

http://www.gnu.org/software/emacs/manual/html_node/elisp/Initial-Parameters.html

  but I'm not seeing where these font-related formats are documented.
  Is there a .el file @ which I should look?

* variable usage: how to set the font spec in one or more variables
  and use those in the list? E.g., presuming the string inside the
  variable was correct, would either of

(font . tlr-default-font)
(font . 'tlr-default-font)

  be appropriate? I'm sure it's in the GNU Emacs Lisp Reference Manual
  somewhere, but am not sure where to look.

TIA, Tom Roche <Tom_Roche@pobox.com>




^ permalink raw reply	[flat|nested] 6+ messages in thread
* proper setting of default font (and string-handling in elisp?)
@ 2009-08-26  2:11 Tom Roche
  2009-08-26  7:44 ` Peter Dyballa
  0 siblings, 1 reply; 6+ messages in thread
From: Tom Roche @ 2009-08-26  2:11 UTC (permalink / raw)
  To: help-gnu-emacs


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>




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-08-26 13:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.5382.1251252804.2239.help-gnu-emacs@gnu.org>
2009-08-26  5:13 ` proper setting of default font (and string-handling in elisp?) Xah Lee
2009-08-26  5:22   ` Xah Lee
2009-08-26 12:59 Tom Roche
2009-08-26 13:45 ` Peter Dyballa
  -- strict thread matches above, loose matches on Subject: below --
2009-08-26  2:11 Tom Roche
2009-08-26  7:44 ` Peter Dyballa

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.