Commit graph

5651 commits

Author SHA1 Message Date
Carl Worth
985263cf51 Makefile: Simplify the conditional message of the all target.
We wamt a simple "make" to call the 'all' target and then print a
message when done, but we don't want "make install" which depends on
that same 'all' target to print the message.

We previously did this with a separate 'all-without-message' target,
which was inelegant because it caused all users of the target to
carefully depend on 'all-without-message' rather than 'all'.

Instead, we now use a single 'all' target but with a Makefile
conditional that examines the MAKECMDGOALS variable to determine
whether to print the message.
2010-03-10 10:44:44 -08:00
Carl Worth
adf5c5ec35 Makefile: Add message to make install listing the other install targets.
Otherwise, it's hard for the user to know that things like install-emacs,
install-bash, and install-zsh even exist.
2010-03-10 10:07:34 -08:00
Carl Worth
2b8131f079 Makefile: Add a meesage after "make" telling the user to run "make install"
As one command completes, it's kind of the tool to indicate which
command the user should execute next.
2010-03-09 17:03:11 -08:00
Carl Worth
6b92ca5a05 Makefile: Rename all_deps to global_deps
The "all" inside this variable name was easy to confuse with the
separate "all" target. This variable specifies dependencies that apply
to every target, so use "global" instead.
2010-03-09 17:01:55 -08:00
Carl Worth
e3046c688b Add is:<tag> as a synonym for tag:<tag> in search terms.
I like the readability of this, it provides compatibility with people
trained in this syntax by sup, and it even saves one character.
2010-03-09 16:03:58 -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
Carl Worth
a875e17211 INSTALL: Include Fedora command for installing dependencies of notmuch.
We already had this command in the error message from the configure script,
so we should include it here as well.
2010-03-09 12:13:32 -08:00
Carl Worth
21a92c6cce INSTALL: Add a pointer to ./configure --help
We have some good documentation in ./configure --help, so we should
direct users to it.
2010-03-09 12:13:32 -08:00
Carl Worth
c446f22dee lib: Silence a compiler warning.
The original code was harmless, but apparently some compilers aren't
able to think deep enough to catch that.
2010-03-09 12:07:26 -08:00
Carl Worth
07876ac135 emacs: Fix refresh of search results to leave cursor on current thread.
This has been broken since the addition of support for streaming
search results to the emacs interface. With the old apparoach it was
easy to simply wait for all search results to land in the buffer and
then search for the desired line. With streaming results, we have to
save the target off to the side and allow the process filter and
sentinel functions to correctly respond when the target thread
appears.
2010-03-09 11:36:08 -08:00
Fernando Carrijo
7f2629520c Fix a few documentation typos in notmuch.h
Fix a few documentation typos in notmuch.h

Signed-off-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
2010-03-09 10:32:58 -08:00
Fernando Carrijo
bc69bf09cb Update documentation of notmuch_query_create
Commit cd467caf renamed notmuch_query_search to notmuch_query_search_messages.
Commit 1ba3d46f created notmuch_query_search_threads. We better keep the docs
of notmuch_query_create consistent with those changes.

Signed-off-by: Fernando Carrijo <fcarrijo@yahoo.com.br>

Edited-by: Carl Worth to explicitly list the full name of each
function being referenced.
2010-03-09 10:29:38 -08:00
Carl Worth
2303d9366e notmuch show: Don't show empty headers.
This is a fairly old regression. There has always been code to avoid
printing empty headers (such as Cc or Bcc with no values), but it has
been broken since notmuch_message_get_header was changed to return
an empty string rather than a NULL pointer for these fields.
2010-03-09 10:12:58 -08:00
Carl Worth
c375f7a407 TODO: Add proposal for a saved-search interface.
Adding this to our TODO list so that it doesn't get forgotten.
2010-03-09 10:09:40 -08:00
Carl Worth
a7f03d9f7c TODO: Remove many items that have been completed recently.
There's been a lot of good work done, and we've been doing a generally
poor job of noticing when some of the tasks we've completed were
already on our TODO list.

So here's a careful scan, removing all items I could find that have
already been done.
2010-03-09 10:06:37 -08:00
Carl Worth
986789e6f6 emacs: Fix documentation of notmuch-search-remove-tag.
The behavior was changed in commit 4aff2ca55b
to affect all messages in the thread (and not only those matching
the current search) but the documentation was not updated (until
now).
2010-03-09 09:54:53 -08:00
Carl Worth
64646841f7 lib: Document what move_to_next does at the end of the list.
Explicitly mention that there's an invalid position after the last
item in the list.
2010-03-09 09:24:45 -08:00
Carl Worth
4e5d2f22db lib: Rename iterator functions to prepare for reverse iteration.
We rename 'has_more' to 'valid' so that it can function whether
iterating in a forward or reverse direction. We also rename
'advance' to 'move_to_next' to setup parallel naming with
the proposed functions 'move_to_first', 'move_to_last', and
'move_to_previous'.
2010-03-09 09:22:29 -08:00
Carl Worth
c5085642b8 emacs: Fix backspace to not scroll more than the previous message
The bug was occuring due to counting invisible lines, but then
scrolling past them since they are invisible.
2010-03-09 08:11:45 -08:00
Carl Worth
c963098e28 emacs: Unbreak notmuch-show-rewind (the function to which Backspace is bound)
Commit 095a02211e broke the backspace
key by trying to execute nil as a function, (which obviously won't
work), when it was intended as a return value. Fix this now, (and pine
for a test suite that exercises the emacs user-interface of notmuch).
2010-03-09 08:11:37 -08:00
Carl Worth
095a02211e emacs: Make 'n' and 'p' navigate only open messages.
And add new 'N' and 'P' keybindings for navigating through messages
that are open or closed.
2010-02-26 11:30:12 -08:00
Carl Worth
f99b46c607 emacs: Don't open unread messages by default.
When searching for an individual message, (by message id, say), it's
really annoying to have the entire thread open just because the thread
was archived without ever having been read.

This means that the "unread" tag is a lot less special, and it really
just exists as a mild cue for the user.
2010-02-26 10:40:23 -08:00
Carl Worth
43c9c11389 control: Update package description to follow upstream README.
Justin B Rye pointed out (in Debian bug #566282) that a user with mail
in mbox format can spend a lot of time investigating notmuch before
realizing that mbox is not supported. Head that off with a more
detailed mention in the package description.
2010-02-25 11:16:41 -08:00
Carl Worth
3ab18d1c22 README: Mention that notmuch only supports maildir or mh format.
Justin B Rye pointed out (in Debian bug #566282) that a user with mail
in mbox format can spend a lot of time investigating notmuch before
realizing that mbox is not supported. Head that off with a more
detailed mention in the README blurb.
2010-02-25 11:03:56 -08:00
Carl Worth
3474263823 emacs: Avoid removing the unread tag due to internal navigation
Sometimes the internals of the implementation navigate among messages,
(as opposed to the user explicitly requesting the next message to be
shown). In these cases we don't want to remove the unread tag from the
message navigated to.

This fixes a bug where invocation of notmuch-show-next-unread-message
would clear the unread tag from all messages in a thread.
2010-02-24 17:02:31 -08:00
Jameson Rollins
4b9d2e3a4d Simplify "unread" tag handling in emacs UI.
This patch is intended to greatly simplify the handling of the
"unread" tag in the emacs UI.  This patch adds a new function
'notmuch-show-mark-read', that removes the "unread" tag in
notmuch-show-mode.  This function is then executed as a
notmuch-show-hook, and by notmuch-show-next-message.  All of the
functions that explicitly marked messages as unread are removed or
renamed.

The idea here is that the user should never have to worry about
manipulating the "unread" tag.  The tag should persist until the user
actually views a message, at which point it should be automatically
removed.  This patch simplifies the notmuch.el quite a bit, removing a
lot of somewhat redundant functions, and reducing clutter in the name
and key-mapping space.
2010-02-24 16:40:52 -08:00
Carl Worth
a7afcee50c TODO: We should fix the --format=json option to not imply --entire-thread.
What we print and how we print it are orthogonal options, so --format
shouldn't change what messages are printed.
2010-02-23 12:51:23 -08:00
Carl Worth
5171831813 notmuch search: Use "thread" rather than "id" when formatting with JSON
The text output uses thread:<foo>, (which is a syntax directly supported
by "notmuch show"), so make the json output be "thread", "<foo>" rather
than "id", "<foo>". This should help avoid confusion of thread IDs with
message IDs, (which do use the "id" prefix in searches).
2010-02-23 12:50:46 -08:00
Carl Worth
cfa95eec27 json: Add copy of MIT license text from cJSON
When we incorporate external code, we should include its license,
(particularly when one of the terms of the license is to include it in
copies).
2010-02-23 12:50:46 -08:00
Scott Robinson
6ce2bf68f5 Add an "--format=(json|text)" command-line option to both notmuch-search and notmuch-show.
In the case of notmuch-show, "--format=json" also implies
"--entire-thread" as the thread structure is implicit in the emitted
document tree.

As a coincidence to the implementation, multipart message ID numbers are
now incremented with each part printed. This changes the previous
semantics, which were unclear and not necessary related to the actual
ordering of the message parts.
2010-02-23 12:01:12 -08:00
Carl Worth
3ca7a4fbcc TODO: Rename the proposed --for option to --output
We've been using --output in IRC and on the mailing list for a while,
(someone had the good sense to point out that --for would defeat
command-line completion since it's a prefix of the proposed --format).
2010-02-23 11:27:43 -08:00
Carl Worth
6365f156c8 notmuch.1: Use bold and indentation for the NOTMUCH_CONFIG variable.
This seems to be the standard method of formatting an environment
variable section within a man page.
2010-02-23 11:21:41 -08:00
James Westby
a696119756 Add ENVIRONMENT VARIABLES section to the man page
Briefly describe the NOTMUCH_CONFIG variable there.
2010-02-23 11:14:09 -08:00
Carl Worth
3910000fe8 notmuch.el: Emphasize the 'i' of 'ID' in the documentation for 'c i'.
We're using 'i' in the keybinding, so it helps to have a capital
'I' in the help string to empahsize the point.
2010-02-20 12:27:37 -08:00
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
Carl Worth
e0a8dee8bc Fix printf for when uint64_t != unsigned long long int
Thanks to Michal Sojka <sojkam1@fel.cvut.cz> for pointing out the
correct fix, which I verified in the freely-available WG14/N1124 draft
(from the C99 working group) which is available here:

http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf
2010-02-09 11:14:16 -08:00
Carl Worth
9439b217c3 Switch from random to sequential thread identifiers.
The sequential identifiers have the advantage of being guaranteed to
be unique (until we overflow a 64-bit unsigned integer), and also take
up half as much space in the "notmuch search" output (16 columns
rather than 32).

This change also has the side effect of fixing a bug where notmuch
could block on /dev/random at startup (waiting for some entropy to
appear). This bug was hit hard by the test suite, (which could easily
exhaust the available entropy on common systems---resulting in large
delays of the test suite).
2010-02-09 11:14:11 -08:00
Carl Worth
0d58d46f7a TODO: Add some recently discussed items.
These were collected either from the mailing list of from IRC
conversations. The good ideas probably aren't mine, and the mistakes
probably are.
2010-02-09 11:02:18 -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