emacs: Add compatibility for org-msg.el

Enable `notmuch-company` with `org-msg`, which does not derive from
`message-mode` in composing. This change was first proposed in the
discussion here:
https://github.com/jeremy-compostella/org-msg/issues/53
This commit is contained in:
Ori 2021-06-24 15:43:58 -04:00 committed by David Bremner
parent 7406abf5e0
commit 2c96956b3b
2 changed files with 4 additions and 1 deletions

2
NEWS
View file

@ -8,6 +8,8 @@ Emacs
previous behaviour of using notmuch to send mail by default, customize
`mail-user-agent` to `notmuch-user-agent`.
`notmuch-company` now works in `org-msg`.
Vim
---

View file

@ -70,7 +70,8 @@
(completion-ignore-case t))
(cl-case command
(interactive (company-begin-backend 'notmuch-company))
(prefix (and (derived-mode-p 'message-mode)
(prefix (and (or (derived-mode-p 'message-mode)
(derived-mode-p 'org-msg-edit-mode))
(looking-back
(concat notmuch-address-completion-headers-regexp ".*")
(line-beginning-position))