Commit graph

192 commits

Author SHA1 Message Date
Carl Worth
4e76865c0d Change the stash keybinding from 'z' to 'c'. And use 'i' for message ID.
In spite of being implemented with the word "stash" in the function
names, the documentation (and hence help strings) for each function
already use the word "Copy" to describe the action. So 'c' is a much
more natural key-binding, (particularly since 'z' didn't map to any
real word anyway).

We also use 'i' for the message ID copying of the submap. This is
intended to align mnemonically with the "id:" prefix already used
for message IDs.
2010-02-20 12:23:13 -08:00
David Bremner
1631c713d9 notmuch.el: add a submap (on "z" for "ztash") to stash things.
Provide key bindings for stuffing various RFC822 header fields and other metadata
into the emacs kill-ring as text. The bindings are as follows:

z F		notmuch-show-stash-filename
z T		notmuch-show-stash-tags
z c		notmuch-show-stash-cc
z d		notmuch-show-stash-date
z f		notmuch-show-stash-from
z m		notmuch-show-stash-message-id
z s		notmuch-show-stash-subject
z t		notmuch-show-stash-to
2010-02-20 12:21:14 -08:00
David Bremner
b20bc7028d notmuch.el: convert sparse keymap to a list in notmuch-substitute-one-command-key-with-prefix
The previous version would crash when a key was bound to a sparse
keymap, since apparently these are not straightforward lists.  The
usage of map-keymap is a bit obscure: it only has side-effects, no
return value.
2010-02-20 12:20:54 -08:00
David Bremner
1137ce11e1 Add functions notmuch-show-get-(bcc, cc, date, from, subject, to).
Return the corresponding header field for the current message as a
string.  These are thin wrappers around notmuch-show-get-header, which
means they each cause a full parse of the RFC822 header. The main idea
is to fix an api.
2010-02-20 12:17:13 -08:00
David Bremner
e6c6bf3250 notmuch-show-get-header: new function; return alist of parsed header fields.
This function parses the displayed message to recover header
fields. It uses mailheader.el to do the actual header parsing, after
preprocessing to remove indentation.  It relies on the variables
notmuch-show-message-begin-regexp, notmuch-show-header-begin-regexp,
and notmuch-show-message-end-regexp.
2010-02-20 12:12:09 -08:00
Carl Worth
becdb42b1f notmuch.el: Delete some trailing whitespace.
I'm not sure when this managed to creep in, but we don't want it.
2010-02-20 12:12:09 -08:00
Carl Worth
7e3b416153 notmuch.el: Fix bug from message with ':' in the From address.
Eric reported that a particular thread was non-functional in the
notmuch-search mode in the emacs client. It was easy enough to trace
the bug down to a broken regular expression (using ':' instead of
';'). The bug would be triggered by a message with ':' in the
From address.

This is something I hope to add to the test suite as soon as we have
support for testing the emacs interface there.
2010-02-11 16:19:37 -08:00
Carl Worth
2174adf374 notmuch.el: Handle attached images via an external viewer.
We temporarily override the mm-inline-media-tests variable so that the
only parts inserted into the temporary buffer (and lost) are those
parts that the user has already seen in the notmuch-show buffer.

Anything else, (such as images), will now be left to be handled via
mailcap, just like other attachment types.
2010-02-10 12:40:47 -08:00
Carl Worth
5dbe1c0307 notmuch.el: Fix indentation.
This line was indented incorrectly which can be confusing.
2010-02-10 12:40:18 -08:00
Carl Worth
ca16b2225d notmuch.el: Avoid infinite loop marking up message with no parts.
The infinite loop was triggered by a message consisting of a single
attachment within the body, (and no "part") tags.

We need to do things in response to this bug (beyond this specific
fix):

1. Create a test suite that exercises our emacs frontend so that bugs
   like this do not come back to haunt us after we fix them once.

2. Switch from our ad-hoc regexp based search of message-part delimeters
   to known-good code for parsing a structured document, (for example,
   the outstanding JSON patches).
2010-02-10 11:44:15 -08:00
Alexander Botero-Lowry
b611cc2319 Reintroduce HTML inlining, with a much needed optimization
Now instead of requiring every single message be parsed, we now check
the Content-type in the parsed headers and only do HTML inlining if it's
text/html
2010-02-09 18:16:23 -08:00
Keith Packard
79d3f9773c Allow folders with no messages to be elided from list
This makes it easier to see folders with messages.
Eliding empty folders is togged with the 'e' binding.

Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-08 14:40:25 -08:00
Keith Packard
b16a767f51 Look at whitespace to separate folder name from count
This allows folder names to contain any non-blank characters

Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-08 14:35:29 -08:00
Keith Packard
b58dcfb702 Add 'm' and ' ' bindings to notmuch-folder view
This allows the user to compose new mail from the folder view, and
also to use <space> to show the current folder.

Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-08 14:35:08 -08:00
Kan-Ru Chen
0a1e37a8c9 emacs: Use font-lock-comment-face to highlight citation button
Signed-off-by: Kan-Ru Chen <kanru@kanru.info>
2010-02-08 14:29:29 -08:00
David Bremner
9b93717a6d notmuch.el: show some of citation even when hiding.
- rename notmuch-show-citation-lines-min to n-s-c-l-prefix
- call forward-line with the appropriate parameter to adjust
  region to be hidden.
- change citation button text so that it makes (some) sense when citation is shown

Reviewed-by: Kan-Ru Chen <kanru@kanru.info>
2010-02-08 14:24:34 -08:00
David Bremner
24b2f7699f notmuch.el: Refactor citation markup. Variables for minimum size, button text.
This is a fairly intrusive rewrite.

- I pulled the common code for the signature and citation case out
  into a separate function. This is not so much shorter, but I think it
  will be easier to maintain.

- I replaced the sequence of (looking-at blah) (forward-line)  with a single
  re-search-forward per citation.

New variables

- notmuch-show-signature-button-format, notmuch-show-citation-button-format
  Allow customization of button text.

- notmuch-show-citation-lines-min
  Do not buttonize citations below the given threshold.

Reviewed-by: Kan-Ru Chen <kanru@kanru.info>
2010-02-08 14:24:11 -08:00
Kan-Ru Chen
d9c9e56912 notmuch.el: Use emacs built-in forward-button and backward-button
There are built-ins, so why not use them?

Signed-off-by: Kan-Ru Chen <kanru@kanru.info>
2010-02-05 11:31:38 -08:00
Carl Worth
78c85f053b Use forward-line instead of next-line
We do this all the time, but at least emacs is kind enough to remind us,
(when compiling), that next-line is only intended for interactive use,
and we should use forward-line inside of lisp code.
2010-02-05 11:31:38 -08:00
Carl Worth
ee3e7416f0 notmuch.el: Add missing documentation for the new 'h' keybinding.
Without this, our help screen displayed 'h' with no description of
what it does.
2010-02-05 11:31:38 -08:00
Kan-Ru Chen
b0ccc88146 notmuch.el: Add keybinding to toggle display of message body and headers.
I really missed this feature. Added notmuch-show-toggle-current-body and
notmuch-show-toggle-current-header and bind them to 'b' and 'h'.

Signed-off-by: Kan-Ru Chen <kanru@kanru.info>
2010-02-05 11:10:13 -08:00
Carl Worth
dac01ec520 emacs: Add instructions to the hidden citations/signatures.
We've received a user report that the hidden citations were annoying
since the user couldn't tell what was being referred to by subsequent
text. Apparently it wasn't obvious enough that the hidden citation
could be revealed by clicking or by pressing Enter. So make the button
text say as much.
2009-12-11 15:54:53 -08:00
Carl Worth
19e8ad6393 emacs: Don't insert extra line after citations.
This extra line had been annoying me for a while, so I'm glad to see
it go away.
2009-12-11 15:54:53 -08:00
Carl Worth
2e3d07b8d5 emacs: Don't regard a manually indented '>' as introducing a citation.
In the message mentioned in the previous commit, an ASCII diagram was
included in which '>' was used as the first non-whitespace character
in a line. Notmuch previously (and mistakenly) regarded this as a
citation.

We fix this by only regarding a '>' in the first column of an email as
introducing a citation.
2009-12-11 15:54:53 -08:00
Carl Worth
8d2f19b896 emacs: Avoid infinite loop when marking up citations.
Thanks to Dirk Hohndel for reporting the bug. The infinite loop was first
noticed in the following message (available from the Linux kernel mailing list):

	alpine.LFD.2.00.0912081304070.3560@localhost.localdomain

Note that the bug does not show up when viewing the message in
isolation---the bug was triggered only when viewing this file indented
to a depth of at least 13.

The fix is simply to use a marker rather than an integer position when
recording a point we plan to move back to later, (since inserting the
indented button causes the buffer position of the desired marker to
change).
2009-12-11 15:54:45 -08:00
Keith Amidon
0d340415c9 Expand scope of items considered when saving attachments
Previously only mime parts that indicated specified a "disposition" of
"attachment" were saved.  However there are time when it is important
to be able to save inline content as well.  After this commit any mime
part that specifies a filename will be considered when saving
attachments.
2009-12-10 16:26:24 -08:00
Carl Worth
4aff2ca55b emacs: Fix '+' and '-' in case of thread no longer matching current search.
Similar to the way thread-viewing was broken after a thread was
archived, (and recently fixed), tag manipulation has also been broken
when the thread no longer matches the current search.

This also means that the behavior of '+' and '-' are now different
than that of '*'. The '+' and '-' bindings now return to the previous
behavior old affecting all messages in the thread, (and not simply
those matching the search).

I actually prefer this behavior, since otherwise a '-' operation on a
thread might not actually remove the tag from the thread, (since it
could operate on a subset of the thread and not hit all messages with
the given tag).

So I'd now like to fix '*' to be consistent with '+' and '-', for
which we add an item to TODO.
2009-12-10 10:35:18 -08:00
David Bremner
0a53a1d1d7 notmuch.el: patch notmuch-show to call notmuch show without query-context (i.e. without tag:inbox) if the first query returns nothing.
This fixes the annoying bug of archiving a thread, and then going back
to open it and getting an error.  It needs the notmuch-show API
changing patch of 1259979997-31544-3-git-send-email-david@tethera.net.
2009-12-10 10:29:36 -08:00
David Bremner
5e8ce15bfb notmuch-show: add optional argument for query context instead of using global binding notmuch-search-query-string
Also modify the one call to notmuch-show in notmuch.el.  This makes
the call (notmuch-show thread-id) will work when there is no binding
for notmuch-search-query-string; e.g. when called from user code
outside notmuch.
2009-12-10 10:29:27 -08:00
David Bremner
764e686f8f notmuch-search-process-filter: add text properties for authors and subject to each line
Add functions notmuch-search-find-authors and notmuch-find-subject to
match notmuch-find-thread-id.  These functions are just a wrapper
around get-text-property, but in principle that could change.
2009-12-10 10:28:20 -08:00
Carl Worth
ed10054829 Revert "Add some very rudimentary support for handling html parts"
This reverts commit ed16edc94d.

The performance hit is just far too severe, (threads with many HTML
messages make emacs stop and pause for seconds before displaying the
thread even if most of the HTML messages are entirely hidden).
2009-12-07 09:35:46 -08:00
Jed Brown
ea4cb3cbdc Make search filters handle disjunctive queries.
notmuch-search-filter now accepts an arbitrary query and will group if
necessary so that we get

  tag:inbox AND (gravy OR biscuits)

instead of the former

  tag:inbox AND gravy OR biscuits

Signed-off-by: Jed Brown <jed@59A2.org>
2009-12-04 11:11:59 -08:00
Carl Worth
0ed126fe19 emacs: Open only matched (and unread) messages when displaying a thread.
This is the long-awaited feature that when viewing a thread resulting
from a search, only the messages that actually match the search will
be opened initially (in addition to unread messages).

So now, it's finally useful to tag a single message in a giant thread,
and then do a search later and easily find just the single tagged
message.
2009-12-03 11:38:05 -08:00
Carl Worth
11490cfebe emacs: Make message-summary button extend to very beginning of message.
There's no visible change here---we're just making the button extend
through the invisible portions of the message before the
message-summary line. The reason this is important is that it's easy
for the user to position point at the (invisible) `point-min', so we
want to ensure that there's a valid button there.
2009-12-03 11:34:01 -08:00
Alexander Botero-Lowry
8e126fe1fb Since we know what these buttons do it seems like the underlines are
unnecessary.
2009-12-03 11:29:35 -08:00
Carl Worth
a0439ded70 emacs: notmuch-fontify-headers: Remove unneeded progn and indent correctly.
The defun special form doesn't require a progn. And the remainder
of the function was previously indented in a misleading way, (as
if each "if" was always evaluated, rather than each only being
evaluated if all the previous evaluated to nil).
2009-12-03 11:29:35 -08:00
Carl Worth
fcc36df1fa emacs: Make message-summary button begin at beginning of line.
Otherwise, RET is unreliable for opening/closing messages when
navigating through messages with 'n' and 'p'.
2009-12-03 11:29:35 -08:00
Carl Worth
6945e7e103 emacs: Highlight message-summary with background-color instead of inverse video.
Also, do this with a notmuch-message-summary-face variable so that
the user can easily customize the desried effect.
2009-12-03 11:29:35 -08:00
Carl Worth
682102c2df emacs: Make the message-summary highlighting extend to end of visible line.
This will look much nicer than the highlighting terminating at the
end of the summary text.
2009-12-03 11:29:35 -08:00
Carl Worth
e1f05f1c20 emacs: Fix notmuch-show-next-open-message.
This function was still implemented in terms of the old, global toggle
for visibility of unread messages, (which no longer exists). Fix it to
use the local 'invisibility-spec property on the button controlling
message visibility.
2009-12-03 11:29:32 -08:00
Carl Worth
48a1b8b006 TODO, emacs: Correct a few typos.
Sometime I'll stop misspelling things so much, honets.
2009-12-03 07:30:26 -08:00
Carl Worth
4d19b89d29 emacs: Add --entire-thread option to "notmuch show" command line.
We (plan to) do any hiding of messages from within emacs, so don't
let notmuch hide messages from us.
2009-12-02 16:14:31 -08:00
Carl Worth
55559ea409 notmuch.el: Make 'x' and 'X' in show-mode archive the current thread.
This makes these keys different than 'q' in this mode, (where 'x'
and 'q' are identical in all of the other modes currently).

The idea here is to make it easier to do non-linear reading of messages,
(such as when poking in to read just one or two threads from a search
result that returned many threads).
2009-11-30 23:21:04 -08:00
Carl Worth
7a63942577 notmuch.el: Use let to avoid assigning to a free variable.
The dynamic scoping of emacs lisp is such that we never want to assign
to any variable unless it's something we've defined with `defvar' or
else something we're using locally via `let'.
2009-11-30 23:14:11 -08:00
Carl Worth
a708ea627e notmuch.el: Avoid warning about referencing free variable `button'.
I'm not even sure how the previous code worked at all---it seems
clear it was supposed to be using `cite-button' rather than `button'.
2009-11-30 23:09:08 -08:00
Carl Worth
9ec9662ec7 notmuch.el: Avoid calling next/previous-line non-interactively.
Emacs always complains if we use these from lisp code.
2009-11-30 23:05:32 -08:00
Carl Worth
9e6ee30cbe notmuch.el: Make notmuch-help use a full-screen window.
Our documentation is long enough that I think it will be more useful
to use an entire window for it (which is easily dismissed with 'q').
This is also kinder for a user not well-initiated with emacs, for
whom the multi-window help can be confusing.
2009-11-30 23:02:10 -08:00
Carl Worth
e9443aeafc notmuch.el: Make documentation of notmuch-search-mode dynamic.
Previously, we had some hard-coded keybindings mentioned in the
introductory paragraphs of the documentation for notmuch-search-mode.
Now, we take advantage of the substitute-command-keys functionality to
produce the same text by default, but to dynamically generate the
correct text in the face of the user customizing the keybindings.
2009-11-30 22:47:10 -08:00
Carl Worth
86992aeb85 notmuch.el: Clean up documentation of notmuch-folder-mode-map commands.
Again, ensuring we have standalone first-line documentation strings,
and overriding builtin commands to add our own documentation strings
to them.
2009-11-30 22:43:14 -08:00
Carl Worth
62993c7622 notmuch.el: Clean up documentation of notmuch-show-mode-map commands.
As we did recently for notmuch-search-mode-map, ensure that the first
line of docuemntation for each command stands alone.

We also take advantage of the substitute-command-keys functionality
within notmuch-help so that the introductory paragraphs can talk
about key bindings by key (rather than function name) in a way that
will always be current even in the face of the user rebinding keys.
2009-11-30 22:24:05 -08:00