summaryrefslogtreecommitdiffhomepage
path: root/custom
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2026-11-27 22:59:47 +0000
committerjao <jao@gnu.org>2026-11-27 22:59:47 +0000
commitbca51e1655d5a305745b7826cf5134f37f6a960a (patch)
tree47fa78d6fa69e004f412087722583b2efac1e95d /custom
parent307f2adf232ab89325549346aadab69ed1702b8d (diff)
downloadelibs-bca51e1655d5a305745b7826cf5134f37f6a960a.tar.gz
elibs-bca51e1655d5a305745b7826cf5134f37f6a960a.tar.bz2
afio refactorings
Diffstat (limited to 'custom')
-rw-r--r--custom/jao-custom-chats.el16
-rw-r--r--custom/jao-custom-email.el2
-rw-r--r--custom/jao-custom-eww.el21
-rw-r--r--custom/jao-custom-pdf.el17
4 files changed, 53 insertions, 3 deletions
diff --git a/custom/jao-custom-chats.el b/custom/jao-custom-chats.el
index d110a24..57af82f 100644
--- a/custom/jao-custom-chats.el
+++ b/custom/jao-custom-chats.el
@@ -125,8 +125,8 @@
(when (and (fboundp 'ement-connect) (or p (y-or-n-p "Connect to matrix? ")))
(unless (get-buffer "*Ement Rooms*")
(jao-with-auth "matrix.org" u p (ement-connect :user-id u :password p))))
- ;; (when (and (fboundp 'mastodon) (or p (y-or-n-p "Connect to mastodon? ")))
- ;; (mastodon))
+ (when (and (fboundp 'mastodon) (or p (y-or-n-p "Connect to mastodon? ")))
+ (mastodon))
(dolist (c '(("Libera Chat" . "irc.libera.chat:6697")))
(unless (get-buffer (cdr c))
(when (or p (y-or-n-p (format "Connect to %s? " (car c))))
@@ -139,6 +139,18 @@
(delete-other-windows))
(jao-chats t))
+(defun jao-chats-open-afio ()
+ (jao-afio-trisect)
+ (when (y-or-n-p "telegram? ")
+ (telega)
+ (other-buffer))
+ (when (y-or-n-p "mastodon? ")
+ (mastodon)
+ (other-buffer))
+ (when (y-or-n-p "irc? ") (circe "Libera Chat")))
+
+(setq jao-afio-open-chats #'jao-chats-open-afio)
+
(defun jao-chats-telega ()
(interactive)
(jao-buffer-same-mode '(telega-root-mode telega-chat-mode)))
diff --git a/custom/jao-custom-email.el b/custom/jao-custom-email.el
index e92a17b..ff84bd2 100644
--- a/custom/jao-custom-email.el
+++ b/custom/jao-custom-email.el
@@ -2,7 +2,7 @@
;;; main email system
(require 'jao-afio)
-(setq jao-afio-mail-function (jao-d-l 'notmuch 'notmuch))
+(setq jao-afio-mail-function 'notmuch)
(defvar jao-notmuch-enabled (eq jao-afio-mail-function 'notmuch))
diff --git a/custom/jao-custom-eww.el b/custom/jao-custom-eww.el
index 3cc10cb..5b39c18 100644
--- a/custom/jao-custom-eww.el
+++ b/custom/jao-custom-eww.el
@@ -118,6 +118,27 @@
;;; sessions
(use-package jao-eww-session :demand t)
+(defun jao-afio--open-eww-session ()
+ (if-let* ((b (jao-eww-session-eww-buffers)))
+ (switch-to-buffer (car b))
+ (jao-eww-session-load)))
+
+(defun jao-afio-open-eww ()
+ (interactive)
+ (require 'jao-eww-session)
+ (if (< (frame-width) 160)
+ (jao-afio--open-eww-session)
+ (jao-afio-trisect)
+ (jao-afio--open-eww-session)
+ (let ((b (current-buffer)))
+ (other-window 1)
+ (switch-to-buffer (car (jao-eww-session-eww-buffers b)))
+ (other-window 1)
+ (switch-to-buffer (car (jao-eww-session-eww-buffers b)))
+ (other-window 1))))
+
+(setq jao-afio-open-www #'jao-afio-open-eww)
+
;;; eww to org
(defun jao-eww-to-org (&optional dest)
(interactive "P")
diff --git a/custom/jao-custom-pdf.el b/custom/jao-custom-pdf.el
index cbe74ef..f42546b 100644
--- a/custom/jao-custom-pdf.el
+++ b/custom/jao-custom-pdf.el
@@ -78,6 +78,23 @@
("S" . jao-doc-session-save)
("u" . jao-doc-view-visit-url)))
+;;;; afio
+(defvar jao-pdf-afio-left-width nil)
+
+(defun jao-afio-open-doc ()
+ (interactive)
+ (delete-other-windows)
+ (split-window-right jao-pdf-afio-left-width)
+ (let ((docs (cl-remove-if-not 'jao-doc-session-is-doc (buffer-list))))
+ (if (car docs)
+ (progn (switch-to-buffer (car docs))
+ (switch-to-buffer-other-window (or (cadr docs) (car docs))))
+ (when-let* ((docs (jao-doc-session)))
+ (when (y-or-n-p (format "Load saved session? (%d docs)" (length docs)))
+ (jao-pdf-open-session docs))))))
+
+(setq jao-afio-open-doc #'jao-afio-open-doc)
+
;;;; transient
(defun jao-org-pdf-goto-org-linking ()
(interactive)