summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gnus42
1 files changed, 30 insertions, 12 deletions
diff --git a/.gnus b/.gnus
index 2c9c122..ab5b7f3 100644
--- a/.gnus
+++ b/.gnus
@@ -86,6 +86,34 @@
gnus-treat-fill-long-lines nil
gnus-treat-fold-headers nil)
+;;; Window configurations.
+
+(defvar my/gnus-side-by-side-threshold 160)
+
+(gnus-add-configuration
+ '(article
+ (if (>= (frame-width) my/gnus-side-by-side-threshold)
+ '(horizontal 1.0
+ (summary 1.0 point)
+ (article 80))
+ '(vertical 1.0
+ (summary 0.25 point)
+ (article 1.0)))))
+
+(dolist (buf-name '(forward reply reply-yank))
+ (gnus-add-configuration
+ `(,buf-name
+ (if (>= (frame-width) my/gnus-side-by-side-threshold)
+ '(vertical 1.0
+ (summary 0.25)
+ (horizontal 1.0
+ (article 0.5)
+ (message 1.0 point)))
+ '(vertical 1.0
+ (summary 0.2)
+ (article 0.2)
+ (message 1.0 point))))))
+
;;; Summary tweaks.
(defun my/gnus-toggle-article-wrap ()
@@ -93,14 +121,9 @@
(with-current-buffer gnus-article-buffer
(visual-line-mode 'toggle)))
-(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
@@ -142,11 +165,6 @@
;;; Article tweaks.
-(defun my/gnus-article-center ()
- (setq fill-column 80
- my/centered-set-right-margin t)
- (my/centered-mode))
-
(defun my/gnus-article-eschew-tables ()
;; I set shr-fill-text to nil because I prefer letting
;; visual-line-mode manage wrapping. Unfortunately, many HTML
@@ -186,7 +204,8 @@
(setq should-wrap
(and
;; The line is bigger than the target width.
- (> (length current-line) fill-column)
+ (> (length current-line)
+ (window-width (get-buffer-window gnus-article-buffer)))
;; The line is not boring (citation, diff addition/removal).
(not (string-match-p "\\`[>+-]" current-line))
;; Lines that start with spaces are boring, except in
@@ -228,7 +247,6 @@
;; (Ⅱ) call `visual-line-mode' (if needed) in prepare-hook, after
;; truncate-lines has been set.
-(add-hook 'gnus-article-mode-hook 'my/gnus-article-center)
(add-hook 'gnus-article-mode-hook 'my/gnus-article-eschew-tables)
(add-hook 'gnus-article-prepare-hook 'my/gnus-article-wrap-maybe)