Skip to content

Commit

Permalink
mu4e: re-add removed mu4e-compose-begin/end-commands
Browse files Browse the repository at this point in the history
The commands `mu4e-compose-begin` and `mu4e-compose-end` were removed in
commit
djcb/mu@85bfe76
of version 1.12.0 of mu.  This commit re-adds these commands to the evil
collection for mu4e.
  • Loading branch information
LemonBreezes committed Mar 5, 2024
1 parent 1ad283f commit c117d9c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions modes/mu4e/evil-collection-mu4e.el
Original file line number Diff line number Diff line change
Expand Up @@ -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 (equal (point) old-position)
(beginning-of-buffer))))

(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))))
(end-of-buffer)
(when (re-search-backward "^-- $" message-position t)
(previous-line))
(when (equal (point) old-position)
(end-of-buffer)))))

;; When using org-mu4e, the above leads to an annoying behaviour, because
;; switching from message body to header activates mu4e-compose-mode, thus
Expand Down

0 comments on commit c117d9c

Please sign in to comment.