From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Roche Newsgroups: gmane.emacs.help Subject: proper setting of default font (and string-handling in elisp?) Date: Tue, 25 Aug 2009 22:11:44 -0400 (EDT) Message-ID: <20090826021144.AB6291405BABB@cedar.isis.unc.edu> Reply-To: help-gnu-emacs@gnu.org, Tom Roche NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1251252842 25503 80.91.229.12 (26 Aug 2009 02:14:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 26 Aug 2009 02:14:02 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 26 04:13:55 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mg81K-0006e4-QT for geh-help-gnu-emacs@m.gmane.org; Wed, 26 Aug 2009 04:13:55 +0200 Original-Received: from localhost ([127.0.0.1]:53473 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mg81J-0004Lb-SE for geh-help-gnu-emacs@m.gmane.org; Tue, 25 Aug 2009 22:13:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mg80o-0004JV-II for help-gnu-emacs@gnu.org; Tue, 25 Aug 2009 22:13:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mg80j-0004CZ-J5 for help-gnu-emacs@gnu.org; Tue, 25 Aug 2009 22:13:21 -0400 Original-Received: from [199.232.76.173] (port=45225 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mg80j-0004CQ-9b for help-gnu-emacs@gnu.org; Tue, 25 Aug 2009 22:13:17 -0400 Original-Received: from cedar.isis.unc.edu ([152.2.3.72]:7037) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mg80i-0007yV-So for help-gnu-emacs@gnu.org; Tue, 25 Aug 2009 22:13:17 -0400 Original-Received: by cedar.isis.unc.edu (Postfix, from userid 155088) id AB6291405BABB; Tue, 25 Aug 2009 22:11:44 -0400 (EDT) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:67539 Archived-At: 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