all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to change font only in gnus-article buffer ?
@ 2011-07-22 17:43 Sander Boer
  2011-07-23 12:00 ` Juanma Barranquero
  0 siblings, 1 reply; 4+ messages in thread
From: Sander Boer @ 2011-07-22 17:43 UTC (permalink / raw)
  To: emacs-devel

Hi,

When reading mails/news (and eventually, also when composing a new
message) I want to be using a variable-width font as opposed to a fixed
width font.
Funny thing about the article body displayed by gnus, there is no face
associated with it. This means I can only change the default font (or
toggle variable-pitch-mode, which is lame).
Is it at all possible to change the default font in only one buffer ?

thx

-- 
Sander Boer




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

* Re: How to change font only in gnus-article buffer ?
  2011-07-22 17:43 How to change font only in gnus-article buffer ? Sander Boer
@ 2011-07-23 12:00 ` Juanma Barranquero
  2011-07-24 18:28   ` Sander Boer
  0 siblings, 1 reply; 4+ messages in thread
From: Juanma Barranquero @ 2011-07-23 12:00 UTC (permalink / raw)
  To: Sander Boer; +Cc: emacs-devel

On Fri, Jul 22, 2011 at 19:43, Sander Boer <sanderboer@yahoo.com> wrote:

> Is it at all possible to change the default font in only one buffer ?

Yes. Remap the face locally with `face-remapping-alist'.

   (set (make-local-variable) 'face-remapping-alist '((default variable-pitch)))

    Juanma



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

* Re: How to change font only in gnus-article buffer ?
  2011-07-23 12:00 ` Juanma Barranquero
@ 2011-07-24 18:28   ` Sander Boer
  2011-07-24 20:13     ` Juanma Barranquero
  0 siblings, 1 reply; 4+ messages in thread
From: Sander Boer @ 2011-07-24 18:28 UTC (permalink / raw)
  To: emacs-devel

Juanma Barranquero <lekktu@gmail.com> writes:

> On Fri, Jul 22, 2011 at 19:43, Sander Boer <sanderboer@yahoo.com> wrote:
>
>> Is it at all possible to change the default font in only one buffer ?
>
> Yes. Remap the face locally with `face-remapping-alist'.
>
>    (set (make-local-variable) 'face-remapping-alist '((default variable-pitch)))
>
>     Juanma

Ok, I did just that and it looks ab-so-lute-ly lovely !
(I'm using the misterioso-theme on emacs 24)

One thing kind of bugs me, but I'm pretty sure it is unavoidable, the
rest of the (unpopulated) buffer window still shows the themed
background color. I'm pretty sure it is a result of the face-paradigm,
but I would love to be corrected on this !


+++++++ Begin src 
(defun sndr-clear-buffer ()
"changes the buffer into a clear formatted one"
(interactive)
(set (make-local-variable 'face-remapping-alist)
'((default :stipple nil :background "#e1e1e0" :foreground "#000000"  :family "Droid Serif" :height 110)
 (font-lock-builtin-face :foreground "grey10")
   (font-lock-comment-face :foreground "grey10")
   (font-lock-constant-face :foreground "grey10")
   (font-lock-function-name-face :foreground "grey10" :weight bold)
   (font-lock-keyword-face :foreground "grey10" :weight bold)
   (font-lock-string-face :foreground "grey10")
   (font-lock-type-face :foreground "grey10")
   (font-lock-variable-name-face :foreground "grey10")
   (font-lock-warning-face :foreground "red3" :weight bold)

   (w3m-anchor :background "#e1e1e0" :foreground "grey20")
   (w3m-image :background "#e1e1e0" :foreground "grey20")

;; Buttons and links
   (button :underline t)
   (link :foreground "black" :underline t)
   (link-visited :foreground "grey20" :underline t)
   ;; Gnus faces
   (gnus-header-content  :family "Droid Sans" :weight normal :foreground "grey20")
   (gnus-header-from  :family "Droid Sans" :foreground "grey20" :weight bold)
   (gnus-header-subject  :family "Droid Sans" :foreground "red3" :weight bold)
   (gnus-header-name  :family "Droid Sans" :foreground "#136")
   (gnus-header-newsgroups  :family "Droid Sans" :foreground "grey20")
   (gnus-cite-1 :foreground "#136")
   (gnus-cite-2 :foreground "#361")
   (gnus-cite-3 :foreground "#613")
   (gnus-cite-4 :foreground "#26b")
   (gnus-cite-5 :foreground "#6b2")
   (gnus-signature :foreground "#136")
   ;; Message faces
   (message-header-name :foreground "grey20" :weight bold)
   (message-header-newsgroups :foreground "grey20")
   (message-header-cc :foreground "grey20")
   (message-header-other :foreground "grey20")
   (message-header-subject :foreground "red3" :weight bold)
   (message-header-to :foreground "grey20")
   (message-cited-text :foreground "grey10")
   (message-separator :foreground "grey30")
   (diff-context :foreground "grey30")
   (mm-uu-extract :background "#e1e1e0")
)))

(add-hook 'gnus-article-prepare-hook 'sndr-clear-buffer)
(add-hook 'message-mode-hook 'sndr-clear-buffer)

+++++++ End src 

-- 
Sander Boer




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

* Re: How to change font only in gnus-article buffer ?
  2011-07-24 18:28   ` Sander Boer
@ 2011-07-24 20:13     ` Juanma Barranquero
  0 siblings, 0 replies; 4+ messages in thread
From: Juanma Barranquero @ 2011-07-24 20:13 UTC (permalink / raw)
  To: Sander Boer; +Cc: emacs-devel

On Sun, Jul 24, 2011 at 20:28, Sander Boer <sanderboer@yahoo.com> wrote:

> One thing kind of bugs me, but I'm pretty sure it is unavoidable, the
> rest of the (unpopulated) buffer window still shows the themed
> background color. I'm pretty sure it is a result of the face-paradigm,
> but I would love to be corrected on this !

Yes, it is unavoidable. So remapping the default face works better if
you don't change the background color.

    Juanma



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

end of thread, other threads:[~2011-07-24 20:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-22 17:43 How to change font only in gnus-article buffer ? Sander Boer
2011-07-23 12:00 ` Juanma Barranquero
2011-07-24 18:28   ` Sander Boer
2011-07-24 20:13     ` Juanma Barranquero

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.