dotfiles

🎜 Clone'em, tweak'em, stick'em in your $HOME 🎝
git clone https://git.kevinlegouguec.net/dotfiles
Log | Files | Refs | README

commit a7e590d471e2cb973cf43c178339ba24d075e274
parent f9226f2dd0cf05fe7ff69bfe1b2cefa516c8c4f5
Author: KΓ©vin Le Gouguec <kevin.legouguec@gmail.com>
Date:   Wed, 10 Jan 2024 19:24:29 +0100

Always set visual-line-mode to the intended state

Since the article buffer is re-used, visual-line-mode will keep its
previous state if not explicitly set.  So before the patch

1. I display article 1, which should be wrapped: the hook sets
visual-line-mode to t,

2. I display article 2, which should not be wrapped: truncate-lines is
set to t, but visual-line-mode remains t (not a biggie, truncate-lines
"wins"),

3. I decide I want to wrap article 2, so I call the visual-line-mode
toggling command: visual-line-mode is set to nil; seemingly nothing
happens.

This patch dispels the confusion.

Diffstat:
M.gnus | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.gnus b/.gnus @@ -189,8 +189,8 @@ (setq fill-column 80 my/centered-set-right-margin t) (my/centered-mode) - (when (my/gnus-article-should-wrap) - (visual-line-mode))) + (visual-line-mode + (unless (my/gnus-article-should-wrap) -1))) (add-hook 'gnus-article-prepare-hook 'my/gnus-article-setup)