summaryrefslogtreecommitdiff
path: root/.gnus
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2024-01-10 19:24:29 +0100
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2024-01-10 19:24:29 +0100
commita7e590d471e2cb973cf43c178339ba24d075e274 (patch)
treebb70f6d59e40f76672c5f188b6bfa4c8b6b7aaf3 /.gnus
parentf9226f2dd0cf05fe7ff69bfe1b2cefa516c8c4f5 (diff)
downloaddotfiles-a7e590d471e2cb973cf43c178339ba24d075e274.tar.xz
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 (limited to '.gnus')
-rw-r--r--.gnus4
1 files changed, 2 insertions, 2 deletions
diff --git a/.gnus b/.gnus
index 37a17af..056a1c6 100644
--- 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)