From 006c3399cb26118010fd10fd57227877dce6ae13 Mon Sep 17 00:00:00 2001 From: Antoine Levitt Date: Thu, 5 Dec 2019 21:36:38 +0100 Subject: [PATCH 1/2] Push mark on beginning/end of buffer --- mu4e/mu4e-compose.el | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/mu4e/mu4e-compose.el b/mu4e/mu4e-compose.el index a7352390..9d011d73 100644 --- a/mu4e/mu4e-compose.el +++ b/mu4e/mu4e-compose.el @@ -900,11 +900,17 @@ buffer buried." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defun mu4e-compose-goto-top () +(defun mu4e-compose-goto-top (&optional arg) "Go to the beginning of the message or buffer. Go to the beginning of the message or, if already there, go to the -beginning of the buffer." - (interactive) +beginning of the buffer. + +Push mark at previous position, unless either a \\[universal-argument] prefix +is supplied, or Transient Mark mode is enabled and the mark is active." + (interactive "P") + (or arg + (region-active-p) + (push-mark)) (let ((old-position (point))) (message-goto-body) (when (equal (point) old-position) @@ -913,13 +919,19 @@ beginning of the buffer." (define-key mu4e-compose-mode-map (vector 'remap 'beginning-of-buffer) 'mu4e-compose-goto-top) -(defun mu4e-compose-goto-bottom () +(defun mu4e-compose-goto-bottom (&optional arg) "Go to the end of the message or buffer. Go to the end of the message (before signature) or, if already there, go to the -end of the buffer." - (interactive) +end of the buffer. + +Push mark at previous position, unless either a \\[universal-argument] prefix +is supplied, or Transient Mark mode is enabled and the mark is active." + (interactive "P") + (or arg + (region-active-p) + (push-mark)) (let ((old-position (point)) - (message-position (save-excursion (message-goto-body) (point)))) + (message-position (save-excursion (message-goto-body) (point)))) (goto-char (point-max)) (when (re-search-backward message-signature-separator message-position t) (forward-line -1)) From dcb3025d1dff137463ffde9d16b9f61069e8558c Mon Sep 17 00:00:00 2001 From: Antoine Levitt Date: Tue, 10 Dec 2019 11:07:01 +0100 Subject: [PATCH 2/2] revert indentation --- mu4e/mu4e-compose.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mu4e/mu4e-compose.el b/mu4e/mu4e-compose.el index 9d011d73..ebaa42e5 100644 --- a/mu4e/mu4e-compose.el +++ b/mu4e/mu4e-compose.el @@ -931,7 +931,7 @@ is supplied, or Transient Mark mode is enabled and the mark is active." (region-active-p) (push-mark)) (let ((old-position (point)) - (message-position (save-excursion (message-goto-body) (point)))) + (message-position (save-excursion (message-goto-body) (point)))) (goto-char (point-max)) (when (re-search-backward message-signature-separator message-position t) (forward-line -1))