From: Nader Akoury <
g...@dojoteef.com>
This patch allows editors like (neo)vim and kakoune to specify
`filetype=mail` as an argument to the editor when being invoked.
---
man/mblaze-profile.5 | 10 ++++++++++
mcom | 5 ++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/man/mblaze-profile.5 b/man/mblaze-profile.5
index e4170ae..a2ad0f2 100644
--- a/man/mblaze-profile.5
+++ b/man/mblaze-profile.5
@@ -97,6 +97,16 @@ If set,
.Xr mcom 1
will call this on the mail file after sending,
and not refile the sent mail to outbox.
+.It Li Editor\&:
+The program that
+.Xr mcom 1
+will call to edit mail.
+(Default:
+.Pa ${VISUAL:-${EDITOR:-vi}} ) .
+.It Li Editor\&-Args\&:
+Flags to be passed to the
+.Li Editor\&:
+program.
.El
.Sh ENVIRONMENT
.Bl -tag -width Ds
diff --git a/mcom b/mcom
index 992af24..ba39986 100755
--- a/mcom
+++ b/mcom
@@ -103,6 +103,9 @@ MBLAZE=${MBLAZE:-$HOME/.mblaze}
sendmail=$(mhdr -h sendmail "$MBLAZE/profile")
sendmail_args=$(mhdr -h sendmail-args "$MBLAZE/profile")
sendmail="${sendmail:-sendmail} ${sendmail_args:--t}"
+editor=$(mhdr -h editor "$MBLAZE/profile")
+editor_args=$(mhdr -h editor-args "$MBLAZE/profile")
+editor="${editor:-${VISUAL:-${EDITOR:-vi}}} ${editor_args}"
default_from=$(mhdr -h local-mailbox "$MBLAZE/profile")
senthook=$(mhdr -h senthook "$MBLAZE/profile")
@@ -527,7 +530,7 @@ while :; do
;;
e|edit)
c=
- if ! ${VISUAL:-${EDITOR:-vi}} "$draft"; then
+ if ! eval "$editor $draft"; then
c=d
else
if checksensible "$draft"; then
--
2.50.0