diff options
author | jao <jao@gnu.org> | 2025-09-17 13:52:04 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2025-09-17 18:14:12 +0100 |
commit | 3526fea3c98dfbaf10cdc6bb0d8b41ff947eb392 (patch) | |
tree | 1318e5ea8d374bcdf3880873b1fbf4e043d7aba0 /custom | |
parent | 02343407cef03a56f36ba838fc275614e43df074 (diff) | |
download | elibs-3526fea3c98dfbaf10cdc6bb0d8b41ff947eb392.tar.gz elibs-3526fea3c98dfbaf10cdc6bb0d8b41ff947eb392.tar.bz2 |
mac: reading email
Diffstat (limited to 'custom')
-rw-r--r-- | custom/jao-custom-email.el | 6 | ||||
-rw-r--r-- | custom/jao-custom-gnus.el | 96 | ||||
-rw-r--r-- | custom/jao-custom-notmuch.el | 86 |
3 files changed, 90 insertions, 98 deletions
diff --git a/custom/jao-custom-email.el b/custom/jao-custom-email.el index a3d1a92..aaaf856 100644 --- a/custom/jao-custom-email.el +++ b/custom/jao-custom-email.el @@ -9,7 +9,7 @@ ;;; personal emails and others (defvar jao-mails) -(defvar jao-extra-mails) +(defvar jao-extra-mails nil) (defvar jao-mails-regexp (regexp-opt jao-mails)) ;;; gnus @@ -21,7 +21,7 @@ message-directory (expand-file-name "Mail" gnus-home-directory) mail-source-directory (expand-file-name "Mail" gnus-home-directory)) ;;; proton -(use-package jao-proton-utils) +(jao-when-linux (use-package jao-proton-utils)) ;;; message mode ;;;; customization @@ -224,7 +224,7 @@ message-sendmail-envelope-from 'header mail-envelope-from 'header)) -(jao-sendmail-local) +(jao-when-linux (jao-sendmail-local)) ;;; bbdb ;; (jao-load-path "bbdb/lisp") diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el index ce77285..3165372 100644 --- a/custom/jao-custom-gnus.el +++ b/custom/jao-custom-gnus.el @@ -42,51 +42,39 @@ gnus-generate-tree-function 'gnus-generate-horizontal-tree gnus-tree-minimize-window nil) -(when jao-gnus-use-three-panes - - ;; (dolist (m '(calendar-mode org-agenda-mode gnus-group-mode)) - ;; (add-to-list 'display-buffer-alist `((major-mode . ,m) (dedicated t)))) - - (setq calendar-left-margin 6) - - (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))))) +(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))))) ;;;; no blue icon (advice-add 'gnus-mode-line-buffer-identification :override #'identity) @@ -324,8 +312,8 @@ (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 187) +;; (add-hook 'gnus-select-group-hook 'jao-gnus--set-summary-line) +;; (jao-gnus--set-summary-line 150) (add-to-list 'nnmail-extra-headers 'Cc) (add-to-list 'nnmail-extra-headers 'BCc) @@ -630,12 +618,13 @@ (interactive) (gnus-demon-add-handler 'jao-gnus--scan 5 1)) -(jao-gnus-add-demon) -(gnus-demon-init) - -;; this is, in theory, not needed; but at some point in the way to emacs -;; version 31 this idle timers have ceased to work after a sleep/awake cycle -(add-to-list 'jao-sleep-awake-functions #'jao-gnus-add-demon) +(jao-when-linux + (jao-gnus-add-demon) + ;; (gnus-demon-remove-handler 'jao-gnus--scan) + (gnus-demon-init) + ;; this is, in theory, not needed; but at some point in the way to emacs + ;; version 31 this idle timers have ceased to work after a sleep/awake cycle + (jao-when-linux (add-to-list 'jao-sleep-awake-functions #'jao-gnus-add-demon))) ;;; add-ons ;;;; notifications @@ -785,6 +774,7 @@ (jao-load-path "consult-notmuch") (use-package consult-notmuch + :ensure t :bind (:map gnus-group-mode-map ("S" . #'jao-gnus-consult-notmuch))) ;;; keyboard shortcuts diff --git a/custom/jao-custom-notmuch.el b/custom/jao-custom-notmuch.el index 42d9e12..30b0976 100644 --- a/custom/jao-custom-notmuch.el +++ b/custom/jao-custom-notmuch.el @@ -199,9 +199,9 @@ ("signed") ("new" "ยท") ("replied" "โฉ" (propertize tag 'face '(:family "Fira Code"))) - ("sent" "๐ช") - ("attachment" "๐") - ("deleted" "๐" (propertize tag 'face '(:underline nil ,@e))) + ("sent" "โ") + ("attachment" "โงบ") + ("deleted" "โ" (propertize tag 'face '(:underline nil ,@e))) ("flagged" "โ") ("jao" "j") ("bigml" "b") @@ -613,46 +613,48 @@ (when jao-notmuch-enabled (setq mm-text-html-renderer 'shr)) ;;; consult -(jao-load-path "consult-notmuch") -(require 'consult-notmuch) -(setq consult-notmuch-newest-first t) -(consult-customize consult-notmuch :preview-key 'any) - -(defvar jao-consult-notmuch-history nil) - -(defvar jao-mailbox-folders '("bigml" "jao")) - -(defun jao-consult-notmuch-folder (&optional tree folder) - (interactive "P") - (let* ((folder (if folder - (file-name-as-directory folder) - (completing-read "Group: " - jao-mailbox-folders - nil nil nil - jao-consult-notmuch-history - "."))) - (folder (replace-regexp-in-string "/\\(.\\)" ".\\1" folder)) - (init (read-string "Initial query: ")) - (init (format "folder:/%s/ %s" folder init))) - (if tree (consult-notmuch-tree init) (consult-notmuch init)))) - -(with-eval-after-load "notmuch-hello" - (define-key notmuch-hello-mode-map "f" #'jao-consult-notmuch-folder)) +(jao-when-linux + (jao-load-path "consult-notmuch") + (require 'consult-notmuch) + (setq consult-notmuch-newest-first t) + (consult-customize consult-notmuch :preview-key 'any) + + (defvar jao-consult-notmuch-history nil) + + (defvar jao-mailbox-folders '("bigml" "jao")) + + (defun jao-consult-notmuch-folder (&optional tree folder) + (interactive "P") + (let* ((folder (if folder + (file-name-as-directory folder) + (completing-read "Group: " + jao-mailbox-folders + nil nil nil + jao-consult-notmuch-history + "."))) + (folder (replace-regexp-in-string "/\\(.\\)" ".\\1" folder)) + (init (read-string "Initial query: ")) + (init (format "folder:/%s/ %s" folder init))) + (if tree (consult-notmuch-tree init) (consult-notmuch init)))) + + (with-eval-after-load "notmuch-hello" + (define-key notmuch-hello-mode-map "f" #'jao-consult-notmuch-folder))) ;;; recoll -(defun jao-notmuch-open-file (fname &optional _page) - (with-temp-buffer - (insert-file-contents-literally fname) - (goto-char (point-min)) - (and (re-search-forward "^Message-ID: <\\([^>]+\\)>$" nil t) - (notmuch-show (concat "id:" (match-string 1)))))) - -(when jao-notmuch-enabled - (with-eval-after-load "org" - (org-link-set-parameters "message" :follow #'jao-notmuch-open-file)) - - (with-eval-after-load "consult-recoll" - (add-to-list 'consult-recoll-open-fns - '("message/rfc822" . jao-notmuch-open-file)))) +(jao-when-linux + (defun jao-notmuch-open-file (fname &optional _page) + (with-temp-buffer + (insert-file-contents-literally fname) + (goto-char (point-min)) + (and (re-search-forward "^Message-ID: <\\([^>]+\\)>$" nil t) + (notmuch-show (concat "id:" (match-string 1)))))) + + (when jao-notmuch-enabled + (with-eval-after-load "org" + (org-link-set-parameters "message" :follow #'jao-notmuch-open-file)) + + (with-eval-after-load "consult-recoll" + (add-to-list 'consult-recoll-open-fns + '("message/rfc822" . jao-notmuch-open-file))))) ;;; . (provide 'jao-custom-notmuch) |