notmuch Debian 0.23.1-1 upload (same as 0.23.1)

-----BEGIN PGP SIGNATURE-----
 
 iQGcBAABCAAGBQJYDV+gAAoJEPIClx2kp54s1FYL/09BsSahXEqzhBAujcMock0o
 f0dPqpNu8oCV2KhGn4RtA5kmHdCR+T9fD/r9Tbjn24sLCmvPdg8X2tZbTAYg/FlG
 k1ql95evYJyWXGjJ9cjel5XKG7cpLGyk3M06/7SXu2EnwTR/73HPaq6S1UoBnhLi
 9btkZrWrM+md7IpkPaHN93Mq9ZWTxJAszRVOtLbFPem1wFXspt6jjdrvzR2zPkCC
 tzcthSH+J7Z9fcpCJOVdo2W/J7Lf0IbWZMblmz3iQVYotv9sVyTkSKSVLpaTG5bW
 Prb1Ln3H/pC+lyU41iM6EiT4xdIy3+lgAgwR3k1Bau8dXGkcYM2n0nn9Ajmh++Lq
 HFFwp69LcOtbyLobN/bralq6a9Sa01FvRauf0e2tmUAEg4A8X/Ikyxh6xRu9hOcU
 +milbKbIjLi7O1cpdjW7aUwbX6Hr6RhzbOBJAdN/Hjyx7NtabxPlr61CnWrN5aBH
 BHqDdYxaESoEybxfALSk1NLxnKT5qU/0iFddAfYI1Q==
 =FQ/W
 -----END PGP SIGNATURE-----

Merge tag 'debian/0.23.1-1' into jessie-backports

notmuch Debian 0.23.1-1 upload (same as 0.23.1)
This commit is contained in:
David Bremner 2016-11-02 08:09:24 -03:00
commit 39b6080f59
249 changed files with 4247 additions and 2586 deletions

8
.mailmap Normal file
View file

@ -0,0 +1,8 @@
Peter Feigl <craven@gmx.net>
Nate <nstraz@redhat.com>
Ali Polatel <alip@penguen.ev>
Stefan <aeuii@posteo.de>
Patrick Totzke <patricktotzke@googlemail.com>
Patrick Totzke <patricktotzke@gmail.com>
Patrick Totzke <p.totzke@ed.ac.uk>
Mark Walters <markwalters1009@gmail.com>

View file

@ -12,4 +12,4 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program, (in the COPYING-GPL-3 file in this
directory). If not, see http://www.gnu.org/licenses/
directory). If not, see https://www.gnu.org/licenses/

View file

@ -2,7 +2,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@ -646,7 +646,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
@ -665,12 +665,12 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/philosophy/why-not-lgpl.html>.

View file

@ -30,7 +30,7 @@ Talloc, and zlib which are each described below:
It provides all the real machinery of indexing and searching,
(including the very nice parsing of the query string).
Xapian is available from http://xapian.org
Xapian is available from https://xapian.org
Note: Notmuch will work best with Xapian 1.0.18 (or later) or
Xapian 1.1.4 (or later). Previous versions of Xapian (whether
@ -58,7 +58,7 @@ Talloc, and zlib which are each described below:
made development of Notmuch much easier and much less prone to
memory leaks.
Talloc is available from http://talloc.samba.org/
Talloc is available from https://talloc.samba.org/
zlib
----

View file

@ -10,7 +10,7 @@
# repository), we let git append identification of the actual commit.
PACKAGE=notmuch
IS_GIT=$(shell if [ -d ${srcdir}/.git ] ; then echo yes ; else echo no; fi)
IS_GIT:=$(if $(wildcard ${srcdir}/.git),yes,no)
ifeq ($(IS_GIT),yes)
DATE:=$(shell git --git-dir=${srcdir}/.git log --date=short -1 --pretty=format:%cd)
@ -35,7 +35,7 @@ DEB_TAG=debian/$(UPSTREAM_TAG)-1
RELEASE_HOST=notmuchmail.org
RELEASE_DIR=/srv/notmuchmail.org/www/releases
RELEASE_URL=http://notmuchmail.org/releases
RELEASE_URL=https://notmuchmail.org/releases
TAR_FILE=$(PACKAGE)-$(VERSION).tar.gz
DEB_TAR_FILE=$(PACKAGE)_$(VERSION).orig.tar.gz
SHA1_FILE=$(TAR_FILE).sha1
@ -44,7 +44,8 @@ GPG_FILE=$(SHA1_FILE).asc
PV_FILE=bindings/python/notmuch/version.py
# Smash together user's values with our extra values
FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CPPFLAGS) $(CFLAGS) $(WARN_CFLAGS) $(extra_cflags) $(CONFIGURE_CFLAGS)
STD_CFLAGS := -std=gnu99
FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CPPFLAGS) $(STD_CFLAGS) $(CFLAGS) $(WARN_CFLAGS) $(extra_cflags) $(CONFIGURE_CFLAGS)
FINAL_CXXFLAGS = $(CPPFLAGS) $(CXXFLAGS) $(WARN_CXXFLAGS) $(extra_cflags) $(extra_cxxflags) $(CONFIGURE_CXXFLAGS)
FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Lutil -lutil -Llib -lnotmuch
ifeq ($(LIBDIR_IN_LDCONFIG),0)
@ -191,7 +192,7 @@ release-message:
@echo "the Xapian library to provide fast, full-text search with a convenient"
@echo "search syntax."
@echo ""
@echo "For more about notmuch, see http://notmuchmail.org"
@echo "For more about notmuch, see https://notmuchmail.org"
# This is a chain of dependencies rather than a simple list simply to
# avoid the messages getting interleaved in the case of a parallel

210
NEWS
View file

@ -1,3 +1,207 @@
Notmuch 0.23.1 (2016-10-23)
===========================
General
-------
Require Xapian >= 1.2.6
The ifdef branch for older Xapian (pre-compact API) had bit-rotted.
Emacs
-----
Fix default colours for unread and flagged messages
In 0.23 the default colours for unread and flagged messages in
search view were accidentally swapped. This release returns them to
the original colours.
A related change in 0.23 broke the customize widget for
notmuch-search-line-faces. This is now fixed.
Fix test failure with Emacs 25.1
A previously undiscovered jit-lock related bug was exposed by Emacs
25, causing a notmuch-show mode test to fail. This release fixes the
bug, and hence the test.
Notmuch 0.23 (2016-10-03)
=========================
General (Xapian 1.4+)
---------------------
Compiling against Xapian 1.4 enables several new features.
Support for single argument date: queries
`date:<expr>` is equivalent to `date:<expr>..<expr>`.
Support for blocking opens
When opening a database notmuch by default will wait for another
process to release a write lock, rather than returning an error.
Support for named queries
Named queries (also known as 'saved searches') can be defined with a
`query:name` format. The expansion of these queries is stored in the
database and they can be used from any notmuch client.
Library
-------
Message property API
libnotmuch now supports the attachment of arbitrary key-value pairs
to messages. These can be used by various tools to manage their
private data without polluting the user tag space. They also support
iteration of values with the same key or same key prefix.
Bug fix for `notmuch_directory_set_mtime`
Update cached mtime to match on-disk mtime.
CLI
---
Support for compile time options
A group of `built_with` keys is now supported for notmuch
config. Initial keys in this group are `compact`, `field_processor`,
and `retry_lock`.
Dump/Restore support for configuration information and properties
Any configuration information stored in the database (initially just
named queries) is dumped and restored. Similarly any properties
attached to messages are also dumped and restored. Any new
information in the dump format is prefixed by '#' to allow existing
scripts to ignore it.
Emacs
-----
Make notmuch-message-mode use insert for fcc
Notmuch-message-mode now defaults to using notmuch insert for
fcc. The old file based fcc behaviour can be restored by setting the
defcustom `notmuch-maildir-use-notmuch-insert` to nil.
When using notmuch insert, `notmuch-fcc-dirs` must be a subdirectory
of the mailstore (absolute paths are not permitted) followed by any
tag changes to be applied to the inserted message. The tag changes
are applied after the default tagging for new messages. For example
setting the header to "sentmail -inbox +sent" would insert the
message in the subdirectory sentmail of the mailstore, add the tag
"sent", and not add the (normally added) "inbox" tag.
Finally, if the insert fails (e.g. if the database is locked) the
user is presented with the option to retry, ignore, or edit the
header.
Make internal address completion customizable
There is a new defcustom `notmuch-address-internal-completion` which
controls how the internal completion works: it allows the user to
choose whether to match on messages the user sent, or the user
received, and to filter the messages used for the match, for example
by date.
Allow internal address completion on an individual basis
There is a new function `notmuch-address-toggle-internal-completion`
(by default it has no keybinding) which allows users who normally
use an external completion command to use the builtin internal
completion for the current buffer.
Alternatively, if the user has company-mode enabled, then the user
can use company mode commands such as `company-complete` to
activate the builtin completion for an individual completion.
Resend messages
The function `notmuch-show-resend-message` (bound to `b` in show
and tree modes) will (attempt to) send current message to new
recipients. The headers of the message won't be altered (e.g. `To:`
may point to yourself). New `Resent-To:`, `Resent-From:` and so on
will be added instead.
Face customization is easier
New faces `notmuch-tag-unread`, `notmuch-tag-flagged`,
`notmuch-tag-deleted`, `notmuch-tag-added`,
`notmuch-search-flagged-face` and `notmuch-search-unread-face` are
now used by default. Customize `notmuch-faces` to modify them.
Omit User-Agent header by default when sending mail
Ruby Bindings
-------------
Add support for `notmuch_database_get_all_tags`
Go Bindings
-----------
Go bindings moved to contrib
Add support for `notmuch_threads_t` and `notmuch_thread_t`
Fixed constant values so they are not all zero anymore
Previously, it was impossible to open writable database handles,
because `DATABASE_MODE_READ_ONLY` and `DATABASE_MODE_READ_WRITE` were
both set to zero.
The same issue occured with sort modes.
Notmuch 0.22.2 (2016-09-08)
===========================
Test Suite
----------
Silence gdb more
Have gdb write to a log file instead of stdout, hiding some more
(harmless) stderr chatter which causes test failures.
Hardcode fingerprint in PGP/MIME tests
Make the tests more robust against changing GnuPG output formats.
Notmuch 0.22.1 (2016-07-19)
===========================
Library
-------
Correct the definition of `LIBNOTMUCH_CHECK_VERSION`.
Document the (lack of) operations permitted on a closed database.
Test Suite
----------
Fix race condition in dump / restore tests.
Notmuch-Mutt
------------
Use `env` to locate perl.
Emacs
-----
Tell `message-mode` mode that outgoing messages are mail
This makes message-mode configuration behave more predictably.
Respect charset of MIME parts when reading them
Fix previous assumption that everyone uses UTF-8.
Notmuch 0.22 (2016-04-26)
=========================
@ -405,13 +609,13 @@ Stopped `notmuch dump` failing if someone writes to the database
process already has the write lock the dump will not start, so
script callers should still check the return value.
`notmuch insert` requires succesful message indexing for success status
`notmuch insert` requires successful message indexing for success status
Previously the `notmuch insert` subcommand indicated success even if
the message indexing failed, as long as the message was delivered to
file system. This could have lead to delivered messages missing
tags, etc. `notmuch insert` is now more strict, also requiring
succesful indexing for success status. Use the new `--keep` option
successful indexing for success status. Use the new `--keep` option
to revert to the old behaviour (keeping the delivered message file
and returning success even if indexing fails).
@ -2353,7 +2557,7 @@ Ruby bindings are now much more complete
Python bindings have been updated and extended
(docs online at http://packages.python.org/notmuch/)
(docs online at https://notmuch.readthedocs.io/)
New bindings:

2
README
View file

@ -58,7 +58,7 @@ Contacting users and developers
-------------------------------
The website for Notmuch is:
http://notmuchmail.org
https://notmuchmail.org
The mailing list address for the notmuch community is:

View file

@ -1,11 +1,11 @@
If you're reading this on http://github.com/notmuch/notmuch, this is a
If you're reading this on https://github.com/notmuch/notmuch, this is a
read-only mirror of the notmuch project.
For more information about the project, see http://notmuchmail.org.
For more information about the project, see https://notmuchmail.org.
Please don't send us pull requests on github. If you have a feature
branch that you want us to look at, use ``git send-email`` to send it
to notmuch@notmuchmail.org.
For more information about contributing to the project, see
http://notmuchmail.org/contributing/.
https://notmuchmail.org/contributing/.

View file

@ -2,7 +2,7 @@ notmuch -- The python interface to notmuch
==========================================
This module makes the functionality of the notmuch library
(`http://notmuchmail.org`_) available to python. Successful import of
(`https://notmuchmail.org`_) available to python. Successful import of
this modul depends on a libnotmuch.so|dll being available on the
user's system.
@ -10,7 +10,7 @@ If you have downloaded the full source tarball, you can create the
documentation with sphinx installed, go to the docs directory and
"make html". A static version of the documentation is available at:
https://notmuch.readthedocs.org/projects/notmuch-python/
https://notmuch.readthedocs.io/projects/notmuch-python/
To build the python bindings, do

View file

@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/philosophy/why-not-lgpl.html>.

View file

@ -4,7 +4,7 @@ Welcome to :mod:`notmuch`'s documentation
.. currentmodule:: notmuch
The :mod:`notmuch` module provides an interface to the `notmuch
<http://notmuchmail.org>`_ functionality, directly interfacing to a
<https://notmuchmail.org>`_ functionality, directly interfacing to a
shared notmuch library. Within :mod:`notmuch`, the classes
:class:`Database`, :class:`Query` provide most of the core
functionality, returning :class:`Threads`, :class:`Messages` and

View file

@ -47,7 +47,7 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with notmuch. If not, see <http://www.gnu.org/licenses/>.
along with notmuch. If not, see <https://www.gnu.org/licenses/>.
Copyright 2010-2011 Sebastian Spaeth <Sebastian@SSpaeth.de>
"""

View file

@ -16,7 +16,7 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with notmuch. If not, see <http://www.gnu.org/licenses/>.
along with notmuch. If not, see <https://www.gnu.org/licenses/>.
Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
Copyright 2012 Justus Winter <4winter@informatik.uni-hamburg.de>

View file

@ -12,7 +12,7 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with notmuch. If not, see <http://www.gnu.org/licenses/>.
along with notmuch. If not, see <https://www.gnu.org/licenses/>.
Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
"""

View file

@ -12,7 +12,7 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with notmuch. If not, see <http://www.gnu.org/licenses/>.
along with notmuch. If not, see <https://www.gnu.org/licenses/>.
Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
"""

View file

@ -12,7 +12,7 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with notmuch. If not, see <http://www.gnu.org/licenses/>.
along with notmuch. If not, see <https://www.gnu.org/licenses/>.
Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
"""

View file

@ -12,7 +12,7 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with notmuch. If not, see <http://www.gnu.org/licenses/>.
along with notmuch. If not, see <https://www.gnu.org/licenses/>.
Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
"""

View file

@ -12,7 +12,7 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with notmuch. If not, see <http://www.gnu.org/licenses/>.
along with notmuch. If not, see <https://www.gnu.org/licenses/>.
Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
"""

View file

@ -12,7 +12,7 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with notmuch. If not, see <http://www.gnu.org/licenses/>.
along with notmuch. If not, see <https://www.gnu.org/licenses/>.
Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
Jesse Rosenthal <jrosenthal@jhu.edu>
@ -572,7 +572,7 @@ class Message(Python3StringMixIn):
notmuch.STATUS.SUCCESS here. See there for details."""
if not self._msg:
raise NotInitializedError()
return Message._tags_to_maildir_flags(self._msg)
return Message._maildir_flags_to_tags(self._msg)
def __repr__(self):
"""Represent a Message() object by str()"""

View file

@ -12,7 +12,7 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with notmuch. If not, see <http://www.gnu.org/licenses/>.
along with notmuch. If not, see <https://www.gnu.org/licenses/>.
Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
Jesse Rosenthal <jrosenthal@jhu.edu>

View file

@ -12,7 +12,7 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with notmuch. If not, see <http://www.gnu.org/licenses/>.
along with notmuch. If not, see <https://www.gnu.org/licenses/>.
Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
"""

View file

@ -12,7 +12,7 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with notmuch. If not, see <http://www.gnu.org/licenses/>.
along with notmuch. If not, see <https://www.gnu.org/licenses/>.
Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
"""

View file

@ -12,7 +12,7 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with notmuch. If not, see <http://www.gnu.org/licenses/>.
along with notmuch. If not, see <https://www.gnu.org/licenses/>.
Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
"""

View file

@ -12,7 +12,7 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with notmuch. If not, see <http://www.gnu.org/licenses/>.
along with notmuch. If not, see <https://www.gnu.org/licenses/>.
Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
"""

View file

@ -1,3 +1,3 @@
# this file should be kept in sync with ../../../version
__VERSION__ = '0.22'
__VERSION__ = '0.23.1'
SOVERSION = '4'

View file

@ -14,7 +14,7 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with notmuch. If not, see <http://www.gnu.org/licenses/>.
along with notmuch. If not, see <https://www.gnu.org/licenses/>.
Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
"""
@ -34,21 +34,21 @@ setup(name='notmuch',
description='Python binding of the notmuch mail search and indexing library.',
author='Sebastian Spaeth',
author_email='Sebastian@SSpaeth.de',
url='http://notmuchmail.org/',
download_url='http://notmuchmail.org/releases/notmuch-%s.tar.gz' % __VERSION__,
url='https://notmuchmail.org/',
download_url='https://notmuchmail.org/releases/notmuch-%s.tar.gz' % __VERSION__,
packages=['notmuch'],
keywords=['library', 'email'],
long_description='''Overview
========
The notmuch module provides an interface to the `notmuch
<http://notmuchmail.org>`_ functionality, directly interfacing with a
<https://notmuchmail.org>`_ functionality, directly interfacing with a
shared notmuch library. Notmuch provides a maildatabase that allows
for extremely quick searching and filtering of your email according to
various criteria.
The documentation for the latest notmuch release can be `viewed
online <http://notmuch.readthedocs.org/>`_.
online <https://notmuch.readthedocs.io/>`_.
Requirements
------------
@ -66,5 +66,5 @@ python >= 2.5. It will not work on earlier python versions.
'Topic :: Software Development :: Libraries'
],
platforms='',
license='http://www.gnu.org/licenses/gpl-3.0.txt',
license='https://www.gnu.org/licenses/gpl-3.0.txt',
)

View file

@ -13,7 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/ .
* along with this program. If not, see https://www.gnu.org/licenses/ .
*
* Author: Ali Polatel <alip@exherbo.org>
*/
@ -374,6 +374,30 @@ notmuch_rb_database_find_message_by_filename (VALUE self, VALUE pathv)
return Qnil;
}
/*
* call-seq: DB.get_all_tags() => TAGS
*
* Returns a list of all tags found in the database.
*/
VALUE
notmuch_rb_database_get_all_tags (VALUE self)
{
notmuch_database_t *db;
notmuch_tags_t *tags;
Data_Get_Notmuch_Database (self, db);
tags = notmuch_database_get_all_tags (db);
if (!tags) {
const char *msg = notmuch_database_status_string (db);
if (!msg)
msg = "Unknown notmuch error";
rb_raise (notmuch_rb_eBaseError, "%s", msg);
}
return Data_Wrap_Struct (notmuch_rb_cTags, NULL, NULL, tags);
}
/*
* call-seq: DB.query(query) => QUERY
*

View file

@ -13,7 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/ .
* along with this program. If not, see https://www.gnu.org/licenses/ .
*
* Author: Ali Polatel <alip@exherbo.org>
*/
@ -177,6 +177,9 @@ notmuch_rb_database_find_message (VALUE self, VALUE idv);
VALUE
notmuch_rb_database_find_message_by_filename (VALUE self, VALUE pathv);
VALUE
notmuch_rb_database_get_all_tags (VALUE self);
VALUE
notmuch_rb_database_query_create (VALUE self, VALUE qstrv);

View file

@ -13,7 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/ .
* along with this program. If not, see https://www.gnu.org/licenses/ .
*
* Author: Ali Polatel <alip@exherbo.org>
*/

View file

@ -13,7 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/ .
* along with this program. If not, see https://www.gnu.org/licenses/ .
*
* Author: Ali Polatel <alip@exherbo.org>
*/

View file

@ -13,7 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/ .
* along with this program. If not, see https://www.gnu.org/licenses/ .
*
* Author: Ali Polatel <alip@exherbo.org>
*/
@ -229,6 +229,7 @@ Init_notmuch (void)
notmuch_rb_database_find_message, 1); /* in database.c */
rb_define_method (notmuch_rb_cDatabase, "find_message_by_filename",
notmuch_rb_database_find_message_by_filename, 1); /* in database.c */
rb_define_method (notmuch_rb_cDatabase, "all_tags", notmuch_rb_database_get_all_tags, 0); /* in database.c */
rb_define_method (notmuch_rb_cDatabase, "query", notmuch_rb_database_query_create, 1); /* in database.c */
/*

View file

@ -13,7 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/ .
* along with this program. If not, see https://www.gnu.org/licenses/ .
*
* Author: Ali Polatel <alip@exherbo.org>
*/

View file

@ -13,7 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/ .
* along with this program. If not, see https://www.gnu.org/licenses/ .
*
* Author: Ali Polatel <alip@exherbo.org>
*/

View file

@ -13,7 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/ .
* along with this program. If not, see https://www.gnu.org/licenses/ .
*
* Author: Ali Polatel <alip@exherbo.org>
*/

View file

@ -13,7 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/ .
* along with this program. If not, see https://www.gnu.org/licenses/ .
*
* Author: Ali Polatel <alip@exherbo.org>
*/

View file

@ -13,7 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/ .
* along with this program. If not, see https://www.gnu.org/licenses/ .
*
* Author: Ali Polatel <alip@exherbo.org>
*/

View file

@ -13,7 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/ .
* along with this program. If not, see https://www.gnu.org/licenses/ .
*
* Author: Ali Polatel <alip@exherbo.org>
*/

View file

@ -13,7 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/ .
* along with this program. If not, see https://www.gnu.org/licenses/ .
*
* Author: Ali Polatel <alip@exherbo.org>
*/

View file

@ -13,7 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/ .
* along with this program. If not, see https://www.gnu.org/licenses/ .
*
* Author: Carl Worth <cworth@cworth.org>
*/

View file

@ -14,7 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/ .
* along with this program. If not, see https://www.gnu.org/licenses/ .
*/
#ifndef FUNCTION_ATTRIBUTES_H

View file

@ -9,7 +9,7 @@ notmuch-completion.bash
bash-completion package [1] version 2.0, which depends on bash
version 3.2 or later.
[1] http://bash-completion.alioth.debian.org/
[1] https://github.com/scop/bash-completion
notmuch-completion.zsh

View file

@ -3,7 +3,7 @@
# Copyright © 2013 Jani Nikula
#
# Based on the bash-completion package:
# http://bash-completion.alioth.debian.org/
# https://github.com/scop/bash-completion
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/ .
# along with this program. If not, see https://www.gnu.org/licenses/ .
#
# Author: Jani Nikula <jani@nikula.org>
#

189
configure vendored
View file

@ -1,5 +1,7 @@
#! /bin/sh
set -u
# Test whether this shell is capable of parameter substring processing.
( option='a/b'; : ${option#*/} ) 2>/dev/null || {
echo "
@ -66,10 +68,12 @@ PYTHON=${PYTHON:-}
PREFIX=/usr/local
LIBDIR=
WITH_DOCS=1
WITH_API_DOCS=1
WITH_EMACS=1
WITH_BASH=1
WITH_RUBY=1
WITH_ZSH=1
WITH_RETRY_LOCK=1
usage ()
{
@ -134,10 +138,12 @@ Some features can be disabled (--with-feature=no is equivalent to
--without-feature) :
--without-bash-completion Do not install bash completions files
--without-docs Do not install documentation and man pages
--without-docs Do not install documentation
--without-api-docs Do not install API man page
--without-emacs Do not install lisp file
--without-ruby Do not install ruby bindings
--without-zsh-completion Do not install zsh completions files
--without-retry-lock Do not use blocking xapian opens, even if available
Additional options are accepted for compatibility with other
configure-script calling conventions, but don't do anything yet:
@ -180,11 +186,21 @@ for option; do
elif [ "${option%%=*}" = '--with-docs' ]; then
if [ "${option#*=}" = 'no' ]; then
WITH_DOCS=0
WITH_API_DOCS=0
else
WITH_DOCS=1
fi
elif [ "${option}" = '--without-docs' ] ; then
WITH_DOCS=0
WITH_API_DOCS=0
elif [ "${option%%=*}" = '--with-api-docs' ]; then
if [ "${option#*=}" = 'no' ]; then
WITH_API_DOCS=0
else
WITH_API_DOCS=1
fi
elif [ "${option}" = '--without-api-docs' ] ; then
WITH_API_DOCS=0
elif [ "${option%%=*}" = '--with-emacs' ]; then
if [ "${option#*=}" = 'no' ]; then
WITH_EMACS=0
@ -209,6 +225,14 @@ for option; do
fi
elif [ "${option}" = '--without-ruby' ] ; then
WITH_RUBY=0
elif [ "${option%%=*}" = '--with-retry-lock' ]; then
if [ "${option#*=}" = 'no' ]; then
WITH_RETRY_LOCK=0
else
WITH_RETRY_LOCK=1
fi
elif [ "${option}" = '--without-retry-lock' ] ; then
WITH_RETRY_LOCK=0
elif [ "${option%%=*}" = '--with-zsh-completion' ]; then
if [ "${option#*=}" = 'no' ]; then
WITH_ZSH=0
@ -250,7 +274,7 @@ if [ -z "$LIBDIR" ] ; then
libdir_expanded="${PREFIX}/lib"
else
# very non-general variable expansion
libdir_expanded=`echo "$LIBDIR" | sed "s|\\${prefix}|${PREFIX}|g; s|\\$prefix/|${PREFIX}/|; s|//*|/|g"`
libdir_expanded=$(echo "$LIBDIR" | sed "s|\\${prefix}|${PREFIX}|g; s|\\$prefix/|${PREFIX}/|; s|//*|/|g")
fi
cat <<EOF
@ -356,23 +380,59 @@ if [ ${have_xapian} = "0" ]; then
errors=$((errors + 1))
fi
# Compaction is only supported on Xapian > 1.2.6
have_xapian_compact=0
have_xapian_field_processor=0
if [ ${have_xapian} = "1" ]; then
printf "Checking for Xapian compaction support... "
case "${xapian_version}" in
0.*|1.[01].*|1.2.[0-5])
printf "No (only available with Xapian > 1.2.6).\n" ;;
[1-9]*.[0-9]*.[0-9]*)
have_xapian_compact=1
printf "Yes.\n" ;;
*)
printf "Unknown version.\n" ;;
esac
fi
cat>_compact.cc<<EOF
#include <xapian.h>
class TestCompactor : public Xapian::Compactor { };
EOF
if ${CXX} ${CXXFLAGS_for_sh} ${xapian_cxxflags} -c _compact.cc -o _compact.o > /dev/null 2>&1
then
have_xapian_compact=1
printf "Yes.\n"
else
printf "No.\n"
errors=$((errors + 1))
fi
rm -f _compact.o _compact.cc
printf "Checking for Xapian FieldProcessor API... "
cat>_field_processor.cc<<EOF
#include <xapian.h>
class TitleFieldProcessor : public Xapian::FieldProcessor { };
EOF
if ${CXX} ${CXXFLAGS_for_sh} ${xapian_cxxflags} -c _field_processor.cc -o _field_processor.o > /dev/null 2>&1
then
have_xapian_field_processor=1
printf "Yes.\n"
else
printf "No. (optional)\n"
fi
rm -f _field_processor.o _field_processor.cc
default_xapian_backend=""
# DB_RETRY_LOCK is only supported on Xapian > 1.3.2
have_xapian_db_retry_lock=0
if [ $WITH_RETRY_LOCK = "1" ]; then
printf "Checking for Xapian lock retry support... "
cat>_retry.cc<<EOF
#include <xapian.h>
int flag = Xapian::DB_RETRY_LOCK;
EOF
if ${CXX} ${CXXFLAGS_for_sh} ${xapian_cxxflags} -c _retry.cc -o _retry.o > /dev/null 2>&1
then
have_xapian_db_retry_lock=1
printf "Yes.\n"
else
printf "No. (optional)\n"
fi
rm -f _retry.o _retry.cc
fi
default_xapian_backend=""
if [ ${have_xapian} = "1" ]; then
printf "Testing default Xapian backend... "
cat >_default_backend.cc <<EOF
#include <xapian.h>
@ -380,16 +440,17 @@ int main(int argc, char** argv) {
Xapian::WritableDatabase db("test.db",Xapian::DB_CREATE_OR_OPEN);
}
EOF
${CXX} ${CXXLAGS} ${xapian_cxxflags} _default_backend.cc -o _default_backend ${xapian_ldflags}
${CXX} ${CXXFLAGS_for_sh} ${xapian_cxxflags} _default_backend.cc -o _default_backend ${xapian_ldflags}
./_default_backend
if [ -f test.db/iamglass ]; then
default_xapian_backend=glass
else
default_xapian_backend=chert
fi
printf "${default_xapian_backend}\n";
printf "%s\n" "${default_xapian_backend}";
rm -rf test.db _default_backend _default_backend.cc
fi
# we need to have a version >= 2.6.5 to avoid a crypto bug. We need
# 2.6.7 for permissive "From " header handling.
GMIME_MINVER=2.6.7
@ -413,8 +474,9 @@ have_glib=0
if pkg-config --exists 'glib-2.0 >= 2.22'; then
printf "Yes.\n"
have_glib=1
glib_cflags=$(pkg-config --cflags glib-2.0)
glib_ldflags=$(pkg-config --libs glib-2.0)
# these are included in gmime cflags and ldflags
# glib_cflags=$(pkg-config --cflags glib-2.0)
# glib_ldflags=$(pkg-config --libs glib-2.0)
else
printf "No.\n"
errors=$((errors + 1))
@ -461,7 +523,7 @@ for name in ${PYTHON} python python2 python3; do
if command -v $name > /dev/null; then
have_python=1
python=$name
printf "Yes ($name).\n"
printf "Yes (%s).\n" "$name"
break
fi
done
@ -479,6 +541,7 @@ if pkg-config --exists valgrind; then
else
printf "No (but that's fine).\n"
have_valgrind=0
valgrind_cflags=
fi
printf "Checking for bash-completion (>= 1.90)... "
@ -489,12 +552,12 @@ else
WITH_BASH=0
fi
if [ -z "${EMACSLISPDIR}" ]; then
EMACSLISPDIR='$(prefix)/share/emacs/site-lisp'
if [ -z "${EMACSLISPDIR-}" ]; then
EMACSLISPDIR="\$(prefix)/share/emacs/site-lisp"
fi
if [ -z "${EMACSETCDIR}" ]; then
EMACSETCDIR='$(prefix)/share/emacs/site-lisp'
if [ -z "${EMACSETCDIR-}" ]; then
EMACSETCDIR="\$(prefix)/share/emacs/site-lisp"
fi
printf "Checking if emacs is available... "
@ -507,7 +570,7 @@ else
fi
have_doxygen=0
if [ $WITH_DOCS = "1" ] ; then
if [ $WITH_API_DOCS = "1" ] ; then
printf "Checking if doxygen is available... "
if command -v doxygen > /dev/null; then
printf "Yes.\n"
@ -542,7 +605,7 @@ fi
libdir_in_ldconfig=0
printf "Checking which platform we are on... "
uname=`uname`
uname=$(uname)
if [ $uname = "Darwin" ] ; then
printf "Mac OS X.\n"
platform=MACOSX
@ -560,11 +623,11 @@ elif [ $uname = "OpenBSD" ] ; then
platform=OPENBSD
linker_resolves_library_dependencies=0
elif [ $uname = "Linux" ] || [ $uname = "GNU" ] ; then
printf "$uname\n"
printf "%s\n" "$uname"
platform="$uname"
linker_resolves_library_dependencies=1
printf "Checking for $libdir_expanded in ldconfig... "
printf "Checking for %s in ldconfig... " "$libdir_expanded"
ldconfig_paths=$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e 's,^\(/.*\):\( (.*)\)\?$,\1,p')
# Separate ldconfig_paths only on newline (not on any potential
# embedded space characters in any filenames). Note, we use a
@ -588,6 +651,8 @@ elif [ $uname = "Linux" ] || [ $uname = "GNU" ] ; then
fi
else
printf "Unknown.\n"
platform="$uname"
linker_resolves_library_dependencies=0
cat <<EOF
*** Warning: Unknown platform. Notmuch might or might not build correctly.
@ -619,9 +684,9 @@ EOF
if [ $have_python -eq 0 ]; then
echo " python interpreter"
fi
if [ $have_xapian -eq 0 ]; then
echo " Xapian library (including development files such as headers)"
echo " http://xapian.org/"
if [ $have_xapian -eq 0 -o $have_xapian_compact -eq 0 ]; then
echo " Xapian library (>= version 1.2.6, including development files such as headers)"
echo " https://xapian.org/"
fi
if [ $have_zlib -eq 0 ]; then
echo " zlib library (>= version 1.2.5.2, including development files such as headers)"
@ -641,7 +706,7 @@ EOF
fi
if [ $have_talloc -eq 0 ]; then
echo " The talloc library (including development files such as headers)"
echo " http://talloc.samba.org/"
echo " https://talloc.samba.org/"
echo
fi
cat <<EOF
@ -815,7 +880,7 @@ for flag in -Wall -Wextra -Wwrite-strings; do
WARN_CXXFLAGS="${WARN_CXXFLAGS}${WARN_CXXFLAGS:+ }${flag}"
fi
done
printf "\n\t${WARN_CXXFLAGS}\n"
printf "\n\t%s\n" "${WARN_CXXFLAGS}"
WARN_CFLAGS="${WARN_CXXFLAGS}"
printf "Checking for available C compiler warning flags... "
@ -825,7 +890,7 @@ for flag in -Wmissing-declarations; do
WARN_CFLAGS="${WARN_CFLAGS}${WARN_CFLAGS:+ }${flag}"
fi
done
printf "\n\t${WARN_CFLAGS}\n"
printf "\n\t%s\n" "${WARN_CFLAGS}"
rm -f minimal minimal.c _libversion.c _libversion _libversion.sh
@ -997,6 +1062,12 @@ HAVE_D_TYPE = ${have_d_type}
# Whether the Xapian version in use supports compaction
HAVE_XAPIAN_COMPACT = ${have_xapian_compact}
# Whether the Xapian version in use supports field processors
HAVE_XAPIAN_FIELD_PROCESSOR = ${have_xapian_field_processor}
# Whether the Xapian version in use supports DB_RETRY_LOCK
HAVE_XAPIAN_DB_RETRY_LOCK = ${have_xapian_db_retry_lock}
# Whether the getpwuid_r function is standards-compliant
# (if not, then notmuch will #define _POSIX_PTHREAD_SEMANTICS
# to enable the standards-compliant version -- needed for Solaris)
@ -1059,33 +1130,25 @@ WITH_BASH = ${WITH_BASH}
WITH_ZSH = ${WITH_ZSH}
# Combined flags for compiling and linking against all of the above
CONFIGURE_CFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\
-DHAVE_CANONICALIZE_FILE_NAME=\$(HAVE_CANONICALIZE_FILE_NAME) \\
\$(ZLIB_CFLAGS) \\
\$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND) \\
\$(VALGRIND_CFLAGS) \\
-DHAVE_STRCASESTR=\$(HAVE_STRCASESTR) \\
-DHAVE_STRSEP=\$(HAVE_STRSEP) \\
-DHAVE_TIMEGM=\$(HAVE_TIMEGM) \\
-DHAVE_D_TYPE=\$(HAVE_D_TYPE) \\
-DSTD_GETPWUID=\$(STD_GETPWUID) \\
-DSTD_ASCTIME=\$(STD_ASCTIME) \\
-DHAVE_XAPIAN_COMPACT=\$(HAVE_XAPIAN_COMPACT) \\
-DUTIL_BYTE_ORDER=\$(UTIL_BYTE_ORDER)
COMMON_CONFIGURE_CFLAGS = \\
\$(GMIME_CFLAGS) \$(TALLOC_CFLAGS) \$(ZLIB_CFLAGS) \\
-DHAVE_VALGRIND=\$(HAVE_VALGRIND) \$(VALGRIND_CFLAGS) \\
-DHAVE_GETLINE=\$(HAVE_GETLINE) \\
-DHAVE_CANONICALIZE_FILE_NAME=\$(HAVE_CANONICALIZE_FILE_NAME) \\
-DHAVE_STRCASESTR=\$(HAVE_STRCASESTR) \\
-DHAVE_STRSEP=\$(HAVE_STRSEP) \\
-DHAVE_TIMEGM=\$(HAVE_TIMEGM) \\
-DHAVE_D_TYPE=\$(HAVE_D_TYPE) \\
-DSTD_GETPWUID=\$(STD_GETPWUID) \\
-DSTD_ASCTIME=\$(STD_ASCTIME) \\
-DHAVE_XAPIAN_COMPACT=\$(HAVE_XAPIAN_COMPACT) \\
-DHAVE_XAPIAN_FIELD_PROCESSOR=\$(HAVE_XAPIAN_FIELD_PROCESSOR) \\
-DHAVE_XAPIAN_DB_RETRY_LOCK=\$(HAVE_XAPIAN_DB_RETRY_LOCK) \\
-DUTIL_BYTE_ORDER=\$(UTIL_BYTE_ORDER)
CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\
-DHAVE_CANONICALIZE_FILE_NAME=\$(HAVE_CANONICALIZE_FILE_NAME) \\
\$(ZLIB_CFLAGS) \\
\$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND) \\
\$(VALGRIND_CFLAGS) \$(XAPIAN_CXXFLAGS) \\
-DHAVE_STRCASESTR=\$(HAVE_STRCASESTR) \\
-DHAVE_STRSEP=\$(HAVE_STRSEP) \\
-DHAVE_TIMEGM=\$(HAVE_TIMEGM) \\
-DHAVE_D_TYPE=\$(HAVE_D_TYPE) \\
-DSTD_GETPWUID=\$(STD_GETPWUID) \\
-DSTD_ASCTIME=\$(STD_ASCTIME) \\
-DHAVE_XAPIAN_COMPACT=\$(HAVE_XAPIAN_COMPACT) \\
-DUTIL_BYTE_ORDER=\$(UTIL_BYTE_ORDER)
CONFIGURE_CFLAGS = \$(COMMON_CONFIGURE_CFLAGS)
CONFIGURE_CXXFLAGS = \$(COMMON_CONFIGURE_CFLAGS) \$(XAPIAN_CXXFLAGS)
CONFIGURE_LDFLAGS = \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(ZLIB_LDFLAGS) \$(XAPIAN_LDFLAGS)
EOF
@ -1098,6 +1161,12 @@ cat > sh.config <<EOF
# Whether the Xapian version in use supports compaction
NOTMUCH_HAVE_XAPIAN_COMPACT=${have_xapian_compact}
# Whether the Xapian version in use supports field processors
NOTMUCH_HAVE_XAPIAN_FIELD_PROCESSOR=${have_xapian_field_processor}
# Whether the Xapian version in use supports lock retry
NOTMUCH_HAVE_XAPIAN_DB_RETRY_LOCK=${have_xapian_db_retry_lock}
# Which backend will Xapian use by default?
NOTMUCH_DEFAULT_XAPIAN_BACKEND=${default_xapian_backend}

View file

@ -13,4 +13,4 @@ todo
- improve notmuch-addrlookup regexp
[1] http://notmuchmail.org/
[1] https://notmuchmail.org/

View file

@ -86,7 +86,7 @@ type Filenames struct {
type DatabaseMode C.notmuch_database_mode_t
const (
DATABASE_MODE_READ_ONLY DatabaseMode = 0
DATABASE_MODE_READ_ONLY DatabaseMode = iota
DATABASE_MODE_READ_WRITE
)
@ -351,7 +351,7 @@ func (self *Database) GetAllTags() *Tags {
* completely in the future, but it's likely to be a specialized
* version of the general Xapian query syntax:
*
* http://xapian.org/docs/queryparser.html
* https://xapian.org/docs/queryparser.html
*
* As a special case, passing either a length-zero string, (that is ""),
* or a string consisting of a single asterisk (that is "*"), will
@ -534,8 +534,6 @@ func (self *Query) CountMessages() uint {
return uint(C.notmuch_query_count_messages(self.query))
}
// TODO: wrap threads and thread
/* Is the given 'threads' iterator pointing at a valid thread.
*
* When this function returns TRUE, notmuch_threads_get will return a
@ -556,6 +554,45 @@ func (self *Threads) Valid() bool {
return true
}
/* Get the current thread from 'threads' as a notmuch_thread_t.
*
* Note: The returned thread belongs to 'threads' and has a lifetime
* identical to it (and the query to which it belongs).
*
* See the documentation of notmuch_query_search_threads for example
* code showing how to iterate over a notmuch_threads_t object.
*
* If an out-of-memory situation occurs, this function will return
* NULL.
*/
func (self *Threads) Get() *Thread {
if self.threads == nil {
return nil
}
thread := C.notmuch_threads_get(self.threads)
if thread == nil {
return nil
}
return &Thread{thread}
}
/* Move the 'threads' iterator to the next thread.
*
* If 'threads' is already pointing at the last thread then the
* iterator will be moved to a point just beyond that last thread,
* (where notmuch_threads_valid will return FALSE and
* notmuch_threads_get will return NULL).
*
* See the documentation of notmuch_query_search_threads for example
* code showing how to iterate over a notmuch_threads_t object.
*/
func (self *Threads) MoveToNext() {
if self.threads == nil {
return
}
C.notmuch_threads_move_to_next(self.threads)
}
/* Destroy a notmuch_threads_t object.
*
* It's not strictly necessary to call this function. All memory from
@ -568,6 +605,227 @@ func (self *Threads) Destroy() {
}
}
/**
* Get the thread ID of 'thread'.
*
* The returned string belongs to 'thread' and as such, should not be
* modified by the caller and will only be valid for as long as the
* thread is valid, (which is until notmuch_thread_destroy or until
* the query from which it derived is destroyed).
*/
func (self *Thread) GetThreadId() string {
if self.thread == nil {
return ""
}
id := C.notmuch_thread_get_thread_id(self.thread)
if id == nil {
return ""
}
return C.GoString(id)
}
/**
* Get the total number of messages in 'thread'.
*
* This count consists of all messages in the database belonging to
* this thread. Contrast with notmuch_thread_get_matched_messages() .
*/
func (self *Thread) GetTotalMessages() int {
if self.thread == nil {
return 0
}
return int(C.notmuch_thread_get_total_messages(self.thread))
}
/**
* Get a notmuch_messages_t iterator for the top-level messages in
* 'thread' in oldest-first order.
*
* This iterator will not necessarily iterate over all of the messages
* in the thread. It will only iterate over the messages in the thread
* which are not replies to other messages in the thread.
*
* The returned list will be destroyed when the thread is destroyed.
*/
func (self *Thread) GetToplevelMessages() (*Messages, Status) {
if self.thread == nil {
return nil, STATUS_NULL_POINTER
}
msgs := C.notmuch_thread_get_toplevel_messages(self.thread)
if msgs == nil {
return nil, STATUS_NULL_POINTER
}
return &Messages{msgs}, STATUS_SUCCESS
}
/**
* Get a notmuch_thread_t iterator for all messages in 'thread' in
* oldest-first order.
*
* The returned list will be destroyed when the thread is destroyed.
*/
func (self *Thread) GetMessages() (*Messages, Status) {
if self.thread == nil {
return nil, STATUS_NULL_POINTER
}
msgs := C.notmuch_thread_get_messages(self.thread)
if msgs == nil {
return nil, STATUS_NULL_POINTER
}
return &Messages{msgs}, STATUS_SUCCESS
}
/**
* Get the number of messages in 'thread' that matched the search.
*
* This count includes only the messages in this thread that were
* matched by the search from which the thread was created and were
* not excluded by any exclude tags passed in with the query (see
* notmuch_query_add_tag_exclude). Contrast with
* notmuch_thread_get_total_messages() .
*/
func (self *Thread) GetMatchedMessages() int {
if self.thread == nil {
return 0
}
return int(C.notmuch_thread_get_matched_messages(self.thread))
}
/**
* Get the authors of 'thread' as a UTF-8 string.
*
* The returned string is a comma-separated list of the names of the
* authors of mail messages in the query results that belong to this
* thread.
*
* The string contains authors of messages matching the query first, then
* non-matched authors (with the two groups separated by '|'). Within
* each group, authors are ordered by date.
*
* The returned string belongs to 'thread' and as such, should not be
* modified by the caller and will only be valid for as long as the
* thread is valid, (which is until notmuch_thread_destroy or until
* the query from which it derived is destroyed).
*/
func (self *Thread) GetAuthors() string {
if self.thread == nil {
return ""
}
str := C.notmuch_thread_get_authors(self.thread)
if str == nil {
return ""
}
return C.GoString(str)
}
/**
* Get the subject of 'thread' as a UTF-8 string.
*
* The subject is taken from the first message (according to the query
* order---see notmuch_query_set_sort) in the query results that
* belongs to this thread.
*
* The returned string belongs to 'thread' and as such, should not be
* modified by the caller and will only be valid for as long as the
* thread is valid, (which is until notmuch_thread_destroy or until
* the query from which it derived is destroyed).
*/
func (self *Thread) GetSubject() string {
if self.thread == nil {
return ""
}
str := C.notmuch_thread_get_subject(self.thread)
if str == nil {
return ""
}
return C.GoString(str)
}
/**
* Get the date of the oldest message in 'thread' as a time_t value.
*/
func (self *Thread) GetOldestDate() int64 {
if self.thread == nil {
return 0
}
date := C.notmuch_thread_get_oldest_date(self.thread)
return int64(date)
}
/**
* Get the date of the newest message in 'thread' as a time_t value.
*/
func (self *Thread) GetNewestDate() int64 {
if self.thread == nil {
return 0
}
date := C.notmuch_thread_get_newest_date(self.thread)
return int64(date)
}
/**
* Get the tags for 'thread', returning a notmuch_tags_t object which
* can be used to iterate over all tags.
*
* Note: In the Notmuch database, tags are stored on individual
* messages, not on threads. So the tags returned here will be all
* tags of the messages which matched the search and which belong to
* this thread.
*
* The tags object is owned by the thread and as such, will only be
* valid for as long as the thread is valid, (for example, until
* notmuch_thread_destroy or until the query from which it derived is
* destroyed).
*
* Typical usage might be:
*
* notmuch_thread_t *thread;
* notmuch_tags_t *tags;
* const char *tag;
*
* thread = notmuch_threads_get (threads);
*
* for (tags = notmuch_thread_get_tags (thread);
* notmuch_tags_valid (tags);
* notmuch_tags_move_to_next (tags))
* {
* tag = notmuch_tags_get (tags);
* ....
* }
*
* notmuch_thread_destroy (thread);
*
* Note that there's no explicit destructor needed for the
* notmuch_tags_t object. (For consistency, we do provide a
* notmuch_tags_destroy function, but there's no good reason to call
* it if the message is about to be destroyed).
*/
func (self *Thread) GetTags() *Tags {
if self.thread == nil {
return nil
}
tags := C.notmuch_thread_get_tags(self.thread)
if tags == nil {
return nil
}
return &Tags{tags}
}
/**
* Destroy a notmuch_thread_t object.
*/
func (self *Thread) Destroy() {
if self.thread != nil {
C.notmuch_thread_destroy(self.thread)
}
}
/* Is the given 'messages' iterator pointing at a valid message.
*
* When this function returns TRUE, notmuch_messages_get will return a

View file

@ -24,8 +24,8 @@ for a --output=symlinks flag to notmuch.
[1]: http://www.mutt.org/
[2]: http://notmuchmail.org/
[3]: http://upsilon.cc/~zack/blog/posts/2011/01/how_to_use_Notmuch_with_Mutt/
[2]: https://notmuchmail.org/
[3]: https://upsilon.cc/~zack/blog/posts/2011/01/how_to_use_Notmuch_with_Mutt/
Requirements
@ -57,5 +57,5 @@ notmuch-mutt is copyright (C) 2011-2012 Stefano Zacchiroli <zack@upsilon.cc>.
notmuch-mutt is released under the terms of the GNU General Public License
(GPL), version 3 or above. A copy of the license is available online at
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.

View file

@ -1,4 +1,4 @@
#!/usr/bin/perl -w
#!/usr/bin/env perl
#
# notmuch-mutt - notmuch (of a) helper for Mutt
#
@ -91,7 +91,7 @@ sub get_message_id() {
$mid = $1;
} else { # Message-ID header not found, synthesize a message id
# based on SHA1, as notmuch would do. See:
# http://git.notmuchmail.org/git/notmuch/blob/HEAD:/lib/sha1.c
# https://git.notmuchmail.org/git/notmuch/blob/HEAD:/lib/sha1.c
my $sha = Digest::SHA->new(1);
$sha->add($_) foreach(@headers);
$sha->addfile(\*STDIN);

View file

@ -1,23 +0,0 @@
.PHONY: all help install link symlink
files = plugin/notmuch.vim \
$(wildcard syntax/notmuch-*.vim)
prefix = $(HOME)/.vim
destdir = $(prefix)/plugin
INSTALL = install -D -m644
all: help
help:
@echo "I don't actually build anything, but I will help you install"
@echo "notmuch support for vim."
@echo
@echo " make install - copy plugin scripts and syntax files to ~/.vim"
@echo " make symlink - create symlinks in ~/.vim (useful for development)"
install:
@for x in $(files); do $(INSTALL) $(CURDIR)/$$x $(prefix)/$$x; done
link symlink: INSTALL = ln -fs
link symlink: install

View file

@ -1,86 +0,0 @@
This directory contains a vim script that allows reading notmuch mail
through vim.
NOTE: this is a work in progress. Patches welcome. <bart@jukie.net>
Dependencies:
notmuch:
Naturally, it expects you have notmuch installed and configured.
sendmail:
To send mail, notmuch.vim uses sendmail as default. Most modern MTAs
provide a compatibility binary, and so should work well.
To install:
make install
To run:
vim -c ':NotMuch'
from vim:
:NotMuch
:NotMuch new to:bart@jukie.net 'subject:this is a test'
Buffer types:
[notmuch-folders]
Folder list, or technically a list of saved searches.
Keybindings:
<Enter> - show the selected search
m - compose a new message
s - enter search criteria
= - refresh display
[notmuch-search]
You are presented with the search results when you run :NotMuch.
Keybindings:
<Space> - show the selected thread collapsing unmatched items
<Enter> - show the entire selected thread
a - archive message (remove inbox tag)
f - filter the current search terms
o - toggle search screen order
m - compose a new message
r - reply to thread
s - enter search criteria
,s - alter search criteria
t - filter the current search terms with tags
q - return to folder display, or undo filter
+ - add tag(s) to selected message
- - remove tag(s) from selected message
= - refresh display
? - reveal the thread ID of what's under cursor
^] - search using word under cursor
[notmuch-show]
This is the display of the message.
Keybindings:
<Space> - mark read, archive, go to next matching message
^n - next message
^p - previous message
b - toggle folding of message bodies
c - toggle folding of citations
h - toggle folding of extra header lines
i - toggle folding of signatures
m - compose a new message
r - reply to the message
s - enter search criteria
q - return to search display
? - reveal the message and thread IDs of what's under cursor
^] - search using word under cursor
[notmuch-compose]
When you're writing an email, you're in this mode.
Insert-mode keybindings:
<Tab> - go to the next header line
Normal-mode keybindings:
<Tab> - go to the next header line
,s - send this message
,q - abort this message

View file

@ -1,8 +0,0 @@
addon: notmuch
description: "notmuch mail user interface"
files:
- plugin/notmuch.vim
- syntax/notmuch-compose.vim
- syntax/notmuch-folders.vim
- syntax/notmuch-search.vim
- syntax/notmuch-show.vim

File diff suppressed because it is too large Load diff

View file

@ -1,7 +0,0 @@
runtime! syntax/mail.vim
syntax region nmComposeHelp contains=nmComposeHelpLine start='^Notmuch-Help:\%1l' end='^\(Notmuch-Help:\)\@!'
syntax match nmComposeHelpLine /Notmuch-Help:/ contained
highlight link nmComposeHelp Include
highlight link nmComposeHelpLine Error

View file

@ -1,12 +0,0 @@
" notmuch folders mode syntax file
syntax region nmFoldersCount start='^' end='\%10v'
syntax region nmFoldersName start='\%11v' end='\%31v'
syntax match nmFoldersSearch /([^()]\+)$/
highlight link nmFoldersCount Statement
highlight link nmFoldersName Type
highlight link nmFoldersSearch String
highlight CursorLine term=reverse cterm=reverse gui=reverse

View file

@ -1,26 +0,0 @@
syn match diffRemoved "^-.*"
syn match diffAdded "^+.*"
syn match diffSeparator "^---$"
syn match diffSubname " @@..*"ms=s+3 contained
syn match diffLine "^@.*" contains=diffSubname
syn match diffFile "^diff .*"
syn match diffNewFile "^+++ .*"
syn match diffOldFile "^--- .*"
hi def link diffOldFile diffFile
hi def link diffNewFile diffFile
hi def link diffFile Type
hi def link diffRemoved Special
hi def link diffAdded Identifier
hi def link diffLine Statement
hi def link diffSubname PreProc
syntax match gitDiffStatLine /^ .\{-}\zs[+-]\+$/ contains=gitDiffStatAdd,gitDiffStatDelete
syntax match gitDiffStatAdd /+/ contained
syntax match gitDiffStatDelete /-/ contained
hi def link gitDiffStatAdd diffAdded
hi def link gitDiffStatDelete diffRemoved

View file

@ -1,12 +0,0 @@
syntax region nmSearch start=/^/ end=/$/ oneline contains=nmSearchDate
syntax match nmSearchDate /^.\{-13}/ contained nextgroup=nmSearchNum
syntax match nmSearchNum /.\{-4}/ contained nextgroup=nmSearchFrom
syntax match nmSearchFrom /.\{-21}/ contained nextgroup=nmSearchSubject
syntax match nmSearchSubject /.\{0,}\(([^()]\+)$\)\@=/ contained nextgroup=nmSearchTags
syntax match nmSearchTags /.\+$/ contained
highlight link nmSearchDate Statement
highlight link nmSearchNum Type
highlight link nmSearchFrom Include
highlight link nmSearchSubject Normal
highlight link nmSearchTags String

View file

@ -1,24 +0,0 @@
" notmuch show mode syntax file
syntax cluster nmShowMsgDesc contains=nmShowMsgDescWho,nmShowMsgDescDate,nmShowMsgDescTags
syntax match nmShowMsgDescWho /[^)]\+)/ contained
syntax match nmShowMsgDescDate / ([^)]\+[0-9]) / contained
syntax match nmShowMsgDescTags /([^)]\+)$/ contained
syntax cluster nmShowMsgHead contains=nmShowMsgHeadKey,nmShowMsgHeadVal
syntax match nmShowMsgHeadKey /^[^:]\+: / contained
syntax match nmShowMsgHeadVal /^\([^:]\+: \)\@<=.*/ contained
syntax cluster nmShowMsgBody contains=@nmShowMsgBodyMail,@nmShowMsgBodyGit
syntax include @nmShowMsgBodyMail syntax/mail.vim
silent! syntax include @nmShowMsgBodyGit syntax/notmuch-git-diff.vim
highlight nmShowMsgDescWho term=reverse cterm=reverse gui=reverse
highlight link nmShowMsgDescDate Type
highlight link nmShowMsgDescTags String
highlight link nmShowMsgHeadKey Macro
"highlight link nmShowMsgHeadVal NONE
highlight Folded term=reverse ctermfg=LightGrey ctermbg=Black guifg=LightGray guibg=Black

View file

@ -13,7 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/ .
* along with this program. If not, see https://www.gnu.org/licenses/ .
*
* Authors: Jameson Rollins <jrollins@finestructure.net>
*/

79
debian/changelog vendored
View file

@ -1,9 +1,88 @@
notmuch (0.23.1-1) unstable; urgency=medium
* New upstream bugfix release
* Fix test suite for Emacs 25.1
* Fix some Emacs customization regressions introduced in 0.23
* Bug fix: "testsuite fails with TERM=unknown", thanks to Gianfranco
Costamagna (Closes: #841319).
-- David Bremner <bremner@debian.org> Sun, 23 Oct 2016 22:06:12 -0300
notmuch (0.23-2) unstable; urgency=medium
* upload to unstable
-- David Bremner <bremner@debian.org> Wed, 05 Oct 2016 21:27:00 -0300
notmuch (0.23-1) experimental; urgency=medium
* New upstream release
* Bump minor version of libnotmuch4 because of new symbols.
* Several new features, see /usr/share/doc/notmuch/NEWS.gz
-- David Bremner <bremner@debian.org> Mon, 03 Oct 2016 22:46:26 -0300
notmuch (0.23~rc1-1) experimental; urgency=medium
* New upstream release candidate
* Make configure more robust on "unknown" platforms. Fixes FTBFS on
kfreebsd.
-- David Bremner <bremner@debian.org> Fri, 30 Sep 2016 07:19:26 -0300
notmuch (0.23~rc0-1) experimental; urgency=medium
* New upstream release candidate
* Bug fix: "Calls to notmuch_directory_get_mtime() don't return
the recently set mtime", thanks to Lars Luthman (Closes: #826881).
* Bug fix: "Please document compact command", thanks to Olivier
Berger (Closes: #825884).
-- David Bremner <bremner@debian.org> Mon, 26 Sep 2016 07:28:06 -0300
notmuch (0.22-1~bpo8+1) jessie-backports; urgency=medium
* Rebuild for jessie-backports.
-- David Bremner <bremner@debian.org> Tue, 28 Jun 2016 16:48:40 +0200
notmuch (0.22.2-1) unstable; urgency=medium
* Fix test suite compatibility with GnuPG 2.1.15. Bug fix: "FTBFS:
Tests failures", thanks to Lucas Nussbaum (Closes: #837013).
-- David Bremner <bremner@debian.org> Thu, 08 Sep 2016 19:09:53 -0300
notmuch (0.22.1-3) unstable; urgency=medium
* Gag gdb even more. Bug fix: "FTBFS in testing", thanks to Santiago
Vila (Closes: #834271).
-- David Bremner <bremner@debian.org> Sun, 14 Aug 2016 13:31:13 +0900
notmuch (0.22.1-2) unstable; urgency=medium
* Add explicit build-depends on gnupg, for the test suite.
-- David Bremner <bremner@debian.org> Tue, 19 Jul 2016 08:50:13 -0300
notmuch (0.22.1-1) unstable; urgency=medium
* Correct the definition of `LIBNOTMUCH_CHECK_VERSION`.
* Document the (lack of) operations permitted on a closed database
(Closes: #826843).
* Fix race condition in dump / restore tests.
* [notmuch-emacs] Tell `message-mode` mode that outgoing messages are mail
* [notmuch-emacs] Respect charset of MIME parts when reading them
-- David Bremner <bremner@debian.org> Tue, 19 Jul 2016 06:42:09 -0300
notmuch (0.22.1~rc0-1) experimental; urgency=medium
* release candidate for bugfix release
-- David Bremner <bremner@debian.org> Thu, 30 Jun 2016 21:28:13 +0200
notmuch (0.22-1) unstable; urgency=medium
* New upstream release. See /usr/share/doc/notmuch/NEWS for new

5
debian/control vendored
View file

@ -24,11 +24,12 @@ Build-Depends:
gdb [!s390x !ia64 !armel !ppc64el !mips !mipsel !mips64el],
dtach (>= 0.8),
gpgsm <!nocheck>,
gnupg <!nocheck>,
bash-completion (>=1.9.0~)
Standards-Version: 3.9.6
Homepage: http://notmuchmail.org/
Homepage: https://notmuchmail.org/
Vcs-Git: git://notmuchmail.org/git/notmuch
Vcs-Browser: http://git.notmuchmail.org/git/notmuch
Vcs-Browser: https://git.notmuchmail.org/git/notmuch
Package: notmuch
Architecture: any

View file

@ -1,4 +1,10 @@
libnotmuch.so.4 libnotmuch4 #MINVER#
notmuch_built_with@Base 0.23~rc0
notmuch_config_list_destroy@Base 0.23~rc0
notmuch_config_list_key@Base 0.23~rc0
notmuch_config_list_move_to_next@Base 0.23~rc0
notmuch_config_list_valid@Base 0.23~rc0
notmuch_config_list_value@Base 0.23~rc0
notmuch_database_add_message@Base 0.3
notmuch_database_begin_atomic@Base 0.9~rc1
notmuch_database_close@Base 0.13~rc1
@ -10,6 +16,8 @@ libnotmuch.so.4 libnotmuch4 #MINVER#
notmuch_database_find_message@Base 0.9~rc2
notmuch_database_find_message_by_filename@Base 0.9~rc2
notmuch_database_get_all_tags@Base 0.3
notmuch_database_get_config@Base 0.23~rc0
notmuch_database_get_config_list@Base 0.23~rc0
notmuch_database_get_directory@Base 0.3
notmuch_database_get_path@Base 0.3
notmuch_database_get_revision@Base 0.21~rc1
@ -18,6 +26,7 @@ libnotmuch.so.4 libnotmuch4 #MINVER#
notmuch_database_open@Base 0.3
notmuch_database_open_verbose@Base 0.20~rc1
notmuch_database_remove_message@Base 0.3
notmuch_database_set_config@Base 0.23~rc0
notmuch_database_status_string@Base 0.20~rc1
notmuch_database_upgrade@Base 0.3
notmuch_directory_delete@Base 0.21~rc1
@ -30,6 +39,7 @@ libnotmuch.so.4 libnotmuch4 #MINVER#
notmuch_filenames_get@Base 0.3
notmuch_filenames_move_to_next@Base 0.3
notmuch_filenames_valid@Base 0.3
notmuch_message_add_property@Base 0.23~rc0
notmuch_message_add_tag@Base 0.3
notmuch_message_destroy@Base 0.3
notmuch_message_freeze@Base 0.3
@ -39,11 +49,20 @@ libnotmuch.so.4 libnotmuch4 #MINVER#
notmuch_message_get_flag@Base 0.3
notmuch_message_get_header@Base 0.3
notmuch_message_get_message_id@Base 0.3
notmuch_message_get_properties@Base 0.23~rc0
notmuch_message_get_property@Base 0.23~rc0
notmuch_message_get_replies@Base 0.3
notmuch_message_get_tags@Base 0.3
notmuch_message_get_thread_id@Base 0.3
notmuch_message_maildir_flags_to_tags@Base 0.5
notmuch_message_properties_destroy@Base 0.23~rc0
notmuch_message_properties_key@Base 0.23~rc0
notmuch_message_properties_move_to_next@Base 0.23~rc0
notmuch_message_properties_valid@Base 0.23~rc0
notmuch_message_properties_value@Base 0.23~rc0
notmuch_message_remove_all_properties@Base 0.23~rc0
notmuch_message_remove_all_tags@Base 0.3
notmuch_message_remove_property@Base 0.23~rc0
notmuch_message_remove_tag@Base 0.3
notmuch_message_set_flag@Base 0.3
notmuch_message_tags_to_maildir_flags@Base 0.5
@ -94,8 +113,10 @@ libnotmuch.so.4 libnotmuch4 #MINVER#
(c++)"typeinfo for Xapian::DocNotFoundError@Base" 0.6.1
(c++)"typeinfo for Xapian::InvalidArgumentError@Base" 0.6.1
(c++)"typeinfo for Xapian::Error@Base" 0.6.1
(c++|optional=present with Xapian 1.4)"typeinfo for Xapian::QueryParserError@Base" 0.23~rc0
(c++)"typeinfo name for Xapian::LogicError@Base" 0.6.1
(c++)"typeinfo name for Xapian::RuntimeError@Base" 0.6.1
(c++)"typeinfo name for Xapian::DocNotFoundError@Base" 0.6.1
(c++)"typeinfo name for Xapian::InvalidArgumentError@Base" 0.6.1
(c++)"typeinfo name for Xapian::Error@Base" 0.6.1
(c++|optional=present with Xapian 1.4)"typeinfo name for Xapian::QueryParserError@Base" 0.23~rc0

View file

@ -13,7 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/ .
* along with this program. If not, see https://www.gnu.org/licenses/ .
*
* Author: Chris Wilson <chris@chris-wilson.co.uk>
*/

View file

@ -66,7 +66,7 @@ while (my ($k, $v) = each %fhash)
my @lines;
open I, '-|', qw/env -i/, "PATH=$ENV{PATH}",
qw/TERM=vt100 LANG=en_US.utf8 LC_ALL=en_US.utf8/,
qw/TERM=vt100 LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8/,
qw/GROFF_NO_SGR=1 MAN_KEEP_FORMATTING=1 MANWIDTH=80/,
qw/man/, $v or die "$!";
binmode I, ':utf8';
@ -200,6 +200,6 @@ foreach (sort srt values %fhash)
print <<'EOF';
The manual pages are licensed under
[the GNU General Public License](http://www.gnu.org/licenses/gpl.txt),
[the GNU General Public License](https://www.gnu.org/licenses/gpl.txt),
either version 3.0 or at your option any later version.
EOF

View file

@ -92,7 +92,7 @@ EXAMPLE
{
"meta": {
"title": "Notmuch Patches",
"blurb": "For more information see <a href=\"http://notmuchmail.org/nmbug\">nmbug</a>",
"blurb": "For more information see <a href=\"https://notmuchmail.org/nmbug\">nmbug</a>",
"header": "<html><head></head><body><h1>{title}</h1><p>{blurb}</p><h2>Views</h2>",
"footer": "<hr><p>Generated: {datetime}</p></html>",
"message-url": "http://mid.gmane.org/{message-id}"

View file

@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/ .
# along with this program. If not, see https://www.gnu.org/licenses/ .
"""
Manage notmuch tags with Git
@ -80,7 +80,7 @@ except AttributeError: # Python < 3.2
See PEP 343 for details on context managers [1].
[1]: http://legacy.python.org/dev/peps/pep-0343/
[1]: https://www.python.org/dev/peps/pep-0343/
"""
def __init__(self, **kwargs):
self.name = _tempfile.mkdtemp(**kwargs)
@ -119,9 +119,9 @@ def _xapian_quote(string):
Xapian uses double-quotes for quoting strings. You can escape
internal quotes by repeating them [1,2,3].
[1]: http://trac.xapian.org/ticket/128#comment:2
[2]: http://trac.xapian.org/ticket/128#comment:17
[3]: http://trac.xapian.org/changeset/13823/svn
[1]: https://trac.xapian.org/ticket/128#comment:2
[2]: https://trac.xapian.org/ticket/128#comment:17
[3]: https://trac.xapian.org/changeset/13823/svn
"""
return '"{0}"'.format(string.replace('"', '""'))

View file

@ -17,7 +17,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/ .
# along with this program. If not, see https://www.gnu.org/licenses/ .
"""Generate text and/or HTML for one or more notmuch searches.

View file

@ -1,7 +1,7 @@
{
"meta": {
"title": "Notmuch Patches",
"blurb": "For more information see <a href=\"http://notmuchmail.org/nmbug\">nmbug</a>"
"blurb": "For more information see <a href=\"https://notmuchmail.org/nmbug\">nmbug</a>"
},
"views": [

View file

@ -7,7 +7,7 @@
;;
;; Authors: Tomi Ollila <tomi.ollila@iki.fi>
;;
;; http://www.emacswiki.org/emacs/EmacsScripts was a useful starting point...
;; https://www.emacswiki.org/emacs/EmacsScripts was a useful starting point...
;;
;; Licence: GPLv3+
;;

View file

@ -177,7 +177,7 @@ FORMULA_FONTSIZE = 10
FORMULA_TRANSPARENT = YES
USE_MATHJAX = NO
MATHJAX_FORMAT = HTML-CSS
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
MATHJAX_RELPATH = https://cdn.mathjax.org/mathjax/latest
MATHJAX_EXTENSIONS =
MATHJAX_CODEFILE =
SEARCHENGINE = YES

View file

@ -14,6 +14,7 @@ Contents:
man1/notmuch-count
man1/notmuch-dump
notmuch-emacs
man1/notmuch-emacs-mua
man5/notmuch-hooks
man1/notmuch-insert
man1/notmuch-new

View file

@ -132,6 +132,17 @@ The available configuration items are described below.
Default: ``gpg``.
**built_with.<name>**
Compile time feature <name>. Current possibilities include
"compact" (see **notmuch-compact(1)**)
and "field_processor" (see **notmuch-search-terms(7)**).
**query.<name>**
Expansion for named query called <name>. See
**notmuch-search-terms(7)** for more information about named
queries.
ENVIRONMENT
===========

View file

@ -71,6 +71,39 @@ Supported options for **dump** include
characters. Note also that tags with spaces will not be
correctly restored with this format.
``--include=(config|properties|tags)``
Control what kind of metadata is included in the output.
**config**
Output configuration data stored in the database. Each line
starts with "#@ ", followed by a space separated key-value
pair. Both key and value are hex encoded if needed.
**properties**
Output per-message (key,value) metadata. Each line starts
with "#= ", followed by a message id, and a space separated
list of key=value pairs. pair. Ids, keys and values are hex
encoded if needed.
**tags**
Output per-message boolean metadata, namely tags. See *format* above
for description of the output.
The default is to include all available types of data. The
option can be specified multiple times to select some subset. As
of version 2 of the dump format, there is a header line of the
following form
|
| #notmuch-dump <*format*>:<*version*> <*included*>
where <*included*> is a comma separated list of the above
options.
``--output=``\ <filename>
Write output to given file instead of stdout.

View file

@ -45,7 +45,7 @@ Supported options for **insert** include
Keep the message file if indexing fails, and keep the message
indexed if applying tags or maildir flag synchronization
fails. Ignore these errors and return exit status 0 to
indicate succesful mail delivery.
indicate successful mail delivery.
``--no-hooks``
Prevent hooks from being run.
@ -53,7 +53,7 @@ Supported options for **insert** include
EXIT STATUS
===========
This command returns exit status 0 on succesful mail delivery,
This command returns exit status 0 on successful mail delivery,
non-zero otherwise. The default is to indicate failed mail delivery on
any errors, including message file delivery to the filesystem, message
indexing to Notmuch database, changing tags, and synchronizing tags to

View file

@ -50,6 +50,31 @@ Supported options for **restore** include
format, this heuristic, based the fact that batch-tag format
contains no parentheses, should be accurate.
``--include=(config|properties|tags)``
Control what kind of metadata is restored.
**config**
Restore configuration data to the database. Each configuration line starts
with "#@ ", followed by a space separated key-value pair.
Both key and value are hex encoded if needed.
**properties**
Output per-message (key,value) metadata. Each line starts
with "#= ", followed by a message id, and a space separated
list of key=value pairs. pair. Ids, keys and values are
hex encoded if needed.
**tags**
Output per-message metadata, namely tags. See *format* above
for more details.
The default is to restore all available types of data. The
option can be specified multiple times to select some subset.
``--input=``\ <filename>
Read input from given file instead of stdin.

View file

@ -29,7 +29,7 @@ While the command-line program ``notmuch`` provides powerful
functionality, it does not provide the most convenient interface for
that functionality. More sophisticated interfaces are expected to be
built on top of either the command-line interface, or more likely, on
top of the notmuch library interface. See http://notmuchmail.org for
top of the notmuch library interface. See https://notmuchmail.org for
more about alternate interfaces to notmuch. The emacs-based interface to
notmuch (available under **emacs/** in the Notmuch source distribution)
is probably the most widely used at this time.
@ -138,13 +138,13 @@ of notmuch.
SEE ALSO
========
**notmuch-config(1)**, **notmuch-count(1)**, **notmuch-dump(1)**,
**notmuch-hooks(5)**, **notmuch-insert(1)**, **notmuch-new(1)**,
**notmuch-reply(1)**, **notmuch-restore(1)**, **notmuch-search(1)**,
**notmuch-search-terms(7)**, **notmuch-show(1)**, **notmuch-tag(1)**,
**notmuch-address(1)**
**notmuch-address(1)**, **notmuch-compact(1)**, **notmuch-config(1)**,
**notmuch-count(1)**, **notmuch-dump(1)**, **notmuch-hooks(5)**,
**notmuch-insert(1)**, **notmuch-new(1)**, **notmuch-reply(1)**,
**notmuch-restore(1)**, **notmuch-search(1)**,
**notmuch-search-terms(7)**, **notmuch-show(1)**, **notmuch-tag(1)**
The notmuch website: **http://notmuchmail.org**
The notmuch website: **https://notmuchmail.org**
CONTACT
=======

View file

@ -41,7 +41,7 @@ The currently available hooks are described below.
message has been delivered, added to the database, and initial
tags have been applied. The hook will not be run if there have
been any errors during the message delivery; what is regarded
as succesful delivery depends on the ``--keep`` option.
as successful delivery depends on the ``--keep`` option.
Typically this hook is used to perform additional query-based
tagging on the delivered messages.

View file

@ -56,6 +56,10 @@ indicate user-supplied values):
- lastmod:<initial-revision>..<final-revision>
- query:<name>
- property:<key>=<value>
The **from:** prefix is used to match the name or address of the sender
of an email message.
@ -132,6 +136,16 @@ were added/removed or filenames changed). This is usually used in
conjunction with the **--uuid** argument to **notmuch search**
to find messages that have changed since an earlier query.
The **query:** prefix allows queries to refer to previously saved
queries added with **notmuch-config(1)**. Named queries are only
available if notmuch is built with **Xapian Field Processors** (see
below).
The **property:** prefix searches for messages with a particular
<key>=<value> property pair. Properties are used internally by notmuch
(and extensions) to add metadata to messages. A given key can be
present on a given message with several different values.
Operators
---------
@ -208,15 +222,11 @@ Boolean and Probabilistic Prefixes
Xapian (and hence notmuch) prefixes are either **boolean**, supporting
exact matches like "tag:inbox" or **probabilistic**, supporting a more flexible **term** based searching. The prefixes currently supported by notmuch are as follows.
+------------------+-----------------------+
|Boolean |Probabilistic |
+------------------+-----------------------+
| **tag:** **id:** | **from:** **to:** |
|**thread:** |**subject:** |
|**folder:** |**attachment:** |
|**path:** |**mimetype:** |
| | |
+------------------+-----------------------+
Boolean
**tag:**, **id:**, **thread:**, **folder:**, **path:**, **property:**
Probabilistic
**from:**, **to:**, **subject:**, **attachment:**, **mimetype:**
Terms and phrases
-----------------
@ -281,9 +291,10 @@ matches from the beginning of January to the end of February.
date:<expr>..! can be used as a shorthand for date:<expr>..<expr>. The
expansion takes place before interpretation, and thus, for example,
date:monday..! matches from the beginning of Monday until the end of
Monday. (Note that entering date:<expr> without "..", for example
date:yesterday, won't work, as it's not interpreted as a range
expression at all. Again, use date:yesterday..!)
Monday.
With **Xapian Field Processor** support (see below), non-range
date queries such as date:yesterday will work, but otherwise
will give unexpected results; if in doubt use date:yesterday..!
Currently, we do not support spaces in range expressions. You can
replace the spaces with '\_', or (in most cases) '-', or (in some cases)
@ -370,6 +381,22 @@ Time zones
Some time zone codes, e.g. UTC, EET.
XAPIAN FIELD PROCESSORS
=======================
Certain optional features of the notmuch query processor rely on the
presence of the Xapian field processor API. You can determine if your
notmuch was built against a sufficiently recent version of Xapian by running
::
% notmuch config get built_with.field_processor
Currently the following features require field processor support:
- non-range date queries, e.g. "date:today"
- named queries e.g. "query:my_special_query"
SEE ALSO
========

View file

@ -42,11 +42,8 @@ a mouse or by positioning the cursor and pressing ``<return>``
|
| All tags: **[show]**
|
| Type a search query and hit RET to view matching threads.
| Edit saved searches with the ``edit`` button.
| Hit RET or click on a saved search or tag name to view matching threads.
| ``=`` to refresh this screen. ``s`` to search messages. ``q`` to quit.
| **Customize** this page.
| Hit \`?' for context-sensitive help in any Notmuch screen.
| Customize Notmuch or this page.
You can change the overall appearance of the notmuch-hello screen by
customizing the variable :index:`notmuch-hello-sections`.

View file

@ -21,7 +21,7 @@
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:

View file

@ -15,7 +15,7 @@
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Notmuch. If not, see <http://www.gnu.org/licenses/>.
;; along with Notmuch. If not, see <https://www.gnu.org/licenses/>.
;;
;; Authors: Austin Clements <aclements@csail.mit.edu>

View file

@ -15,7 +15,7 @@
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Notmuch. If not, see <http://www.gnu.org/licenses/>.
;; along with Notmuch. If not, see <https://www.gnu.org/licenses/>.
;;
;; Authors: David Edmondson <dme@dme.org>
@ -28,15 +28,62 @@
;;
(declare-function company-manual-begin "company")
(defvar notmuch-address-last-harvest 0
"Time of last address harvest")
(defvar notmuch-address-completions (make-hash-table :test 'equal)
"Hash of email addresses for completion during email composition.
This variable is set by calling `notmuch-address-harvest'.")
(defvar notmuch-address-full-harvest-finished nil
"t indicates that full completion address harvesting has been
finished")
(defcustom notmuch-address-command 'internal
"The command which generates possible addresses. It must take a
single argument and output a list of possible matches, one per
line. The default value of `internal' uses built-in address
completion."
"Determines how address completion candidates are generated.
If it is a string then that string should be an external program
which must take a single argument (searched string) and output a
list of completion candidates, one per line.
Alternatively, it can be the symbol 'internal, in which case
internal completion is used; the variable
`notmuch-address-internal-completion` can be used to customize
this case.
Finally, if this variable is nil then address completion is
disabled."
:type '(radio
(const :tag "Use internal address completion" internal)
(const :tag "Disable address completion" nil)
(string :tag "Use external completion command" "notmuch-addresses"))
(string :tag "Use external completion command"))
:group 'notmuch-send
:group 'notmuch-external)
(defcustom notmuch-address-internal-completion '(sent nil)
"Determines how internal address completion generates candidates.
This should be a list of the form '(DIRECTION FILTER), where
DIRECTION is either sent or received and specifies whether the
candidates are searched in messages sent by the user or received
by the user (note received by is much faster), and FILTER is
either nil or a filter-string, such as \"date:1y..\" to append
to the query."
:type '(list :tag "Use internal address completion"
(radio
:tag "Base completion on messages you have"
:value sent
(const :tag "sent (more accurate)" sent)
(const :tag "received (faster)" received))
(radio :tag "Filter messages used for completion"
(const :tag "Use all messages" nil)
(string :tag "Filter query")))
;; We override set so that we can clear the cache when this changes
:set (lambda (symbol value)
(set-default symbol value)
(setq notmuch-address-last-harvest 0)
(setq notmuch-address-completions (clrhash notmuch-address-completions))
(setq notmuch-address-full-harvest-finished nil))
:group 'notmuch-send
:group 'notmuch-external)
@ -51,17 +98,6 @@ to know how address selection is made by default."
:group 'notmuch-send
:group 'notmuch-external)
(defvar notmuch-address-last-harvest 0
"Time of last address harvest")
(defvar notmuch-address-completions (make-hash-table :test 'equal)
"Hash of email addresses for completion during email composition.
This variable is set by calling `notmuch-address-harvest'.")
(defvar notmuch-address-full-harvest-finished nil
"t indicates that full completion address harvesting has been
finished")
(defun notmuch-address-selection-function (prompt collection initial-input)
"Call (`completing-read'
PROMPT COLLECTION nil nil INITIAL-INPUT 'notmuch-address-history)"
@ -82,19 +118,30 @@ finished")
:group 'notmuch-send)
(defun notmuch-address-setup ()
(let* ((use-company (and notmuch-address-use-company
(eq notmuch-address-command 'internal)
(let* ((setup-company (and notmuch-address-use-company
(require 'company nil t)))
(pair (cons notmuch-address-completion-headers-regexp
(if use-company
#'company-manual-begin
#'notmuch-address-expand-name))))
(when use-company
#'notmuch-address-expand-name)))
(when setup-company
(notmuch-company-setup))
(unless (memq pair message-completion-alist)
(setq message-completion-alist
(push pair message-completion-alist)))))
(defun notmuch-address-toggle-internal-completion ()
"Toggle use of internal completion for current buffer.
This overrides the global setting for address completion and
toggles the setting in this buffer."
(interactive)
(if (local-variable-p 'notmuch-address-command)
(kill-local-variable 'notmuch-address-command)
(setq-local notmuch-address-command 'internal))
(if (boundp 'company-idle-delay)
(if (local-variable-p 'company-idle-delay)
(kill-local-variable 'company-idle-delay)
(setq-local company-idle-delay nil))))
(defun notmuch-address-matching (substring)
"Returns a list of completion candidates matching SUBSTRING.
The candidates are taken from `notmuch-address-completions'."
@ -115,7 +162,7 @@ external commands."
(when (not notmuch-address-full-harvest-finished)
;; First, run quick synchronous harvest based on what the user
;; entered so far
(notmuch-address-harvest (format "to:%s*" original) t))
(notmuch-address-harvest original t))
(prog1 (notmuch-address-matching original)
;; Then start the (potentially long-running) full asynchronous harvest if necessary
(notmuch-address-harvest-trigger)))
@ -123,7 +170,12 @@ external commands."
(process-lines notmuch-address-command original))))
(defun notmuch-address-expand-name ()
(when notmuch-address-command
(cond
((and (eq notmuch-address-command 'internal)
notmuch-address-use-company
(bound-and-true-p company-mode))
(company-manual-begin))
(notmuch-address-command
(let* ((end (point))
(beg (save-excursion
(re-search-backward "\\(\\`\\|[\n:,]\\)[ \t]*")
@ -149,7 +201,8 @@ external commands."
(delete-region beg end)
(insert chosen))
(message "No matches.")
(ding)))))
(ding))))
(t nil)))
;; Copied from `w3m-which-command'.
(defun notmuch-address-locate-command (command)
@ -191,32 +244,49 @@ external commands."
The car is a partial harvest, and the cdr is a full harvest")
(defun notmuch-address-harvest (&optional filter-query synchronous callback)
"Collect addresses completion candidates. It queries the
notmuch database for all messages sent by the user optionally
matching FILTER-QUERY (if not nil). It collects the destination
addresses from those messages and stores them in
`notmuch-address-completions'. Address harvesting may take some
time so the address collection runs asynchronously unless
SYNCHRONOUS is t. In case of asynchronous execution, CALLBACK is
called when harvesting finishes."
(let* ((from-me-query (mapconcat (lambda (x) (concat "from:" x)) (notmuch-user-emails) " or "))
(query (if filter-query
(format "(%s) and (%s)" from-me-query filter-query)
from-me-query))
(defun notmuch-address-harvest (&optional addr-prefix synchronous callback)
"Collect addresses completion candidates.
It queries the notmuch database for messages sent/received (as
configured with `notmuch-address-command`) by the user, collects
destination/source addresses from those messages and stores them
in `notmuch-address-completions'.
If ADDR-PREFIX is not nil, only messages with to/from addresses
matching ADDR-PREFIX*' are queried.
Address harvesting may take some time so the address collection runs
asynchronously unless SYNCHRONOUS is t. In case of asynchronous
execution, CALLBACK is called when harvesting finishes."
(let* ((sent (eq (car notmuch-address-internal-completion) 'sent))
(config-query (cadr notmuch-address-internal-completion))
(prefix-query (when addr-prefix
(format "%s:%s*" (if sent "to" "from") addr-prefix)))
(from-or-to-me-query
(mapconcat (lambda (x)
(concat (if sent "from:" "to:") x))
(notmuch-user-emails) " or "))
(query (if (or prefix-query config-query)
(concat (format "(%s)" from-or-to-me-query)
(when prefix-query
(format " and (%s)" prefix-query))
(when config-query
(format " and (%s)" config-query)))
from-or-to-me-query))
(args `("address" "--format=sexp" "--format-version=2"
"--output=recipients"
,(if sent "--output=recipients" "--output=sender")
"--deduplicate=address"
,query)))
(if synchronous
(mapc #'notmuch-address-harvest-addr
(apply 'notmuch-call-notmuch-sexp args))
;; Asynchronous
(let* ((current-proc (if filter-query
(let* ((current-proc (if addr-prefix
(car notmuch-address-harvest-procs)
(cdr notmuch-address-harvest-procs)))
(proc-name (format "notmuch-address-%s-harvest"
(if filter-query "partial" "full")))
(if addr-prefix "partial" "full")))
(proc-buf (concat " *" proc-name "*")))
;; Kill any existing process
(when current-proc
@ -228,7 +298,7 @@ called when harvesting finishes."
args))
(set-process-filter current-proc 'notmuch-address-harvest-filter)
(set-process-query-on-exit-flag current-proc nil)
(if filter-query
(if addr-prefix
(setcar notmuch-address-harvest-procs current-proc)
(setcdr notmuch-address-harvest-procs current-proc)))))
;; return value
@ -249,6 +319,25 @@ called when harvesting finishes."
;;
(defun notmuch-address-from-minibuffer (prompt)
(if (not notmuch-address-command)
(read-string prompt)
(let ((rmap (copy-keymap minibuffer-local-map))
(omap minibuffer-local-map))
;; Configure TAB to start completion when executing read-string.
;; "Original" minibuffer keymap is restored just before calling
;; notmuch-address-expand-name as it may also use minibuffer-local-map
;; (completing-read probably does not but if something else is used there).
(define-key rmap (kbd "TAB") (lambda ()
(interactive)
(let ((enable-recursive-minibuffers t)
(minibuffer-local-map omap))
(notmuch-address-expand-name))))
(let ((minibuffer-local-map rmap))
(read-string prompt)))))
;;
(provide 'notmuch-address)
;;; notmuch-address.el ends here

View file

@ -16,7 +16,7 @@
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
@ -47,7 +47,13 @@
(defun notmuch-company-setup ()
(company-mode)
(make-local-variable 'company-backends)
(setq company-backends '(notmuch-company)))
(setq company-backends '(notmuch-company))
;; Disable automatic company completion unless an internal
;; completion method is configured. Company completion (using
;; internal completion) can still be accessed via standard company
;; functions, e.g., company-complete.
(unless (eq notmuch-address-command 'internal)
(setq-local company-idle-delay nil)))
;;;###autoload
(defun notmuch-company (command &optional arg &rest _ignore)
@ -72,7 +78,7 @@
(lambda (callback)
;; First run quick asynchronous harvest based on what the user entered so far
(notmuch-address-harvest
(format "to:%s*" arg) nil
arg nil
(lambda (_proc _event)
(funcall callback (notmuch-address-matching arg))
;; Then start the (potentially long-running) full asynchronous harvest if necessary

View file

@ -15,7 +15,7 @@
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Notmuch. If not, see <http://www.gnu.org/licenses/>.
;; along with Notmuch. If not, see <https://www.gnu.org/licenses/>.
;;
;; Authors: Jameson Rollins <jrollins@finestructure.net>

View file

@ -15,7 +15,7 @@
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Notmuch. If not, see <http://www.gnu.org/licenses/>.
;; along with Notmuch. If not, see <https://www.gnu.org/licenses/>.
;;
;; Authors: David Edmondson <dme@dme.org>
@ -265,7 +265,7 @@ International Bureau of Weights and Measures."
:group 'notmuch-hello
:group 'notmuch-hooks)
(defvar notmuch-hello-url "http://notmuchmail.org"
(defvar notmuch-hello-url "https://notmuchmail.org"
"The `notmuch' web site.")
(defvar notmuch-hello-custom-section-options
@ -671,7 +671,7 @@ with `notmuch-hello-query-counts'."
"Keymap for \"notmuch hello\" buffers.")
(fset 'notmuch-hello-mode-map notmuch-hello-mode-map)
(defun notmuch-hello-mode ()
(define-derived-mode notmuch-hello-mode fundamental-mode "notmuch-hello"
"Major mode for convenient notmuch navigation. This is your entry portal into notmuch.
Saved searches are \"bookmarks\" for arbitrary queries. Hit RET
@ -702,13 +702,7 @@ The screen may be customized via `\\[customize]'.
Complete list of currently available key bindings:
\\{notmuch-hello-mode-map}"
(interactive)
(kill-all-local-variables)
(setq notmuch-buffer-refresh-function #'notmuch-hello-update)
(use-local-map notmuch-hello-mode-map)
(setq major-mode 'notmuch-hello-mode
mode-name "notmuch-hello")
(run-mode-hooks 'notmuch-hello-mode-hook)
;;(setq buffer-read-only t)
)

View file

@ -15,7 +15,7 @@
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Notmuch. If not, see <http://www.gnu.org/licenses/>.
;; along with Notmuch. If not, see <https://www.gnu.org/licenses/>.
;;
;; Authors: Austin Clements <aclements@csail.mit.edu>
;; David Edmondson <dme@dme.org>

View file

@ -15,7 +15,7 @@
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Notmuch. If not, see <http://www.gnu.org/licenses/>.
;; along with Notmuch. If not, see <https://www.gnu.org/licenses/>.
;;
;; Authors: Carl Worth <cworth@cworth.org>
@ -23,6 +23,7 @@
;;; Code:
(require 'mm-util)
(require 'mm-view)
(require 'mm-decode)
(require 'cl)
@ -572,7 +573,20 @@ the given type."
,@(when process-crypto '("--decrypt"))
,(notmuch-id-to-query (plist-get msg :id))))
(coding-system-for-read
(if binaryp 'no-conversion 'utf-8)))
(if binaryp 'no-conversion
(let ((coding-system (mm-charset-to-coding-system
(plist-get part :content-charset))))
;; Sadly,
;; `mm-charset-to-coding-system' seems
;; to return things that are not
;; considered acceptable values for
;; `coding-system-for-read'.
(if (coding-system-p coding-system)
coding-system
;; RFC 2047 says that the default
;; charset is US-ASCII. RFC6657
;; complicates this somewhat.
'us-ascii)))))
(apply #'call-process notmuch-command nil '(t nil) nil args)
(buffer-string))))))
(when (and cache data)
@ -776,9 +790,15 @@ You may need to restart Emacs or upgrade your notmuch package."))
(insert-file-contents err-file)
(unless (eobp)
(buffer-string)))))
(command-string
(mapconcat (lambda (arg)
(shell-quote-argument
(cond ((stringp arg) arg)
((symbolp arg) (symbol-name arg))
(t "*UNKNOWN ARGUMENT*"))))
command " "))
(extra
(concat
"command: " (mapconcat #'shell-quote-argument command " ") "\n"
(concat "command: " command-string "\n"
(if (integerp exit-status)
(format "exit status: %s\n" exit-status)
(format "exit signal: %s\n" exit-status))

View file

@ -30,14 +30,14 @@
(defvar notmuch-maildir-fcc-count 0)
(defcustom notmuch-fcc-dirs "sent"
"Determines the maildir directory in which to save outgoing mail.
"Determines the Fcc Header which says where to save outgoing mail.
Three types of values are permitted:
- nil: no Fcc header is added,
- a string: the value of `notmuch-fcc-dirs' is the name of the
folder to use,
- a string: the value of `notmuch-fcc-dirs' is the Fcc header to
be used.
- a list: the folder is chosen based on the From address of the
current message using a list of regular expressions and
@ -50,12 +50,23 @@ Three types of values are permitted:
If none of the regular expressions match the From address, no
Fcc header will be added.
In all cases, a relative FCC directory will be understood to
specify a directory within the notmuch mail store, (as set by
the database.path option in the notmuch configuration file).
If `notmuch-maildir-use-notmuch-insert' is set (the default) then
the header should be of the form \"folder +tag1 -tag2\" where
folder is the folder (relative to the notmuch mailstore) to store
the message in, and tag1 and tag2 are tag changes to apply to the
stored message. This string is split using `split-string-and-unquote',
so a folder name containing spaces can be specified by
quoting each space with an immediately preceding backslash
or surrounding the entire folder name in double quotes.
You will be prompted to create the directory if it does not exist
yet when sending a mail."
If `notmuch-maildir-use-notmuch-insert' is nil then the Fcc
header should be the directory where the message should be
saved. A relative directory will be understood to specify a
directory within the notmuch mail store, (as set by the
database.path option in the notmuch configuration file).
In all cases you will be prompted to create the folder or
directory if it does not exist yet when sending a mail."
:type '(choice
(const :tag "No FCC header" nil)
@ -65,11 +76,15 @@ yet when sending a mail."
:require 'notmuch-fcc-initialization
:group 'notmuch-send)
(defun notmuch-fcc-handler (destdir)
"Write buffer to `destdir', marking it as sent
(defcustom notmuch-maildir-use-notmuch-insert 't
"Should fcc use notmuch insert instead of simple fcc"
:type '(choice :tag "Fcc Method"
(const :tag "Use notmuch insert" t)
(const :tag "Use simple fcc" nil))
:group 'notmuch-send)
Intended to be dynamically bound to `message-fcc-handler-function'"
(notmuch-maildir-fcc-write-buffer-to-maildir destdir t))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Functions which set up the fcc header in the message buffer.
(defun notmuch-fcc-header-setup ()
"Add an Fcc header to the current message buffer.
@ -110,26 +125,143 @@ by notmuch-mua-mail"
(error "Invalid `notmuch-fcc-dirs' setting (neither string nor list)")))))
(when subdir
(message-add-header
(concat "Fcc: "
(file-truename
;; If the resulting directory is not an absolute path,
;; prepend the standard notmuch database path.
(if (= (elt subdir 0) ?/)
subdir
(concat (notmuch-database-path) "/" subdir)))))
(if notmuch-maildir-use-notmuch-insert
(notmuch-maildir-add-notmuch-insert-style-fcc-header subdir)
(notmuch-maildir-add-file-style-fcc-header subdir)))))
;; finally test if fcc points to a valid maildir
(let ((fcc-header (message-field-value "Fcc")))
(unless (notmuch-maildir-fcc-dir-is-maildir-p fcc-header)
(cond ((not (file-writable-p fcc-header))
(error (format "No permission to create %s, which does not exist"
fcc-header)))
((y-or-n-p (format "%s is not a maildir. Create it? "
fcc-header))
(notmuch-maildir-fcc-create-maildir fcc-header))
(t
(error "Message not sent"))))))))
(defun notmuch-maildir-add-notmuch-insert-style-fcc-header (subdir)
;; Notmuch insert does not accept absolute paths, so check the user
;; really want this header inserted.
(when (or (not (= (elt subdir 0) ?/))
(y-or-n-p (format "Fcc header %s is an absolute path and notmuch insert is requested.\nInsert header anyway? "
subdir)))
(message-add-header (concat "Fcc: " subdir))))
(defun notmuch-maildir-add-file-style-fcc-header (subdir)
(message-add-header
(concat "Fcc: "
(file-truename
;; If the resulting directory is not an absolute path,
;; prepend the standard notmuch database path.
(if (= (elt subdir 0) ?/)
subdir
(concat (notmuch-database-path) "/" subdir))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Functions for saving a message either using notmuch insert or file
;; fcc. First functions common to the two cases.
(defmacro with-temporary-notmuch-message-buffer (&rest body)
"Set-up a temporary copy of the current message-mode buffer."
`(let ((case-fold-search t)
(buf (current-buffer))
(mml-externalize-attachments message-fcc-externalize-attachments))
(with-current-buffer (get-buffer-create " *message temp*")
(erase-buffer)
(insert-buffer-substring buf)
,@body)))
(defun notmuch-maildir-setup-message-for-saving ()
"Setup message for saving. Should be called on a temporary copy.
This is taken from the function message-do-fcc."
(message-encode-message-body)
(save-restriction
(message-narrow-to-headers)
(let ((mail-parse-charset message-default-charset))
(mail-encode-encoded-word-buffer)))
(goto-char (point-min))
(when (re-search-forward
(concat "^" (regexp-quote mail-header-separator) "$")
nil t)
(replace-match "" t t )))
(defun notmuch-maildir-message-do-fcc ()
"Process Fcc headers in the current buffer.
This is a rearranged version of message mode's message-do-fcc."
(let (list file)
(save-excursion
(save-restriction
(message-narrow-to-headers)
(setq file (message-fetch-field "fcc" t)))
(when file
(with-temporary-notmuch-message-buffer
(save-restriction
(message-narrow-to-headers)
(while (setq file (message-fetch-field "fcc" t))
(push file list)
(message-remove-header "fcc" nil t)))
(notmuch-maildir-setup-message-for-saving)
;; Process FCC operations.
(while list
(setq file (pop list))
(notmuch-fcc-handler file))
(kill-buffer (current-buffer)))))))
(defun notmuch-fcc-handler (fcc-header)
"Store message with notmuch insert or normal (file) fcc.
If `notmuch-maildir-use-notmuch-insert` is set then store the
message using notmuch insert. Otherwise store the message using
normal fcc."
(message "Doing Fcc...")
(if notmuch-maildir-use-notmuch-insert
(notmuch-maildir-fcc-with-notmuch-insert fcc-header)
(notmuch-maildir-fcc-file-fcc fcc-header)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Functions for saving a message using notmuch insert.
(defun notmuch-maildir-notmuch-insert-current-buffer (folder &optional create tags)
"Use notmuch insert to put the current buffer in the database.
This inserts the current buffer as a message into the notmuch
database in folder FOLDER. If CREATE is non-nil it will supply
the --create-folder flag to create the folder if necessary. TAGS
should be a list of tag changes to apply to the inserted message."
(let* ((args (append (when create (list "--create-folder"))
(list (concat "--folder=" folder))
tags)))
(apply 'notmuch-call-notmuch-process
:stdin-string (buffer-string) "insert" args)))
(defun notmuch-maildir-fcc-with-notmuch-insert (fcc-header &optional create)
"Store message with notmuch insert.
The fcc-header should be of the form \"folder +tag1 -tag2\" where
folder is the folder (relative to the notmuch mailstore) to store
the message in, and tag1 and tag2 are tag changes to apply to the
stored message. This string is split using `split-string-and-unquote',
so a folder name containing spaces can be specified by
quoting each space with an immediately preceding backslash
or surrounding the entire folder name in double quotes.
If CREATE is non-nil then create the folder if necessary."
(let* ((args (split-string-and-unquote fcc-header))
(folder (car args))
(tags (cdr args)))
(condition-case nil
(notmuch-maildir-notmuch-insert-current-buffer folder create tags)
;; Since there are many reasons notmuch insert could fail, e.g.,
;; locked database, non-existent folder (which could be due to a
;; typo, or just the user want a new folder, let the user decide
;; how to deal with it.
(error
(let ((response (read-char-choice
"Insert failed: (r)etry, (c)reate folder, (i)gnore, or (e)dit the header? "
'(?r ?c ?i ?e))))
(case response
(?r (notmuch-maildir-fcc-with-notmuch-insert fcc-header))
(?c (notmuch-maildir-fcc-with-notmuch-insert fcc-header 't))
(?i 't)
(?e (notmuch-maildir-fcc-with-notmuch-insert
(read-from-minibuffer "Fcc header: " fcc-header)))))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Functions for saving a message using file fcc.
(defun notmuch-maildir-fcc-host-fixer (hostname)
(replace-regexp-in-string "/\\|:"
@ -192,6 +324,29 @@ if successful, nil if not."
(concat destdir "/tmp/" msg-id)
(concat destdir "/cur/" msg-id ":2," (when mark-seen "S"))))
(defun notmuch-maildir-fcc-file-fcc (fcc-header)
"Write the message to the file specified by FCC-HEADER.
It offers the user a chance to correct the header, or filesystem,
if needed."
(if (notmuch-maildir-fcc-dir-is-maildir-p fcc-header)
(notmuch-maildir-fcc-write-buffer-to-maildir fcc-header 't)
;; The fcc-header is not a valid maildir see if the user wants to
;; fix it in some way.
(let* ((prompt (format "Fcc %s is not a maildir: (r)etry, (c)reate folder, (i)gnore, or (e)dit the header? "
fcc-header))
(response (read-char-choice prompt '(?r ?c ?i ?e))))
(case response
(?r (notmuch-maildir-fcc-file-fcc fcc-header))
(?c (if (file-writable-p fcc-header)
(notmuch-maildir-fcc-create-maildir fcc-header)
(message "No permission to create %s." fcc-header)
(sit-for 2))
(notmuch-maildir-fcc-file-fcc fcc-header))
(?i 't)
(?e (notmuch-maildir-fcc-file-fcc
(read-from-minibuffer "Fcc header: " fcc-header)))))))
(defun notmuch-maildir-fcc-write-buffer-to-maildir (destdir &optional mark-seen)
"Writes the current buffer to maildir destdir. If mark-seen is
non-nil, it will write it to cur/, and mark it as read. It should

View file

@ -15,7 +15,7 @@
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Notmuch. If not, see <http://www.gnu.org/licenses/>.
;; along with Notmuch. If not, see <https://www.gnu.org/licenses/>.
;;
;; Authors: Jesse Rosenthal <jrosenthal@jhu.edu>

View file

@ -15,7 +15,7 @@
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Notmuch. If not, see <http://www.gnu.org/licenses/>.
;; along with Notmuch. If not, see <https://www.gnu.org/licenses/>.
;;
;; Authors: David Edmondson <dme@dme.org>
@ -32,7 +32,7 @@
(declare-function notmuch-show-insert-body "notmuch-show" (msg body depth))
(declare-function notmuch-fcc-header-setup "notmuch-maildir-fcc" ())
(declare-function notmuch-fcc-handler "notmuch-maildir-fcc" (destdir))
(declare-function notmuch-maildir-message-do-fcc "notmuch-maildir-fcc" ())
;;
@ -62,7 +62,7 @@ disabled: this would result in an incorrect behavior."))
(const :tag "Compose mail in a new window" new-window)
(const :tag "Compose mail in a new frame" new-frame)))
(defcustom notmuch-mua-user-agent-function 'notmuch-mua-user-agent-full
(defcustom notmuch-mua-user-agent-function nil
"Function used to generate a `User-Agent:' string. If this is
`nil' then no `User-Agent:' will be generated."
:type '(choice (const :tag "No user agent string" nil)
@ -73,7 +73,7 @@ disabled: this would result in an incorrect behavior."))
:value notmuch-mua-user-agent-full))
:group 'notmuch-send)
(defcustom notmuch-mua-hidden-headers '("^User-Agent:")
(defcustom notmuch-mua-hidden-headers nil
"Headers that are added to the `message-mode' hidden headers
list."
:type '(repeat string)
@ -142,7 +142,7 @@ mutiple parts get a header."
(let ((notmuch-version (if (string= notmuch-emacs-version "unknown")
(notmuch-cli-version)
notmuch-emacs-version)))
(concat "Notmuch/" notmuch-version " (http://notmuchmail.org)")))
(concat "Notmuch/" notmuch-version " (https://notmuchmail.org)")))
(defun notmuch-mua-user-agent-emacs ()
"Generate a `User-Agent:' string suitable for notmuch."
@ -253,8 +253,11 @@ mutiple parts get a header."
(notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function)
;; Don't indent multipart sub-parts.
(notmuch-show-indent-multipart nil))
(notmuch-show-insert-body original (plist-get original :body) 0)
(buffer-substring-no-properties (point-min) (point-max)))))
;; We don't want sigstatus buttons (an information leak and usually wrong anyway).
(letf (((symbol-function 'notmuch-crypto-insert-sigstatus-button) #'ignore)
((symbol-function 'notmuch-crypto-insert-encstatus-button) #'ignore))
(notmuch-show-insert-body original (plist-get original :body) 0)
(buffer-substring-no-properties (point-min) (point-max))))))
(set-mark (point))
(goto-char start)
@ -276,8 +279,7 @@ mutiple parts get a header."
(define-derived-mode notmuch-message-mode message-mode "Message[Notmuch]"
"Notmuch message composition mode. Mostly like `message-mode'"
(when notmuch-address-command
(notmuch-address-setup)))
(notmuch-address-setup))
(put 'notmuch-message-mode 'flyspell-mode-predicate 'mail-mode-flyspell-verify)
@ -334,11 +336,14 @@ modified. This function is notmuch addaptation of
;; C-h f compose-mail says that headers should be specified as
;; (string . value); however all the rest of message expects
;; headers to be symbols, not strings (eg message-header-format-alist).
;; http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg00337.html
;; https://lists.gnu.org/archive/html/emacs-devel/2011-01/msg00337.html
;; We need to convert any string input, eg from rmail-start-mail.
(dolist (h other-headers other-headers)
(if (stringp (car h)) (setcar h (intern (capitalize (car h))))))))
(args (list yank-action send-actions)))
(args (list yank-action send-actions))
;; Cause `message-setup-1' to do things relevant for mail,
;; such as observe `message-default-mail-headers'.
(message-this-is-mail t))
;; message-setup-1 in Emacs 23 does not accept return-action
;; argument. Pass it only if it is supplied by the caller. This
;; will never be the case when we're called by `compose-mail' in
@ -487,13 +492,13 @@ will be addressed to all recipients of the source message."
(defun notmuch-mua-send-and-exit (&optional arg)
(interactive "P")
(let ((message-fcc-handler-function #'notmuch-fcc-handler))
(message-send-and-exit arg)))
(letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc))
(message-send-and-exit arg)))
(defun notmuch-mua-send (&optional arg)
(interactive "P")
(let ((message-fcc-handler-function #'notmuch-fcc-handler))
(message-send arg)))
(letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc))
(message-send arg)))
(defun notmuch-mua-kill-buffer ()
(interactive)

View file

@ -15,7 +15,7 @@
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Notmuch. If not, see <http://www.gnu.org/licenses/>.
;; along with Notmuch. If not, see <https://www.gnu.org/licenses/>.
;;
;; Authors: Austin Clements <aclements@csail.mit.edu>

View file

@ -15,7 +15,7 @@
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Notmuch. If not, see <http://www.gnu.org/licenses/>.
;; along with Notmuch. If not, see <https://www.gnu.org/licenses/>.
;;
;; Authors: David Edmondson <dme@dme.org>

View file

@ -15,7 +15,7 @@
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Notmuch. If not, see <http://www.gnu.org/licenses/>.
;; along with Notmuch. If not, see <https://www.gnu.org/licenses/>.
;;
;; Authors: David Bremner <david@tethera.net>

View file

@ -16,7 +16,7 @@
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Notmuch. If not, see <http://www.gnu.org/licenses/>.
;; along with Notmuch. If not, see <https://www.gnu.org/licenses/>.
;;
;; Authors: Carl Worth <cworth@cworth.org>
;; David Edmondson <dme@dme.org>
@ -182,9 +182,9 @@ each attachment handler is logged in buffers with names beginning
(defcustom notmuch-show-stash-mlarchive-link-alist
'(("Gmane" . "http://mid.gmane.org/")
("MARC" . "http://marc.info/?i=")
("Mail Archive, The" . "http://mid.mail-archive.com/")
("LKML" . "http://lkml.kernel.org/r/")
("MARC" . "https://marc.info/?i=")
("Mail Archive, The" . "https://mid.mail-archive.com/")
("LKML" . "https://lkml.kernel.org/r/")
;; FIXME: can these services be searched by `Message-Id' ?
;; ("MarkMail" . "http://markmail.org/")
;; ("Nabble" . "http://nabble.com/")
@ -682,6 +682,9 @@ will return nil if the CID is unknown or cannot be retrieved."
(indent-rigidly start (point) 1)))
t)
(defun notmuch-show-insert-part-application/pgp-encrypted (msg part content-type nth depth button)
t)
(defun notmuch-show-insert-part-multipart/* (msg part content-type nth depth button)
(let ((inner-parts (plist-get part :content))
(start (point)))
@ -1171,13 +1174,15 @@ This also turns id:\"<message id>\"-parts and mid: links into
buttons for a corresponding notmuch search."
(goto-address-fontify-region start end)
(save-excursion
(let (links)
(goto-char start)
(while (re-search-forward notmuch-id-regexp end t)
(let (links
(beg-line (progn (goto-char start) (line-beginning-position)))
(end-line (progn (goto-char end) (line-end-position))))
(goto-char beg-line)
(while (re-search-forward notmuch-id-regexp end-line t)
(push (list (match-beginning 0) (match-end 0)
(match-string-no-properties 0)) links))
(goto-char start)
(while (re-search-forward notmuch-mid-regexp end t)
(goto-char beg-line)
(while (re-search-forward notmuch-mid-regexp end-line t)
(let* ((mid-cid (match-string-no-properties 1))
(mid (save-match-data
(string-match "^[^/]*" mid-cid)
@ -1403,6 +1408,7 @@ reset based on the original query."
(define-key map "v" 'notmuch-show-view-part)
(define-key map "o" 'notmuch-show-interactively-view-part)
(define-key map "|" 'notmuch-show-pipe-part)
(define-key map "m" 'notmuch-show-choose-mime-of-part)
(define-key map "?" 'notmuch-subkeymap-help)
map)
"Submap for part commands")
@ -1418,6 +1424,7 @@ reset based on the original query."
(define-key map (kbd "TAB") 'notmuch-show-next-button)
(define-key map "f" 'notmuch-show-forward-message)
(define-key map "F" 'notmuch-show-forward-open-messages)
(define-key map "b" 'notmuch-show-resend-message)
(define-key map "l" 'notmuch-show-filter-thread)
(define-key map "r" 'notmuch-show-reply-sender)
(define-key map "R" 'notmuch-show-reply)
@ -1453,7 +1460,7 @@ reset based on the original query."
"Keymap for \"notmuch show\" buffers.")
(fset 'notmuch-show-mode-map notmuch-show-mode-map)
(defun notmuch-show-mode ()
(define-derived-mode notmuch-show-mode fundamental-mode "notmuch-show"
"Major mode for viewing a thread with notmuch.
This buffer contains the results of the \"notmuch show\" command
@ -1481,12 +1488,7 @@ You can add or remove arbitrary tags from the current message with
All currently available key bindings:
\\{notmuch-show-mode-map}"
(interactive)
(kill-all-local-variables)
(setq notmuch-buffer-refresh-function #'notmuch-show-refresh-view)
(use-local-map notmuch-show-mode-map)
(setq major-mode 'notmuch-show-mode
mode-name "notmuch-show")
(setq buffer-read-only t
truncate-lines t))
@ -1700,12 +1702,23 @@ user decision and we should not override it."
(notmuch-show-mark-read)
(notmuch-show-set-prop :seen t)))
(defvar notmuch-show--seen-has-errored nil)
(make-variable-buffer-local 'notmuch-show--seen-has-errored)
(defun notmuch-show-command-hook ()
(when (eq major-mode 'notmuch-show-mode)
;; We need to redisplay to get window-start and window-end correct.
(redisplay)
(save-excursion
(funcall notmuch-show-mark-read-function (window-start) (window-end)))))
(condition-case err
(funcall notmuch-show-mark-read-function (window-start) (window-end))
((debug error)
(unless notmuch-show--seen-has-errored
(setq notmuch-show--seen-has-errored 't)
(setq header-line-format
(concat header-line-format
(propertize " [some mark read tag changes may have failed]"
'face font-lock-warning-face)))))))))
(defun notmuch-show-filter-thread (query)
"Filter or LIMIT the current thread based on a new query string.
@ -1855,6 +1868,14 @@ any effects from previous calls to
(error "No open messages to forward."))
(notmuch-mua-new-forward-messages open-messages prompt-for-sender)))
(defun notmuch-show-resend-message (addresses)
"Resend the current message."
(interactive (list (notmuch-address-from-minibuffer "Resend to: ")))
(when (y-or-n-p (concat "Confirm resend to " addresses " "))
(notmuch-show-view-raw-message)
(message-resend addresses)
(notmuch-bury-or-kill-this-buffer)))
(defun notmuch-show-next-message (&optional pop-at-end)
"Show the next message.
@ -2317,25 +2338,27 @@ omit --in-reply-to=<Message-Id>."
(insert (notmuch-get-bodypart-binary msg part process-crypto)))
buf))
(defun notmuch-show-current-part-handle ()
(defun notmuch-show-current-part-handle (&optional mime-type)
"Return an mm-handle for the part containing point.
This creates a temporary buffer for the part's content; the
caller is responsible for killing this buffer as appropriate."
caller is responsible for killing this buffer as appropriate. If
MIME-TYPE is given then set the handle's mime-type to MIME-TYPE."
(let* ((msg (notmuch-show-get-message-properties))
(part (notmuch-show-get-part-properties))
(buf (notmuch-show-generate-part-buffer msg part))
(computed-type (plist-get part :computed-type))
(computed-type (or mime-type (plist-get part :computed-type)))
(filename (plist-get part :filename))
(disposition (if filename `(attachment (filename . ,filename)))))
(mm-make-handle buf (list computed-type) nil nil disposition)))
(defun notmuch-show-apply-to-current-part-handle (fn)
(defun notmuch-show-apply-to-current-part-handle (fn &optional mime-type)
"Apply FN to an mm-handle for the part containing point.
This ensures that the temporary buffer created for the mm-handle
is destroyed when FN returns."
(let ((handle (notmuch-show-current-part-handle)))
is destroyed when FN returns. If MIME-TYPE is given then force
part to be treated as if it had that mime-type."
(let ((handle (notmuch-show-current-part-handle mime-type)))
;; emacs 24.3+ puts stdout/stderr into the calling buffer so we
;; call it from a temp-buffer, unless
;; notmuch-show-attachment-debug is non-nil in which case we put
@ -2380,6 +2403,27 @@ is destroyed when FN returns."
(notmuch-show-apply-to-current-part-handle #'mm-pipe-part))
(defun notmuch-show--mm-display-part (handle)
"Use mm-display-part to display HANDLE in a new buffer.
If the part is displayed in an external application then close
the new buffer."
(let ((buf (get-buffer-create (generate-new-buffer-name
(concat " *notmuch-internal-part*")))))
(switch-to-buffer buf)
(if (eq (mm-display-part handle) 'external)
(kill-buffer buf)
(goto-char (point-min))
(set-buffer-modified-p nil)
(view-buffer buf 'kill-buffer-if-not-modified))))
(defun notmuch-show-choose-mime-of-part (mime-type)
"Choose the mime type to use for displaying part"
(interactive
(list (completing-read "Mime type to use (default text/plain): "
(mailcap-mime-types) nil nil nil nil "text/plain")))
(notmuch-show-apply-to-current-part-handle #'notmuch-show--mm-display-part mime-type))
(provide 'notmuch-show)
;;; notmuch-show.el ends here

View file

@ -16,7 +16,7 @@
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Notmuch. If not, see <http://www.gnu.org/licenses/>.
;; along with Notmuch. If not, see <https://www.gnu.org/licenses/>.
;;
;; Authors: Carl Worth <cworth@cworth.org>
;; Damien Cassou <damien.cassou@gmail.com>
@ -56,9 +56,23 @@
(string :tag "Custom")))
(sexp :tag "Custom")))))
(defface notmuch-tag-unread
'((t :foreground "red"))
"Default face used for the unread tag.
Used in the default value of `notmuch-tag-formats`."
:group 'notmuch-faces)
(defface notmuch-tag-flagged
'((t :foreground "blue"))
"Face used for the flagged tag.
Used in the default value of `notmuch-tag-formats`."
:group 'notmuch-faces)
(defcustom notmuch-tag-formats
'(("unread" (propertize tag 'face '(:foreground "red")))
("flagged" (propertize tag 'face '(:foreground "blue"))
'(("unread" (propertize tag 'face 'notmuch-tag-unread))
("flagged" (propertize tag 'face 'notmuch-tag-flagged)
(notmuch-tag-format-image-data tag (notmuch-tag-star-icon))))
"Custom formats for individual tags.
@ -90,15 +104,17 @@ with images."
:group 'notmuch-faces
:type 'notmuch-tag-format-type)
(defface notmuch-tag-deleted
'((((class color) (supports :strike-through "red")) :strike-through "red")
(t :inverse-video t))
"Face used to display deleted tags.
Used in the default value of `notmuch-tag-deleted-formats`."
:group 'notmuch-faces)
(defcustom notmuch-tag-deleted-formats
'(("unread" (notmuch-apply-face bare-tag
(if (display-supports-face-attributes-p '(:strike-through "red"))
'(:strike-through "red")
'(:inverse-video t))))
(".*" (notmuch-apply-face tag
(if (display-supports-face-attributes-p '(:strike-through "red"))
'(:strike-through "red")
'(:inverse-video t)))))
'(("unread" (notmuch-apply-face bare-tag `notmuch-tag-deleted))
(".*" (notmuch-apply-face tag `notmuch-tag-deleted)))
"Custom formats for tags when deleted.
For deleted tags the formats in `notmuch-tag-formats` are applied
@ -118,8 +134,15 @@ See `notmuch-tag-formats' for full documentation."
:group 'notmuch-faces
:type 'notmuch-tag-format-type)
(defface notmuch-tag-added
'((t :underline "green"))
"Default face used for added tags.
Used in the default value for `notmuch-tag-added-formats`."
:group 'notmuch-faces)
(defcustom notmuch-tag-added-formats
'((".*" (notmuch-apply-face tag '(:underline "green"))))
'((".*" (notmuch-apply-face tag 'notmuch-tag-added)))
"Custom formats for tags when added.
For added tags the formats in `notmuch-tag-formats` are applied

View file

@ -17,7 +17,7 @@
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Notmuch. If not, see <http://www.gnu.org/licenses/>.
;; along with Notmuch. If not, see <https://www.gnu.org/licenses/>.
;;
;; Authors: David Edmondson <dme@dme.org>
;; Mark Walters <markwalters1009@gmail.com>
@ -241,6 +241,8 @@ FUNC."
(define-key map [remap notmuch-search] 'notmuch-tree-to-search)
;; Override because we want to close message pane first.
(define-key map [remap notmuch-mua-new-mail] (notmuch-tree-close-message-pane-and #'notmuch-mua-new-mail))
;; Override because we want to close message pane first.
(define-key map [remap notmuch-jump-search] (notmuch-tree-close-message-pane-and #'notmuch-jump-search))
(define-key map "S" 'notmuch-search-from-tree-current-query)
@ -249,6 +251,7 @@ FUNC."
(define-key map "w" 'notmuch-show-save-attachments)
(define-key map "v" 'notmuch-show-view-all-mime-parts)
(define-key map "c" 'notmuch-show-stash-map)
(define-key map "b" 'notmuch-show-resend-message)
;; these apply to the message pane
(define-key map (kbd "M-TAB") (notmuch-tree-to-message-pane #'notmuch-show-previous-button))
@ -280,7 +283,7 @@ FUNC."
(define-key map "+" 'notmuch-tree-add-tag)
(define-key map "*" 'notmuch-tree-tag-thread)
(define-key map " " 'notmuch-tree-scroll-or-next)
(define-key map "b" 'notmuch-tree-scroll-message-window-back)
(define-key map (kbd "DEL") 'notmuch-tree-scroll-message-window-back)
map))
(fset 'notmuch-tree-mode-map notmuch-tree-mode-map)
@ -803,7 +806,7 @@ This function inserts a collection of several complete threads as
passed to it by notmuch-tree-process-filter."
(mapc 'notmuch-tree-insert-forest-thread forest))
(defun notmuch-tree-mode ()
(define-derived-mode notmuch-tree-mode fundamental-mode "notmuch-tree"
"Major mode displaying messages (as opposed to threads) of of a notmuch search.
This buffer contains the results of a \"notmuch tree\" of your
@ -817,12 +820,7 @@ Complete list of currently available key bindings:
\\{notmuch-tree-mode-map}"
(interactive)
(kill-all-local-variables)
(setq notmuch-buffer-refresh-function #'notmuch-tree-refresh-view)
(use-local-map notmuch-tree-mode-map)
(setq major-mode 'notmuch-tree-mode
mode-name "notmuch-tree")
(hl-line-mode 1)
(setq buffer-read-only t
truncate-lines t))

View file

@ -16,7 +16,7 @@
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Notmuch. If not, see <http://www.gnu.org/licenses/>.
;; along with Notmuch. If not, see <https://www.gnu.org/licenses/>.
;;; Code:

View file

@ -16,7 +16,7 @@
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Notmuch. If not, see <http://www.gnu.org/licenses/>.
;; along with Notmuch. If not, see <https://www.gnu.org/licenses/>.
;;
;; Authors: Carl Worth <cworth@cworth.org>
;; David Edmondson <dme@dme.org>
@ -26,6 +26,7 @@
(require 'coolj)
(declare-function notmuch-show-insert-bodypart "notmuch-show" (msg part depth &optional hide))
(defvar notmuch-show-indent-messages-width)
;;
@ -121,8 +122,8 @@ collapse the remaining lines into a button."
If this is nil, lines in messages will be wrapped to fit in the
current window. If this is a number, lines will be wrapped after
this many characters or at the window width (whichever one is
lower)."
this many characters (ignoring indentation due to thread depth)
or at the window width (whichever one is lower)."
:type '(choice (const :tag "window width" nil)
(integer :tag "number of characters"))
:group 'notmuch-wash)
@ -335,12 +336,13 @@ message at the window width. When doing so, citation leaders in
the wrapped text are maintained."
(let* ((coolj-wrap-follows-window-size nil)
(indent (* depth notmuch-show-indent-messages-width))
(limit (if (numberp notmuch-wash-wrap-lines-length)
(min notmuch-wash-wrap-lines-length
(min (+ notmuch-wash-wrap-lines-length indent)
(window-width))
(window-width)))
(fill-column (- limit
depth
indent
;; 2 to avoid poor interaction with
;; `word-wrap'.
2)))

Some files were not shown because too many files have changed in this diff Show more