Commit graph

80 commits

Author SHA1 Message Date
Keith Packard
dac31c9e01 Use 'forward-line' instead of 'next-line' while walking search display
The documentation for 'next-line' suggests that 'forward-line' is a
better choice for non-interactive usage. That appears to be the case
here; using next-line caused emacs to spin forever for me.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-16 22:10:36 -08:00
Carl Worth
057b3060e8 notmuch.el: Consider an entire line of underscores as a signature separator.
This is the default separator used by mailman, so there's a lot of
clutter in thread displays without this. Also, we not provide a nice
variable to the user (notmuch-show-signature-regexp) for configuring
this.
2009-11-16 16:39:59 -08:00
Carl Worth
ea484f0ebf notmuch.el: Insert a newline if the last line of a part is missing one.
I think there's a GMime bug that we're getting parts decoded without a
final newline (the encoded parts seem to have them just fine). We can
workaround the bug easily enough by finding a part-closing delimiter
that is not at the beginning of a line, and if so, just insert a
newline.

Without this, the one-line-summary of the next message would continue
on the same line as the last line of the previous message, (and this
would often happen for mailing-list messages where mailman would add
an extra part for its signature block).
2009-11-16 14:53:02 -08:00
Carl Worth
d5068983b8 notmuch.el: Display authors in a column separate from subject.
This makes it much easier to actually read the subject lines.

The user can set notmuch-search-authors-width to control the width of
the column.

Two possible ideas for improving this support further:

  1. Make the excess authors invisible instead of removing them from
     the buffer, (which means that isearch could still find them).

  2. Have the user variable control a percentage of the window width
  rather than being a fixed number of columns.
2009-11-16 11:57:05 -08:00
Carl Worth
352e91625b notmuch.el: Indent messages to show nested structure of thread.
Now that we're actually adding text to the buffer for the indentation,
our old aproach of using positions to record regions to manipulate is
now longer correct. Fortunately, it's easy to switch from positions to
markers which are robust, (just call point-marker instead of point and
all relevant functions accept markers as well as points).

I also finally fixed the bug where the text "[6 line signature]" we
display was causing the one-line-summary of the next message to be on
its same line rather than at the beginning of the next line where it
belongs.
2009-11-16 11:08:24 -08:00
Carl Worth
322fe4f3fb notmuch.el: Add support for viewing MIME-encoded parts (with 'v').
Currently just supports viewing all MIME parts in the message. There's
not yet support for selecting and viewing individual parts, but that
should be easy to add from here, (now that we've found
mm-display-parts to do all the heavy lifting).
2009-11-14 08:57:38 -08:00
Carl Worth
4812cfb368 notmuch.el: Add an 'm' binding to start composing a new mail.
Available from either the "search" or the "show" view.
2009-11-13 15:54:58 -08:00
Carl Worth
77088624af notmuch.el: Use require instead of load to get the cl functions.
Not only is "load" probably the wrong thing, but loading cl-seq befoe
cl can cause complaints anyway.
2009-11-13 15:49:43 -08:00
Carl Worth
8561c7463a notmuch.el: Add a binding ('o') and command to toggle current search order.
This ended up being a bit easier than I thought. Just flip the controlling
variable and then run `notmuch-search-refresh-view'.
2009-11-12 23:16:19 -08:00
Carl Worth
a5e9c06eb6 notmuch.el: Hook up support for different search orders.
This gives us two different default search orders: The inbox view that
comes up from "M-x notmuch" is sorted in chronological order (oldest
threads first). A new global search "M-x notmuch-search" will instead
be in reverse chronological order (newest threads first).

Any filtered searches retain the sort order of the search being
filtered.

There's not yet any interface for changing the sort order of a search
after it is constructed.
2009-11-12 23:09:56 -08:00
Carl Worth
e530910ae2 notmuch.el: Remove functions to show/hide thread IDs.
I wrote these originally jsut for debugging. They've never been hooked
up to any keybinding and the existing "M-x visible-mode" does what's
needed anyway.
2009-11-12 14:35:41 -08:00
Carl Worth
1407e409b1 notmuch.el: Switch to using "notmuch reply" rather than message-reply.
This way we get to take advantage of the configuration of the user's
email addresses in notmuch, (rather than expecting the user to
configure all of their email addresses in message mode as well).
2009-11-11 21:37:35 -08:00
Carl Worth
26bb521f52 notmuch.el: Add a binding ('r') to reply to the current message.
We were just starting to get "notmuch reply" into shape in order to
provide the needed functionality here, but then I realized that the
message-reply function built into emacs is already more functional,
(at least for the case of replying to a single message).
2009-11-10 18:47:53 -08:00
Carl Worth
54d79f60a1 notmuch.el: Simplify get-message-id
We were stripping off the "id:" portion of the identifier, only to
put it back on again in all cases. Stop this madness.
2009-11-10 18:45:30 -08:00
Carl Worth
8ae1c3c6e1 notmuch.el: Don't advance line in search buffer before showing thread.
Previously, when selecting a thread to view from the search buffer, we
would advance the point by one line before showing the thread, (so
that it would be ready to show the next thread once the user was done
with the current thread). This was annoying when the user temporarily
exited the thread view, (because the "wrong" thread was then selected
in the search view).

We get a more consistent experience by waiting to advance until the
user has finished viewing one thread and is ready to view the next.
2009-11-09 13:48:58 -08:00
Carl Worth
97ef8a74c9 notmuch.el: Fix add/remove tag from search buffers.
These were recently broken with the change of "notmuch search" to
prefix thread IDs with "thread:" rather than printing them raw.
2009-11-09 13:45:11 -08:00
Carl Worth
306e19f5dd notmuch show: Move subject from one-line summary down to its own line.
And change the display code in emacs to display the one-line summary
in inverse video.
2009-11-05 15:02:20 -08:00
Carl Worth
afcd85ee71 notmuch.el: Bring back the "End of search results." message.
The recent change of the hidden thread-ID syntax caused this message
to instead be replaced with a cryptic "search failed" error and an
internal regular expression. Put our nice message back.
2009-11-05 14:18:44 -08:00
Carl Worth
51a68d4e01 notmuch.el: Make hidden parts advertise how to unhide them.
This is in place now citations and signatures. We'll still need to
add something else for hidden messages (those that are already
read and hidden away).
2009-11-05 11:25:02 -08:00
Carl Worth
ab68891bec notmuch.el: Add 'A' binding to archive thread after removing all "unread" tags.
This is useful for when the rest of the thread is visible on screen so
the user really has read the rest of it.
2009-11-05 11:22:20 -08:00
Carl Worth
494c74229b notmuch show: Fix to work with any search string rather than just a thread ID.
The more general command is more consistent, and more useful.

We also fix "notmuch search" to output copy-and-pasteable search terms
for the thread with "thread:" prepended already. Similarly, the
message-ID in the output of "notmuch show" is also now printed as a
valid search term, ("id:<message-id>" rather than "ID: <message-id>").

Naturally, the emacs code is also changed to track these changes.
2009-11-05 10:23:04 -08:00
Carl Worth
2b576c62be notmuch.el: Add 'N' binding to mark message read and go to next.
The magic space bar is nice, but sometimes there's a message with a
long attachment that I just want to skip, but still consider the
message marked as read.
2009-11-05 04:55:51 -08:00
Carl Worth
22adeeaab7 notmuch.el: Don't require an extra press of space bar before archiving.
I had implemented this intentionally originally, thinking that it
would be important to see the last message scroll all the way off
screen before the next press of the magic space bar would go and
archive away the whole thread.

But in practice, that just turns out to be annoying, (especially for a
long sequence of single-message threads where the space bar has to be
pressed twice for every one). It's actually quite easy to know if it's
"safe" to press the space bar expecting just a scroll instead of an
archive by simply looking down and seeing if the current window is
full.

And as for the total lack of undo with all of this, I'm getting by by
simply using x to get back to the search view, and then going back
into the thread of interest.
2009-11-04 17:42:01 -08:00
Carl Worth
19993ea33b notmuch.el: Add a simple command to pipe a message to a process.
With the obvious keybinding.
2009-11-04 16:54:09 -08:00
Carl Worth
3a330cb84a notmuch.el: Don't skip read messages when they are open.
More magic for the magic space bar: If a thread is entirely open,
(such as when viewing an old thread where every message is read), the
space bar now visits each message in turn (rather than skipping all of
the unread messages).
2009-11-04 16:22:42 -08:00
Carl Worth
b7366f8052 notmuch.el: Allow for scrolling backwards through thread with DEL
Otherwise known as "Backspace" on keyboards in the real, (rather than
emacs), world. This will go by screenfuls for long messages, and
message by message for short messages. So it does the reverse of the
magic space bar, (but without reversing any tag-changing magic that
the magic space bar might have done).
2009-11-04 16:15:56 -08:00
Carl Worth
988320ad74 notmuch.el: Add 'w' binding to view raW email message.
This takes advantage of the new filename output just added to "notmuch
show".
2009-11-04 15:53:41 -08:00
Carl Worth
9f668b3d56 notmuch.el: Don't use defvar for undocumented variables.
Make at least some attempt to distinguish internal variables from
those that the user is expected to fiddle with.
2009-11-04 15:45:33 -08:00
Carl Worth
97b5f81533 notmuch.el: Don't hide long signatures.
Chances are, a signature above a certain threshold isn't just a
signature, (for example, it could be an encrypted messages tacked onto
the end of the file, or could be any sort of PS.)

We add a new variable, notmuch-show-signature-lines-max that can be
used to configure the threshold, (set to 6 by default for now).
2009-11-04 15:44:11 -08:00
Carl Worth
3604a19beb notmuch.el: Fix to claim correct number of lines for hidden signature.
Previously, it was reporting that all signatures were 0 lines.
2009-11-04 15:19:08 -08:00
Carl Worth
a1f631ab6b notmuch.el: Don't hide message bodies when all messages are read.
Presumably the user is trying to view this thread for a reason, so
it's better to actually show *something* rather than just the summary
lines.
2009-11-04 15:05:44 -08:00
Carl Worth
c6aae1561a notmuch.el: Make notmuch-search scroll commands move to first/last message.
If there's nothing to scroll but we're not yet on the first or last
message then move point to that message.
2009-11-04 14:38:49 -08:00
Carl Worth
eacd1ac41e notmuch.el: Override next-line and previous-line to make them reliable.
I noticed that these functions would sometimes leave point on an
invisible character[*]. The problem would be that point would appear
to be on a particular message, but adding or removing a tag would
actually add/remove a tag from the *previous* message.

Fix the C-n and C-p keybindings at least to call the underlying
command and then advance to a visible character. We set this-command
in our overrides so that the temporary-goal-column feature still
works.

[*] The documentation says that command loop is supposed to move point
outside of any invisible region when a command exits. But apparently
not.
2009-11-04 13:39:26 -08:00
Carl Worth
1d68e75c21 notmuch.el: Un-break the magic space bar to scroll a long, single message.
Clearly some recent code was very fragile, which I noticed in that the
space bar would no longer scroll a long message if it was the only
message in a thread.

This resulted in a lot of churn, but hopefully things are more robust
now, (for example by using new predicates like
notmuch-show-last-message-p rather than doing heuristics based on
(eobp) or (window-end)).

As usual, the presence of invisible characters complicates the task of
making this stuff robust.
2009-11-04 13:16:33 -08:00
Carl Worth
9fc6f4e60d notmuch.el: Fix to show *something* when all messages are already read.
With the recent change of showing the first unread message, we would
scroll down to the end of the buffer if all messages were already
read. This would confusingly show nothing visible in the window.

Instead, detect this case and move to the beginning of the buffer.
2009-11-04 11:30:15 -08:00
Carl Worth
46f41d80b0 notmuch.el: Make magic space bar advance to next unread messages.
The magic of the space bar is all about unread messages, so there's no
reason for it to advance to messages that have already been read.

Similarly, we now remove any magic from (n)ext so that it simply
advances to the next message without marking anything read, (which
makes it symmetrical with (p)revious).
2009-11-04 11:27:21 -08:00
Carl Worth
88810b999a notmuch.el: Move to first unread message on notmuch-show.
This is important for when a new message is delivered to an existing
enormous thread.
2009-11-04 11:19:50 -08:00
Carl Worth
08d84ceeab notmuch.el: Make next-message move to end of buffer after last message.
We need an easier way to detect when we're done with the last message
so taking advantage of the end-of-buffer position helps here.
2009-11-04 11:03:07 -08:00
Carl Worth
c5672ca12a notmuch.el: Leave a blank line after last thread in search.
This allows for pleasant termination of the "show next thread" magic
in notmuch-show mode. Now, it will terminate and show the
notmuch-search results rather than continually displaying the last
thread over and over.
2009-11-04 11:02:40 -08:00
Carl Worth
3effd82ace notmuch.el: Move "show next thread" from magic-space-bar to archive-thread
If I explicitly hit the 'a' key before reading the whole thread, I
still want to advance to the next thread in my search.
2009-11-04 10:32:44 -08:00
Carl Worth
9a02b950a3 notmuch.el: More magic for magic space bar: Show next thread from search.
This is implemented by stashing away the parent notmuch-search buffer
into a variable within the notmuch-show buffer. Then, when magic space
bar triggers an archive of the current thread, it switches to the parent
search buffer and shows the next thread.
2009-11-04 10:25:04 -08:00
Carl Worth
daedd2442a notmuch.el: notmuch-search: Advance to next line before showing thread.
The idea here is that after viewing the thread, when we come back to
this buffer we'll be all ready to view the next thread.
2009-11-04 09:32:47 -08:00
Carl Worth
33fae33d82 notmuch.el: Make archive-thread more efficient for already archived messages.
The approach here is to move the optimization from mark-read to the
more general remove-tag. Namely, don't call out to a "notmuch tag"
command to remove a tag that's not there already.
2009-11-04 09:26:50 -08:00
Carl Worth
278ae86f64 notmuch.el: Make the magic spacebar archive a thread in the end.
Next all it needs to do is kill the buffer and show the next thread.
2009-11-04 09:21:09 -08:00
Carl Worth
aab9b5cf47 notmuch.el: Start implementing the magic space bar.
Currently this will either advance by screenfuls, or to the next
message if it's already within a screenful, and will mark each message
read as it is left.

It doesn't yet complete the magic by archiving the messages nor by
advancing to the next thread in the search.
2009-11-04 09:09:02 -08:00
Carl Worth
c8382b2f0e notmuch.el: Fix to hide citations in body of read messages.
Previously, unhinding a read message would still show all the citations
in that message without an explicit command to make them visible. Fix.
2009-11-04 08:50:44 -08:00
Carl Worth
446459a5ea notmuch.el: Redefine behavior of notmuch-show-previous-message
Now, if the user has manually moved point to somewhere within a
message, executing the previous-message command onece will rewind
point only to the beginning of the current message. Previously this
would go back to the previous message, (which the user can now do
easily and naturally by simply executing the command one more time).
2009-11-04 08:50:44 -08:00
Carl Worth
253c11b675 notmuch.el: Fix notmuch-snow-next-message when on the last message.
Before this just brought the current line to the top of the
window. Now it actually moves to the beginning of the current message.

This is built on a much more solid foundation now with a function to
move to the summary-line of the current message, and then moving from
there.
2009-11-04 08:43:14 -08:00
Carl Worth
fbf473220b notmuch.el: Add more complete documentation to the major modes.
These now provide a summary of the most useful features/bindings
as well as a complete printout of the relevant mode maps to show
all available keybindings.
2009-11-03 18:24:13 -08:00
Carl Worth
e0b830410a notmuch.el: Make archive-thread advance to next line.
This is the command in notmuch-search mode and it's cer convenient
for it to advance to the next line there. (It would be even more
convenient if it didn't also take forever, but as mentioned before
that's an issue we'll need to fix in Xapian.)
2009-11-03 17:18:04 -08:00