Commit graph

2273 commits

Author SHA1 Message Date
Carl Worth
650f6ac573 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.
2009-12-01 16:33:25 -08:00
Jeffrey C. Ollie
3054bc462c Add test to configure script to detect getline
Add a simple test to the configure script to detect getline.  It's not
important that the test run, just that it compiles and links without
any errors.

Signed-off-by: Jeffrey C. Ollie <jeff@ocjtech.us>
2009-12-01 16:33:25 -08:00
Carl Worth
1682633f65 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.
2009-12-01 16:33:25 -08:00
Carl Worth
880b21a097 Makefile: Incorporate getline implementation into the build.
It's unconditional for a very short time. We expect to soon be
building it only if necessary.
2009-12-01 16:33:17 -08:00
Carl Worth
7fd7611b23 compat/getdelim: Silence a warning about mixing of signed/unsigned.
If the length is ever so large as to overflow, then we'll end up
returning a negative value (which indicates an error anyway).
2009-12-01 16:27:35 -08:00
Carl Worth
c04a432ef2 compat: Change includes from config.h to compat.h.
We may switch to using an autoconf-like config.h, but we're not doing
that just yet.
2009-12-01 16:27:29 -08:00
Carl Worth
96c9109d94 compat: Add implementation of getline from gnulib.
These were copied from the gnulib git repository as of:

	commit 563c779682040ed4b89c9b4bbe428dcd8157c90a

They come under the GNU GPL v3 (or later) exactly as notmuch is
licensed.
2009-12-01 14:06:41 -08:00
Carl Worth
8b445212e4 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.
2009-12-01 12:51:39 -08:00
Carl Worth
e5316b320a 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.
2009-12-01 12:40:13 -08:00
Carl Worth
6320695223 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.
2009-12-01 11:39:30 -08:00
Carl Worth
7c2c26bc4e 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).
2009-12-01 10:14:00 -08:00
Carl Worth
72edf82cd0 configure: Fix pkg-config warning to not refer to non-existent variables.
We used to have NOTMUCH_CFLAGS and NOTMUCH_LDFLAGS in the Makefile, but
we don't anymore, so don't refer to them.
2009-12-01 10:07:14 -08:00
Carl Worth
d4a765b63e configure: Clean up the introductory message a bit.
Eliminate a typo or two, and mention that the user can edit
Makefile.config if necessary.
2009-12-01 08:40:45 -08:00
Carl Worth
98b93a7d5a Remove Makefile.config from the repository.
Instead of shipping a default version, we now add a rule to automatically
run configure if necessary to create Makefile.config.
2009-12-01 08:34:09 -08:00
Carl Worth
eb0cf86c7a 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().
2009-12-01 08:06:09 -08:00
Dirk-Jan C. Binnema
5f0b2ece16 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.

Compile with:

	make CFLAGS="-O -D_FORTIFY_SOURCE"

before this commit to see the warning.
2009-12-01 07:50:35 -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
Jameson Graef Rollins
4edf37a1d5 fix debian packaging emacsen installation 2009-11-29 08:48:46 -05:00
Jameson Graef Rollins
3cb3d2c021 first crack at debian packaging (using git-buildpackage) 2009-11-28 21:11:47 -05:00
Jameson Graef Rollins
ceed83f805 fix Makefile.local to install bash completion definitions as not executable 2009-11-28 18:29:01 -05:00
Jameson Graef Rollins
80483a92be add checking for zlib development libraries to configure script 2009-11-28 18:27:57 -05:00
Jameson Graef Rollins
cfa246272d fix configure script to handle --prefix= and properly create Makefile.config
This also removes the Makefile.config from the repository, since it
shouldn't be kept in the repository and should be created by the
configure script.
2009-11-28 18:22:58 -05:00
Jed Brown
a2a522a758 Documentation for notmuch reply --format=(default|headers-only)
Signed-off-by: Jed Brown <jed@59A2.org>
2009-11-28 12:13:02 -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
Carl Worth
64c8d6227a Avoid bogus internal error reporting duplicate In-Reply-To IDs.
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:

http://ozlabs.org/~rusty/index.cgi/tech/2008-04-01.html
2009-11-28 10:01:22 -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
Alec Berryman
ea124966e7 Send mail to notmuch list, not Carl 2009-11-27 22:50:23 -08:00
Chris Wilson
de064f1772 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>
2009-11-27 21:36:35 -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