unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: font for dired mode?
Date: Fri, 22 Apr 2005 10:04:07 -0600	[thread overview]
Message-ID: <d4b715$kl6$1@sea.gmane.org> (raw)
In-Reply-To: <a175f5862d016c66187c0df428c11374@gmail.com>

David Reitter wrote:
 > I'm trying to set a different font for the dired mode. I would like to
 > make everything appear in "fontset-monaco12". I've tried setting the
 > faces (like dired-header), but that didn't work at all.
 >
 > Then I've tried this:
 >
 > (add-hook 'dired-mode-hook
 >           (lambda () (set-frame-font "fontset-monaco12")))
 >
 > but the result was only that the buffer from which i called dired was
 > displayed in monaco, but not the newly opened frame for dired. It's like
 > the hook is called from the wrong context, with a different frame being
 > the selected frame.

Why is the Dired buffer opened in a new frame?  Is it because you're
using `C-x 5 d', or is some other customization coming into play
(e.g. special-display-buffer-names)?

Your problem is probably that the Dired buffer is created and the mode
hook is run, before the buffer is displayed -- in particular, before the
new frame is created.  I wonder whether this approach will work:

(defvar dired-other-frame-alist nil)

(defadvice dired-other-frame (around frame-alist activate)
   (let ((default-frame-alist (append dired-other-frame-alist
                                      default-frame-alist)))
     ad-do-it))

(setq dired-other-frame-alist
       '((font . "fontset-monaco12")))

Or maybe just:

(add-hook 'after-make-frame-functions
           (lambda (frame)
             ;; do we need to first select the FRAME?
             (when (eq major-mode 'dired)
               (set-frame-font "fontset-monaco12"))))

-- 
Kevin Rodgers

  parent reply	other threads:[~2005-04-22 16:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-21 23:07 font for dired mode? David Reitter
2005-04-21 23:29 ` Joe Corneli
2005-04-22  9:23 ` Peter Dyballa
2005-04-22  9:33   ` David Reitter
2005-04-22 16:04 ` Kevin Rodgers [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-04-22  6:29 David Reitter
2005-04-22 13:57 ` Joe Corneli
2005-04-24  7:53 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='d4b715$kl6$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).