aboutsummaryrefslogtreecommitdiff
path: root/git-email.el
diff options
context:
space:
mode:
Diffstat (limited to 'git-email.el')
-rw-r--r--git-email.el19
1 files changed, 11 insertions, 8 deletions
diff --git a/git-email.el b/git-email.el
index 84e5eaf..e3a08e1 100644
--- a/git-email.el
+++ b/git-email.el
@@ -48,7 +48,7 @@
(require 'project)
(require 'message)
-;;; Customization options
+;;;; Customization options
(defgroup git-email nil
"Work with git and email."
:group 'convenience)
@@ -122,14 +122,14 @@ variable."
(defface git-email-revision-face '((t :inherit font-lock-comment-face))
"Face used for the revision when selecting from the minibuffer.")
-;;; Remove Compiler warnings
+;;;; Remove Compiler warnings
(declare-function dired-get-filename "dired.el")
(declare-function dired-map-over-marks "dired.el")
(declare-function ibuffer-get-marked-buffers "ibuffer.el")
(declare-function vc-dir-marked-files "vc-dir.el")
(declare-function vc-dir-current-file "vc-dir.el")
-;;; Get files to send
+;;;; Get files to send
(defun git-email--extract-diff (patch-file)
"Extract the diff from PATCH-FILE."
(with-temp-buffer
@@ -189,7 +189,7 @@ If no marks are found, return the filename at point."
(when (mapcar 'git-email--check-file files)
files)))
-;;; Get contents from patch
+;;;; Get contents from patch
(defun git-email--extract-header (header)
"Extract HEADER from current buffer."
(goto-char (point-min))
@@ -245,7 +245,7 @@ them into the message buffer."
(when (re-search-backward "\\*\\*\\* SUBJECT HERE \\*\\*\\*" nil t)
(kill-line))))
-;;; Format patches
+;;;; Format patches
(defun git-email--get-revision ()
"Let the user choose a git revision from the minibuffer."
(interactive)
@@ -290,7 +290,10 @@ With optional ARGS (\\[universal-argument]) you can specify extra
arguments to give to 'git format-patch'. By default, the
arguments in `git-email-format-patch-default-args' will be used."
(interactive "P")
- (let* ((rev (git-email--get-revision))
+ (let* ((rev-at-point (cadr (log-view-current-entry (point) t)))
+ (rev (if rev-at-point
+ rev-at-point
+ (git-email--get-revision)))
;; Extra arguments.
(args (if args
(apply
@@ -311,7 +314,7 @@ arguments in `git-email-format-patch-default-args' will be used."
(run-hooks 'git-email-post-compose-email-hook))))
-;;; Operate on emails
+;;;; Operate on emails
(defun git-email-send-all ()
"Send all unsent emails."
(interactive)
@@ -330,7 +333,7 @@ arguments in `git-email-format-patch-default-args' will be used."
(git-email--compose-email file)
(run-hooks 'git-email-post-compose-email-hook))))
-;;; Apply patches
+;;;; Apply patches
(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))