From 7d768ca221e7d7235bee4bc6573791c39934357b Mon Sep 17 00:00:00 2001 From: yoctocell Date: Mon, 4 Jan 2021 19:41:50 +0100 Subject: Fix hooks Update docstrings for types for hooks and run them before and after every `git-email--compose-email' call. * git-email.el (git-email-pre-compose-email-hook): (git-email-post-compose-email-hook): (git-email-send-email): --- git-email.el | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'git-email.el') diff --git a/git-email.el b/git-email.el index 0627639..50e5774 100644 --- a/git-email.el +++ b/git-email.el @@ -56,13 +56,13 @@ :type 'symbol) (defcustom git-email-pre-compose-email-hook nil - "A list of functions called before running `git-email--compose-message'." - :type 'hook + "A list of functions called before running `git-email--compose-email'." + :type '(hook) :group 'git-email) (defcustom git-email-post-compose-email-hook nil - "A list of functions called after running `git-email--compose-message'." - :type 'hook + "A list of functions called after running `git-email--compose-email'." + :type '(hook) :group 'git-email) (defcustom git-email-headers @@ -140,12 +140,11 @@ If no marks are found, return the filename at point." (defun git-email-send-email () "Send patch(es) to someone." (interactive) - (run-hooks 'git-email-pre-compose-email-hook) (let ((files (git-email--get-filenames))) - (prog1 (dolist (file files) - (git-email--compose-email file)) - (run-hooks 'git-email-post-compose-email-hook)))) + (run-hooks 'git-email-pre-compose-email-hook) + (git-email--compose-email file) + (run-hooks 'git-email-post-compose-email-hook)))) (defun git-email--remove-subject (header) "Remove HEADER if it is the subject." -- cgit v1.2.3