Commit graph

273 commits

Author SHA1 Message Date
Carl Worth
38c595738f emacs: Move definition of notmuch-folders to earlier in the file.
To avoid a warning about a free variable from the emacs compiler.
2010-04-21 17:04:36 -07:00
Servilio Afre Puentes
3bf27d6c58 emacs: Try to name search buffers using info in notmuch-folders
As the user has already defined aliases for certain searches in
notmuch-folders, search buffer names that use these aliases will
be easier to identify.
2010-04-21 16:58:46 -07:00
Carl Worth
8981842ff6 emacs: Fix notmuch-search-authors-width declaration.
Our defcustom call was missing the 'notmuch group, which emacs was
nice enough to warn about during compilation.
2010-04-21 14:17:14 -07:00
David Edmondson
8cee113819 emacs: Support for customizing search result display
This patch helps in customizing search result display similar to
mutt's index_format. The customization is done by defining an alist as
below:

(setq notmuch-search-result-format '(("date" . "%s ")
				     ("authors" . "%-40s ")
				     ("subject" . "%s ")))

The supported keywords are date, count, authors, subject and tags.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: David Edmondson <dme@dme.org>
2010-04-21 13:37:14 -07:00
David Edmondson
e26d767897 emacs: JSON based implementation
Re-implement notmuch-show.el using the JSON output format of the
notmuch command. Most functionality is retained - HTML display is
noticeably missing.
2010-04-21 12:12:02 -07:00
David Edmondson
cdd64727f1 emacs/notmuch.el: Enable hl-line-mode' in notmuch-search-mode' 2010-04-19 11:20:02 -07:00
Carl Worth
9792d3553e Revert "notmuch.el: 'F' in search mode takes us to a list of folders."
This reverts commit fbec989fe3.

I only pushed this accidentally. See message
id:871ver6u9r.fsf@yoom.home.cworth.org for the various reasons I
didn't like this patch, (mostly I think the association of 'F' is
wrong).
2010-04-16 07:53:10 -07:00
Carl Worth
b4459b8a4d emacs: Fix search filtering of a global search ("*")
With the recent addition of "*" being a special case for a search
matching all messages, we have to take care when doing a filter
operation. In this case it's not legal to simply append and get:

	* and <some-new-search-terms>

Instead we carefully construct a new search string of only:

	<some-new-search-terms>

This could all be avoided if we had a parser that could understand
"*" with the meaning we want.
2010-04-15 21:25:45 -07:00
Jesse Rosenthal
db96d67ba2 Clean up code duplication in adding or removing tag by region.
Clean up code duplication, as per Carl's suggestion, by making
notmuch-search-{add/remove}-tag-thread a special case of the -region
commands, where the region in question is between (point) and (point).
2010-04-14 10:10:55 -07:00
Jesse Rosenthal
2fbb6d05a9 Fix bug in adding or removing tag by region.
There was a bug in notmuch-search-{add,remove}-tag-region, which would
not behave correctly if the region went beyond the last message. Now,
instead of simply iterating to the last line of the region, these
functions will iterate to the minimum of the last line of the region
and the last possible line, i.e.

(- (line-number-at-pos (point-max)) 2)

Tested-by: Carl Worth <cworth@cworth.org> Note that the old, buggy
behavior included infinite loops of emacs lisp code, so the new
behavior is significantly better than that.
2010-04-14 10:09:53 -07:00
Carl Worth
fec5622add emacs: Correct the documentation for notmuch-search-add-tag (and -remove-tag)
These commands act on all messages in the thread, not simply those
that match the search. (There are use case for both behaviors, but the
documentation must match the behavior that's actually implemented).
2010-04-07 13:15:27 -07:00
Jesse Rosenthal
4c9585933e notmuch.el: add functionality in notmuch search mode to add or remove tags by region
This patch adds `-region' versions of the `notmuch-search-' commands to find
properties. It also splits up  `notmuch-add/remove-tags' into both a
`-thread' and a `-region' version. (This makes us modify
`notmuch-search-archive-thread' to use the
`notmuch-search-remove-tag-thread' function, instead of
`notmuch-search-remove-tag', for consistency.) The add/remove-tag command
called by pressing `+' or `-' will then choose accordingly, based on whether
region is active.

This version fixes a couple of errors in the first version, which led to
incorrect marking of some tags in the search view (though the actual
tagging was still correct). It's also based on current master.

I'm not sure any more if region selection is actually the correct way to
do this, or if a mutt-style message-marking method would be better. But
I didn't want a buggy incorrect version out there.
2010-04-07 13:10:36 -07:00
Jameson Rollins
84767fd582 notmuch.el: colorize lines in notmuch-search based on thread tags.
Arbitrary font faces can be specified for given thread tags.  By
default, no coloring is applied.  To specify coloring, place something
like this in your .emacs:

(setq notmuch-search-line-faces '(("delete" . '(:foreground "red"))
                                  ("unread" . '(:foreground "green"))))

Order matters: line faces listed first will take precedence (in the
example above, a thread tagged both "delete" and "unread" will be
colored red, since the "delete" face is listed before the "unread").
 notmuch.el |   33 ++++++++++++++++++++++++++++++++-
 1 files changed, 32 insertions(+), 1 deletions(-)
2010-04-07 11:09:20 -07:00
Jesse Rosenthal
9bee20aed3 notmuch.el: Make notmuch-show buffer name first subject, instead of thread-id (supersedes V1--3)
Change the buffer name to a uniquified subject of the thread (i.e. the
subject of the first message in the thread) instead of the thread-id. This
is more meaningful to the user, and will make it easier to scroll through
numerous open buffers.

Note that this patch adds an optional `buffer-name' argument to notmuch
show.

Signed-off-by: Jesse Rosenthal <jrosenthal@jhu.edu>
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2010-04-07 10:40:06 -07:00
David Edmondson
fbec989fe3 notmuch.el: 'F' in search mode takes us to a list of folders. 2010-04-07 10:25:35 -07:00
Jameson Rollins
aa531a92ae notmuch.el: fontify date in header
The date was unfairly left out of getting pretty colors in the
notmuch-show header display.  This fixes that grave injustice.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2010-04-07 10:22:13 -07:00
David Edmondson
e8414a72d4 emacs: Move notmuch-show functionality to notmuch-show.el
To ease the transition to a JSON based implementation of
`notmuch-show', move the current implementation into a separate file.

Create `notmuch-lib.el' to hold common variables.
2010-04-05 09:25:56 -07:00
Carl Worth
03588ee710 emacs: Fix "free variable" warning for notmuch-folder-show-empty.
Emacs really wants us to defvar each variable before assigning to it,
(which gives us a place to document the variable as well).
2010-04-03 12:31:49 -07:00
David Edmondson
e33b73819a emacs/notmuch.el: Improve tag highlighting in search mode
Assume that tags never include an opening bracket, and hence improve
the regular expression used to highlight them. This avoids false
matches where the 'from' address of a thread participant includes an
opening bracket.
2010-04-03 12:31:49 -07:00
Carl Worth
b957a1b029 emacs: Fix the notmuch-search-authors-width variable.
This variable existed previously, but wasn't actually used for anything.
2010-03-31 13:32:00 -07:00
Carl Worth
bb61755afe emacs: Fix search refresh when on the last line of a search buffer.
We currently allow the cursor to be positioned on the "End of search
results" line after the last thread in a search buffer. When
refreshing on this line, there's no thread ID to be used as the
target.

Previously, a refresh from this case would result in a nil thread
target, but we were also using nil to indicate that the target thread
had been found. This caused the position to be lost during refresh,
(the cursor would move from the last line in the buffer to the first).

We fix this by using a magic string of "found" rather than nil to
clearly indicate whether the target thread has actually been found.
2010-03-10 11:07:58 -08:00
Carl Worth
70ef8de798 emacs: Adjust search refresh to use a target line not a target position.
It doesn't make sense to move the cursor to some random point in the
middle of a line. We always want the refresh to leave the cursor at
the beginning of some line instead.
2010-03-10 11:07:51 -08:00
David Bremner
bbda0a0156 emacs: Move emacs UI (currently just one file) to subdirectory.
Add emacs/Makefile.local and emacs/Makefile. Move emacs targets into
emacs/Makefile.local, but leave the byte compilation rule in the top
level Makefile.
2010-03-09 12:13:33 -08:00
Renamed from notmuch.el (Browse further)