Commit graph

165 commits

Author SHA1 Message Date
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
Carl Worth
f5e125a9c0 notmuch.el: Fix notmuch-help to properly display prefixed bindings.
Previously, we would do only a single-level traverse of the keymap.
That meant that for a keybinding such as "M-TAB" we would just see
the prefix key ("ESC") and print that it was a keymap---never printing
the TAB nor the documentation for the command it is bound to.

Now, we do the full walk, constructing a proper description of the
full keybdinding with prefix characters, (and converting "ESC" to
"M-" for legibility).
2009-11-30 21:46:55 -08:00
Carl Worth
335a8aec2b notmuch.el: Clean up documentation of notmuch-search-mode-map commands.
Since notmuch-help now displays a single line of documentation from
each of these commands we ensure that the first line stands alone for
each command.

We also override some builtin commands with new commands that don't
behave any differently, but have our own notmuch-specific
documentation, (such as "select next thread" rather than "move point
to next line").
2009-11-30 16:52:31 -08:00
Carl Worth
b7a6e05980 notmuch.el: Fix notmuch-search-goto-last-thread.
This broke when we switched to filter-based processing of search
results and added the "End of search results" line onto the end. Fix
to skip ignore that line when moving to the last thread.
2009-11-30 16:50:52 -08:00
Carl Worth
07a46d10ea notmuch.el: Fix notmuch-search-scroll-down to go to first thread.
When there's no more to scroll, we want to select the first thread.

This used to work, and I'm not sure when it broke, (perhaps when we
switched from post-process decorating of the search results to
filtering). Fix the calculation to work again.
2009-11-30 16:48:19 -08:00
Carl Worth
c24360e59e notmuch.el: Don't document mouse actions in notmuch-help.
The concept behind direct manipulation with mouse clicks is that
documentation shouldn't be necessary, (though my original motivation
here was simply that "<mouse-1>" was exceeding my TAB width.

This does cause a blank line to be added for the mouse binding. This
isn't directly desired, but as long as it's there we put it at a
natural place for a separator.
2009-11-30 16:46:26 -08:00
Carl Worth
161b2738e1 notmuch.el: Reorder notmuch-search-mode keybindings map.
I had originally created this keymap in order from most important to
least important commands. But our new notmuch-help command is
presented with the list in the reverse order. So we reverse the input
so that the user sees the most important commands first.
2009-11-30 16:02:27 -08:00
Carl Worth
de4be1b229 notmuch.el: Implement our own notmuch-help instead of describe-mode.
This gives somewhat friendlier output for the '?' binding than we had
previously with `describe-mode'. First, we no longer have the various
minor modes cluttering up the output. Second the display of the
binding table uses the first line of documentation for the bound
function rather than the function name.
2009-11-30 09:53:38 -08:00
Carl Worth
04036fb806 notmuch.el: Add documentation for notmuch-search-show-thread.
It's especially unkind to leave interactive functions without
documentation.
2009-11-30 09:49:53 -08:00
Carl Worth
0671436872 notmuch.el: Don't use beginning-of-buffer from elisp program.
This silences a warning when compiling notmuch.el. The documentation
of beginning-of-buffer does say (rather emphatically) that it's not
to be used from lisp programs.
2009-11-30 09:48:15 -08:00
Jed Brown
0a41c34310 More portable and easier to read regex in notmuch-search-operate-all
The former one worked in 23.1.50.1 but not in 23.1.1.

Signed-off-by: Jed Brown <jed@59A2.org>
Tested-by: Keith Packard <keithp@keithp.com>
2009-11-28 12:01:10 -08:00
Keith Amidon
0a7bd1c728 Adjust autoload comments
The previous location of autoload comments didn't seem to correspond
with the functions most likely to be the entry points for using
notmuch.  This change adjusts them to match those likely entry points.
2009-11-28 09:35:28 -08:00
Aneesh Kumar K.V
92c4dcc641 notmuch.el: Add face support to search mode
This patch use notmuch-tag-face showing tags in the notmuch-search-mode.

We can selectively highlight each tag by setting notmuch-tag-face-alist as below

(defface notmuch-tag-unread-face
 '((((class color)) (:foreground "goldenrod")))
  "Notmuch search mode face used to highligh tags.")

(defface notmuch-tag-inbox-face
 '((((class color)) (:foreground "red")))
  "Notmuch search mode face used to highligh tags.")

(setq notmuch-tag-face-alist '(("unread" . 'notmuch-tag-unread-face)
			       ("inbox" . 'notmuch-tag-inbox-face)))
(require 'notmuch)

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2009-11-27 22:52:22 -08:00
Keith Amidon
f94146bd39 Key binding rearrangement for save attachments in show mode
The most obvious bindings for save attachments are already taken.  The
existing 'w' binding was bound to view the raw message.  This commit
moves it to 'V' which still seems somewhat mnemonic and uses 'w' for
save (write) attachments.
2009-11-27 21:24:03 -08:00
Keith Amidon
e593b6aacb Provide ability to save attachments
Previously the only way to save an attachment was to attempt to view
it and then save it from within the viewer program.
2009-11-27 21:23:58 -08:00
Keith Amidon
07ce64e435 Forward individual messages using message-forward
Sometimes forwarding a message is preferable to replying and modifying
the set of recipients.  This commit provides that ability using the
message-forward function.
2009-11-27 21:11:37 -08:00
Keith Amidon
c4463d4cb4 Factor out message buffer mgmt from notmuch-show-view-all-mime-parts
The ability to temporarily create a buffer containing only the
contents of the currently selected message in notmuch show mode is
generally useful.  This commit factors the majority of the code
required to do so out of notmuch-show-view-all-mime-parts into a macro
called with-current-notmuch-show-message and rewrites the original
function in terms of the macro.

A future set of commits will provide additional functionality using
the macro as well.
2009-11-27 21:07:35 -08:00
Keith Amidon
30bdcfe651 Add key binding for notmuch-search in show-mode
It's not uncommon to want to start a search as a result of something
read in a message so this is convenient.
2009-11-27 21:06:56 -08:00
Aneesh Kumar K.V
8418dee2f6 notmuch.el: Use message-mode font-face to highlight mail headers
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2009-11-27 20:57:43 -08:00
Alexander Botero-Lowry
ed16edc94d Add some very rudimentary support for handling html parts
If there is an html mime-part in the message and it's the first part,
it gets inlined using `mm-display-part' to convert it to plain text.

The HTML content is still available as a non-text part as well.
2009-11-27 20:47:27 -08:00
Eric Anholt
f0bb5e9c3e notmuch.el: Require message mode to avoid undefined function in replies.
Otherwise, those without keithp's .emacs would end up with reply mode
not being entered.  Suggested by keithp.
2009-11-27 19:45:36 -08:00
Jed Brown
0ce9c53fd4 notmuch-search-add/remove-tag: restrict to messages in current query
Rather than tagging the everything in the thread.  This is arguably more
desirable behavior and is consistent with clearly desirably behavior of
notmuch-search-operate-all.

Note that this change applies indirectly to
notmuch-search-archive-thread (which is actually equivalent behavior
since this function is primarily used when browsing an inbox).

Signed-off-by: Jed Brown <jed@59A2.org>
2009-11-27 05:57:07 -08:00
Jed Brown
7293d84826 New function notmuch-search-operate-all: operate on all messages in the current query.
It is often convenient to change tags on several messages at once.  This
function applies any number of tag whitespace-delimited tag
modifications to all messages matching the current query.

I have bound this to `*'.

Signed-off-by: Jed Brown <jed@59A2.org>
2009-11-27 05:57:04 -08:00
Tassilo Horn
b7898b0c2a Return unpropertized strings for filename and message-id 2009-11-26 13:18:20 -08:00
Aneesh Kumar K.V
dc4d0a53a2 notmuch.el: Use variable notmuch-search-oldest-first to decide the search order
Make sure we use notmuch-search-oldest-first to decide the how
the search result should be displayed. This helps to set the
value to nil and have latest mail shown first

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2009-11-26 13:09:12 -08:00
Jan Janak
5ab69232bc notmuch.el: When removing tags, offer only those a msg/thread has set.
When removing a tag from a message or thread, build a completion buffer
which contains only tags that the message or thread has really set.

Signed-off-by: Jan Janak <jan@ryngle.com>
2009-11-26 07:07:12 -08:00
Jan Janak
16eab4c87d notmuch.el: Select tag names with completion.
Several commands ask the user for a tag name. With this feature the
user can just press tab and Emacs automatically retrieves the list of
all existing tags from notmuch database with 'notmuch search-tags' and
presents a completion buffer to the user.

This feature is very useful for users who have a large number of tags
because it saves typing and minimizes the risk of typos.

Signed-off-by: Jan Janak <jan@ryngle.com>
2009-11-26 07:03:32 -08:00
Carl Worth
03ea266bc2 notmuch.el: Remove some dead code.
This was left over from before the switch to using a filter for
processing the results of "notmuch search".
2009-11-25 09:18:39 -08:00