Commit graph

52 commits

Author SHA1 Message Date
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
Mark Walters
f9aad24f02 contrib: pick: if no target specified go to first matching message 2013-07-04 00:36:19 -03:00
Mark Walters
b7df509fb5 contrib: pick: remove reference to inbox in docstring
Copy the recent changes in show to use just notmuch-archive-tags (as a
link) rather than saying '(defaults to "inbox")'.
2013-06-25 08:45:43 -07:00
Mark Walters
57a88397ca contrib: pick: remove unnecessary funcall
Remove unnecessary funcall. This keeps the pick function inline with
the recently tweaked show function.
2013-06-04 09:02:59 -03:00
Mark Walters
dbc3a247ca contrib: pick: bugfix: use notmuch-show-mark-read-tags instead of unread
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.
2013-06-02 20:53:49 -03:00
Mark Walters
cec063736a contrib: pick: bugfix. use notmuch-show-only-matching-messages rather than prefix
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.
2013-06-02 20:52:41 -03:00
Mark Walters
5461c31d64 contrib: pick: use the sexp parser
This just converts notmuch-pick to use the sexp parser.
2013-06-02 08:11:27 -03:00
Mark Walters
47a419ad16 contrib: pick: add a target message for pick
This adds a target message for pick which it will jump to when (if) it
appears. It adds the target to notmuch-pick-from-show-current-query so
that pick goes straight to the message that was current in the show
view and it adds target to notmuch-pick-refresh-view so that the
current message is preserved.
2013-05-20 15:38:40 -03:00
Mark Walters
740f0cda55 contrib: pick: move save-excursion closer to message insertion
Pick keeps point roughly at the top of the buffer while inserting
messages at the end as they come in (from the async
parser). Previously the save-excursion to do this was done once for
each thread inserted: now it is done for each individual message.

The advantage is that the message insertion code can decide where to
leave point. In the next patch point will be left on the target message.

Note notmuch-pick-insert-msg is unchanged as that is used by the tag
display update code.
2013-05-20 15:37:52 -03:00
Mark Walters
a1ddf62f6a contrib: pick: close message pane when quitting from show in the message pane
We add a hook to the show buffer in the message window to close the
message window when that buffer quits.  It checks that the
message-window is still displaying the show-message buffer and then
closes it.
2012-12-25 23:02:12 -04:00
Mark Walters
da6d66e286 contrib: pick: slightly tweak running search and pick from pick buffer
Previously running search or pick from the pick buffer did not close
the message pane (if open). This meant that then new search ends up in
a very small window. Fix this so that the message pane is
shut. However, make it so that the pane is shut after the search
string is entered in case the user is basing the search on something
in the current message.
2012-12-24 19:02:35 -04:00
Mark Walters
480f44fbe4 contrib: pick: Do not indent messages in the message pane
Currently pick just uses notmuch-show to display messages in the
message pane: this means that they get indented just as show
would. However, since pick is only displaying one message at a time
there is no need to indent so override the indentation.
2012-12-18 17:03:00 -04:00
Mark Walters
780a98d14e contrib: pick: archive message updated
Update pick's archive message to respect notmuch-archive-tags. Also
split archive message into an archiving part and a separate
"then-next" part, to move more inline with show. Update the keybinding
so default behaviour is unchanged.
2012-12-15 13:48:02 -04:00
Mark Walters
8f1a8c7b09 contrib: pick: bugfix for pick splitting the window excessively
Previously if you carried on past the last message in a pick view pick
would get confused and `forget' about the split pane and would try and
re-split when moving up again. This was due to faulty logic in
notmuch-pick-show-message: something that should have been in the (when message)
clause was not.

Thanks to jrollins for the bug report.
2012-12-11 10:01:18 -04:00
Mark Walters
bd918e35d4 contrib: pick: use notmuch-clean-address
Now notmuch-clean-address is split out in show pick can use that (with a small
wrapper).
2012-12-03 07:34:31 -04:00
Mark Walters
113e30c01b contrib: pick: use async parser from lib
This moves notmuch-pick to use the newly split out async json parser
from notmuch-lib.el.
2012-12-01 08:16:06 -04:00
markwalters1009
859b8ed791 contrib: pick: remove some debug timing messages
When I submitted notmuch-pick I deleted most of the debug messages but
I missed two cases. Remove them now.
2012-12-01 08:15:45 -04:00
Mark Walters
e0adf10be8 contrib: notmuch-pick: add tests
The test should be run using the wrapper run-tests.sh.  This links
the tests into the normal notmuch TEST_DIRECTORY and runs them from
there. After the test is complete then the links are removed.
2012-11-19 08:22:37 -04:00
Mark Walters
96d9f54615 contrib: pick: bugfix when trying to show a non-message
If the user pressed return on the end result status line it gave a
blank message. Modify the function notmuch-pick-get-message-id to
return nil rather than an empty message-id in this case to fix this.

This also fixes a bug in the (lack of) quoting of the id string.
2012-11-16 15:37:10 -04:00
Mark Walters
35ebf0b321 contrib: add pick TODO file 2012-10-28 09:35:38 -03:00