diff options
Diffstat (limited to 'custom/jao-custom-notmuch.el')
-rw-r--r-- | custom/jao-custom-notmuch.el | 86 |
1 files changed, 44 insertions, 42 deletions
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) |