summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-04-17 23:16:19 +0100
committerjao <jao@gnu.org>2021-04-17 23:16:19 +0100
commit8ea756c5d0ff541d33fb1be56d4c53a0b12f90e4 (patch)
tree07dc3a8576f28b774e9f5ff826548a442fe94d80
parent3d6a8ed794357e9764fe7281c2070601be6daae0 (diff)
downloadelibs-8ea756c5d0ff541d33fb1be56d4c53a0b12f90e4.tar.gz
elibs-8ea756c5d0ff541d33fb1be56d4c53a0b12f90e4.tar.bz2
configurable MUA in afio
-rw-r--r--attic/w3m.org (renamed from w3m.org)0
-rw-r--r--exwm.org4
-rw-r--r--lib/eos/jao-afio.el58
3 files changed, 35 insertions, 27 deletions
diff --git a/w3m.org b/attic/w3m.org
index e1229ab..e1229ab 100644
--- a/w3m.org
+++ b/attic/w3m.org
diff --git a/exwm.org b/exwm.org
index eb8e81e..9e989df 100644
--- a/exwm.org
+++ b/exwm.org
@@ -213,7 +213,7 @@
(if jao-exwm--use-afio
(cl-case n
((1) (jao-afio--goto-main))
- ((2) (jao-afio--goto-gnus))
+ ((2) (jao-afio--goto-mail))
((3) (jao-afio--goto-www))
((4) (jao-afio--goto-docs))
((5) (jao-afio--goto-scratch-1))
@@ -501,7 +501,7 @@
exwm-input-global-keys
'(([?\s-0] . jao-afio--goto-scratch)
([?\s-1] . jao-afio--goto-main)
- ([?\s-2] . jao-afio--goto-gnus)
+ ([?\s-2] . jao-afio--goto-mail)
([?\s-3] . jao-afio--goto-www)
([?\s-4] . jao-afio--goto-docs)
([?\s-A] . org-agenda-list)
diff --git a/lib/eos/jao-afio.el b/lib/eos/jao-afio.el
index 7ebaf5d..1410b80 100644
--- a/lib/eos/jao-afio.el
+++ b/lib/eos/jao-afio.el
@@ -86,26 +86,32 @@
(when (and (jao-doc-view-session) (y-or-n-p "Load saved session? "))
(jao-afio-open-pdf-session)))))
+(defvar jao-afio-mail-function 'gnus)
(defvar jao-afio-use-w3m nil)
+(defvar jao-afio-notmuch-in-web t)
+
(declare w3m "w3m")
(declare w3m-alive-p "w3m")
(declare w3m-previous-buffer "w3m")
+(declare notmuch "notmuch")
;;;###autoload
(defun jao-afio-open-www ()
(interactive)
(require 'jao-eww-session)
- (if (< (frame-width) 180)
+ (if (< (frame-width) 160)
(if jao-afio-use-w3m (w3m) (jao-eww-session-load))
(delete-other-windows)
(split-window-right)
- (if jao-afio-use-w3m (w3m) (jao-eww-session-load))
- (other-window 1)
- (when jao-afio-use-w3m
- (switch-to-buffer "*w3m*")
- (ignore-errors (w3m-previous-buffer 2)))
- (unless jao-afio-use-w3m
- (switch-to-buffer (car (last (jao-eww-session--list-buffers)))))))
+ (if jao-afio-use-w3m
+ (w3m)
+ (jao-eww-session-load)
+ (let ((b (current-buffer)))
+ (other-window 1)
+ (if jao-afio-notmuch-in-web
+ (notmuch)
+ (switch-to-buffer (car (jao-eww-session--list-buffers b))))
+ (other-window 1)))))
;;;###autoload
(defun jao-afio-open-gnus ()
@@ -118,20 +124,22 @@
(jao-gnus--set-summary-line))
;;;###autoload
-(defun jao-afio-open-mail (mail-func)
+(defun jao-afio-open-mail ()
(interactive)
- (delete-other-windows)
- (funcall mail-func)
- (jao-bisect)
- (other-window 1)
- (find-file (expand-file-name "inbox.org" org-directory))
- (split-window-below (/ (window-height) 3))
- (other-window 1)
- (org-agenda-list)
- (split-window-below -9)
- (other-window 1)
- (switch-to-buffer "*Calendar*")
- (other-window 1))
+ (if (or (null jao-afio-mail-function) (eq 'gnus jao-afio-mail-function))
+ (jao-afio-open-gnus)
+ (delete-other-windows)
+ (funcall jao-afio-mail-function)
+ (jao-bisect)
+ (other-window 1)
+ (find-file (expand-file-name "inbox.org" org-directory))
+ (split-window-below (/ (window-height) 3))
+ (other-window 1)
+ (org-agenda-list)
+ (split-window-below -9)
+ (other-window 1)
+ (switch-to-buffer "*Calendar*")
+ (other-window 1)))
(defvar jao-afio-switch-hook nil)
@@ -145,7 +153,7 @@
(delete-other-windows)
(cl-case next
(?w (jao-afio-open-www))
- (?g (jao-afio-open-gnus))
+ (?g (jao-afio-open-mail))
(?p (jao-afio-open-doc))
(?s (delete-other-windows))))
(run-hooks 'jao-afio-switch-hook))))
@@ -160,7 +168,7 @@
(jao-afio--check-frame)
(jao-afio--goto-frame ?s reset))
-(defun jao-afio--goto-gnus (&optional reset)
+(defun jao-afio--goto-mail (&optional reset)
(interactive "P")
(jao-afio--check-frame)
(jao-afio--goto-frame ?g reset))
@@ -201,7 +209,7 @@
(cl-case jao-afio--current-config
(?c "Main")
(?s "Scratch")
- (?g "Gnus")
+ (?g "Mail")
(?p "Docs")
(?w "Web")))
@@ -216,7 +224,7 @@
;;;###autoload
(defun jao-afio-setup (&optional fallback-fun init-p)
(global-set-key "\C-cf" 'jao-afio--goto-main)
- (global-set-key "\C-cg" 'jao-afio--goto-gnus)
+ (global-set-key "\C-cg" 'jao-afio--goto-mail)
(global-set-key "\C-cw" 'jao-afio--goto-www)
(global-set-key "\C-cz" 'jao-afio--goto-docs)
(setq jao-afio-fallback-fun fallback-fun)