diff options
-rw-r--r-- | git-email.el | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/git-email.el b/git-email.el index 244f44e..d8f3069 100644 --- a/git-email.el +++ b/git-email.el @@ -96,6 +96,20 @@ in you git config. If the variable is not set, the 'to' address will be empty." :type 'int :group 'git-email) +(defcustom git-email-apply-patch-function + 'git-email--shell-command-on-body + "Function that executes a shell command on the body of the message. +This function should take one argument, it should be the shell command to +execute. By default it is determined by the `git-email-apply-patch-command' +variable." + :type 'symbol + :group 'git-email) + +(defcustom git-email-apply-patch-command "git am" + "Command to run to apply the patch." + :type 'string + :group 'git-email) + ;; Compile warnings (declare-function dired-get-filename "dired.el") (declare-function dired-map-over-marks "dired.el") @@ -111,6 +125,10 @@ in you git config. If the variable is not set, the 'to' address will be empty." (funcall git-email-send-email-function)) buffers))) +(defun git-email--shell-command-on-body (command) + "Get the body of the message in the current buffer and run COMMAND on it." + (shell-command-on-region (point-min) (point-max) command)) + (defun git-email--extract-header (header) "Extract HEADER from current buffer." (goto-char (point-min)) @@ -232,7 +250,8 @@ If no marks are found, return the filename at point." (interactive (list (project-prompt-project-dir))) (let ((default-directory project)) (push (list project) project--list) - (shell-command-on-region (point-min) (point-max) "git am"))) + (funcall git-email-apply-patch-function + git-email-apply-patch-command))) ;;;###autoload (defun git-email-send-email () |