Commit graph

71 commits

Author SHA1 Message Date
Austin Clements
3c3304131d pick: Use list form of tag-changes in test
Currently we support both string and list forms of tag-changes for
historical reasons.  This is about to change, so fix pick's tests that
use the legacy string form of tag-changes.
2013-10-25 21:31:00 -03:00
Austin Clements
14971fe57c pick: Fix incorrect use of `notmuch-pick-tag'
`notmuch-pick-tag' takes a list of tag changes, but
`notmuch-pick-archive-message' passes it a &rest argument.  This
happens to work if `notmuch-archive-tags' contains a single tag (which
it usually does), but will break if it does not.
2013-10-25 21:30:49 -03:00
Mark Walters
10596a5cce contrib: pick: update notmuch-show calls
Remove some unneeded nil arguments in notmuch-show calls.
2013-10-14 08:26:37 -03:00
Mark Walters
cc8c407dfc contrib: pick: remove temporary keybinding
We would like to bind prefix-arg RET in search view to "pick show this
thread" (i.e. notmuch-pick-from-search-thread). It is not easy to do
this cleanly from contrib so I have been using M-RET instead.

Temporarily remove this functionality in preparation for entering
mainline and binding to prefix-arg RET.
2013-10-02 08:47:39 -03:00
Mark Walters
d1a5f5c659 contrib: pick: move M-RET to prefix-arg RET
In pick the user has the option of showing the selected message in a
subpane (the message pane) or in the full frame. This is customisable
using the variable notmuch-pick-show-out. At the moment RET is bound
to the default option and M-RET the other option. This is
messy and involves tricks to make sure the keymap is setup at the
right time.

This changes this to prefix-arg RET for the other option which
simplifies the code and makes things cleaner.
2013-10-02 08:47:18 -03:00
Mark Walters
cbbf53e4df contrib: pick: tidy up pick-format-field
Previously this function used a temporary variable to store the return
value but we can just use the return value of the cond statement
directly.

The only tiny subtlety is that in one case (subject) we need to
slightly reorder the logic to make sure the formatted-field is the
last thing computed.
2013-09-23 07:30:57 -03:00
Mark Walters
c8f7b6e0c4 contrib: pick: remove unused notmuch-pick-from-hello
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).
2013-09-23 07:30:20 -03:00
Mark Walters
4672cf0fe6 contrib: pick: use the new notmuch-common-keymap for pick entry
Austin recently added a global keymap: use this for pick
entry.
2013-09-23 07:29:56 -03:00
Mark Walters
393788487d contrib: pick: remove some superfluous quotes
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.
2013-09-23 07:29:45 -03:00
Mark Walters
81ee7855b5 contrib: pick: make the tree graphics a proper part of the format
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.)
2013-09-15 08:58:36 -03:00
Mark Walters
6ae591911c contrib: pick: allow recursive message field formats
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.
2013-09-15 08:58:03 -03:00
Mark Walters
6c8116c05b contrib: pick: move the insertion of fields up a level
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.
2013-09-15 08:57:32 -03:00
Mark Walters
44bfad08f1 contrib: pick: print () for a message with no tags
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.
2013-09-15 08:57:21 -03:00
Mark Walters
2ae45c3392 contrib: pick: use global keymap
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.
2013-09-15 08:56:57 -03:00
Mark Walters
b8faf2b543 contrib: pick: bugfix use of mini-buffer history
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.
2013-09-15 08:56:13 -03:00
Mark Walters
75ddd1eb46 contrib: pick: test: buffer movement 2013-09-04 06:33:41 -03:00
Mark Walters
0d8a3cc7fd contrib: pick: test: stash message id
This is important to test as lots of subsequent tests will fail if this fails.
2013-09-04 06:33:31 -03:00
Mark Walters
e8affaec06 contrib: pick: test: tag/untag whole thread 2013-09-04 06:33:17 -03:00
Mark Walters
d96863e54d contrib: pick: test: tag/untag single message 2013-09-04 06:32:58 -03:00
Mark Walters
e1e7b6fd2e contrib: pick: test: refresh view
A recent proposed patch was buggy when refreshing the view. Add a test
for refresh so that this does not reoccur.
2013-09-03 06:14:40 -03:00
Mark Walters
95ee9ed643 contrib: pick: add docstring for notmuch-pick-worker 2013-09-03 06:14:03 -03:00
Mark Walters
7febf701e7 contrib: pick: remove unneeded variable notmuch-pick-buffer-name
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.
2013-09-03 06:13:50 -03:00
Mark Walters
9d2ac59a80 contrib: pick: bind M-p and M-n to prev/next thread
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).
2013-09-03 06:12:36 -03:00
Mark Walters
3edd9f127b contrib: pick: thread tagging (including archiving) implemented
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).
2013-09-03 06:11:18 -03:00
Mark Walters
f8a8afe5c2 contrib: pick: add thread based utility functions
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.
2013-09-03 06:10:25 -03:00
Mark Walters
9701e9c7d5 contrib: pick: remove sync tests
Since the previous commit removed the sync parser we may as well
remove its tests too.
2013-08-27 08:01:32 -03:00
Mark Walters
a56449c24c contrib: pick: remove sync parser
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.
2013-08-27 08:01:15 -03:00
Mark Walters
e3c2be3e25 contrib: pick: use close-message-pane for reply etc
We can save some code duplication by using the new close-message-pane
functionality for reply, forward, and new mail.
2013-08-24 11:27:22 +02:00
Mark Walters
863d9aa674 contrib: pick: add in binding to view raw message
Note this does rely on the fact that we have over-ridden notmuch-show-get-properties
2013-08-24 11:19:14 +02:00
Mark Walters
8349173e96 contrib: pick: make help close the message pane first
Previously pressing "?" for help when the message pane was open meant
the help window was very small. Close the message pane before
displaying help.
2013-08-24 11:18:48 +02:00
Mark Walters
d3ef0f74cf contrib: pick: close window function 2013-08-24 11:18:01 +02:00
Mark Walters
d3924d5798 contrib: pick: pass tab through to the message pane
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.
2013-08-24 11:17:44 +02:00
Mark Walters
415d5da7dd contrib: pick: add button press helper
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.
2013-08-24 11:17:16 +02:00
Mark Walters
1c591115d6 contrib: pick: add in to-message-window function 2013-08-24 11:16:58 +02:00
Mark Walters
5728d178f7 contrib: pick: Link in stash map straight from notmuch-show
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.
2013-08-24 11:16:45 +02:00
Mark Walters
84e30ea789 contrib: pick: Link in attachment functions straight from notmuch-show
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.
2013-08-24 11:16:03 +02:00
Mark Walters
a79396999c contrib: pick: Link in notmuch-show-pipe-message
Since we can now use show functions directly in pick we can drop pick-pipe-message.
2013-08-24 11:15:44 +02:00
Mark Walters
1716edff9d contrib: pick: override notmuch-show-get-prop
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.
2013-08-24 11:15:23 +02:00
Mark Walters
1fd1e57d93 contrib: pick: use notmuch-start-notmuch
This uses the new notmuch-start-notmuch function which should give
better handling of stderr and errors generally.
2013-07-20 14:20:17 -03:00
Mark Walters
b60fb3309c contrib: pick: document several of the tree/forest insertion functions. 2013-07-04 00:41:45 -03:00
Mark Walters
4c09e67adf pick: contrib: document notmuch-pick-message-window-kill-hook 2013-07-04 00:41:32 -03:00
Mark Walters
a8ade6b144 pick: contrib: document notmuch-pick-refresh-result 2013-07-04 00:41:15 -03:00
Mark Walters
bb03a26c25 pick: contrib: document notmuch-pick-show-out 2013-07-04 00:40:44 -03:00
Mark Walters
1ed9db6c30 contrib: pick: remove unused function
The function notmuch-pick-show-error was used before Austin's improved
error handling. It is now redundant so remove.
2013-07-04 00:37:47 -03:00
Mark Walters
3d772a0a85 contrib: pick: remove unused variable
This variable was needed at one point for the async parser but is not
needed anymore.
2013-07-04 00:37:37 -03:00
Mark Walters
8c33fde83e contrib: pick: bugfix: make the right variable buffer-local
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.
2013-07-04 00:37:30 -03:00
Mark Walters
3a8163e17f contrib: pick: add docstrings to all defvars 2013-07-04 00:37:21 -03:00
Mark Walters
91777f8dc9 contrib: pick: add a docstring for the main notmuch-pick function 2013-07-04 00:37:13 -03:00
Mark Walters
eb26cd1fba contrib: pick: fix refresh result
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.
2013-07-04 00:36:38 -03:00
Mark Walters
a9dbcbb00c contrib: pick: remove hack notmuch-pick-show-match-message-with-wait
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.
2013-07-04 00:36:26 -03:00