aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReily Siegel <mail@reilysiegel.com>2021-06-01 17:41:21 -0400
committerXinglu Chen <public@yoctocell.xyz>2021-06-02 08:51:16 +0200
commit5c7a1d3aa23f28b52956ecd92ef1fb9cf55bfbfa (patch)
tree5e4076f676b37744d81fd65e13849d1f579c2d1c
parent3395de2094a23bfd5125ff166de4b4e2c9500562 (diff)
Add git-email-mu4e.el
* git-email-mu4e.el: New file. * doc/git-email.texi (Miscellaneous): Mention integration with Mu4e. Signed-off-by: Xinglu Chen <public@yoctocell.xyz>
-rw-r--r--doc/git-email.texi6
-rw-r--r--git-email-mu4e.el58
2 files changed, 61 insertions, 3 deletions
diff --git a/doc/git-email.texi b/doc/git-email.texi
index 38e3408..6d49c01 100644
--- a/doc/git-email.texi
+++ b/doc/git-email.texi
@@ -308,9 +308,9 @@ trailing @samp{/}.
@node Integration with other packages
@chapter Integration with other packages
-@samp{git-email} offers minor modes for Gnus and Notmuch, these minor modes
-will just configure some variables for you and provide any extra
-functionality as of right now.
+@samp{git-email} offers minor modes for Gnus, Mu4e, and Notmuch, these
+minor modes will just configure some variables for you and provide any
+extra functionality as of right now.
There is also integration with magit in the @samp{git-email-magit.el}
library. This will faciliate the transient library, you can send a
diff --git a/git-email-mu4e.el b/git-email-mu4e.el
new file mode 100644
index 0000000..05807ab
--- /dev/null
+++ b/git-email-mu4e.el
@@ -0,0 +1,58 @@
+;;; git-email-mu4e.el --- mu4e integration for git-email -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2021 all contributors <~yoctocell/git-email-deve@lists.sr.ht>
+
+;; Author: Reily Siegel <mail@reilysiegel.com>
+;; URL: https://git.sr.ht/~yoctocell/git-email
+;; Version: 0.2.0
+;; Package-Requires: ((emacs "27"))
+;; Keywords: git mail
+;; License: GNU General Public License >= 3
+
+;; This program is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This library sets some variables for git-email to make it work
+;; better with mu4e.
+
+;;; Code:
+
+(require 'git-email)
+(require 'mu4e-compose)
+
+;;;###autoload
+(define-minor-mode git-email-mu4e-mode
+ "Mu4e integration for git-email.
+If called interactively, toggle the mode. A positive prefix ARG
+enables the mode, any other prefix ARG disabled it. If called
+from Lisp, enable the mode if ARG is omitted or nil."
+ :group 'git-email
+ :global t
+ :init-value nil
+ (if git-email-mu4e-mode
+ (setq git-email-compose-email-function
+ (lambda (to subject headers)
+ (mu4e~compose-mail
+ to
+ subject
+ ;; Remove "from" header, as it interferes with mu4e's
+ ;; built in context feature.
+ (seq-filter (lambda (header)
+ (not (eq (car header) 'from)))
+ headers)
+ (setq git-email-compose-email-function 'message-mail)))
+
+(provide 'git-email-mu4e)
+;;; git-email-mu4e.el ends here