summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.emacs10
-rw-r--r--.gnus23
2 files changed, 16 insertions, 17 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)
diff --git a/.gnus b/.gnus
index 4d33566..d2ddf6d 100644
--- a/.gnus
+++ b/.gnus
@@ -53,6 +53,16 @@
. "%b %d")
(t
. "%F")))
+
+(add-hook 'gnus-summary-mode-hook
+ (lambda ()
+ (setq fill-column 120)
+ (my/centered-mode)))
+(add-hook 'gnus-article-mode-hook
+ (lambda ()
+ (setq fill-column 80
+ my/centered-set-right-margin t)
+ (my/centered-mode)))
;;; Summary tweaks.
@@ -86,19 +96,6 @@
(setq-local message-subject-re-regexp
my/gnus-summary-normalize-subject)))
-(gnus-add-configuration
- '(summary
- (horizontal 1.0
- (vertical 40 (group 1.0))
- (vertical 1.0 (summary 1.0 point)))))
-(gnus-add-configuration
- '(article
- (horizontal 1.0
- (vertical 40 (group 1.0))
- (vertical 1.0
- (summary 0.25 point)
- (article 1.0)))))
-
(let* ((initials (mapconcat (lambda (s) (substring s 0 1))
(split-string user-full-name)
nil))