unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: Mode-specific font setting?
Date: Tue, 26 Apr 2005 13:43:20 -0600	[thread overview]
Message-ID: <d4m5aq$9c4$1@sea.gmane.org> (raw)
In-Reply-To: <85241ee522fb59bebe6eeb599d39b831@gmail.com>

David Reitter wrote:
 > How do I set a mode-specific font?

You can't.  Fonts are frame-specific, not window- or mode-specific.

 > I've tried this hack:
 >
 >  (add-hook 'after-change-major-mode-hook
 >        (lambda ()
 >        (case major-mode
 >       ('text-mode
 >          (set-frame-font "fontset-lucida14")
 > )))
 > )
 >
 > Unfortunately it doesn't work, obviously because the selected frame is a
 > different one when the hook is called (find-file-other-frame was used to
 > open a file), so the font gets set in the wrong frame.

It also won't change the font when you select a buffer in a different
mode with `C-x b'.

 > Maybe there is a more elegant way (customization?) than using a hook,
 > anyways.

Use after-make-frame-functions, and make each frame's initial window
dedicated to that buffer for good measure.

-- 
Kevin Rodgers

  reply	other threads:[~2005-04-26 19:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-25 18:35 Mode-specific font setting? David Reitter
2005-04-26 19:43 ` Kevin Rodgers [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-04-26  6:42 David Reitter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='d4m5aq$9c4$1@sea.gmane.org' \
    --to=ihs_4664@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).