From 5a0912802c8c6d76762c42558c511fcbff17e422 Mon Sep 17 00:00:00 2001 From: jao Date: Mon, 7 Sep 2026 21:34:28 +0100 Subject: jao-pdf: circular require fix --- lib/eos/jao-afio.el | 15 +++++++++++++-- lib/eos/jao-buffers.el | 16 ++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) (limited to 'lib/eos') diff --git a/lib/eos/jao-afio.el b/lib/eos/jao-afio.el index caacc8c..1400949 100644 --- a/lib/eos/jao-afio.el +++ b/lib/eos/jao-afio.el @@ -22,6 +22,7 @@ (require 'multisession) (require 'cl-lib) (require 'jao-doc-session) +(require 'jao-pdf) (defvar jao-afio-use-frames (not window-system)) (defvar jao-afio-frame-parameters nil) @@ -143,6 +144,16 @@ (switch-to-buffer (car b)) (jao-eww-session-load))) +;;;###autoload +(defun jao-afio-org-agenda () + (interactive) + (org-agenda nil "j") + (when-let* ((w (get-buffer-window "*Org Agenda*"))) + (set-window-margins w 2 1) + (with-current-buffer (window-buffer w) + (setq-local cursor-in-non-selected-windows nil + line-spacing 0.2)))) + ;;;###autoload (defun jao-afio-open-www () (interactive) @@ -165,7 +176,7 @@ ;;;###autoload (defun jao-afio-open-gnus () (interactive) - ;; (jao-org-agenda) + (jao-afio-org-agenda) (calendar) (find-file (expand-file-name "inbox.org" org-directory)) (delete-other-windows) @@ -180,7 +191,7 @@ (set-window-dedicated-p nil t) (split-window-below (/ (window-height) 3)) (other-window 1) - (jao-org-agenda) + (jao-afio-org-agenda) (set-window-dedicated-p nil t) (split-window-below -8) (other-window 1) diff --git a/lib/eos/jao-buffers.el b/lib/eos/jao-buffers.el index 5a41486..cae6c0f 100644 --- a/lib/eos/jao-buffers.el +++ b/lib/eos/jao-buffers.el @@ -51,7 +51,23 @@ (add-to-list 'display-buffer-alist (jao-attached-buffer-entry name-rx height))) +;;;###autoload +(defun jao-buffer-same-mode (&optional mode pre-fn switch-fn) + (interactive) + (let* ((mode (or mode major-mode)) + (modes (if (symbolp mode) (list mode) mode)) + (pred `(lambda (b) + (let ((b (get-buffer (if (consp b) (car b) b)))) + (member (buffer-local-value 'major-mode b) + ',modes)))) + (buff (read-buffer "Buffer: " nil t pred))) + (when pre-fn (funcall pre-fn)) + (if switch-fn (funcall switch-fn buff) (switch-to-buffer buff)))) +;;;###autoload +(defun jao-buffer-same-mode-cmd (&optional pop) + (interactive "P") + (jao-buffer-same-mode nil nil (and pop #'pop-to-buffer))) (provide 'jao-buffers) ;;; jao-buffers.el ends here -- cgit v1.2.3