From 4a09fa6e1275047d4e9e1e135c702b1d60646332 Mon Sep 17 00:00:00 2001 From: jao Date: Thu, 6 Oct 2022 20:18:01 +0100 Subject: a bit less code is always good --- custom/jao-custom-gnus.el | 2 +- lib/eos/jao-afio.el | 21 +++++---------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el index 0a015bc..f24d20a 100644 --- a/custom/jao-custom-gnus.el +++ b/custom/jao-custom-gnus.el @@ -38,7 +38,7 @@ ;;; Looks ;;;; geometry -(defvar jao-gnus-use-three-panes (not jao-notmuch-enabled)) +(defvar jao-gnus-use-three-panes t) (defvar jao-gnus-groups-width 50) (defvar jao-gnus-wide-width 190) diff --git a/lib/eos/jao-afio.el b/lib/eos/jao-afio.el index d022ef1..dcaa833 100644 --- a/lib/eos/jao-afio.el +++ b/lib/eos/jao-afio.el @@ -140,31 +140,20 @@ (set-window-dedicated-p nil t) (other-window 1)) -;;;###autoload -(defun jao-afio-open-notmuch () - (interactive) +(defun jao-afio--open-mail (fun) + (unless (get-buffer "*Calendar*") (calendar)) (delete-other-windows) (split-window-horizontally -80) - (notmuch) + (funcall fun) (set-window-dedicated-p nil t) (jao-afio--mail-sidebar)) -(defun jao-afio-open-mail-function () - (interactive) - (jao-trisect) - (other-window 2) - (delete-window) - (other-window 1) - (funcall jao-afio-mail-function) - (jao-afio--mail-sidebar)) - ;;;###autoload (defun jao-afio-open-mail () (interactive) - (unless (get-buffer "*Calendar*") (calendar)) (cond ((eq 'gnus jao-afio-mail-function) (jao-afio-open-gnus)) - ((eq 'notmuch jao-afio-mail-function) (jao-afio-open-notmuch)) - (jao-afio-open-mail-function (jao-afio-open-mail-function)))) + ((eq 'notmuch jao-afio-mail-function) (jao-afio--open-mail 'notmuch)) + (t (jao-afio-trisect)))) ;;;###autoload (defun jao-afio-reset () -- cgit v1.2.3