From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jim McCloskey Newsgroups: gmane.emacs.help Subject: mode-specific font specifications? Date: Mon, 24 Aug 2009 02:12:38 -0700 Message-ID: <20090824091238.GB6563@ohlone> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1251123796 10711 80.91.229.12 (24 Aug 2009 14:23:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Aug 2009 14:23:16 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 24 16:23:09 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 1MfaRw-0006kn-JQ for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Aug 2009 16:23:08 +0200 Original-Received: from localhost ([127.0.0.1]:44892 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfaRv-0002gs-ON for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Aug 2009 10:23:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MfVnD-0000Ac-C2 for help-gnu-emacs@gnu.org; Mon, 24 Aug 2009 05:24:47 -0400 Original-Received: from [199.232.76.173] (port=53257 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfVnB-0000AM-BL for help-gnu-emacs@gnu.org; Mon, 24 Aug 2009 05:24:45 -0400 Original-Received: from email-prod-mxsocsci-2.ucsc.edu ([128.114.125.78]:63807 helo=email-prod-mx-2.ucsc.edu) by monty-python.gnu.org with esmtps (SSL 3.0:RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1MfVnA-0006uw-VO for help-gnu-emacs@gnu.org; Mon, 24 Aug 2009 05:24:45 -0400 X-UCSC-CATS-MailScanner: found to be clean X-UCSC-CATS-MailScanner-SpamCheck: not spam, spamassassin (score=-1.44, required=5, autolearn=disabled, ALL_TRUSTED) X-UCSC-CATS-MailScanner-SpamScore: X-UCSC-CATS-MailScanner-From: Original-Received: by email-prod-mx-2.ucsc.edu (CommuniGate Pro PIPE 5.2.13) with PIPE id 35902567; Mon, 24 Aug 2009 02:24:25 -0700 X-UCSC-EDU-Sender: X-UCSC-EDU-Scanned-By: email-prod-mx-2.ucsc.edu X-UCSC-EDU-Submitted-Via: SMTP [128.114.186.171] X-UCSC-EDU-ClamAVCheck: not spam, ClamAV(signaure=none) X-UCSC-EDU-SpamCheck: No, score=-1.44 required=5 tests=ALL_TRUSTED X-UCSC-EDU-SpamScore: X-UCSC-EDU-SpamFlag: NO X-UCSC-EDU-SpamReport: -1.4 ALL_TRUSTED Passed through trusted hosts only via SMTP Original-Received: from [128.114.186.171] (HELO ohlone.ucsc.edu) by email-prod-mx-2.ucsc.edu (CommuniGate Pro SMTP 5.2.13) with ESMTPS id 35902575 for help-gnu-emacs@gnu.org; Mon, 24 Aug 2009 02:24:01 -0700 Original-Received: from jim by ohlone.ucsc.edu with local (Exim 4.69) (envelope-from ) id 1MfVbS-0001nY-Vg for help-gnu-emacs@gnu.org; Mon, 24 Aug 2009 02:12:38 -0700 Content-Disposition: inline X-Operating-System: Debian GNU/Linux/2.6.30.300609 (i686) User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) X-Mailman-Approved-At: Mon, 24 Aug 2009 10:16:42 -0400 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:67468 Archived-At: Just getting used to Emacs 23.1, and especially enjoying the improved font-rendering. Thanks to all who made this possible. It's really great. There's one thing that I haven't figured out yet, though, so I thought I might ask for help here. I suspect that I am not alone in wanting to be able to do this. I'd like to be able to set a default font for text and latex mode (for prose composition essentially) and to have a nice proportional font for that context (Linux Libertine or something). But such a font makes little or no sense for dired-mode, for example, where you really want a monospace font like Inconsolata (so that the alignment looks right). I thought I could do what I wanted by setting a default font in the init file with (set-default-font "FONTNAME") and then: (add-hook 'dired-mode-hook (function (lambda () (font-lock-mode 1) (require 'dired-x) (set-frame-font "Inconsolata-11") ))) or: (add-hook 'dired-mode-hook (function (lambda () (font-lock-mode 1) (require 'dired-x) (set-default-font "Inconsolata-11") ))) and that sort of works, in the sense that the first buffer visited is displayed in the proportional font FONTNAME, and then when you switch to dired-mode, you get 11pt Inconsolata. However, when you then go =66rom dired-mode back to the first buffer (in latex-mode, say), the font used is now Inconsolata. I had hoped to limit the scope of that second font declaration by putting it inside: (add-hook 'dired-mode-hook .... ) but, once called, its effects in fact seem to be global rather than local to that mode. Is there a way for me to do what I'd like to be able to do? Thanks very much for any advice or any pointers to relevant documentation. Jim