From 0b0e8c2da77979eaea9e0b0da865d35bd86936d5 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 18 Jun 2020 20:19:50 +0100 Subject: chore(tazjin/emacs): Move //tools/emacs to //users/tazjin/emacs Change-Id: I9dfbd0bb1fd3e215bb91c5734fb0934ee3faeae6 --- tools/emacs/config/mail-setup.el | 83 ---------------------------------------- 1 file changed, 83 deletions(-) delete mode 100644 tools/emacs/config/mail-setup.el (limited to 'tools/emacs/config/mail-setup.el') diff --git a/tools/emacs/config/mail-setup.el b/tools/emacs/config/mail-setup.el deleted file mode 100644 index 1167bcadd372..000000000000 --- a/tools/emacs/config/mail-setup.el +++ /dev/null @@ -1,83 +0,0 @@ -(require 'notmuch) -(require 'counsel-notmuch) - -;; (global-set-key (kbd "C-c m") 'notmuch-hello) -;; (global-set-key (kbd "C-c C-m") 'counsel-notmuch) -;; (global-set-key (kbd "C-c C-e n") 'notmuch-mua-new-mail) - -(setq notmuch-cache-dir (format "%s/.cache/notmuch" (getenv "HOME"))) -(make-directory notmuch-cache-dir t) - -;; Cache addresses for completion: -(setq notmuch-address-save-filename (concat notmuch-cache-dir "/addresses")) - -;; Don't spam my home folder with drafts: -(setq notmuch-draft-folder "drafts") ;; relative to notmuch database - -;; Mark things as read when archiving them: -(setq notmuch-archive-tags '("-inbox" "-unread" "+archive")) - -;; Show me saved searches that I care about: -(setq notmuch-saved-searches - '((:name "inbox" :query "tag:inbox" :count-query "tag:inbox AND tag:unread" :key "i") - (:name "sent" :query "tag:sent" :key "t") - (:name "drafts" :query "tag:draft"))) -(setq notmuch-show-empty-saved-searches t) - -;; Mail sending configuration -(setq send-mail-function 'sendmail-send-it) ;; sendmail provided by MSMTP -(setq notmuch-always-prompt-for-sender t) -(setq notmuch-mua-user-agent-function - (lambda () (format "Emacs %s; notmuch.el %s" emacs-version notmuch-emacs-version))) -(setq mail-host-address (system-name)) -(setq notmuch-mua-cite-function #'message-cite-original-without-signature) -(setq notmuch-fcc-dirs nil) ;; Gmail does this server-side -(setq message-signature nil) ;; Insert message signature manually with C-c C-w - -;; Close mail buffers after sending mail -(setq message-kill-buffer-on-exit t) - -;; Ensure sender is correctly passed to msmtp -(setq mail-specify-envelope-from t - message-sendmail-envelope-from 'header - mail-envelope-from 'header) - -;; Store sent mail in the correct folder per account -(setq notmuch-maildir-use-notmuch-insert nil) - -;; I don't use drafts but I instinctively hit C-x C-s constantly, lets -;; handle that gracefully. -(define-key notmuch-message-mode-map (kbd "C-x C-s") #'ignore) - -;; Define a telephone-line segment for displaying the count of unread, -;; important mails in the last window's mode-line: -(defvar *last-notmuch-count-redraw* 0) -(defvar *current-notmuch-count* nil) - -(defun update-display-notmuch-counts () - "Update and render the current state of the notmuch unread - count for display in the mode-line. - - The offlineimap-timer runs every 2 minutes, so it does not make - sense to refresh this much more often than that." - - (when (> (- (float-time) *last-notmuch-count-redraw*) 30) - (setq *last-notmuch-count-redraw* (float-time)) - (let* ((inbox-unread (notmuch-saved-search-count "tag:inbox and tag:unread")) - (notmuch-count (format "I: %s; D: %s" inbox-unread))) - (setq *current-notmuch-count* notmuch-count))) - - (when (and (bottom-right-window-p) - ;; Only render if the initial update is done and there - ;; are unread mails: - *current-notmuch-count* - (not (equal *current-notmuch-count* "I: 0; D: 0"))) - *current-notmuch-count*)) - -(telephone-line-defsegment telephone-line-notmuch-counts () - "This segment displays the count of unread notmuch messages in - the last window's mode-line (if unread messages are present)." - - (update-display-notmuch-counts)) - -(provide 'mail-setup) -- cgit 1.4.1