From 52522e1a13aeb787c4e410eebf06338710d51362 Mon Sep 17 00:00:00 2001 From: Amolith Date: Sat, 20 Jan 2024 14:11:19 -0500 Subject: [PATCH] add func for applying mu4e buffer as patch --- dot_config/doom/config.el.tmpl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dot_config/doom/config.el.tmpl b/dot_config/doom/config.el.tmpl index 195808029f3ec362ba248969dff275a03c349be7..92ae90be3ec81a74549e370802518ac5386fef41 100644 --- a/dot_config/doom/config.el.tmpl +++ b/dot_config/doom/config.el.tmpl @@ -167,6 +167,19 @@ (after! mu4e (load "~/.config/doom/extra/mu4e.el")) +(defun magit-am-apply-buffer (buffer &optional args) + "Apply the patch in BUFFER." + (interactive (list (read-buffer "Apply contents of buffer: ") + (magit-am-arguments))) + (let ((patch + (with-current-buffer buffer + (buffer-substring-no-properties (point-min) (point-max))))) + (with-temp-buffer + (insert patch) + (magit-run-git-with-input + "am" args "-")) + (magit-refresh))) + (use-package edit-server :ensure t :commands edit-server-start