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
_______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs