Merge pull request #345 from DamienCassou/goto-begin-end-of-message
* better `M-<` and `M->` when composing a message.
This commit is contained in:
@ -589,6 +589,36 @@ Ie. either 'name <email>' or 'email')."
|
|||||||
(message-goto-body)))))))
|
(message-goto-body)))))))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
(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))))
|
||||||
|
|
||||||
|
(define-key mu4e-compose-mode-map
|
||||||
|
(vector 'remap 'beginning-of-buffer) 'mu4e-compose-goto-top)
|
||||||
|
|
||||||
|
(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-signature-separator message-position t)
|
||||||
|
(previous-line))
|
||||||
|
(when (equal (point) old-position)
|
||||||
|
(end-of-buffer))))
|
||||||
|
|
||||||
|
(define-key mu4e-compose-mode-map
|
||||||
|
(vector 'remap 'end-of-buffer) 'mu4e-compose-goto-bottom)
|
||||||
|
|
||||||
(provide 'mu4e-compose)
|
(provide 'mu4e-compose)
|
||||||
|
|
||||||
;; Load mu4e completely even when this file was loaded through
|
;; Load mu4e completely even when this file was loaded through
|
||||||
|
|||||||
Reference in New Issue
Block a user