all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* mode-specific font specifications?
@ 2009-08-24  9:12 Jim McCloskey
  0 siblings, 0 replies; 5+ messages in thread
From: Jim McCloskey @ 2009-08-24  9:12 UTC (permalink / raw)
  To: help-gnu-emacs


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
from 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




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

end of thread, other threads:[~2009-09-01 21:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.5251.1251123404.2239.help-gnu-emacs@gnu.org>
2009-08-24 16:14 ` mode-specific font specifications? A.Politz
2009-09-01 17:50 ` Xah Lee
2009-09-01 21:28 ` Oliver Scholz
2009-09-01 21:38   ` Oliver Scholz
2009-08-24  9:12 Jim McCloskey

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.