From 40775ea8dc96d7e930626b7daf9f9cb199b77528 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Wed, 14 Feb 2024 17:32:45 +0100 Subject: Fixup wrap heuristic gnus-article-prepare-hook is _not_ run in the article buffer. No idea why things fall into place on my desktop; probably some ill-defined buffer-switching plumbing. Also clarify nearby comment. --- .gnus | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.gnus b/.gnus index 87e0fc9..eb452bb 100644 --- a/.gnus +++ b/.gnus @@ -171,9 +171,9 @@ (> (length current-line) fill-column) ;; The line is not boring (citation, diff addition/removal). (not (string-match-p "\\`[>+-]" current-line)) - ;; Lines that start with spaces are boring, unless this - ;; is an HTML part: those are choked with tags - ;; that shr left-pads with spaces. + ;; Lines that start with spaces are boring, except in + ;; HTML parts: those are choked with
tags that + ;; shr left-pads with spaces. ;; NB: HAS-HTML is a naive heuristic: we are assuming ;; that "any text/html part is present" means "we are ;; looking at this text/html part". @@ -184,8 +184,9 @@ (defun my/gnus-article-wrap-maybe () ;; Enable visual-line-mode when it helps, i.e. when the message has ;; long lines that are not part of citations nor patches. - (visual-line-mode - (unless (my/gnus-article-should-wrap) -1))) + (with-current-buffer gnus-article-buffer + (visual-line-mode + (unless (my/gnus-article-should-wrap) -1)))) ;; Article setup is tricky. In order, `gnus-article-prepare' ;; -- cgit v1.2.3