diff options
Diffstat (limited to 'custom/jao-custom-notmuch.el')
-rw-r--r-- | custom/jao-custom-notmuch.el | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/custom/jao-custom-notmuch.el b/custom/jao-custom-notmuch.el index 27b8465..492da2d 100644 --- a/custom/jao-custom-notmuch.el +++ b/custom/jao-custom-notmuch.el @@ -193,7 +193,7 @@ (setq notmuch-archive-tags '("+trove" "-new" "-inbox") notmuch-show-mark-read-tags '("-new" "-unread") notmuch-tag-formats - (let ((d `(:foreground ,(face-attribute 'jao-themes-dimm :foreground))) + (let (;; (d `(:foreground ,(face-attribute 'jao-themes-dimm :foreground))) (e `(:foreground ,(face-attribute 'jao-themes-error :foreground)))) `(("unread") ("signed") @@ -273,7 +273,7 @@ (defun jao-notmuch-hello-first () (interactive) (let ((inhibit-message t)) - (beginning-of-buffer) + (goto-char (point-min)) (widget-forward 1))) (defun jao-notmuch-refresh-hello (&optional agenda) @@ -318,8 +318,11 @@ notmuch-show-logo nil notmuch-show-empty-saved-searches nil) - :hook ((notmuch-hello-refresh . jao-notmuch-notify) - (jao-afio-switch . jao-notmuch-refresh-hello)) + :hook ((notmuch-hello-refresh . jao-notmuch-notify)) + + :config + (when jao-notmuch-enabled + (add-hook 'jao-afio-switch-hook #'jao-notmuch-refresh-hello)) :bind (:map notmuch-hello-mode-map (("a" . jao-notmuch-refresh-agenda) @@ -474,14 +477,14 @@ (jao-notmuch-adjust-tree-fonts (when (string-prefix-p "Hack" jao-themes-default-face) "Source Code Pro"))) - (defun jao-notmuch-before-tree (&rest args) + (defun jao-notmuch-before-tree (&rest _args) (when (string= (buffer-name) "*notmuch-hello*") (split-window-right 40) (other-window 1))) (defvar jao-notmuch--visits 0) - (defun jao-notmuch-after-tree-quit (&optional both) + (defun jao-notmuch-after-tree-quit (&optional _both) (when (and (not (derived-mode-p 'notmuch-tree-mode 'notmuch-hello-mode)) (save-window-excursion (other-window -1) (derived-mode-p 'notmuch-hello-mode))) @@ -562,7 +565,7 @@ (jao-notmuch--add-tags '("+trove"))) (when (y-or-n-p "Flag message as todo? ") (jao-notmuch--add-tags '("+flagged"))) - (org-store-link-props :type "notmuch" + (org-link-store-props :type "notmuch" :link link :description description))) (notmuch-search-mode @@ -572,7 +575,7 @@ (subj (notmuch-search-find-subject)) (description (format "Mail: %s" subj))) (setq jao-org-notmuch-last-subject subj) - (org-store-link-props + (org-link-store-props :type "notmuch" :link link :description description))))) @@ -618,13 +621,13 @@ (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 - "."))) + (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))) @@ -633,7 +636,7 @@ (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) +(defun jao-notmuch-open-file (fname &optional _page) (with-temp-buffer (insert-file-contents-literally fname) (goto-char (point-min)) |