From c3a39c6a62a1fda0723832e50217fab8f534f5d0 Mon Sep 17 00:00:00 2001 From: yoctocell Date: Mon, 4 Jan 2021 16:01:54 +0100 Subject: Retain the cursor position after inserting diff Put the cursor at the beginning of the body of the message instead of at the end. * git-email.el (git-email--compose-email): --- git-email.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'git-email.el') diff --git a/git-email.el b/git-email.el index 2bfe675..0ddf93d 100644 --- a/git-email.el +++ b/git-email.el @@ -210,7 +210,8 @@ them into the message buffer." ;; (let ((body (or (re-search-forward "<#part .*>") ;; (re-search-forward "--text follows this line--")))) (goto-char (point-max)) - (insert diff))) + (save-excursion + (insert diff)))) (provide 'git-email) -- cgit v1.2.3