aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2021-12-01 06:30:32 +0100
committerLars Ingebrigtsen2021-12-01 14:41:42 +0100
commit2d60566c8787b63b5e4e2958e9ec9f55fbcf9e87 (patch)
tree48ab6b62f9960210cfb0ee65ee084d10259e3610
parent9d17e346fe15d7afff8a2e520522586c51225a4c (diff)
downloademacs-2d60566c8787b63b5e4e2958e9ec9f55fbcf9e87.tar.gz
emacs-2d60566c8787b63b5e4e2958e9ec9f55fbcf9e87.zip
Use proportional fonts in the Gnus headers by default
* lisp/gnus/gnus-art.el (gnus-header): Inherit from `variable-pitch'. (gnus--variable-pitch-p): New helper function. (gnus-article-treat-fold-headers): Fill using pixel filling.
-rw-r--r--etc/NEWS7
-rw-r--r--lisp/gnus/gnus-art.el14
2 files changed, 19 insertions, 2 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 52686479ce2..d786d17f21e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -367,6 +367,13 @@ the common "utm_" trackers from URLs.
367** Gnus 367** Gnus
368 368
369--- 369---
370*** Gnus now uses a variable-pitch font in the headers by default.
371To get the monospace font back, you can put something like the
372following in your .gnus file:
373
374 (set-face-attribute 'gnus-header nil :inherit 'unspecified)
375
376---
370*** New face 'gnus-header'. 377*** New face 'gnus-header'.
371All other 'gnus-header-*' faces inherit from this face now. 378All other 'gnus-header-*' faces inherit from this face now.
372 379
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 02f0d50be5d..8b2b7ade294 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -769,7 +769,7 @@ Obsolete; use the face `gnus-signature' for customizations instead."
769 :group 'gnus-article-signature) 769 :group 'gnus-article-signature)
770 770
771(defface gnus-header 771(defface gnus-header
772 '((t nil)) 772 '((t :inherit variable-pitch))
773 "Base face used for all Gnus header faces. 773 "Base face used for all Gnus header faces.
774All the other `gnus-header-' faces inherit from this face." 774All the other `gnus-header-' faces inherit from this face."
775 :version "29.1" 775 :version "29.1"
@@ -2212,6 +2212,13 @@ unfolded."
2212 (replace-match " " t t)))) 2212 (replace-match " " t t))))
2213 (goto-char (point-max))))))) 2213 (goto-char (point-max)))))))
2214 2214
2215(defun gnus--variable-pitch-p (face)
2216 (or (eq face 'variable-pitch)
2217 (let ((parent (face-attribute face :inherit)))
2218 (if (eq parent 'unspecified)
2219 nil
2220 (seq-some #'gnus--variable-pitch-p (ensure-list parent))))))
2221
2215(defun gnus-article-treat-fold-headers () 2222(defun gnus-article-treat-fold-headers ()
2216 "Fold message headers." 2223 "Fold message headers."
2217 (interactive nil gnus-article-mode gnus-summary-mode) 2224 (interactive nil gnus-article-mode gnus-summary-mode)
@@ -2219,7 +2226,10 @@ unfolded."
2219 (while (not (eobp)) 2226 (while (not (eobp))
2220 (save-restriction 2227 (save-restriction
2221 (mail-header-narrow-to-field) 2228 (mail-header-narrow-to-field)
2222 (mail-header-fold-field) 2229 (if (not (gnus--variable-pitch-p (get-text-property (point) 'face)))
2230 (mail-header-fold-field)
2231 (forward-char 1)
2232 (pixel-fill-region (point) (point-max) (pixel-fill-width)))
2223 (goto-char (point-max)))))) 2233 (goto-char (point-max))))))
2224 2234
2225(defun gnus-treat-smiley () 2235(defun gnus-treat-smiley ()