Keith Amidon [Sat, 5 Dec 2009 22:53:59 +0000 (14:53 -0800)]
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.
Carl Worth [Thu, 10 Dec 2009 18:35:18 +0000 (10:35 -0800)]
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.
David Bremner [Thu, 10 Dec 2009 15:14:35 +0000 (11:14 -0400)]
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.
David Bremner [Sat, 5 Dec 2009 02:26:37 +0000 (22:26 -0400)]
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.
David Bremner [Sat, 5 Dec 2009 02:26:36 +0000 (22:26 -0400)]
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.
Carl Worth [Wed, 9 Dec 2009 22:03:03 +0000 (14:03 -0800)]
TODO: Add idea for an --exclude-threads options to "notmuch search".
This would provide support for "muted" threads, as well as allowing for negative
filtering based on messages not matched by the original search, (but present in
threads that do have at least one matched message).
Nuke the remainings of _notmuch_message_add_thread_id.
The function _notmuch_message_add_thread_id has been removed
from the private interface of notmuch. There's no reason for
one to keep a declaration of its prototype in the code base.
Also, lets update a commentary that referenced that function
and escaped from previous scrutiny.
Signed-off-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
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).
Carl Worth [Fri, 4 Dec 2009 23:37:39 +0000 (15:37 -0800)]
Makefile: Silence compiler errors during dependency generation.
We have a bootstrapping issue with our dependency generation. When the
Makefile.config doesn't exist yet, the complete compilation flags are
not yet available for passing to the compiler to generate the
dependencies.
But we don't have explicit rules to create these dependency files,
(just the implicit rule that is created by the -include), so we can't
control when make will attempt to create them.
We do have a dependency of the dependency files on Makefile.config, so
make should eventually call the compiler with the correct flags and
everything should be good. So in the meantime, silence any complaints.
Carl Worth [Fri, 4 Dec 2009 23:32:05 +0000 (15:32 -0800)]
Makefile: Inform user that they might want to call ./configure explicitly.
If the Makefile does this for the user, then no arguments are passed. So
it's only polite to let the user know that it's possible to get pass those
arguments.
Carl Worth [Fri, 4 Dec 2009 23:20:12 +0000 (15:20 -0800)]
configure: Support the capturing of CFLAGS and CXXFLAGS at configure time.
These variables can now be set via configure time via environment
variables like so:
CFLAGS=-g ./configure
and subsequent builds will remember these values. The values can
still be overridden at compile time by passing make variables:
make CFLAGS=-O2
The CXXFLAGS variable is optional. If unset at either configure
time or at compile time, it will inherit its value from the
CFLAGS variable. (Though if explicitly set at configure time
it must be explicitly overriden at compile time---just overriding
CFLAGS will not override CXXFLAGS as well.)
Carl Worth [Fri, 4 Dec 2009 23:08:37 +0000 (15:08 -0800)]
Fix quiet compilation to print the user's CFLAGS, CXXFLAGS, LDFLAGS.
The only reason I ever call "make V=1" myself, (other than when
debugging the compiler command-line for some reason), is to ensure
whether my CFLAGS, (like "-g -O0" or "-O2"), are actually making it to
the command-line.
But these are hard to find in the V=1 output, and really, we should
just print these even in the quiet case. So do that.
Reviewed-by: Carl Worth <cworth@cworth.org>:
This is really the fundamental thing that people expect a configure
script to do, so it's important to support it.
Jeffrey C. Ollie [Sat, 28 Nov 2009 14:20:08 +0000 (08:20 -0600)]
Add some text to configure on how to install dependencies with yum.
Add some text on how to install dependencies with yum for Fedora or
other systems that use yum for package management. Since the named of
the required packages on Fedora are slightly different from Debian
this will help get new users of notmuch that use Fedora going quicker.
Bart Trojanowski [Sat, 28 Nov 2009 02:31:12 +0000 (21:31 -0500)]
vim: preserve the 'show everything' flag when finding next/prev buffer
When show mode is invoked it could be displaying just the matched messages
or everything. This flag is passed to NM_search_show_thread(). It is then
stored in a buffer variable, b:nm_show_everything, and used for subsequent
calls to NM_search_show_thread() triggered by <Space>, <C-n> and <C-p>.
Carl Worth [Thu, 3 Dec 2009 19:38:05 +0000 (11:38 -0800)]
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.
Carl Worth [Thu, 3 Dec 2009 19:34:01 +0000 (11:34 -0800)]
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.
Carl Worth [Thu, 3 Dec 2009 18:39:33 +0000 (10:39 -0800)]
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).
Carl Worth [Thu, 3 Dec 2009 15:37:40 +0000 (07:37 -0800)]
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.
Carl Worth [Thu, 3 Dec 2009 01:18:51 +0000 (17:18 -0800)]
TODO: Add some tasks, delete some tasks.
A new item from IRC discussion, (speeding up "notmuch restore"), as
well as a bug I just hit myself, (content from citations is not being
indexed).
While here, notce that several items have recently been completed ('?'
now displays documentation, not function names; we have a search
binding from notmush-show-mode; and "notmuch new" responds to SIGINT
by flushing). Finally, the item regarding optimizing chunky searching
is irrelevant since we dropped chunky searching in favor of the much
better streamed searching.
Carl Worth [Thu, 3 Dec 2009 00:05:23 +0000 (16:05 -0800)]
notmuch show: Preserve thread-ordering and nesting without --entire-thread
When "notmuch show" was recently modified to not show an entire thread
by default, it also lost all capability to properly order the messages
in a thread and to print their proper depth. For example, the command:
even though both commands were selecting and displaying the same set
of messages. The first command would diplay them "flat", (all with
depth:0), and in strict date order; while the second command would
display them "nested" (with depth based on threading), and in thread
order.
We now fix "notmuch show" without the --entire-thread option to also
display nested and thread-ordered messages.
If some messages in the thread are not included in the displayed
results, then they are not counted when computing depth values.
Bart Trojanowski [Sat, 28 Nov 2009 02:49:39 +0000 (21:49 -0500)]
notmuch show: limit display to only matching messages
This patch changes the default behaviour of notmuch show to display only
messages that match the search expression. However, --entire-thread
option is provided to display all messages in threads that matched the
search expression.
It is deemed that will be more useful for human users on the command line.
Scripts can be modified to include the --entire-thread option so that they
can display all messages once more.
Carl Worth [Wed, 2 Dec 2009 02:33:23 +0000 (18:33 -0800)]
configure: Allow user to specify compiler to be used.
The environment variables CC and CXX can be set at configure time to
specify what compiler to use. This compiler will be used for any
configure-time compilation, and will also be recorded in
Makefile.config to be used during the actual build.
The compiler to be used can still be overridden at build time by using
a make variable such as:
Carl Worth [Wed, 2 Dec 2009 02:25:17 +0000 (18:25 -0800)]
configure: Generate more friendly Makefile.config with separated CFLAGS
Each dependency now gets its own variable in the resulting
Makefile.config to make it much easier to debug where the various
flags came from in the case of any problems.
Carl Worth [Wed, 2 Dec 2009 02:13:43 +0000 (18:13 -0800)]
configure: Clarify pkg-config warning now that Makefile does not invoke pkg-config.
It's probably a bit more work to use this configure script without
pkg-config, but it's at least possible, (and we could make it even
easier if this becomes an important use case).
Carl Worth [Wed, 2 Dec 2009 01:56:39 +0000 (17:56 -0800)]
configure: Resolve all pkg-config flags at configure time.
Previously, we were resolving these within the Makefile. This had
the problem that if pkg-config was not present, the Makefile would
still invoke it resulting in ugly errors before the configure script
was even run, (which would finally present a kind error message about
pkg-config not being present).
Carl Worth [Wed, 2 Dec 2009 00:56:39 +0000 (16:56 -0800)]
configure: Move getlinetest.c down into config/have_getline.c.
This keeps configure-related clutter out of the main directory, and
also gives a more direct correlation between the name of the test and
the feature being tested for.
Carl Worth [Wed, 2 Dec 2009 00:46:21 +0000 (16:46 -0800)]
getdelim: Silence a (bogus) compiler warning.
Some compilers complain that result might be used uninitialized in
this function. I believe such compilers simply aren't looking hard
enough, but it's easy enough to silence them.
Carl Worth [Wed, 2 Dec 2009 00:38:47 +0000 (16:38 -0800)]
Makefile: Switch from echo to printf for better portability.
Some systems have an echo implementation which doesn't know how to
interpret a sequence of "\n". The word is that printf should be much
more portable, so let's try that instead.
Carl Worth [Wed, 2 Dec 2009 00:00:31 +0000 (16:00 -0800)]
configure: Assimilate new getlinetest into recent configure conventions.
We're now using printf to print what we're checking before we check. We're
also making variables such as HAVE_GETLINE available to both make and to
the C pre-processor.
With this, the local getline implementation is now only compiled if not
available on the system.
Carl Worth [Tue, 1 Dec 2009 23:52:44 +0000 (15:52 -0800)]
configure: Fix valgrind check to take effect, and to work.
We were missing an "override" directive in the assignment of CFLAGS
within Makefile.config so it was actually having no effect. Then, we
were also failing to get the proper include path for valgrind.h so
it wouldn't have worked even it were having effect. Fix both problems.
Carl Worth [Tue, 1 Dec 2009 20:51:39 +0000 (12:51 -0800)]
xutil: Implement xstrndup without relying on strndup.
Since we need to do this for portability, (some systems don't have a
strndup function), we might as well do it unconditionally. There's
almost no disadvantage to doing so, and this has the advantages of not
requiring a configure-time check nor having two different
implementations, one of which would often be less tested.
Carl Worth [Tue, 1 Dec 2009 20:40:13 +0000 (12:40 -0800)]
lib/index: Fix memory leak for email addresses without names.
We carefully noted the fact that we had locally allocated the string
here, but then we neglected to free it. Switch to talloc instead
which makes it easier to get the behavior we want. It's simpler since
we can just call talloc_free unconditionally, without having to track
the state of whether we allocated the storage for name or not.
Carl Worth [Tue, 1 Dec 2009 19:39:30 +0000 (11:39 -0800)]
configure: Use printf to achieve result of "echo -n".
We had avoided using "echo -n" originally for portability concerns,
and instead just printed the same string in both conditions, (and
also printed the string late if any check took long). The word is
that printf is quite portable, so we use that instead.
Carl Worth [Tue, 1 Dec 2009 18:14:00 +0000 (10:14 -0800)]
Makefile: Add new "install-bash" target for bash completion support
It was problematic to have this in "make install" since it would
unconditionally try to install to /etc, (even if a non-privileged user
was attempting an install to a prefix in the user's home directory,
for example).
Carl Worth [Tue, 1 Dec 2009 16:06:09 +0000 (08:06 -0800)]
notmuch setup: Exit if EOF is encountered at any prompt.
If the user is explicitly providing EOF, then terminating the program
is the most likely desired thing to do. This also avoids undefined
behavior from continuing with an uninitialized response after ignoring
the return value of getline().
Avoid compiler warnings due to ignored write return values
Glibc (at least) provides the warn_unused_result attribute on write,
(if optimizing and _FORTIFY_SOURCE is defined). So we explicitly
ignore the return value in our signal handler, where we couldn't do
anything anyway.
Carl Worth [Tue, 1 Dec 2009 07:21:04 +0000 (23:21 -0800)]
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).
Carl Worth [Tue, 1 Dec 2009 07:14:11 +0000 (23:14 -0800)]
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'.
Carl Worth [Tue, 1 Dec 2009 07:02:10 +0000 (23:02 -0800)]
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.
Carl Worth [Tue, 1 Dec 2009 06:47:10 +0000 (22:47 -0800)]
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.
Carl Worth [Tue, 1 Dec 2009 06:24:05 +0000 (22:24 -0800)]
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.
Carl Worth [Tue, 1 Dec 2009 05:46:55 +0000 (21:46 -0800)]
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).
Carl Worth [Tue, 1 Dec 2009 00:52:31 +0000 (16:52 -0800)]
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").
Carl Worth [Tue, 1 Dec 2009 00:50:52 +0000 (16:50 -0800)]
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.
Carl Worth [Tue, 1 Dec 2009 00:48:19 +0000 (16:48 -0800)]
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.
Carl Worth [Tue, 1 Dec 2009 00:44:05 +0000 (16:44 -0800)]
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.
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.
Carl Worth [Mon, 30 Nov 2009 17:53:38 +0000 (09:53 -0800)]
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.
Carl Worth [Mon, 30 Nov 2009 17:48:15 +0000 (09:48 -0800)]
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.
This error was tirggered with a debugging build via:
make CXXFLAGS="-DDEBUG"
and reported by David Bremner. The actual error is that I'm an
idiot that doesn't know how to use strcmp's return value. Of
course, the strcmp interface scores a negative 7 on Rusty Russell
ranking of bad interfaces:
Keith Amidon [Fri, 27 Nov 2009 13:30:08 +0000 (05:30 -0800)]
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.
Chris Wilson [Fri, 27 Nov 2009 13:50:11 +0000 (13:50 +0000)]
notmuch-new: Check for non-fatal errors from stat()
Currently we assume that all errors on stat() a dname is fatal (but
continue anyway and report the error at the end). However, some errors
reported by stat() such as a missing file or insufficient privilege,
we can simply ignore and skip the file. For the others, such as a fault
(unlikely!) or out-of-memory, we handle like the other fatal errors by
jumping to the end.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Keith Amidon [Fri, 27 Nov 2009 13:30:15 +0000 (05:30 -0800)]
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.
Keith Amidon [Fri, 27 Nov 2009 13:30:11 +0000 (05:30 -0800)]
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.
Keith Amidon [Fri, 27 Nov 2009 13:30:10 +0000 (05:30 -0800)]
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.