git clone https://github.com/krobelus/kakoune-mblaze \
~/.config/kak/autoload/kakoune-mblaze
kak -e 'doc mblaze'mblaze-scan pipes the output of the given shell script into mscan(1) and
shows the result in an *mblaze-scan* buffer.
Example:
mblaze-scan %{ mlist $(mdirs) | mthread }Inside *mblaze-scan*, you can run
-
mblaze-showto usemshow(1)to render selected messages in an*mblaze-show*buffer -
mblaze-refreshto update a scan buffer by re-running its command -
mblaze-next-threadormblaze-previous-threadto move the main cursor to the next or previous thread start
Most mblaze-* commands operate on the "context’s message(s)", which is defined as follows:
-
in an
*mblaze-scan*buffer, the messages covered by the selections. Commands that operate on only one message only consider the main cursor. -
in an
*mblaze-show*buffer, the messages shown. Commands that operate on only one message currently fail in show buffers where multiple messages are shown.
To show the context’s message in another client as you
browse a scan buffer, set mblaze_autoshow_client. For example:
mblaze-scan %{ mlist $(mdirs) | mthread }
new evaluate-commands %{ set-option global mblaze_autoshow_client %val{client} }mblaze-pipe-to <command> writes the context’s messages
to the given command’s standard input, one filename per line, and then calls
mblaze-refresh if called from a scan buffer.
The command’s output is currently shown in the *debug* buffer.
For example:
mblaze-pipe-to %{ mrefile "$(mhdr -h maildir ~/.mblaze/profile)"/archive }In a scan buffer with a threaded view as created by mthread(1), the
mblaze-pipe-to command can be passed the -thread
option, to pipe whole threads.
mblaze-compose wraps mcom(1) to create a draft message and edits it.
mblaze-reply and mblaze-forward wrap mrep(1) and mfwd(1) to create and
edit a draft reply to or forward of the context’s messages.
mblaze-send sends the message draft in the current buffer with mcom(1).
mblaze-open-named-mime-parts <part_filename>… opens the given named MIME
parts (such as attachments) from the context’s message.
mblaze-open-html-mime-part opens the unique unnamed text/html part of
the context’s message.
Both commands call mblaze-open-mime-part <message_file> <part> <mime_type>
which needs to be overridden by the user. For example, to save MIME parts
in the current directory and open them, do:
define-command -override mblaze-open-mime-part -params 3 %{
nop %sh{
message_file=$1 part=$2 mime_type=$3
mshow -n -x "$message_file" "$part"
xdg-open "$part"
}
}Search for occurrences of mblaze in my kakrc.
I was previously using https://git.sr.ht/~parasrah/mblaze.kak for some of my workflows; when I finally got around to writing this plugin and using it for all my mail, I based it on https://github.com/mawww/mblaze.kak because that had fewer things I needed to change.
Send feedback and patches to ~krobelus/kakoune@lists.sr.ht (see public archives) or use GitHub.