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
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.
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.
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.
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>
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).
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).
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).
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.
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
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>
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>
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>
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>
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>
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.
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).
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.
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.
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.
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.
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)
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.
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
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.
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.
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.
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).
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).
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.
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).
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.
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.
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)).