From b94f54827fc31f95ab3c87d47bf7245647cc137e Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Sun, 26 May 2024 19:08:47 +0200 Subject: 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. --- .gnus | 28 +++++++++++++++++++++++----- 1 file 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: + (setf (alist-get "text/markdown" mm-inline-media-tests nil nil 'equal) + '(my/mm-display-markdown-inline))) + ;;; Key bindings. ;; ;; m compose -- cgit v1.2.3