summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2025-09-19 19:16:17 +0100
committerjao <jao@gnu.org>2025-09-19 19:20:20 +0100
commit2f4d326b7ee1a1e1e3a8e0d88c2751522645495f (patch)
tree41178715907958566aa7ce6f632b3aeebe948392
parent4ffc5fa01a0285177d1313d04684ffb9d73cc0da (diff)
downloadelibs-2f4d326b7ee1a1e1e3a8e0d88c2751522645495f.tar.gz
elibs-2f4d326b7ee1a1e1e3a8e0d88c2751522645495f.tar.bz2
gnus: making three panes work on darwin
-rw-r--r--custom/jao-custom-gnus.el110
-rw-r--r--lib/eos/jao-afio.el2
2 files changed, 76 insertions, 36 deletions
diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el
index 4e88d59..4cf3841 100644
--- a/custom/jao-custom-gnus.el
+++ b/custom/jao-custom-gnus.el
@@ -34,7 +34,7 @@
;;;; verbosity
(setq gnus-verbose 4)
;;;; geometry
-(defvar jao-gnus-use-three-panes t)
+(defvar jao-gnus-use-three-panes (not jao-notmuch-enabled))
(defvar jao-gnus-groups-width 50)
(defvar jao-gnus-wide-width 190)
@@ -44,37 +44,76 @@
(setq calendar-left-margin 6)
-(let ((wide-len jao-gnus-wide-width)
- (groups-len jao-gnus-groups-width)
- (summary-len (- jao-gnus-wide-width jao-gnus-groups-width)))
- (gnus-add-configuration
- `(article
- (horizontal 1.0
- (vertical ,groups-len (group 1.0))
- (vertical 1.0
- (summary 0.25 point)
- (article 1.0)))))
-
- ;; (gnus-add-configuration
- ;; `(group (horizontal 1.0 (group ,wide-len point))))
-
- (gnus-add-configuration
- `(message (horizontal 1.0 (message ,wide-len point))))
-
- (gnus-add-configuration
- `(reply-yank (horizontal 1.0 (message ,wide-len point))))
-
- (gnus-add-configuration
- `(summary
- (horizontal 1.0
- (vertical ,groups-len (group 1.0))
- (vertical 1.0 (summary 1.0 point)))))
-
- (gnus-add-configuration
- `(reply
- (horizontal 1.0
- (message ,(- wide-len 100) point)
- (article 100)))))
+(if jao-gnus-use-three-panes
+ (let ((side-bar '(vertical 1.0
+ ("inbox.org" 0.4)
+ ("*Org Agenda*" 1.0)
+ ("*Calendar*" 8)))
+ (wide-len jao-gnus-wide-width)
+ (groups-len jao-gnus-groups-width)
+ (summary-len (- jao-gnus-wide-width jao-gnus-groups-width)))
+ (gnus-add-configuration
+ `(article
+ (horizontal 1.0
+ (vertical ,groups-len (group 1.0))
+ (vertical ,summary-len
+ (summary 0.25 point)
+ (article 1.0))
+ ,side-bar)))
+
+ (gnus-add-configuration
+ `(group (horizontal 1.0 (group ,wide-len point) ,side-bar)))
+
+ (gnus-add-configuration
+ `(message (horizontal 1.0 (message ,wide-len point) ,side-bar)))
+
+ (gnus-add-configuration
+ `(reply-yank (horizontal 1.0 (message ,wide-len point) ,side-bar)))
+
+ (gnus-add-configuration
+ `(summary
+ (horizontal 1.0
+ (vertical ,groups-len (group 1.0))
+ (vertical ,summary-len (summary 1.0 point))
+ ,side-bar)))
+
+ (gnus-add-configuration
+ `(reply
+ (horizontal 1.0
+ (message ,(- wide-len 100) point)
+ (article 100)
+ ,side-bar))))
+ (let ((wide-len jao-gnus-wide-width)
+ (groups-len jao-gnus-groups-width)
+ (summary-len (- jao-gnus-wide-width jao-gnus-groups-width)))
+ (gnus-add-configuration
+ `(article
+ (horizontal 1.0
+ (vertical ,groups-len (group 1.0))
+ (vertical 1.0
+ (summary 0.25 point)
+ (article 1.0)))))
+
+ ;; (gnus-add-configuration
+ ;; `(group (horizontal 1.0 (group ,wide-len point))))
+
+ (gnus-add-configuration
+ `(message (horizontal 1.0 (message ,wide-len point))))
+
+ (gnus-add-configuration
+ `(reply-yank (horizontal 1.0 (message ,wide-len point))))
+
+ (gnus-add-configuration
+ `(summary
+ (horizontal 1.0
+ (vertical ,groups-len (group 1.0))
+ (vertical 1.0 (summary 1.0 point)))))
+
+ (gnus-add-configuration
+ `(reply
+ (horizontal 1.0
+ (message ,(- wide-len 100) point)
+ (article 100))))))
;;;; no blue icon
(advice-add 'gnus-mode-line-buffer-identification :override #'identity)
@@ -308,12 +347,13 @@
"\n"))
(defun jao-gnus--set-summary-line (&optional w)
- (let* ((d (if jao-gnus-use-three-panes (+ jao-gnus-groups-width 11) 12))
+ (let* ((d (if jao-gnus-use-three-panes
+ (+ jao-gnus-groups-width 11)
+ (+ jao-gnus-groups-width 12)))
(w (- (or w (window-width)) d)))
(setq gnus-summary-line-format (format jao-gnus--summary-line-fmt w))))
-;; (add-hook 'gnus-select-group-hook 'jao-gnus--set-summary-line)
-;; (jao-gnus--set-summary-line 150)
+(add-hook 'gnus-select-group-hook 'jao-gnus--set-summary-line)
(add-to-list 'nnmail-extra-headers 'Cc)
(add-to-list 'nnmail-extra-headers 'BCc)
diff --git a/lib/eos/jao-afio.el b/lib/eos/jao-afio.el
index 10e9115..4506bd8 100644
--- a/lib/eos/jao-afio.el
+++ b/lib/eos/jao-afio.el
@@ -122,10 +122,10 @@
;;;###autoload
(defun jao-afio-open-gnus ()
(interactive)
- (delete-other-windows)
(jao-org-agenda)
(calendar)
(find-file (expand-file-name "inbox.org" org-directory))
+ (delete-other-windows)
(gnus)
(jao-gnus--set-summary-line))