Improve org-msg automatic greeting insertion

This commit is contained in:
TEC 2024-03-09 00:07:38 +08:00
parent cc33a5750d
commit e523a3ec2a
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 5 additions and 3 deletions

View File

@ -7549,15 +7549,17 @@ END can be the symbol top, bottom, or nil to toggle."
(let ((initial-pos (point)))
(org-msg-goto-body)
(when (or (eq end 'top)
(and (or (eq initial-pos (point)) ; Already at bottom
(and (or (memq initial-pos ; Already at bottom
(list (point) (1- (point))))
(<= initial-pos ; Above message body
(save-excursion
(message-goto-body)
(point))))
(not (eq end 'bottom))))
(message-goto-body)
(search-forward (format org-msg-greeting-fmt
(concat " " (org-msg-get-to-name)))))))
(re-search-forward
(format (regexp-quote org-msg-greeting-fmt) ; %s is unaffected.
(concat "\\(?: " (regexp-quote (org-msg-get-to-name)) "\\)?"))))))
#+end_src
We can replace the evil binding of =mu4e-compose-goto-bottom= with this function.