summaryrefslogtreecommitdiff
path: root/.gnus
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2024-05-26 19:08:47 +0200
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2024-05-26 19:14:49 +0200
commitb94f54827fc31f95ab3c87d47bf7245647cc137e (patch)
tree1cbbdf0e36366dc0b359be854a8d41d2883f5c85 /.gnus
parente9ce1b5402072017b8243b878e200f053da210d2 (diff)
downloaddotfiles-b94f54827fc31f95ab3c87d47bf7245647cc137e.tar.xz
Fiddle with Gnus config
* Call out mm-fill-flowed; even if I keep it "enabled" as it is by default, I don't want to forget that I rely on it to un-fill. * Bump summary "target width" and give name to hooks. * Recognize & fontify text/markdown parts.
Diffstat (limited to '.gnus')
-rw-r--r--.gnus28
1 files changed, 23 insertions, 5 deletions
diff --git a/.gnus b/.gnus
index e078c91..b978dc8 100644
--- a/.gnus
+++ b/.gnus
@@ -71,7 +71,12 @@
"^From:" "^Organization:" "^Followup-To:" "^To:" "^Cc:" "^Newsgroups:")
gnus-treat-display-smileys nil
;; Do not fill anything; let visual-line-mode wrap text.
+ ;;; NB: for format=flowed, there is no setting to say "un-fill
+ ;;; flowed lines", so we *enable* filling, setting an absurd
+ ;;; line length limit, in order to un-fill flowed lines.
fill-flowed-display-column most-positive-fixnum
+ mm-fill-flowed t
+ ;;; More long-line-folding settings.
gnus-article-unfold-long-headers t
gnus-treat-fill-article nil
gnus-treat-fill-long-lines nil
@@ -84,11 +89,15 @@
(with-current-buffer gnus-article-buffer
(visual-line-mode 'toggle)))
-(add-hook 'gnus-summary-mode-hook
- (lambda ()
- (setq fill-column 120)
- (my/centered-mode)
- (keymap-local-set "C-c d v" 'my/gnus-toggle-article-wrap)))
+(defun my/gnus-summary-center ()
+ (setq fill-column 160)
+ (my/centered-mode))
+
+(defun my/gnus-summary-tweak-keys ()
+ (keymap-local-set "C-c d v" 'my/gnus-toggle-article-wrap))
+
+(add-hook 'gnus-summary-mode-hook 'my/gnus-summary-center)
+(add-hook 'gnus-summary-mode-hook 'my/gnus-summary-tweak-keys)
;; message-subject-re-regexp is used both in Gnus summary buffers to
;; detect and elide similar subjects in a thread, and by message mode
@@ -219,6 +228,15 @@
(add-hook 'gnus-article-mode-hook 'my/gnus-article-eschew-tables)
(add-hook 'gnus-article-prepare-hook 'my/gnus-article-wrap-maybe)
+;;; MIME display.
+(defun my/mm-display-markdown-inline (handle)
+ (mm-display-inline-fontify handle 'markdown-mode))
+
+(with-eval-after-load 'mm-decode
+ ;; bug-gnu-emacs:<jwvzfsnntlq.fsf-monnier+emacs@gnu.org>
+ (setf (alist-get "text/markdown" mm-inline-media-tests nil nil 'equal)
+ '(my/mm-display-markdown-inline)))
+
;;; Key bindings.
;;
;; m compose