From 4326b4327f8b253051bb0f4ee4c6ae7d20985207 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 21 Feb 2022 22:40:35 -0600 Subject: Further configure mail --- lisp/+message.el | 26 ++++++++++++++++++++++++++ lisp/+tab-bar.el | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 lisp/+message.el (limited to 'lisp') 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 @@ +;;; +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 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 @@ "Display a notmuch count in the tab-bar." (when (featurep 'notmuch) (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))) (when (and next-count (> next-count 0)) `((notmuch-count menu-item -- cgit 1.4.1-21-gabe81