summaryrefslogtreecommitdiff
path: root/.emacs
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2022-10-01 11:55:29 +0200
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2022-10-01 12:04:21 +0200
commit1688ee78986af9f069da864779db7cdf4f707b7d (patch)
treedf980ab608172e8f7d6f863bee8e24c6feec5dc0 /.emacs
parent6a55b05eb1433f7d95b324b7bf740fa470d53c60 (diff)
downloaddotfiles-1688ee78986af9f069da864779db7cdf4f707b7d.tar.xz
Use my/centered-mode instead of relying on Gnus layouts
Lots of commands in Gnus buffers try to reinstate the setup defined in gnus-buffer-configuration, so when eg drafting a message with the original article displayed on the side, and using P or N to move around the thread, there ends up being some friction in window management. So stop using the Group buffer as a way to left-pad articles; it doesn't even look good on half-width frames anyway.
Diffstat (limited to '.emacs')
-rw-r--r--.emacs10
1 files changed, 6 insertions, 4 deletions
diff --git a/.emacs b/.emacs
index ed70f21..75662f1 100644
--- a/.emacs
+++ b/.emacs
@@ -126,6 +126,7 @@
(message "changed from %s to %s" old-width new-width)))
(defvar-local my/centered-width 'fill-column)
+(defvar-local my/centered-set-right-margin nil)
(define-minor-mode my/centered-mode
"Update margins to keep content centered."
@@ -150,11 +151,12 @@
(adjustable-width
(- (window-total-width window)
(+ (fringe-columns 'left) (fringe-columns 'right))))
- (target-margin
+ (left-margin
(when (> adjustable-width target-body-width)
- (/ (- adjustable-width target-body-width) 2))))
- ;; Only set left margin, so that long lines are not truncated.
- (set-window-margins window target-margin))))
+ (/ (- adjustable-width target-body-width) 2)))
+ (right-margin (and my/centered-set-right-margin
+ left-margin)))
+ (set-window-margins window left-margin right-margin))))
(defun my/kill (stuff)
(kill-new stuff)