Further configure mail
This commit is contained in:
parent
147f94f5d2
commit
4326b4327f
7
init.el
7
init.el
|
@ -465,7 +465,7 @@
|
||||||
(setup notmuch
|
(setup notmuch
|
||||||
(:load-from "~/usr/share/emacs/site-lisp/")
|
(:load-from "~/usr/share/emacs/site-lisp/")
|
||||||
;;(:load-after org-contacts)
|
;;(:load-after org-contacts)
|
||||||
(:also-load +notmuch)
|
(:also-load +notmuch +message)
|
||||||
(+define-dir notmuch/ (sync/ "emacs/notmuch")
|
(+define-dir notmuch/ (sync/ "emacs/notmuch")
|
||||||
"Notmuch configuration and data.")
|
"Notmuch configuration and data.")
|
||||||
(:option notmuch-init-file (notmuch/ "notmuch-init.el" t)
|
(:option notmuch-init-file (notmuch/ "notmuch-init.el" t)
|
||||||
|
@ -473,7 +473,8 @@
|
||||||
notmuch-address-use-company (featurep 'company)
|
notmuch-address-use-company (featurep 'company)
|
||||||
notmuch-search-oldest-first nil)
|
notmuch-search-oldest-first nil)
|
||||||
;; Composing mail
|
;; Composing mail
|
||||||
(:option message-kill-buffer-on-exit t)
|
(:option message-kill-buffer-on-exit t
|
||||||
|
message-auto-save-directory "~/var/mail/drafts")
|
||||||
;; Sending mail
|
;; Sending mail
|
||||||
(:option send-mail-function #'sendmail-send-it
|
(:option send-mail-function #'sendmail-send-it
|
||||||
mail-specify-envelope-from t
|
mail-specify-envelope-from t
|
||||||
|
@ -482,7 +483,7 @@
|
||||||
;; Extras and fixes
|
;; Extras and fixes
|
||||||
(with-eval-after-load 'notmuch
|
(with-eval-after-load 'notmuch
|
||||||
(load notmuch-init-file :noerror)
|
(load notmuch-init-file :noerror)
|
||||||
;;(add-hook 'notmuch-show-mode-hook #'visual-fill-column-mode)
|
(add-hook 'message-setup-hook #'+message-signature-setup)
|
||||||
(add-hook 'message-send-hook #'+send-mail-dispatch)
|
(add-hook 'message-send-hook #'+send-mail-dispatch)
|
||||||
(advice-add 'notmuch-tag :filter-args #'+notmuch-correct-tags)
|
(advice-add 'notmuch-tag :filter-args #'+notmuch-correct-tags)
|
||||||
(:option notmuch-saved-searches (list
|
(:option notmuch-saved-searches (list
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
;;; +message.el --- Extra message-mode functions -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
;; Thanks to Alex Schroeder for this!
|
||||||
|
;; https://www.emacswiki.org/emacs/Change_Signature_Dynamically
|
||||||
|
|
||||||
|
(defun +message-check-for-signature-change (&rest ignore)
|
||||||
|
"Check for a change in the To: or Cc: fields"
|
||||||
|
(when (and (message--in-tocc-p)
|
||||||
|
(not (buffer-narrowed-p)))
|
||||||
|
(save-excursion
|
||||||
|
(goto-char (point-max))
|
||||||
|
(let ((end (point)))
|
||||||
|
(when (re-search-backward message-signature-separator nil t)
|
||||||
|
(delete-region (1- (match-beginning 0)) end)))
|
||||||
|
(message-insert-signature))))
|
||||||
|
|
||||||
|
(defun +message-signature-setup ()
|
||||||
|
(make-local-variable 'after-change-functions)
|
||||||
|
(push '+message-check-for-signature-change after-change-functions))
|
||||||
|
|
||||||
|
(provide '+message)
|
||||||
|
;;; +message.el ends here
|
|
@ -53,7 +53,7 @@
|
||||||
"Display a notmuch count in the tab-bar."
|
"Display a notmuch count in the tab-bar."
|
||||||
(when (featurep 'notmuch)
|
(when (featurep 'notmuch)
|
||||||
(let* ((counts (notmuch-hello-query-counts notmuch-saved-searches))
|
(let* ((counts (notmuch-hello-query-counts notmuch-saved-searches))
|
||||||
(next (cl-find "next" counts :key (lambda (l) (plist-get l :name)) :test 'equal))
|
(next (cl-find "inbox" counts :key (lambda (l) (plist-get l :name)) :test 'equal))
|
||||||
(next-count (plist-get next :count)))
|
(next-count (plist-get next :count)))
|
||||||
(when (and next-count (> next-count 0))
|
(when (and next-count (> next-count 0))
|
||||||
`((notmuch-count menu-item
|
`((notmuch-count menu-item
|
||||||
|
|
Loading…
Reference in New Issue