Commit graph

106 commits

Author SHA1 Message Date
David Edmondson
647c250989 notmuch/emacs: Observe the charset of text/html parts, where known.
Add the charset of text/html parts to the JSON output of 'notmuch
-show' when it is known. Observe the encoding when rendering such
parts in emacs.
2012-01-13 21:45:21 -04:00
David Bremner
0bbfc5ce8b Merge branch 'release'
Conflicts:
	notmuch-reply.c
	notmuch.1
2012-01-13 20:52:01 -04:00
Jameson Graef Rollins
74bced62b4 emacs: fix notmuch-show-indent-messages-width customization variable name
The name was originally notmuch-indent-messages-width, which is
inconsistent with our variable naming convention.
2012-01-05 17:48:46 -04:00
David Edmondson
641399fa2c emacs: Enable more text/plain hook functions by default.
Users are missing out on various functions which usefully improve the
display of text/plain message parts because they are not enabled by
default. Enable a useful set.

`notmuch-wash-convert-inline-patch-to-part' is _not_ enabled by
default as it is based on a heuristic.
2011-12-28 13:28:54 -04:00
Jani Nikula
d5d39a92f1 emacs: add inline patch fake parts through a special handler
Add wash generated inline patch fake parts through a special
"inline-patch-fake-part" handler to distinguish them from real MIME
parts. The fake parts are described as "inline patch (as text/x-diff)".

Signed-off-by: Jani Nikula <jani@nikula.org>
2011-12-28 08:18:13 -04:00
Jameson Graef Rollins
c0d694035d emacs: call notmuch-show instead of notmuch-search in buttonised id: links
Since message-ids necessarily match just a single message, there's no
reason to do a search for the id before viewing the actual message;
the search just becomes an extra screen to click through.  Clicking on
an id: links now just jumps straight to the message itself.
2011-12-24 15:32:01 -04:00
Aaron Ecay
8392a7cc54 emacs: fix off-by-one bug in notmuch-show-archive
Text properties change between characters; prev-s-c-property-change
returns the position after the change.  Thus, it is still inside the
invisible region.
2011-12-23 08:29:04 -04:00
Aaron Ecay
e3260d0253 Don't quote lambda forms
This generates byte-compiler warnings on (at least) current trunk
versions of Emacs.  The quote is not necessary; lambda forms are
self-quoting.
2011-12-21 07:27:38 -04:00
Daniel Schoepe
3f02ba3406 emacs: Document notmuch-show-get-message-properties 2011-12-16 08:34:26 -04:00
Thomas Jost
430fb27b3e emacs: Add a face for crypto parts headers
Commit cb841878 introduced new parts handlers for crypto parts, but also
hardcoded values for their headers face. This replaces these hardcoded values
with a customizable face.
2011-12-15 22:51:24 -04:00
Dmitry Kurochkin
a647f43643 emacs: do not call notmuch show for non-inlinable parts
Before the change, there was a workaround to avoid notmuch show calls
for parts with application/* Content-Type.  But non-inlinable parts
are not limited to this Content-Type (e.g. mp3 files have audio/mpeg
Content-Type and are not inlinable).  For such parts
`notmuch-show-insert-part-*/*' handler is called which unconditionally
fetches contents for all parts.

The patch moves content fetching from `notmuch-show-insert-part-*/*'
to `notmuch-show-mm-display-part-inline' function after MIME inlinable
checks are done to avoid useless notmuch show calls.  The
application/* hack is no longer needed and removed.
2011-12-07 20:05:25 -04:00
Dmitry Kurochkin
2a349d739b emacs: remove unused variable in `notmuch-show-insert-part-message/rfc822'
An obvious cleanup.  I wonder why there was no warning about this
during compilation.
2011-12-07 20:00:24 -04:00
Dmitry Kurochkin
f1e75c724d emacs: remove some code duplication in notmuch-show
Add optional props argument to `notmuch-show-get-header'.  Use it to
get headers in `notmuch-show-insert-part-multipart/signed' and
`notmuch-show-insert-part-multipart/encrypted'.
2011-12-07 19:58:45 -04:00
Gregor Zattler
46eb1c116a emacs: make message indentation width customisable
Till now Emacs UI indents messages according to their respecive
depth of neting in the thread.  The actual width of indentation
per level is hardcoded to `1' space.
This patch makes message indentation customisable by introducing
a variable `notmuch-indent-messages-width' which defaults to `1',
which is the same as before.  Felix could set this variable to
`0' in order to disable indentation, I tested it with a value of
`4' for a clearer separation of messages in a thread.
2011-11-25 12:40:23 -05:00
Austin Clements
3a3f6f0ab5 emacs: Don't record undo information for search or show buffers.
There's no reason to record undo information for read-only,
programmatically-constructed buffers.  The undo list just chews up
memory keeping track of our calls to insert.
2011-11-24 08:31:44 -04:00
Jameson Graef Rollins
53629b5506 emacs: breakout notmuch-show-advance functionality from notmuch-show-advance-and-archive
This patch breaks out much of the functionality of
notmuch-show-advance-and-archive into a new function:
notmuch-show-advance.  This new function does all the advancing
through a show buffer that notmuch-show-advance-and-archive did,
without all the invasive thread archiving.  The return value of
notmuch-show-advance is nil if the bottom of the thread is not
reached, and t if it is.

notmuch-show-advance-and-archive is modified to just call
notmuch-show-advance, and then call notmuch-show-archive-thread if the
return value is true.  In this way the previous functionality of
notmuch-show-advance-and-archive is preserved.

This provides a way for people to rebind the space bar to a more sane
function if they don't like the default behavior.
2011-11-20 22:45:17 -04:00
Jameson Graef Rollins
edd2f3f0a8 emacs: add notmuch-show-worker function for specifying crypto processing directly
The main reason to introduce this new unexposed function is to allow
the buffer redisplay crypto switch to behaving in a more expected way.
The prefix to notmuch-show-redisplay buffer now switches the crypto
processing of the current show buffer, as opposed to switching the
logic of the notmuch-crypto-process-mime customization variable.  This
behavior is more intuitive.
2011-11-13 15:22:16 -04:00
Jameson Graef Rollins
b00e27bd99 emacs: add documentation for notmuch-show crypto-switch option 2011-11-13 15:21:58 -04:00
Pieter Praet
f9764bfacc emacs: add keybind and function to stash Message-ID without prefix
Add function `notmuch-show-stash-message-id-stripped'
which stashes a Message-ID after ripping off the prefix and quotes,
add bind it to "I" key in `notmuch-show-stash-map'.

Simplifying `notmuch-show-get-message-id' instead might seem better,
but that would require concat'ing in 9 places instead of 1.

Signed-off-by: Pieter Praet <pieter@praet.org>
2011-11-12 20:29:04 -04:00
Dmitry Kurochkin
8809e09dcc emacs: remove no longer used functions from notmuch-show.el
Remove `notmuch-show-move-past-invisible-backward' and
`notmuch-show-move-past-invisible-forward' functions which are
unused.
2011-11-07 20:38:37 -04:00
Dmitry Kurochkin
6e6cb68b80 emacs: improve hidden signatures handling in notmuch-show-advance-and-archive
Use `previous-single-char-property-change' instead of going
through each character by hand and testing it's visibility.  This
fixes `notmuch-show-advance-and-archive' to work for the last
message in thread with hidden signature.
2011-11-07 20:38:37 -04:00
Daniel Schoepe
4a4ada73b7 emacs: Turn id:"<message-id>" elements into buttons for notmuch searches
This fixes the minor annoyance that message ids were parsed as mail
addresses by goto-address-mode in notmuch-show buffers.
2011-10-28 14:12:19 -03:00
Jameson Graef Rollins
76fdca8f77 emacs: add notmuch-show-refresh-view function
This function, like the equivalent for notmuch-search, just refreshes
the current show view.  Like in notmuch-search, this new function is
bound to "=".  If a prefix is given then the redisplay happens with the
crypto-switch set, which displays the thread with the opposite logic
of whatever is set in the notmuch-crypto-process-mime customization
variable.
2011-10-06 10:33:21 -03:00
Jameson Graef Rollins
7d3aacbf14 emacs: Improve support for message/rfc822 parts.
The insert-part-message/rfc822 function is overhauled to properly
processes the new formatting of message/rfc822 parts.  The json output
for message parts now includes "headers" and "body" fields, which are
now parsed and output appropriately.
2011-09-05 22:58:52 -03:00
Carl Worth
580de27177 emacs: Fix to unconditionally display subject changes in collapsed thread view
The feature to show subject changes in the collapsed thread view was
originally added (8ab433607) with an option
(notmuch-show-always-show-subject) to display the subject
for all messages, even when there was no change.

The subsequent commit (4f04d273) changed the sense of the test (or to
and) and the name of the controlling variable
(notmuch-show-elide-same-subject).

But this commit is broken in a few ways:

  1. The original definition of notmuch-show-always-show-subject was
     left around

     But the variable isn't actually used in the code at all, so it
     just adds clutter and confusion to the customization interface.

  2. The name and description of the controlling variable doesn't
     match the implementation

     The name suggests that setting the variable to t will cause
     repeated subjects to be elided, (suggesting that when it is nil
     all subjects will be shown).

     However, when the variable is nil, no subjects are shown. So a
     correct name for the variable in this sense would be
     notmuch-show-subject-changes.

Showing subject changes is a useful feature, and should be on by
default. (We don't want to bury generally useful features behind
customizations that users have to find).

Rather than fixing the name of the variable and changing its default
value, here we remove the condition entirely, such that the feature is
enabled unconditionally.

So both the currently-used variable and the stale definition of the
formerly-used are removed.

Also, the one relevant test-suite result is updated, (showing the
intial subject of a collapsed thread, and no subject display for later
messages that do not change the subject).
2011-07-01 02:00:25 -07:00
Pieter Praet
432e091924 fix sum moar typos [user-visible documentation in code]
Various typo fixes in documentation within the code that can be made
available to the user, (emacs function help strings, "notmuch help"
output, notmuch man page, etc.).

Signed-off-by: Pieter Praet <pieter@praet.org>

Edited-by: Carl Worth <cworth@cworth.org> Restricted to just
documentation and fixed fix of "comman" to "common" rather than
"command".
2011-06-23 15:58:50 -07:00
Pieter Praet
8bb6f7869c fix sum moar typos [comments in source code]
Various typo fixes in comments within the source code.

Signed-off-by: Pieter Praet <pieter@praet.org>

Edited-by: Carl Worth <cworth@cworth.org> Restricted to just
source-code comments, (and fixed fix of "descriptios" to "descriptors"
rather than "descriptions").
2011-06-23 15:58:39 -07:00
Jameson Graef Rollins
2ba880d59e emacs: Show all multipart/alternative parts by default.
This is patch is a temporary work-around for a slight regression that
popped up in the part handling reorganization.  Currently, text/plain
parts are always preferred, if present, over other non-text/plain
parts in multipart/alternative.  However, this means that if there is
a blank text/plain part, no content will be displayed.

One way to get around this is to set the
"notmuch-show-all-multipart/alternative-parts" customization variable
to True ('t'), which will cause all parts to always be displayed.

Since we want to move forward with the next release, we're going to
set this variable true by default, to make sure that no content is
unretrievably hidden from the user.  Once we come up with a better
solution for easy display of hidden parts we can set this back to a
default value of 'nil'.
2011-06-22 22:28:12 -03:00
Dmitry Kurochkin
52f751fb74 Simplify message and headers visibility code in notmuch-show view.
Before the change, headers and message visibility functions took
extra care to correctly set `buffer-invisibility-spec'.  This was
needed because headers overlay `invisible' property had only
headers' invisibility spec.  So visibility of headers was
determined only by the headers invisibility spec.  The patch sets
headers overlay `invisible' property a list with both the headers
and the message invisibility spec.  This makes headers invisible
if either of them is added to the `buffer-invisibility-spec' and
allows to simplify the code.
2011-06-15 07:07:32 -07:00
Dmitry Kurochkin
4a9d0ac147 Set higher priority for headers and hidden citation overlays.
Before the patch, message, headers and hidden citation overlays
had zero priority.  All these overlay have `invisible' property.
Emacs documentation says that we should not make assumptions
about which overlay will prevail when they have the same priority
[1].  It happens to work as we need, but we should not rely on
undocumented behavior.

[1] http://www.gnu.org/s/emacs/manual/html_node/elisp/Overlay-Properties.html
2011-06-15 07:07:32 -07:00
Dmitry Kurochkin
7524b0650e Set message invisibility spec properties before inserting the body.
This would allow body-inserting code (in particular, wash
button-inserting code) to use message invisibility specs.
2011-06-15 07:07:32 -07:00
Dmitry Kurochkin
f43f760887 Pass message to the `notmuch-show-insert-text/plain-hook' hook.
Before the change, the `notmuch-show-insert-text/plain-hook' was
given only the `depth' argument.  The patch adds another one -
the message.  Currently, the new message argument is not used by
any on the hooks.  But it will be used later to get access to
message invisibility specs when wash buttons are inserted.
2011-06-15 07:07:32 -07:00
Dmitry Kurochkin
d1cbd833a7 Make `notmuch-show-clean-address' parsing-error-proof.
Mail-header-parse-address may fail for an invalid address.
Before the change, this would result in empty notmuch-show buffer
with an error message like: Scan error: "Unbalanced parentheses".
The patch wraps the function in condition-case and returns
unchanged address in case of error.
2011-06-03 14:08:26 -07:00
Jameson Graef Rollins
da3e47e377 emacs: fix notmuch-show-part-button to not include newline
This makes the button cleaner, so that it doesn't include the entire
rest of the line that the button is on.
2011-06-03 12:37:55 -07:00
Dmitry Kurochkin
a87a6b99f9 Don't re-compress .gz & al. in notmuch-show-save-part.
Write-region handles some file names specially, see Emacs Lisp
manual section 25.11 Making Certain File Names "Magic" [1].  This
is a nice feature for normal text editing, but it is not
desirable if we need to save raw file content (e.g. attachment).
In particular, this affects archives and may result in corrupted
attachments saved with notmuch-show-save-part (attachment button
click handler).

Turns out, smart GNUS folks encountered the same problem and
implemented write-region wrapper which inhibits some file name
handlers.  In particular, this wrapper is used in mm-save-part,
which is why notmuch-save-attachments that uses it works fine
with archives.

The patch replaces write-region with mm-write-region in
notmuch-show-save-part.  Also it removes coding-system-for-write
and require-final-newline setting in notmuch-show-save-part.  The
former is set in mm-write-region.  The latter seems to be
unneeded because mm-save-part does not use it.

[1] http://www.gnu.org/s/emacs/manual/html_node/elisp/Magic-File-Names.html
2011-05-31 15:04:52 -07:00
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
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
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