Commit graph

318 commits

Author SHA1 Message Date
Jameson Graef Rollins
cb8418784c emacs: Give mutlipart/{signed, encrypted} their own part handler.
This is the best way to make the displayed output for
decrypted/verified messages clearer.  The special sigstatus and
encstatus buttons are now displayed under the part header button.  The
part header button is also tweaked to provide information to user
about how to proces crypto.
2011-05-27 16:22:00 -07:00
Jameson Graef Rollins
933011ccaf emacs: Do not attempt to render arbitrary application parts.
We probably shouldn't have been doing this anyway, but we do it here
specifically because we don't want the content of the
application/pgp-encrypted parts to be displayed and cluttering the
message show.
2011-05-27 16:22:00 -07:00
Jameson Graef Rollins
45fe354745 emacs: Add support for PGP/MIME verification/decryption
A new emacs configuration variable "notmuch-crypto-process-mime"
controls the processing of PGP/MIME signatures and encrypted parts.
When this is set true, notmuch-query will use the notmuch show
--decrypt flag to decrypt encrypted messages and/or calculate the
sigstatus of signed messages.  If sigstatus is available, notmuch-show
will place a specially color-coded header at the begining of the
signed message.

Also included is the ability to switch decryption/verification on/off
on the fly, which is bound to M-RET in notmuch-search-mode.
2011-05-27 16:22:00 -07:00
Daniel Schoepe
eb4e0ea2ab emacs: Make the queries used in the all-tags section configurable
This patch adds a customization variable that controls what queries
are used to construct the all-tags section in notmuch-hello. It allows
the user to specify a function to construct the query given a tag or
a string that is used as a filter for each tag.
It also adds a variable to hide various tags from the all-tags section.

Signed-off-by: Daniel Schoepe <daniel.schoepe@googlemail.com>
2011-05-26 14:34:41 -07:00
Thomas Jost
b15cfd7ffa emacs: Add a customization allowing to always prompt for the "From" address when composing a new message 2011-05-26 10:38:39 -07:00
Thomas Jost
f7cc259c10 emacs: Allow the user to choose the "From" address when replying to a message
When pressing C-u r, the user will be prompted for the identity to use.
2011-05-26 10:38:16 -07:00
Thomas Jost
1a8aae6fa7 emacs: Allow the user to choose the "From" address when forwarding a message
When pressing C-u f, the user will be prompted for the identity to use.
2011-05-26 10:34:45 -07:00
Thomas Jost
784649561a emacs: Allow the user to choose the "From" address when composing a new message
When pressing C-u m, the user will be prompted for the identity to use.
2011-05-26 10:34:37 -07:00
Thomas Jost
fda6416745 emacs: Helpers needed for the user to be able to choose the "From" address when composing a new message
This adds functions and variables needed for this feature to be implemented.
Once it's done, the user will be able to use a prefix argument (e.g. pressing
C-u m instead of m) and be able to select a From address.

By default the list of names/addresses to be used during completion will be
automatically generated by the settings in the notmuch configuration file. The
user can customize the notmuch-identities variable to provide an alternate list.

This is based on a previous patch by Carl Worth
(id:"87wrhfvk6a.fsf@yoom.home.cworth.org" and follow-ups).
2011-05-26 10:34:21 -07:00
Dmitry Kurochkin
b6862c7eb9 Carefully manage save/restore of point in `notmuch-wash-toggle-invisible-action'.
Before the change, save-excursion was used to save the point.  But the
marker saved by save-excursion was inside a region that was deleted,
so that approach is unreliable, (leading to point jumping to a new
position past the button). This patch instead saves point in an
integer variable, and when restoring, carefully avoids moving point
past the button, (in case the new button label is shorter than the old
button label).
2011-05-24 16:33:09 -07:00
Dmitry Kurochkin
40de245862 Use different labels for wash buttons when text is visible or hidden.
Before the change, citation and signature wash buttons used the
same label in both visible and hidden states.  Sometimes it is
very convenient when you can determine if the text is hidden or
shown without reading the context and/or clicking the button.
The patch makes it easy to see if the text is shown or hidden by
explicitly saying what the button does (shows or hides the text).
2011-05-24 15:28:33 -07:00
Carl Worth
bc382902c1 emacs: Add an accessor function for emacs code to get at user.other_email
This is like the other notmuch-config accessor functions except that it
converts the newline-separated string into an actual lisp list.
2011-05-24 14:43:48 -07:00
Daniel Schoepe
d84e927091 emacs: add notmuch-before- and notmuch-after-tag-hook
This patch adds hooks that are run before/after messages are tagged
From the emacs interface.  In order to implement this and to avoid
having hooks parse all the arguments to the notmuch binary again, I
created a `notmuch-tag' function that other modules should use instead
of running (notmuch-call-notmuch-process "tag" ...) directly.
2011-05-24 13:28:41 -07:00
Jameson Graef Rollins
1650fd39ce emacs: update notmuch-show.el to use new part output
The command-line interface for extracting a single part from a message
recently changed from:

	notmuch part --part=X
to:
	notmuch show --format=raw --part=X
2011-05-24 12:19:18 -07:00
David Edmondson
0898cfad5e emacs: Show cleaner `From:' addresses in the summary line.
Remove double quotes and flatten "foo@bar.com <foo@bar.com>" to
"foo@bar.com".

Edited-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net> (clean up
expected output for emacs tests).

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
2011-05-18 16:11:53 -07:00
David Edmondson
4f04d2734f emacs: Add custom `notmuch-show-elide-same-subject'
This controls the appearance of collapsed messages in notmuch-show
mode, avoiding redundancy for repeated subject).

Remove `notmuch-show-always-show-subject'.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
2011-05-18 16:11:53 -07:00
David Edmondson
8ab4336074 emacs: Add `notmuch-show-always-show-subject', allowing control over
the display of collapsed messages.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
2011-05-18 16:11:52 -07:00
David Edmondson
f3384a322e emacs: Allow renderer of multipart/related parts access to non-primary parts.
Typically used to allow a `text/html' renderer access to images which
are sent along with the HTML.

This is not enabled by default, instead the user must execute
`notmuch-show-setup-w3m' for it to take effect.

Edited-by: Carl Worth <cworth@cworth.org> Add documentation string for
notmuch-show-setup-23m and clean up warning about reference/assignment
of free variable.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
2011-05-18 16:10:15 -07:00
David Edmondson
31bd2872c3 emacs: Optionally show all parts in multipart/alternative.
Add a variable `notmuch-show-all-multipart/alternative-parts' that
allows the user to indicate that all candidate sub-parts of a
multipart/alternative part should be shown rather than just the
preferred part. The default is `nil', showing only the preferred part.

This is mostly a debugging aid.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
2011-05-18 15:51:46 -07:00
David Edmondson
7ca4db2b46 emacs: Render text/x-vcalendar parts.
Use code from icalendar.el to convert text/x-vcalendar parts to
something suitable for use with the Emacs diary.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
2011-05-17 16:34:26 -07:00
David Edmondson
f35813df38 emacs: Allow indentation of multipart children.
Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
2011-05-17 16:34:26 -07:00
David Edmondson
0c68a5d847 emacs: Add `notmuch-show-multipart/alternative-discouraged'.
Also improved implementation of indication of which parts are
not shown.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
2011-05-17 16:34:26 -07:00
David Edmondson
b741e4dd25 emacs: add more part handling functions
This adds new notmuch-show-insert-part functions to handle
multipart/alternative and message/rfc822 parts.
2011-05-17 16:34:26 -07:00
Carl Worth
362ab047c2 notmuch show: Properly nest MIME parts within mulipart parts
Previously, notmuch show flattened all output, losing information
about the nesting of the MIME hierarchy. Now, the output is properly
nested, (both in the --format=text and --format=json output), so that
clients can analyze the original MIME structure.

Internally, this required splitting the final closing delimiter out of
the various show_part functions and putting it into a new
show_part_end function instead. Also, the show_part function now
accepts a new "first" argument that is set not only for the first MIME
part of a message, but also for each first MIME part within a series
of multipart parts. This "first" argument controls the omission of a
preceding comma when printing a part (for json).

Many thanks to David Edmondson <dme@dme.org> for originally
identifying the lack of nesting in the json output and submitting an
early implementation of this feature. Thanks as well to Jameson Graef
Rollins <jrollins@finestructure.net> for carefully shepherding David's
patches through a remarkably long review process, patiently explaining
them, and providing a cleaned up series that led to this final
implementation. Jameson also provided the new emacs code here.
2011-05-17 15:58:57 -07:00
Carl Worth
7c58326d62 emacs: Only compile replacement functions for emacs < emacs-23
This avoids the emacs lisp compiler from emitting warnings on this
replacement code, (which warnings would be hard for us to eliminate
since we didn't write the code but copied it verbatim from emacs 23).
2011-05-11 13:27:14 -07:00
Jameson Graef Rollins
907cac7035 use custom-face-edit value-type in notmuch-search-line-faces
This enables the proper face customization UI for
notmuch-search-line-faces.
2011-04-25 14:26:20 -07:00
Carl Worth
eead238277 emacs: Define notmuch-search-process-filter-data before first use.
To avoid a wraning about a reference to a free variable when compiling.
2011-03-10 17:59:53 -08:00
Carl Worth
708c4f46ca emacs: Don't drop error messages from "notmuch search"
With the previous commit, unexpected output before or between search results
would be displayed. However, trailing junk from the "notmuch search" output
would still be silently swallowed.

The most common case for an error message from "notmuch search" would be
an invalid command-line, and in that case, there would be no search results
and the trailing error message would get swallowed.

We fix the process sentinel to check for leftover data and add it to the
final buffer. We also add a test case to ensure this works.
2011-03-10 16:53:46 -08:00
Carl Worth
8a534dc60d emacs: Fix notmuch-search-process-filter to handle incomplete lines
This fixes the recently-added emacs-large-search-buffer test. This is
as simple as saving any trailing input and then pre-prepending it on
the next call.

MAny thanks to Thomas Schwinge <thomas@schwinge.name> for tracking
down this problem and contributing a preliminary version of this fix.
2011-03-10 16:25:37 -08:00
Carl Worth
44d3c57e2a emacs: Display any unexpected output from notmuch search
Rather than silently swallowing unexpected output, the emacs interface will now
display it. This will allow error messages to actually arrive at the emacs
interface (though not in an especially pretty way). This also allows for easier
investigation of the inadvertent swallowing of search results that span page
boundaries (as demonstrated by the recent added emacs-large-search-buffer test).

The page-boundary bug has been present since a commit from 2009-11-24:
93af7b5745

Many thanks to Thomas Schwinge for tracking that bug down and
contributing the test for it.
2011-03-10 15:18:40 -08:00
Carl Worth
3e4a9d60a9 build: Add support for non-source-directory builds.
Such as:

     mkdir build
     cd build
     ../configure
     make

This is implemented by having the configure script set a srcdir
variable in Makefile.config, and then sprinkling $(srcdir) into
various make rules. We also use vpath directives to convince GNU make
to find the source files from the original source directory.
2011-03-09 15:10:03 -08:00
Jameson Rollins
15d8928f41 emacs: send notmuch-query stderr to /dev/null
The call-process to notmuch in notmuch-query.el was previously sending
stderr into the output buffer.  This means that if there is any stderr
the JSON parsing breaks.  Unfortunately call-process does not support
sending stderr to a separate buffer or to the minibuffer [0], but it
does support sending it to /dev/null.  So we do that here instead.

[0] a bug was filed against emacs (#7842)
2011-01-27 14:44:05 +10:00
Carl Worth
1a915d1b38 Makefile: Quote variables used as filenames in shell commands
This allows support for filenames with spaces in them.
2011-01-26 23:36:52 +10:00
Michal Sojka
74cb76a69d emacs: View the output of pipe command when it fails
Previously, the user didn't know whether the pipe command succeeded or
not. It was only possible to find it out by manually inspecting
the work done (or not done) by the command or by manually switching to
*notmuch-pipe* buffer and determine it from command output. For this
the user had to first find the text corresponding to the last run of
pipe command as the buffer accumulated the output from all pipe commands.

This patch changes the following. The *notmuch-pipe* buffer is erased
before every pipe command so it contains only the output from the last
command. Additionally, when the command failed, the *notmuch-pipe* buffer
is shown and an error message is displayed.
with the output of pipe command.
2011-01-26 22:39:36 +10:00
Cédric Cabessa
26b4cc4aad configure: add options to disable emacs/zsh/bash and choose install dir.
add --bashcompletiondir and --zshcompletiondir (like --emacslispdir) to choose
installation dir for bash/zsh completion files

Make some features optional:
  --without-emacs / --with-emacs=no do not install lisp file
  --without-bash-completion / --with-bash-completion=no  do not install bash
files
  --without-zsh-completion / --with-zsh-completion=no do not install zsh files
By default, everything is enabled. You can reenable something with
  --with-feature=yes
2011-01-26 22:30:32 +10:00
David Edmondson
b9d4af4641 emacs: Remove over-eager regular expressions from notmuch-wash-tidy-citations.
The removed expressions, which were used to ensure that citations were
both preceded and followed by a blank line, were poorly implemented
and caused a regexp stack overflow on messages more than a few
thousand lines long.
2010-12-07 14:10:43 -08:00
David Edmondson
5d05d5434d emacs: Improve the display of truncated authors.
Incremental search does not match strings that span a
visible/invisible boundary. This results in failure to correctly
isearch for authors in `notmuch-search' mode if the name of the author
is split between the visible and invisible components of the authors
string. To avoid this, attempt to truncate the visible component of
the authors string on a boundary between authors, such that the
entirety of an author's name is either visible or invisible.
2010-12-07 13:57:05 -08:00
David Edmondson
cafd46ca13 emacs: Use truenames for Fcc paths.
Appease the test suite by using the true name for the Fcc directory
path, otherwise a value for `notmuch-database-path' which includes
symbolic links causes test suite failures.
2010-12-07 13:47:59 -08:00
James Vasile
7ae149445a compatibility with emacs22
Emacs22 lacks apply-partially and mouse-event-p, so define them if emacs
version is less than 23.  With this change, I was able to begin using
notmuch in emacs22.

The definitions of apply-partially and mouse-event-p are copied from
the emacs 23 distribution, (which is distributed under the GPLv3+ just
as notmuch).
2010-11-16 15:04:22 -08:00
David Edmondson
75d616c6ca emacs: Use `view-mode' when examining raw messages.
Explained-by: Carl Worth: This gives convenient keybindings for
navigating the file and for quitting from the buffer, (since, with a
raw message file the user will generally want to just view the
message, not edit it).
2010-11-16 11:16:59 -08:00
Jameson Rollins
2b433736a5 emacs: add stash thread-id function to notmuch-search mode
This add a "stash-map" for search-mode, just like in show-mode, and
adds one function, bound to "i" to stash the thread-id of the current
selected thread.

Couldn't think of the correct way to stash other thread info, so I
didn't add any other stash functions for now.
2010-11-11 17:28:48 -08:00
Jameson Rollins
128b6259ee emacs: mv notmuch-{show,common}-do-stash
Here we move the notmuch-show/notmuch-show-do-stash function to
notmuch-lib/notmuch-common-do-stash.  Nothing in this function is
notmuch-show mode specific, so this move will make it cleaner to be
used by other modes (such as notmuch-search).
2010-11-11 17:28:32 -08:00
David Edmondson
ea1c2bb5c5 emacs: Improve the definition and use of `notmuch-fcc-dirs'.
Re-work the declaration and definition of `notmuch-fcc-dirs'. The
variable now allows three types of values:

- nil: no Fcc header is added,

- a string: the value of `notmuch-fcc-dirs' is the name of the
  folder to use,

- a list: the folder is chosen based on the From address of the
  current message using a list of regular expressions and
  corresponding folders:

     ((\"Sebastian@SSpaeth.de\" . \"privat\")
      (\"spaetz@sspaeth.de\" . \"OUTBOX.OSS\")
      (\".*\" . \"defaultinbox\"))

  If none of the regular expressions match the From address, no
  Fcc header will be added.
2010-11-11 17:16:28 -08:00
David Edmondson
c471c4eb04 emacs: Use the header line to show the subject of the thread. 2010-11-11 17:06:04 -08:00
David Edmondson
e845f4e27e emacs: Simplify subjects more aggressively.
Remove 're: ' or 'Re: ' from anywhere within a subject line rather
than just at the beginning. This is to accommodate threads where a
mailing list sometimes inserts a subject prefix.

For example, if a thread has the subjects:

    [Orgmode] org-indent, org-inlinetask: patches on github
    Re: [Orgmode] org-indent, org-inlinetask: patches on github
    [Orgmode] Re: org-indent, org-inlinetask: patches on github

the last of these would not have been considered the same and would
therefore have been shown.
2010-11-11 17:04:35 -08:00
David Edmondson
e6d31a5435 emacs: Elide the display of repeated subjects in thread display mode.
Collapsed messages do not show a "Subject:" line if the subject is the
same as that of the previous message.
2010-11-11 17:03:45 -08:00
David Edmondson
1b2ea703e7 emacs: Correctly count the number of lines in a signature. 2010-11-11 16:50:22 -08:00
Jameson Rollins
7171e77d4d Don't use kill-this-buffer to kill notmuch emacs buffers
kill-this-buffer appears to be a function intended specifically for
use in the menu bar, and causes problem killing notmuch buffers when
multiple frames have been used.  This patch replaces kill-this-buffer
with notmuch-kill-this-buffer, which in turn just simply calls
(kill-buffer (current-buffer)).
2010-11-08 09:02:54 -08:00
Michal Sojka
c7189ed607 emacs: Fix notmuch-show-pipe-message to use notmuch-command variable
Previously notmuch command name was hardcoded into this function,
which made remote use of pipe command impossible.
2010-11-06 17:17:40 -07:00
Carl Worth
81d3bd3670 Rename "notmuch cat" to "notmuch show --format=raw"
This is part of an effort to avoid proliferation of excessive
top-level notmuch commands. Also, "raw" better captures the
functionality here, (as opposed to "cat" which is a fairly oblique
reference to a bad Unix abbreviation whose metaphor doesn't work here
since "notmuch cat" operates only on a single message and hence cannot
"con'cat'enate" anything).
2010-11-06 12:03:51 -07:00
Michal Sojka
fe9e163f19 emacs: Access raw messages via cat subcommand
This patch modifies the following commands to access the messages via
cat subcommand:
- view/save attachments ('v', 'w'),
- view a raw message ('V') and
- pipe a message to a command ('|').

With this patch, it is straightforward to use notmuch emacs interface
with a remote database accessed over SSH. To do this, it is sufficient
to redefine notmuch-command variable to contain the name of a script
containing:

    ssh user@host notmuch "$@"

If the ssh client has enabled connection sharing (ControlMaster option
in OpenSSH), the emacs interface is almost as responsive as when
notmuch is invoked locally.
2010-11-05 17:51:18 -07:00
Dirk Hohndel
ee578338a6 Fix problem with notmuch-hello-nice-number
Without this little patch notmuch fails if asked to display a saved
search that has zero results

Edited-by: David Edmondson <dme@dme.org>: With code that is a little
more "emacsy".
2010-10-29 15:49:01 -07:00
David Edmondson
f99ad42da0 emacs: Re-work the implementation of highlighting in notmuch-search-mode.
Re-write `notmuch-search-color-line', with the following improvements:
 - create overlays only if they will be needed,
 - merge the properties specified for a tag on top of any matching a
   previous tag.
2010-10-29 15:30:43 -07:00
Carl Worth
b11ecf613a emacs: Fix the autoload comments
Remove them from non-top-level entry points, (such as the functions to
set notmuch modes and the deprecated notmuch-folder function). And add
one to the notmuch-hello function. Also, add missing documentation
string to notmuch-hello.
2010-10-29 15:27:01 -07:00
David Benjamin
adbfff40ca Don't involve the shell in notmuch searches
The shell isn't needed to interpret any of the arguments, so don't
bother using it at all.

Signed-off-by: David Benjamin <davidben@mit.edu>
2010-10-29 14:13:51 -07:00
Carl Worth
294b6a67c1 emacs: Use copy-sequence instead of copy-seq.
I don't see copy-seq documented within emacs at all, and some users
have encountered failures of the form:

notmuch-show-del-tags-worker: Symbol's function definition is void: copy-seq

This should eliminate that problem.
2010-10-28 11:35:58 -07:00
Carl Worth
6d93d2090d emacs: Eliminate duplicate From header in replies.
The original code was intended to work, but clearly wasn't tested. Use
mail-header (as in existing code) to extract a header from a header alist.

This fixes the duplicate-from-line bug that is exercised by the test
just added to the test suite.
2010-10-27 18:44:05 -07:00
Carl Worth
c9e0da3a1a emacs: Eliminate warning of calling function with excess arguments.
Yet another case of "how could this have possibly worked before?!".

I guess we were just getting very lucky with the emacs lisp calling
conventions and what happens with extra arguments, but, ick! Much
better now.
2010-10-27 18:04:38 -07:00
Carl Worth
75f703e7c2 emacs: Remove non-interactive call of goto-line
As the emacs compiler warns, the goto-line function is only intended for
interactive use. Instead use the approach recommended in the goto-line
documentation to avoid this.
2010-10-27 17:58:19 -07:00
Carl Worth
4ddb5ab4dd emacs: Fix to eliminate warning in notmuch-query-map-aux
This is one of those cases where the warning looks absolutely correct,
(complaining about a free variable), but I'm left wondering how the
original code could have worked at all.

From what I can tell, this code wasn't actually being called by any
of the current code in notmuch.
2010-10-27 17:54:38 -07:00
David Edmondson
c506e1034b emacs: Avoid runtime use of `cl'.
The GNU Emacs Lisp Reference Manual section D.1 says:

> *  Please don't require the cl package of Common Lisp extensions at
>    run time. Use of this package is optional, and it is not part of
>    the standard Emacs namespace. If your package loads cl at run time,
>    that could cause name clashes for users who don't use that package.
>
>    However, there is no problem with using the cl package at compile
>    time, with (eval-when-compile (require 'cl)). That's sufficient for
>    using the macros in the cl package, because the compiler expands
>    them before generating the byte-code.

Follow this advice, requiring the following changes where `cl' was
used at runtime:

- replace `rassoc-if' in `notmuch-search-buffer-title' with the `loop'
  macro and inline code. At the same time find the longest prefix
  which matches the query rather than simply the last,
- replace `union', `intersection' and `set-difference' in
  `notmuch-show-add-tag' and `notmuch-show-remove-tag' with local code
  to calculate the result of adding and removing a list of tags from
  another list of tags.
2010-10-27 17:41:50 -07:00
Rob Browning
b67c3ed609 Move notmuch-fcc-header-setup to message-header-setup-hook.
Call notmuch-fcc-header-setup from message-header-setup-hook rather
than message-send-hook.  This allows you to see what's going to
happen, and to make manual adjustments if desired.  Gnus does
something similar.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
2010-10-27 17:36:02 -07:00
Carl Worth
36dcbdeff6 emacs: Explicitly set the From address when composing a new message.
Previously, underlying emacs code was setting this header. Now, we do the
right thing and query the notmuch configuration for the default value here.
2010-10-27 17:04:48 -07:00
Carl Worth
a3883a7e17 emacs: Enable FCC (to a directory named "sent") by default.
Now that the FCC code is fixed to use the notmuch database path, we can
actually enable this by default, which should be highly useful for all
new users of notmuch.
2010-10-27 17:02:44 -07:00
Carl Worth
8b6f3e3f45 emacs: Change FCC to be relative to notmuch mail store, not message-directory
Otherwise, FCC is too hard to use, (user must set it and also set message-
directory variable to match notmuch mail datbase path). As a rule, I'd like
for users of notmuch to not be required to muck around with non-notmuch
mail settings in emacs.

The above is only really possible now thanks to the recent addition of the
"notmuch config get" command which allows emacs to query the currently
configured notmuch database path.

This also now allows an absolute-path FCC to be set if desired.
2010-10-27 16:27:43 -07:00
Carl Worth
4606ea60a7 emacs: Fix quoting of Message-Id to fix test case of Id containing ".."
If Xapian sees unquoted ".." as in id:123..456 then it thinks that's a
range specification. We avoid this problem by instead passing
id:"123..456" to Xapian.
2010-10-22 17:41:40 -07:00
Carl Worth
ca956552bd emacs: Remove the joke from the first line of the notmuch-hello view.
Overuse just makes the joke unfunny.
2010-10-22 12:12:22 -07:00
Carl Worth
1a17faf48d emacs: Fix notmuch-hello to not break when given a very narrow window.
Simply ensure that some subtractions never result in a negative
number, (since emacs complains when asked to create a string with a
negative length).
2010-10-22 12:03:34 -07:00
Carl Worth
31a5e5a125 emacs: Fix bug when parsing a subject cotaining: \[[0-9/]\]
That is, a subject with a bracketed set of digits (and optionally a
slash), for example "[2010]" would cause the emacs code to misparse
the search results. Fix this by tweaking the regular expression.
2010-09-23 13:21:03 -07:00
Carl Worth
4e77148a4b emacs: Allow '|' to operate on multiple messages (by means of prefix argument).
We extend the '|' command so that passing a prefix argument, (for
example, "C-u |"), causes it to pipe all open messages in the current
thread rather than just the single, current message.
2010-09-16 15:52:12 -07:00
Carl Worth
c8da979352 emacs: Fix line-wrapping for help message of notmuch-show mode.
This was previously wrapped for unsubtituted command names. It looks
much better in the notmuch-help (available with '?') if wrapped
according to the length of the substituted command names.
2010-08-19 15:09:55 -07:00
Carl Worth
42e146a3a2 Add C-tab binding in notmuch-search mode as well.
We recently added this to notmuch-hello mode so we might as well
support it in this mode as well for consistency.
2010-06-04 17:16:53 -07:00
David Edmondson
0109f67e38 emacs: Tags should be shown with `notmuch-tag-face'.
Use the same face for tags in `notmuch-show' mode as that used in
`notmuch-search' mode.
2010-06-03 19:13:23 -07:00
David Edmondson
17b09af228 emacs: In search mode, truncate authors using invisible text.
Rather than discarding authors when truncated to fit the defined
column width, mark the text beyond the end of the column as invisible
and allow `isearch' to be used over the text so hidden.

This allows us to retain the compact display whilst enabling a user to
find the elided text.
2010-06-03 19:12:23 -07:00
David Edmondson
f2525ed18f emacs: Adjust comment to avoid confusing font-lock.
Comments with an open bracket in the first column confuse `font-lock'
mode, so avoid them.
2010-06-03 19:11:15 -07:00
David Edmondson
fc37771a71 emacs: Allow the display of absolute dates in the header line.
Add `notmuch-show-relative-dates' to control whether the summary line
in `notmuch-show' mode displays relative dates (e.g. '26 mins. ago') or
the full date string from the message. Default to `t' for
compatibility with the previous behaviour.
2010-06-03 19:09:18 -07:00
Nelson Elhage
35343710a2 emacs: Bind <backtab> (shift-TAB) to notmuch-show-previous-button
Shift-TAB is standard "opposite" of TAB -- in GUI interfaces they
typically cycle through input elements in opposite orders -- so it
makes sense to behave the same way.

Signed-off-by: Nelson Elhage <nelhage@ksplice.com>
2010-06-03 18:17:03 -07:00
David Edmondson
5ebf5efcb0 emacs: More functionality for `notmuch-wash-tidy-citations'.
Add:
- Insert a blank line before a citation if there isn't one,
- Insert a blank line after a citation if there isn't one.
2010-06-03 18:17:03 -07:00
David Edmondson
636925b40b emacs: Pretty print the numbers of matching messages.
Insert a separator every three digits when outputting numbers. Allow
the user to choose the separator by customizing
`notmuch-decimal-separator'. Widen the space allocated for message
counts accordingly.
2010-06-03 18:17:03 -07:00
Nelson Elhage
9ccd978665 emacs: notmuch-hello: Make widget-keymap a parent of notmuch-hello-keymap
This lets us pick up later changes to widget-keymap if the user
customizes it in some way. This is the recommended way to use
`widget-keymap', according to its help.
2010-06-03 18:17:03 -07:00
Sebastian Spaeth
e229bfa5aa add missing docstring for functions
The '?' key bindings uses them for the help window and these are
currently empty.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2010-06-03 18:17:03 -07:00
Sebastian Spaeth
a56010ac8b Make notmuch-hello a mode.
This enables the nifty '?' key binding to work in notmuch-hello
(although for some strange reasons I don't see any descriptions for
specific key bindings yet. Not sure how that is supposed to work
though.
But this starts, runs and behaves identical to the existing code.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2010-06-03 18:17:03 -07:00
Sebastian Spaeth
5bc4ff4e1d emacs: Remove notmuch-hello-roundup function
as it does the same as (ceiling number divisor) which is already provided in elisp.
2010-06-03 18:17:03 -07:00
David Edmondson
0ffea4297f emacs: In hello mode, bind `C-tab' to move backwards through widgets.
`C-tab' is now the inverse operation to `tab'.
2010-06-03 17:08:27 -07:00
Sebastian Spaeth
c9eb047c6c emacs: Reuse rather than reinvent message header filtering
In notmuch-mua-reply we were filtering out the Subject and To headers
manually in a loop, but message mode offers a nice function for
exactly that. Simplify the code by using it. Also, as notmuch-mua-mail
already sorts and hides headers that we want sorted and hidden, we can
safely remove those 2 functions from here as well.  Also remove the
(require 'cl), the only reason for its existence was the now removed
"loop" function.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2010-06-03 17:05:33 -07:00
David Edmondson
251d57f56b emacs: Allow tuning of the tag/saved search layout.
Add `notmuch-column-control', which has three potential sets of
values:

- t: automatically calculate the number of columns per line based on
  the tags to be shown and the window width,
- an integer: a lower bound on the number of characters that will be
  used to display each column,
- a float: a fraction of the window width that is the lower bound on
  the number of characters that should be used for each column.

So:
- if you would like two columns of tags, set this to 0.5.
- if you would like a single column of tags, set this to 1.0.
- if you would like tags to be 30 characters wide, set this to
  30.
- if you don't want to worry about all of this nonsense, leave
  this set to `t'.
2010-06-03 17:04:11 -07:00
David Edmondson
55cef18f95 emacs: Allow control over faces for search mode columns.
Add face declarations for the date, count, matching author and subject
columns in search mode and apply those faces when building the search
mode display.

Approved-by: Jameson Rollins <jrollins@finestructure.net>
2010-06-03 16:55:27 -07:00
David Edmondson
965b3e6a8b emacs: Set the face' property rather than font-lock-face'.
Avoid using face properties reserved for the font-lock package.
2010-06-03 16:53:36 -07:00
David Edmondson
106f9862d1 emacs: Display non-matching authors with a different face.
In search mode some messages don't match the search criteria. Show
their authors names with a different face - generally darker than
those that do match.
2010-06-03 16:53:32 -07:00
Sebastian Spaeth
fc73737ff5 Easier way to define a fcc directory
In the common case that a user only has one FCC (save outgoing mail in
the Mail directory, it is now possible to simply configure a string
such as "Sent" in the notmuch-fcc-dirs variable. More complex options,
depending on a users email address, are possible and described in the
variable customization help text.

The whole function notmuch-fcc-header-setup has been cleaned up a
little while working on that.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2010-06-03 16:50:46 -07:00
David Edmondson
6039864ed5 emacs: Usability improvements for `notmuch-hello'.
- If no saved searches exist or are displayed, don't signal an error,
- If no saved searches exist or are displayed, leave the cursor in the
  search bar,
- Minor layout improvements.
2010-06-03 16:49:03 -07:00
Jesse Rosenthal
b749bd5390 Add notmuch-message.el to emacs/Makefile.local
When notmuch-message.el was added to the emacs directory, I neglected to
add it to the makefile as one of the emacs_sources. This patch adds it.
2010-04-27 10:19:09 -07:00
Jesse Rosenthal
80a9078716 emacs: Remove conditional from notmuch-fcc-initialization.
The fcc code would only initialize if notmuch-fcc-dirs was set. This was
a problem if you reset the variable, or added the variable later during
initialization. Now we always add the fcc hook, but it doesn't do
anything unless notmuch-fcc-dirs are set.
2010-04-27 09:42:40 -07:00
Jesse Rosenthal
a43ceef205 emacs: require notmuch-message.el from notmuch.el
Add a (require 'notmuch-message) to notmuch.el. This is for functions that
specifically target message mode (and, in the future, notmuch-message
mode).
2010-04-27 09:16:44 -07:00
Jesse Rosenthal
0adcabc7cf emacs: Add auto-tagging for replied messages.
Add `notmuch-message-mark-replied', a function for automatically tagging
replied messages with user-defined tags. The tags (which can be either
added or removed) can be customized with the customization variable
`notmuch-message-replied-tags'. This is a simple list of strings. Any
string prefaced with a "-" will be removed; any string prefaced with a "+"
(or neither "+" nor "-") will be added.

This adds a new file notmuch-message.el, for functions which target
message mode (and in the future, notmuch-message mode). Based on some
conversation, notmuch-message.el will probably end up subsuming
notmuch-mua.el, but until we figure out exactly how we want to do that,
they will remain separate files.

Edited-by: Carl Worth <cworth@cworth.org>: Remove trailing whitespace
and add newline at end of file.
2010-04-27 09:16:10 -07:00
Carl Worth
7d440c56c1 emacs: Add missing parenthesis that was breaking the build.
Someday I'll stop pushing patches without at least compile-testing them.
*sigh*
2010-04-27 08:42:11 -07:00
David Edmondson
43423e9c88 emacs/notmuch-wash.el: Add `notmuch-wash-convert-inline-patch-to-part'.
Detect inline patches and convert them to fake attachments, in order
that `diff-mode' highlighting can be applied to the patch. This can be
enabled by customising `notmuch-show-insert-text/plain-hook'.
2010-04-27 08:22:40 -07:00
David Edmondson
08561d8ae1 emacs: Fix `notmuch-hello-insert-tags' to correctly draw the tags.
The fix in 1e18711543 broke end-of-row
wrapping when drawing the table of tags/saved searches. Fix that and
improve the readability of the matrix reflection code to hasten future
debugging.
2010-04-27 08:20:24 -07:00
David Edmondson
18d41192d2 emacs: If 'all tags' is not shown, don't use it when calculating widths.
If the 'all tags' section of the hello buffer will not be shown, don't
consider those tags when determining the number of saved searches that
can be displayed on a single line.
2010-04-27 08:19:39 -07:00
David Edmondson
1e18711543 emacs: Fix column alignment in `notmuch-hello-insert-tags'
Re-working the saved search/tag insertion to buttonize only the name
of the saved search/tag plus one space broke the calculation of how
much filler is required to complete the column, resulting in lines
wider than the window.
2010-04-27 01:56:13 -07:00
Carl Worth
3dac7305c2 emacs: Use message-signature-separator rather than hard-coded string.
It's possible that the user has instructed message-mode to use some
other separator. If so, then that's what we should look for when
looking for the signature.

Thanks to David Edmondson <dme@dme.org> for pointing this out.
2010-04-26 23:12:58 -07:00
Carl Worth
173a195da9 emacs: Delete some trailing whitespace.
That managed to sneak in with some recent improvements to the Fcc code.
2010-04-26 23:09:08 -07:00
Jesse Rosenthal
24a7a10af2 emacs: Ensure that message-directory for Fcc has a trailing slash
Use `file-name-as-directory' to ensure that message-directory has a
trailing slash so it can be combined with the notmuch-fcc-dirs
correctly.
2010-04-26 23:06:54 -07:00
Jesse Rosenthal
07c8eb1db6 emacs: add prompt to create maildir for fcc if it does not exist.
If the user specifies a maildir that does not exist, prompt the user to
see whether a maildir should be created. This will fail, with the
relevant explanation, if the location is not writable, or if a file
already exists in that location. If the location is a dir, but not a
maildir, this will add /tmp/cur/new to it.
2010-04-26 23:06:50 -07:00
Jesse Rosenthal
9b85872ed4 emacs: fcc should fail at the right time if it doesn't point to a maildir
Throw an error after the maildir is generated but before the message
is sent. This change allows the user to edit the maildir if it fails,
so that it will point to a correct place.

Note that this changes the previous behavior which always overwrote
the existing Fcc line. Now, an Fcc line is only auto-generated if
there isn't one already there.

The ideal change would be to prompt to create a maildir. This should
enable a place for doing that in a future patch.
2010-04-26 23:06:36 -07:00
Carl Worth
0d8e26d0e3 emacs: Tweak search-buffer naming to search list in reverse order
The complete-string matching of commit
f2ebe3ac44
defeats the substitution of partial search
strings when the user manually types a
long search string that just happens to
partially match a saved search.

For example, typing "tag:inbox and not tag:foo"
should result in "[inbox] and not tag:foo" but
this has been broken since that commit.

As a compromise between this feature and what the
commit was trying to achieve, we now reverse the
saved-searches list before looking for a match.
This happens to work for me, but won't necessarily
work in general.

What we really want is the longest match, but rassoc-if
just gives us the first match. All of this is just about
creating slightly nice search-buffer names. So if anyone
really cares about making the names *even* nicer, then
they could improve this further.
2010-04-26 23:00:20 -07:00
Carl Worth
6731ab1037 emacs: Rename search buffers with "saved-search" not "folder"
Since we recently renamed everything from notmuch-folders to
notmuch-saved-searches, fix up the generated names in the search
buffers to match.
2010-04-26 22:58:46 -07:00
Carl Worth
f2ebe3ac44 emacs: Match entire saved-search when computing search-view buffer name
I happen to have a lot of saved searches that are variants of the
tag:inbox search, (such as "tag:inbox and tag:notmuch"). The logic for
these was always matching inbox first, resulting in "[ inbox ] and
tag:notmuch" rather than "notmuch" as desired.

Anchor the regular expression on both ends to make it look harder for
the better match.
2010-04-26 22:49:45 -07:00
Carl Worth
a466921760 emacs: Rip out all of the notmuch-folder code.
We are asserting that the new notmuch-hello implementation, (available
by just calling `notmuch') is just as easy to use as the old
notmuch-folder. So let's remove what's now a largely redundant
implementation.

To make this transition easier, we are still supporting the
notmuch-folders variable name, and we still provide `notmuch-folder'
as an alias which can be invoked to get the new notmuch-hello
functionality.
2010-04-26 22:42:07 -07:00
Carl Worth
fa5279113b emacs: Fix notmuch-hello to use its own function for counting search results.
Previously, this was calling into a notmuch-folder-count
function. Only, everything related to notmuch-folder is about to go
away, so lets have notmuch-hello define its own function
(notmuch-saved-search-count) for this purpose.
2010-04-26 22:40:31 -07:00
Carl Worth
f1f7e71e03 emacs: Add a notmuch-saved-searches function.
We use this function to abstract away the common 3-step process for
looking for a value for the saved-searches variable:

	1. Look at the notmuch-saved-searches variable itself
	2. Look at the notmuch-folders vaiable
	3. Use a default value

We were already using this logic (open-coded) in notmuch-hello, but
notmuch.el was accessing notmuch-folders directly for the clever name
selection of search buffers.
2010-04-26 22:37:11 -07:00
Carl Worth
4727eacb36 emacs: Move declare-function from notmuch-lib.el to notmuch-hello.el.
Apparently the declare-function macro doesn't work in a required file
as I might like it too. Put it where it needs to go to avoid the
warning.
2010-04-26 22:33:09 -07:00
Carl Worth
f8e372ebec notmuch-hello: Add a 'G' keybinding.
Just like the G keybinding we've had in notmuch-folder-mode and
notmuch-search-mode, (to call `notmuch-poll' to 'G'et new mail).
2010-04-26 22:05:47 -07:00
Carl Worth
2a6a0e2481 notmuch-hello: Make this work with a notmuch-folders variable set in ~/.emacs
I'm planning to rip out the notmuch-folder-mode completely. So as a
token kindness to existing users of notmuch-folders, I'm at least
making notmuch-hello support the notmuch-folders variable name as an
alternate for the new name of notmuch-saved-searches.
2010-04-26 21:55:51 -07:00
Carl Worth
51e5eaac17 emacs: Remove "hello" from all variables exported through customize.
We've recently changed things so that the notmuch-hello screen is the
default view one gets by executing `notmuch'. So hide the "hello" name
from everything exposed in the customize interface, (leaving "hello"
as just an internal name within the implementation).
2010-04-26 21:45:19 -07:00
Carl Worth
404c6121e5 notmuch-hello: Fix a sign error when computing number of padding spaces.
After the previous commit, toggling the visibility of tags could
result in notmuch-hello aborting with:

	Wrong type argument: wholenump, -1

At least, the error only occurred for me when making tags visible. But
that may be because my longest tag name is longer than my longest
saved-search name.
2010-04-26 20:51:31 -07:00
Carl Worth
ca5ae54cb1 notmuch-hello: Fix ability to isearch to a saved-search and press RET
After isearching for an entire saved-search name, the point will be
immediately after that name in the buffer. Before commit
c9ba61bebe the space right after the
name was part of the widget so the user could press RET right after
the isearch to activate the saved search.

The above commit broke that functionality. Restore it by including a
single space after each name as part of the widget.
2010-04-26 20:15:45 -07:00
Carl Worth
7df0e611df emacs: notmuch-hello: Make viewing of all tags conditional.
And off by default. There's a notmuch-hello-show-tags option in
customize to toggle the default setting, as well as buttons to
persistently toggle the visibility for the current session.

I have enough tags in my database that it's quite a bit faster for
notmuch-hello to come up without showing the tags.
2010-04-26 20:08:30 -07:00
Carl Worth
7fa6306cae notmuch-hello: Preserve current position when invoking notmuch-hello
Previously, we preserved the current position only when returning to
the notmuch-hello buffer or when refreshing it. Fix to also preserve
the position when directly invoking notmuch-hello, (such as from a
global keybinding).
2010-04-26 19:43:21 -07:00
Carl Worth
3ac2727dae emacs: notmuch-hello: Move to first saved search item.
This give us a useful active widget by default, ("inbox"), and
otherwise gives the first saved search in the user's customized
list. Not having point on the search bar means that the various
keybindings are all available.
2010-04-26 18:54:08 -07:00
Carl Worth
f2f6da9af0 emacs: Fix 's' keybinding to go to search bar in notmuch-hello.
This command was previously written under the fragile assumption that
the search bar was always the third widget. That's no longer true with
the saved searches now appearing before the search bar, so we save the
position of the search bar and go directly to it now.
2010-04-26 18:54:08 -07:00
Carl Worth
b5c71adc8f emacs: Move saved searches before search bar in notmuch-hello.
Once users start using saved searches regularly, it's expected that
these will become the primary access points to mail. So give them a
priority position in the buffer.
2010-04-26 18:54:08 -07:00
Carl Worth
1c17dda5d5 emacs: Remove the notmuch-hellow-jump-to-search variable.
Instead, make notmuch-hello unconditionally jump to the first widget
in the buffer. By default this will be the search bar anyway.
2010-04-26 18:40:55 -07:00
Carl Worth
652e92c6cc emacs: Take advantage of position-remembering when returning to notmuch-hello
When we go into a search, and then later quit and return to the
notmuch-hello buffer, we want the point to remain in the same position
it was in when we left. So we have to call the position-remembering
notmuch-hello-update rather than notmuch-hello from the continuation.
2010-04-26 18:00:37 -07:00
Carl Worth
ddce8438a0 emacs: Make update of notmuch-hello leave point on the same widget.
Before refreshing, we check which widget we are currently on, (or look
for the next widget), and then we watch for that same widget to go by
when constructing the buffer contents. Finally, we jump to the
position we saw when the widget went by.
2010-04-26 17:59:01 -07:00
Carl Worth
c9ba61bebe emacs: notmuch-hello: Don't include extra spaces in widget values.
Previously, trailing spaces after each saved-search name were included
as part of the widget. This is going to be problematic for a future
change that will extract the widget's value and compare it to the
configured names of saved searches.

Instead, just include the name itself in the widget, and then insert
the spaces for separation afterwards.
2010-04-26 17:55:55 -07:00
Carl Worth
8a6a00bf4c emacs: Disable automatic jump to search bar for notmuch-hello.
We're about to get support for maintaining point on the current
saved-search, so we don't want this jump-to-search defeating that.
2010-04-26 17:51:27 -07:00
Dirk Hohndel
56cbff2988 Put signatures at the very end of the message
The existing code inserts the signature before inserting the message
body (which it puts at the very end of the buffer - therefore AFTER
the signature). This little snippet makes us search backwards and
insert the message body before a signature, if it exists.

This also fixes a small indentation issue in David's code.

Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
2010-04-26 16:37:47 -07:00
Carl Worth
2b49f4631c emacs: Fix to generate error if fcc directory is not a maildir
Previously this was just a message that was almost impossible for the
user to see. Now, the user gets to see the error message, and is
presented with a buffer that actually contains the Fcc header of
interest.
2010-04-26 14:56:46 -07:00
Sebastian Spaeth
4b34effca5 Integrate notmuch-fcc mechansim
I have gone wild and added a defcustom "notmuch-fcc-dirs".
Depending on the value of that variable we will not do any
maildir fcc at all (nil, the default), or it is of the format
(("defaultsentbox")
 ("full name <email@address>" . "Work/sentbox")
 ("full name2 <email2@address2>" . "Work2/sentbox"))

The outbox name will be concatenated with the message mode
variable "message-directory" which is "~/Mail/" by default.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2010-04-26 12:00:13 -07:00
Sebastian Spaeth
c000c4b394 notmuch-maildir-fcc: elisp syntax fixes
1)use insert-buffer-substring

Rather than the insert-buffer. Emacs complains that it is for interactive use
and not for use within elisp. So use insert-buffer-substring which does the
same thing when not handed any 'begin' 'end' parameters.

2)replace caddr with (car (cdr (cdr)))

The former requires 'cl to be loaded and during make install emacs complained
about not knowing it.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2010-04-26 11:58:43 -07:00
Sebastian Spaeth
36245db69d Integrate notmuch-maildir-fcc into notmuch
Require notmuch-maildir-fcc and also install it.
Rename all jkr/* functions to notmuch-maildir-fcc-*

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2010-04-26 11:58:34 -07:00
Jesse Rosenthal
1775893720 Add elisp file for FCC to maildir solution
File grabbed from http://jkr.acm.jhu.edu/jkr-maildir.el
but not integrated yet.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2010-04-26 11:54:15 -07:00
David Edmondson
b66ff567f6 emacs: Tell the user how many addresses matched when completing
When completing an address, tell the user how many addresses in the
database matched the query.

Edited-by: Carl Worth <cworth@cworth.org>: Removed a stray numeric
literal that was causing a compiler warning.
2010-04-26 10:58:42 -07:00
David Edmondson
975307c945 emacs: Remove duplicate declaration of `notmuch-folders'
Reviewed-by: Carl Worth <cworth@cworth.org>

This variable was moved from notmuch.el to notmuch-lib.el some time
ago, but the declaration in notmuch.el was left around. Clean that up.
2010-04-26 10:45:05 -07:00
David Edmondson
98cf886120 emacs: notmuch' should display the notmuch-hello' interface
Reviewed-by: Carl Worth <cworth@cworth.org>

The notmuch-hello functionality is now sufficiently useful that we
want to make it the default view of notmuch for new users. This also
effectively hides the "hello" name from the user, so we'll be free to
change that in the implementation if necessary.

This change also shuffles the requires between notmuch.el and
notmuch-hello.el. This fixes things so that our documented (require
'notmuch) is sufficient for getting the notmuch-hello functionality.

Finally, the shuffling caused the notmuch-search-oldest-first variable
from one file to the other. While doing that, give this variable the
defcustom treatment for easier customization.
2010-04-26 10:37:35 -07:00
David Edmondson
159b05fcaa emacs: Fix `notmuch-show-rewind' in the presence of invisible text
When determining whether or not to re-align the head of the current
message with the top of the window, use `count-screen-lines' rather
than `count-lines' to allow for invisible text in the preceding
message. When comparing that number of lines against
`next-screen-context-lines', realign if the number of lines of the
previous message visible is 'smaller than or equal to' rather than
just 'smaller than' to improve usability.
2010-04-26 10:33:38 -07:00
David Edmondson
e247ae47c1 emacs: More DWIM when editing messages
For composing new messages and forwarding, leave the cursor on the
'To:' field. For replies, leave the cursor at the start of the
body. In all cases, mark the buffer as not modified so that the user
is not prompted if she decides to immediately kill the buffer.
2010-04-26 10:24:36 -07:00
David Edmondson
01ec4d3bcb emacs: Add more functions to clean up text/plain parts
Add:
- notmuch-wash-wrap-long-lines: Wrap lines longer than the width of
  the current window whilst maintaining any citation prefix.
- notmuch-wash-tidy-citations: Tidy up citations by:
  - compress repeated otherwise blank citation lines,
  - remove otherwise blank citation lines at the head and tail of a
    citation,
- notmuch-wash-elide-blank-lines: Compress repeated blank lines and
  remove leading and trailing blank lines.

None of these is enabled by default - add them to
`notmuch-show-insert-text/plain-hook' to use.

Reviewed-by: Carl Worth <cworth@cworth.org>: I previously committed a
stale version of this patch.
2010-04-26 10:05:46 -07:00
Carl Worth
6408270512 Revert "emacs: Add more functions to clean up text/plain parts"
This reverts commit 97570954cb.
2010-04-26 10:05:29 -07:00
David Edmondson
6afa0b16a3 emacs: Fix `notmuch-search-insert-field'
Compare the formatted version of the authors with the formatted sample
string rather than the un-formatted authors with the formatted sample
string.
2010-04-26 08:23:48 -07:00
David Edmondson
e2516a343b emacs: Hide the "User-Agent:" when composing messages
Add a list of headers to those hidden by `message-mode' when
composing. By default the list includes only "User-Agent:".
2010-04-26 08:23:05 -07:00
David Edmondson
87d9df50e5 emacs: Automatically load "notmuch-address"
"notmuch-address.el" tries to be careful to insinuate itself into
message mode only if it will do something useful, so it's safe to load
it all of the time.
2010-04-26 08:10:47 -07:00
David Edmondson
75b9b028ea emacs: Correct message/header/citation/signature hiding
Set `buffer-invisibility-spec' to `nil' (a list) if it is just `t'
before inserting any body parts, otherwise removing items from
`buffer-invisibility-spec' (which is what
`notmuch-show-headers-visible' and `notmuch-show-message-visible' do)
is a no-op and has no effect. This caused threads with only matching
messages to have those messages hidden initially because
`buffer-invisibility-spec' stayed `t'.
2010-04-26 08:07:17 -07:00
David Edmondson
a9bf967e71 emacs: Add a search to the 'recent searches' list once only
Avoiding adding the same search string to the 'recent searches' list
more than once by testing whether the string was already used with
`member' rather than `memq'.
2010-04-26 07:31:26 -07:00
David Edmondson
d6dea89588 emacs: Remove the accelerator keys from the hello buffer
Carl though that the recent search accelerator keys are not useful, so
remove them.
2010-04-26 07:31:15 -07:00
David Edmondson
7b31a11f20 emacs: Adapt the logo background colour to that of the frame
The notmuch logo uses transparency. That can display poorly when
inserting the image into an emacs buffer (black logo on a black
background), so force the background colour of the image. We use a
face (`notmuch-hello-logo-background') to represent the colour so that
`defface' can be used to declare the different possible colours, which
depend on whether the frame has a light or dark background.
2010-04-26 07:30:33 -07:00
David Edmondson
38c35f8123 emacs: Sort headers when composing
Always sort the headers in the message composition window.
2010-04-26 07:15:50 -07:00
David Edmondson
47f5871aff emacs: Suppress window creation when replying
The buffer used to edit a reply should overlay the original
message. Encourage this by setting `same-window-regexps' locally.
2010-04-26 07:15:42 -07:00
David Edmondson
97570954cb emacs: Add more functions to clean up text/plain parts
Add:
- notmuch-wash-wrap-long-lines: Wrap lines longer than the width of
  the current window whilst maintaining any citation prefix.
- notmuch-wash-tidy-citations: Tidy up citations by:
  - compress repeated otherwise blank citation lines,
  - remove otherwise blank citation lines at the head and tail of a
    citation and remove blank lines between attribution statements and
    the citation,
- notmuch-wash-compress-blanks: Compress repeated blank lines and
  remove leading and trailing blank lines.

Enable `notmuch-wash-tidy-citations' and
`notmuch-wash-compress-blanks' by default by adding them to
`notmuch-show-insert-text/plain-hook'. `notmuch-wash-wrap-long-lines'
is not enabled by default.

If `notmuch-wash-wrap-long-lines' is enabled, word wrapping of the
buffer leads to an unappealing display of text, so provide a function
to disable it and add it to the list of `notmuch-show-mode' hook
functions.
2010-04-24 07:52:37 -07:00