summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrawberryTea <look@strawberrytea.xyz>2024-03-05 16:51:13 -0600
committerYoumu <condy0919@gmail.com>2024-03-08 02:07:00 +0800
commitfe96b412f437f263f99492fe293499016b816a78 (patch)
treee1ea69a9970b93380bf3778a31c4e5dd142e3382
parentd0518fc1626f09a341d4b5a98c857087abfb1b0c (diff)
mu4e: re-add removed mu4e-compose-begin/end-commands
The commands `mu4e-compose-begin` and `mu4e-compose-end` were removed in commit https://github.com/djcb/mu/commit/85bfe763362b95935a3967f6585e14b3f9890a70 of version 1.12.0 of mu. This commit re-adds these commands to the evil collection for mu4e.
-rw-r--r--modes/mu4e/evil-collection-mu4e.el25
1 files changed, 25 insertions, 0 deletions
diff --git a/modes/mu4e/evil-collection-mu4e.el b/modes/mu4e/evil-collection-mu4e.el
index e32577a..96010d3 100644
--- a/modes/mu4e/evil-collection-mu4e.el
+++ b/modes/mu4e/evil-collection-mu4e.el
@@ -93,6 +93,31 @@
(evil-set-initial-state mode 'normal))
(evil-set-initial-state 'mu4e-compose-mode 'insert))
+ ;; These functions were removed from mu4e 1.12.0, specifically this commit:
+ ;; https://github.com/djcb/mu/commit/85bfe763362b95935a3967f6585e14b3f9890a70
+ (when (version<= "1.12.0" mu4e-mu-version)
+ (defun mu4e-compose-goto-top ()
+ "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)
+ (let ((old-position (point)))
+ (message-goto-body)
+ (when (= (point) old-position)
+ (goto-char (point-min)))))
+
+ (defun mu4e-compose-goto-bottom ()
+ "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)
+ (let ((old-position (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))
+ (when (= (point) old-position)
+ (goto-char (point-max))))))
;; When using org-mu4e, the above leads to an annoying behaviour, because
;; switching from message body to header activates mu4e-compose-mode, thus