about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--init.el7
-rw-r--r--lisp/+message.el26
-rw-r--r--lisp/+tab-bar.el2
3 files changed, 31 insertions, 4 deletions
diff --git a/init.el b/init.el index 8d17de2..d7f7d8c 100644 --- a/init.el +++ b/init.el
@@ -465,7 +465,7 @@
465(setup notmuch 465(setup notmuch
466 (:load-from "~/usr/share/emacs/site-lisp/") 466 (:load-from "~/usr/share/emacs/site-lisp/")
467 ;;(:load-after org-contacts) 467 ;;(:load-after org-contacts)
468 (:also-load +notmuch) 468 (:also-load +notmuch +message)
469 (+define-dir notmuch/ (sync/ "emacs/notmuch") 469 (+define-dir notmuch/ (sync/ "emacs/notmuch")
470 "Notmuch configuration and data.") 470 "Notmuch configuration and data.")
471 (:option notmuch-init-file (notmuch/ "notmuch-init.el" t) 471 (:option notmuch-init-file (notmuch/ "notmuch-init.el" t)
@@ -473,7 +473,8 @@
473 notmuch-address-use-company (featurep 'company) 473 notmuch-address-use-company (featurep 'company)
474 notmuch-search-oldest-first nil) 474 notmuch-search-oldest-first nil)
475 ;; Composing mail 475 ;; Composing mail
476 (:option message-kill-buffer-on-exit t) 476 (:option message-kill-buffer-on-exit t
477 message-auto-save-directory "~/var/mail/drafts")
477 ;; Sending mail 478 ;; Sending mail
478 (:option send-mail-function #'sendmail-send-it 479 (:option send-mail-function #'sendmail-send-it
479 mail-specify-envelope-from t 480 mail-specify-envelope-from t
@@ -482,7 +483,7 @@
482 ;; Extras and fixes 483 ;; Extras and fixes
483 (with-eval-after-load 'notmuch 484 (with-eval-after-load 'notmuch
484 (load notmuch-init-file :noerror) 485 (load notmuch-init-file :noerror)
485 ;;(add-hook 'notmuch-show-mode-hook #'visual-fill-column-mode) 486 (add-hook 'message-setup-hook #'+message-signature-setup)
486 (add-hook 'message-send-hook #'+send-mail-dispatch) 487 (add-hook 'message-send-hook #'+send-mail-dispatch)
487 (advice-add 'notmuch-tag :filter-args #'+notmuch-correct-tags) 488 (advice-add 'notmuch-tag :filter-args #'+notmuch-correct-tags)
488 (:option notmuch-saved-searches (list 489 (:option notmuch-saved-searches (list
diff --git a/lisp/+message.el b/lisp/+message.el new file mode 100644 index 0000000..b8bc234 --- /dev/null +++ b/lisp/+message.el
@@ -0,0 +1,26 @@
1;;; +message.el --- Extra message-mode functions -*- lexical-binding: t; -*-
2
3;;; Commentary:
4
5;;; Code:
6
7;; Thanks to Alex Schroeder for this!
8;; https://www.emacswiki.org/emacs/Change_Signature_Dynamically
9
10(defun +message-check-for-signature-change (&rest ignore)
11 "Check for a change in the To: or Cc: fields"
12 (when (and (message--in-tocc-p)
13 (not (buffer-narrowed-p)))
14 (save-excursion
15 (goto-char (point-max))
16 (let ((end (point)))
17 (when (re-search-backward message-signature-separator nil t)
18 (delete-region (1- (match-beginning 0)) end)))
19 (message-insert-signature))))
20
21(defun +message-signature-setup ()
22 (make-local-variable 'after-change-functions)
23 (push '+message-check-for-signature-change after-change-functions))
24
25(provide '+message)
26;;; +message.el ends here
diff --git a/lisp/+tab-bar.el b/lisp/+tab-bar.el index c56ca68..c4b7420 100644 --- a/lisp/+tab-bar.el +++ b/lisp/+tab-bar.el
@@ -53,7 +53,7 @@
53 "Display a notmuch count in the tab-bar." 53 "Display a notmuch count in the tab-bar."
54 (when (featurep 'notmuch) 54 (when (featurep 'notmuch)
55 (let* ((counts (notmuch-hello-query-counts notmuch-saved-searches)) 55 (let* ((counts (notmuch-hello-query-counts notmuch-saved-searches))
56 (next (cl-find "next" counts :key (lambda (l) (plist-get l :name)) :test 'equal)) 56 (next (cl-find "inbox" counts :key (lambda (l) (plist-get l :name)) :test 'equal))
57 (next-count (plist-get next :count))) 57 (next-count (plist-get next :count)))
58 (when (and next-count (> next-count 0)) 58 (when (and next-count (> next-count 0))
59 `((notmuch-count menu-item 59 `((notmuch-count menu-item