[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#42330: 26.3; Emacs does not change fonts per mode when changing buff
From: |
Eli Zaretskii |
Subject: |
bug#42330: 26.3; Emacs does not change fonts per mode when changing buffers |
Date: |
Wed, 15 Jul 2020 17:54:40 +0300 |
> From: Ray Dillinger <bear@sonic.net>
> Date: Tue, 14 Jul 2020 18:17:07 -0700
>
> On Sun, 2020-07-12 at 17:07 +0300, Eli Zaretskii wrote:
> > >
> > If you fix these two problems, i.e. use buffer-face-set correctly and
> > don't use set-frame-font at all, your setup will work as you want.
> >
> > IOW, I don't think there's an Emacs bug here.
>
> You are correct. I find myself floundering in the help subsystem and
> documentation, unable to find what I want or, often, correctly
> interpret what I find.
>
> Sorry to clog up your bug reporting system. I got about half of the
> functionality I wanted, and interpreted the documentation I found in a
> way that made it seem that I ought to be getting all of it. Of course
> there was other documentation that I had skipped ten times or more
> because some higher level of the documentation hierarchy was named
> something that I didn't think would be at all related to what I wanted
> to do.
>
> But I have managed to get the configuration to do what I want, finally.
>
> Bear
>
> Here are the relevant bits.
> -----clip-----
>
> (defun fixed-face-buffer ()
> "use a small fixed-width font for this buffer."
> (interactive)
> (setq buffer-face-mode-face '(:family "Latin Modern Mono" :foundry
> "unknown" :slant normal :weight light :height 90 :width condensed))
> (buffer-face-mode))
>
> (defun prop-face-buffer ()
> "use a large variable-width font for this buffer."
> (interactive)
> (setq buffer-face-mode-face '(:family "DejaVu Serif" :height 160
> :width semi-condensed))
> (buffer-face-mode))
>
>
> (add-hook 'text-mode-hook
> (lambda()
> (prop-face-buffer)
> (visual-line-mode t)
> (setq fill-column 9999) ; each "line" (as defined by ending
> in \n) is a paragraph.
> (setq flyspell-mode t)
> ))
>
> (add-hook 'prog-mode-hook
> (lambda()
> (fixed-face-buffer)
> (visual-line-mode nil)
> (setq fill-column 160)
> (setq flyspell-mode nil)
> ))
Thanks, I'm therefore closing the bug.