This function was used for pick entry from hello but isn't needed
anymore. It was modelled on notmuch-hello-search which is now only
used non-interactively (and notmuch-pick does now add to the
recent-search history correctly).
Pick adds some keybindings to keymaps for other modes (for entry to
pick). These quoted the keymaps which appears to be unnecessary and to
rely on the fact that these keymaps have the same entry in the
function cell as the value cell (perhaps for historical reasons?)
Remove these quotes.
Previously the box graphics in the pick view were always attached to
the subject. Make them a field in their own right. We use the
recursive insert to change the default notmuch-pick-result-format so
that the user view does not change. (The subject touches the tree box
graphics but the next column (tags) is still vertically aligned.)
Previously, the message format was fixed: each part had to be a
certain width and either left or right justified. This allows the user
to specify that two parts can be variable width but that combined they
should be some fixed width. We do this by allowing the user to set as
a "field" a list of the normal result-format form which is formatted
and then itself inserted according to the format string specified.
This means all existing formats work but allows more general things
too. This will be used in the next patch to allow the user to specify
where the tree box graphics are drawn but allow, e.g., the total width
of the tree box graphics and subject to be specified.
This moves the actual insertion of message fields up from the field
formatting function into the message insertion function. This will be
useful in the next patch as we can apply further formatting to the
insertion string before inserting.
Dating back to the earliest notmuch-pick we have not printed anything
for the tag field for a message with no tags. This is inconsistent
with search and show both of which print "()". Change pick to be
consistent.
Austin recently introduced a new global keymap. This makes pick use
this global map.
In most cases pick needs to override this global map because
it wants to close the message pane before doing the action. However,
this documents the over-rides and makes it less likely that the pick
bindings will get out of sync with the main bindings.
pick was meant to use the same mini-buffer history but this failed
because the interactive definition took place before the use search
mini-buffer history part. Remove the interactive prompt to ensure the
correct history is used.
This variable is essentially unused: it was only used for making sure
it itself got reset after a refresh of the buffer.
It did this by passing an unnecessary argument to notmuch-pick-worker
so remove that too.
This adds functions to go to the previous or next thread to
pick. Prev-thread behaves similarly to prev-message in show: if you
are on the top line of a thread it will go to the top of the previous
thread, otherwise it will go to the top of the current thread. Next
thread will always go to the top of the next thread (or the end of
buffer). These are bound to "M-p" and "M-n" by default (matching the
bindings in show).
Previously pick had no actions based on the entire thread: this adds
some. Note in this version '*' is bound to `tag thread' which is not
consistent with search or show. However it still might be the most
natural thing (as it is similar to running * in the show pane).
Previously notmuch-pick had no thread based functionality. This adds a
macro to iterate through all messages in a thread. To simplify this it
adds a text-property marker to the first message of each thread.
Previously pick had the option of using an async parser like search or
a sync parser like show. The async parser has always been the default
and it seems fine so we can remove the sync one and the corresponding
defcustom.
This makes tab move to next button in the message pane and binds
button activate (in message pane) to "e". This means that is easy to
toggle hidden parts or hidden citations etc in the message pane.
We will want to be able to activate buttons not in the current
buffer (ie in the message pane) so it is helpful to have a way of
activating a button without signalling error if there is no button.
These functions all now work straight from their notmuch-show
implementation so link them in.
Stash functionality was one of the key missing things in notmuch-pick.
We can use the attachment functions straight from
notmuch-show. notmuch-show-view-all-mime-parts might be deprecated so
we either want to undeprecate it or not have this binding.
We override notmuch-show-get-prop so that many of the show functions
can be used in notmuch-pick without modification. The main use is that
it means notmuch-show-get-message-id `works' in pick. Thus we get all
the stash functions and several other `for free' in pick.
The variable notmuch-pick-message-buffer should be buffer local but
instead notmuch-pick-message-buffer-name (a non-existent variable) was
made buffer local.
The function notmuch-pick-refresh-result (used to update tag changes)
was not quite correct: sometimes it got the choice between the subject
and " ..." wrong. This was always true but the new code often calls
this (when opening a message in the message pane to remove the unread
tag) while the async pick process is still running and this caused
mistakes which made the tests fail.
Thus we store the previous subject with the message.
This function was a horrible hack (sleeping while waiting for the
correct message). The new target code can just open the message in the
message window when it arrives.
Previously pick removed the unread tag from its tag display: since the
tag change is now customisable use the customised variable.
This only affected the tags displayed, not the tags in the database as
notmuch-show (in the view pane) did the actual tag changes.
Previously pick set a prefix argument prior to calling show in the
message pane to tell show to only show matching messages. This sets
notmuch-show-only-matching-messages instead which is much cleaner and
will work even if the user has configured show to default to showing
only matching messages.