Austin Clements [Mon, 23 Jun 2014 14:25:28 +0000 (10:25 -0400)]
NEWS: Improve and correct "Fix for phrase indexing" entry
This improves the description of the fix, fixes some typos, and
changes "(re)-indexed" to "indexed" because we have no particular
notion of "re-indexing" a message.
Felipe Contreras [Mon, 12 May 2014 03:09:32 +0000 (22:09 -0500)]
configure: add workaround for systems without zlib.pc
Some systems (e.g. FreeBSD) might not have installed the appropriate
pkg-config file as they should. We can workaround the issue by creating
the .pc file they should have distributed.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Austin Clements [Mon, 16 Jun 2014 02:40:34 +0000 (22:40 -0400)]
lib: Separate all phrases indexed by _notmuch_message_gen_terms
This adds a 100 termpos gap between all phrases indexed by
_notmuch_message_gen_terms. This fixes a bug where terms from the end
of one header and the beginning of another header could match together
in a single phrase and a separate bug where term positions of
un-prefixed terms overlapped.
This fix only affects newly indexed messages. Messages that are
already indexed won't benefit from this fix without re-indexing, but
the fix won't make things any worse for existing messages.
Austin Clements [Mon, 16 Jun 2014 02:40:33 +0000 (22:40 -0400)]
test: Known-broken test for overlapping/adjacent termpos
This adds two known-broken tests and one working test related to the
term positions assigned to terms from different headers or MIME parts.
The first test fails because we don't create a termpos gap between
different headers. The second test fails because we don't adjust
termpos at all when indexing multiple parts.
Austin Clements [Mon, 16 Jun 2014 02:40:32 +0000 (22:40 -0400)]
lib: Index name and address of from/to headers as a phrase
Previously, we indexed the name and address parts of from/to headers
with two calls to _notmuch_message_gen_terms. In general, this
indicates that these parts are separate phrases. However, because of
an implementation quirk, the two calls to _notmuch_message_gen_terms
generated adjacent term positions for the prefixed terms, which
happens to be the right thing to do in this case, but the wrong thing
to do for all other calls. Furthermore, _notmuch_message_gen_terms
produced potentially overlapping term positions for the un-prefixed
copies of the terms, which is simply wrong.
This change indexes both the name and address in a single call to
_notmuch_message_gen_terms, indicating that they should be part of a
single phrase. This masks the problem with the un-prefixed terms
(fixing the two known-broken tests) and puts us in a position to fix
the unintentionally phrases generated by other calls to
_notmuch_message_gen_terms.
Austin Clements [Mon, 16 Jun 2014 02:40:31 +0000 (22:40 -0400)]
test: Add search tests for combined name/address queries
Two of these are currently known-broken. We index the name and
address parts in two separate calls to _notmuch_message_gen_terms.
Currently this has the effect of placing the term positions of the
prefixed terms from the second call right after those of the first
call, but screws up the term positions of the non-prefixed terms.
Austin Clements [Mon, 16 Jun 2014 02:40:30 +0000 (22:40 -0400)]
test: Fix from/to search test queries
Two of the search tests for "from" and "to" queries were clearly
trying to search for prefixed phrases, but forgot to shell quote the
phrases. Fix this by quoting them correctly.
Tomi Ollila [Sat, 10 May 2014 21:36:43 +0000 (00:36 +0300)]
emacs install: make sure all components to be installed are there
`make install-emacs` will copy $(emacs_sources), $(emacs_images) and
$(emacs_bytecode) to their target directories. $(emacs_bytecode) was
already a prerequisite of make install-emacs as these obviously needed
to be build. Until a while ago all of $(emacs_sources) was available
in the repository, but now it includes `notmuch-version.el` which
is generated. In the future we may have generated emacs images too.
The intention was to drop support for indexing new single-message mbox
files (and whether that was a good idea in the first place is
arguable). However this inadvertently broke support for reading
headers from previously indexed single-message mbox files, which is
far worse.
Distinguishing between the two cases would require more code than
simply bringing back support for single-message mbox files.
David Bremner [Thu, 29 May 2014 00:26:27 +0000 (21:26 -0300)]
test: use --quick when starting emacs.
At least in emacs24, this removes the "site-lisp" directories from the
load path in addition to enforcing --no-site-lisp --no-init-file.
This works around a slightly mysterious bug on Debian that causes
test-lib.el not to load when there is cl-lib.el(c) in some site-lisp
directory. It should be harmless in general since we really don't
want to load any files from addon packages to emacs.
Felipe Contreras [Mon, 12 May 2014 02:22:25 +0000 (21:22 -0500)]
build: fix order of rpath
In my system `pkg-config --libs talloc` returns
'Wl,-rpath,/usr/lib -ltalloc' (probably wrongly) which causes the final
LDFLAGS to be something like '-Wl,-rpath,/usr/lib
-Wl,-rpath,/opt/notmuch/lib', which causes the RUNPATH to be
'/usr/lib:/opt/notmuch/lib', so basically defeating the whole purpose of
RUNPATH.
I noticed this when my /opt/notmuch/bin/notmuch (0.17) started updating
the database after I updated the system (which updated the system's
notmuch). This shouldn't happen.
Let's move the RUNPATH flags before other external flags have a chance of
screwing the build.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
html_static_path is a kind of source directory and it was set to
destination directory (../html) which caused infinite recursion with
Sphinx 1.2 and above.
Mark Walters [Wed, 21 May 2014 09:58:50 +0000 (10:58 +0100)]
emacs: make sure tagging on an empty query is harmless
Currently notmuch-tag throws a "wrong-type-argument stringp nil" if
passed a nil query-string. Catch this and provide a more useful error
message. This fixes a case in notmuch-tree (if you try to tag when at
the end of the buffer).
Secondly, as pointed out by David (dme)
`notmuch-search-find-stable-query-region' can return the query string
() if there are no messages in the region. This gets passed to notmuch
tag, and due to interactions in the optimize_query code in
notmuch-tag.c becomes, in the case tag-change is -inbox, "( () ) and
(tag:inbox)". This query matches some strange collection of messages
which then get archived. This should probably be fixed, but in any
case make `notmuch-search-find-stable-query-region' return a nil
query-string in this case.
This avoids data-loss (random tag removal) in this case.
The linking to talloc is hard-coded in the testing Makefile. This patch
causes the linking to talloc to be done according to how TALLOC_LDFLAGS
was configured.
Signed-off-by: Charles Celerier <cceleri@cs.stanford.edu>
David Bremner [Thu, 8 May 2014 11:57:07 +0000 (20:57 +0900)]
notmuch-dump: use fsync instead of fdatasync
Since the file size will have changed, there is no performance benefit
to calling fdatasync. Somewhat surprisingly, using fdatasync
apparently causes portability problems on FreeBSD.
We want the proper encoding and content-type to be set when sending the
mail, but human-readable plain-text for composing. So split the code in
two parts: the presentation and the transport conversion.
This fixes an issue while sending non-ascii mails to strict servers; the
mail needs to be encoded.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
It never really worked; in Ruby only 'nil' and 'false' evaluate to
false, therefore the statement '0 : true ? false' returns true, so it
doesn't matter if notmuch_folders_count_threads = 0, count_threads would
be true.
We need to check specifically if the value is 1 or 0.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Jani Nikula [Fri, 2 May 2014 16:28:38 +0000 (19:28 +0300)]
NEWS: make it explicit that wildcard matching is no longer supported
Wildcard matching was a feature of the probabilistic prefix, and we no
longer have it for the boolean prefix. Also note that top-level folder
can now be searched.
doc: Simplify and clarify notmuch show --format=sexp description
Previously, this was a verbatim copy of the --format=json text.
Change it to instead reference the JSON text and actually describe how
the S-expression format works.
Mark Walters [Wed, 16 Apr 2014 21:21:53 +0000 (22:21 +0100)]
emacs: hello: bugfix for saved searches defcustom
The recent changes for saved searches introduced a bug when notmuch
was loaded after the saved search was defined. This was caused by a
utility function not being defined when the defcustom was loaded.
Fix this by moving some code around: the defcustom is moved into
notmuch-hello (which is a more natural place anyway), and the utility
functions are moved before the defcustom in notmuch-hello. We are
rather constrained as the defcustom for saved searches is the first
variable in the notmuch-hello customize window; to avoid moving this
customize the defcustom needs to be the first defcustom in
notmuch-hello, and the utility functions come before that.
This patch also renames one of the utility functions from
notmuch--saved-searches-to-plist to
notmuch-hello--saved-searches-to-plist (as it is purely local to
notmuch-hello) and corrects a couple of typo/spelling mistakes pointed
out by Tomi.
W. Trevor King [Sat, 5 Apr 2014 17:31:06 +0000 (10:31 -0700)]
doc/mkdocdeps.py: Use "with" statement for the output file
Before this patch, the open was unnecessarily early and relied on the
process cleanup to close. Neither one of these was a real problem,
but PEP 343's context managers (which landed in Python 2.5) make
proper cleanup very easy.
W. Trevor King [Sat, 5 Apr 2014 17:31:05 +0000 (10:31 -0700)]
doc/mkdocdeps.py: Convert execfile to import
excefile is gone in Python 3 [1]. Instead of exec-ing the
configuration, it's easier to insert the source directory in Python's
path [2], and just import the configuration. With this change,
mkdocdeps.py is compatible with both Python 2 and 3.
Previously, even if debug-on-error was non-nil, the debugger would not
trap on part renderer errors. This made debugging part renderer bugs
frustrating, so let the debugger trap these errors.
The roff build rule builds all of the roff files in a single command.
Previously, this was expressed as a multi-target rule, but since this
is equivalent to specifying a copy of the rule for each target, make
-jN could start up to N parallel instances of this command. Fix this
by bottlenecking this rule through a single stamp file.
This also removes the unused man.stamp from CLEAN.
Mark Walters [Sat, 12 Apr 2014 12:46:27 +0000 (13:46 +0100)]
NEWS: document possible breakage from saved-search format change
If the user has unsorted or alphabetically sorted saved-searches these
should continue to work. If they have some custom lisp sort function
then it will need updating to work with the new saved-sort
format. Document this, and how the updating should be done.
Also roll in fixes for the markdown in the first part of the NEWS
suggested by Tomi: change `just work' to *just work* and removed
periods from the end of subtitle lines.
emacs: remove auto-signing of replies to signed messages
It was decided that auto-signing is potentially too troublesome for the
apparently common case of users who enable crypto processing for the
purpose of checking signature validity but who are not in a position to
sign out-going messages. Users can still manually invoke signing as needed.
Encrypting replies to encrypted messages is more of a security issue
so we leave it in place.
Jani Nikula [Sat, 5 Apr 2014 09:18:06 +0000 (12:18 +0300)]
emacs: sign/encrypt replies to signed/encrypted messages
This is a simple approach to improving security when replying to
signed or encrypted messages. If the message being replied to was
signed, add mml tag to sign the reply. If the message being replied to
was encrypted, add mml tag to sign and encrypt the reply.
This may need configuration; I for one might want to encrypt replies
to encrypted messages, but not always sign replies to signed messages.
This still includes a slight bug: if any mml tags are added, they are
included in the region containing the quoted parts. Killing the region
will kill the mml tags too.
David Bremner [Sat, 29 Mar 2014 17:53:17 +0000 (14:53 -0300)]
util: add gz_readline
The idea is to provide a more or less drop in replacement for readline
to read from zlib/gzip streams. Take the opportunity to replace
malloc with talloc.
David Bremner [Sat, 29 Mar 2014 01:14:51 +0000 (22:14 -0300)]
dump: support gzipped and atomic output
The main goal is to support gzipped output for future internal
calls (e.g. from notmuch-new) to notmuch_database_dump.
The additional dependency is not very heavy since xapian already pulls
in zlib.
We want the dump to be "atomic", in the sense that after running the
dump file is either present and complete, or not present. This avoids
certain classes of mishaps involving overwriting a good backup with a
bad or partial one.
Mark Walters [Wed, 9 Apr 2014 17:09:54 +0000 (18:09 +0100)]
News for emacs saved-searches change.
The important point is that the changed search variable is not forward
compatible (it *is* backwards compatible): that is previous version
of notmuch-emacs will be unusable with a new style
notmuch-saved-search variable.
Mark Walters [Sun, 6 Apr 2014 05:44:49 +0000 (06:44 +0100)]
emacs: Add a sort-order option to saved-searches
This adds a sort-order option to saved-searches, stores it in the
saved-search buttons (widgets), and uses the stored value when the
button is pressed.
Mark Walters [Sun, 6 Apr 2014 05:44:47 +0000 (06:44 +0100)]
emacs: hello: add a customize for saved-searches
Make the defcustom for notmuch-saved-searches use the new plist
format. It should still work with oldstyle saved-searches but will
write the newstyle form.
Mark Walters [Sun, 6 Apr 2014 05:44:45 +0000 (06:44 +0100)]
emacs: hello: add helper functions for saved-searches
Add helper functions to for saved searches to ease the transition to
the new plist form while maintaining backwards compatibility. They
will be used in the next patch.
Tomi Ollila [Wed, 19 Mar 2014 20:37:10 +0000 (22:37 +0200)]
emacs: add notmuch-version.el.tmpl and create notmuch-version.el from it
The notmuch cli program and emacs lisp versions may differ (especially
in remote usage). It helps to resolve problems if we can determine
the versions of notmuch cli and notmuch emacs mua separately.
The build process now creates notmuch-version.el from template file
by filling the version info to notmuch-emacs-version variable.
This version file will be as prerequisite to the target files
that use the version info for some purpose, like printing
it for the user to examine. The contents of the version.stamp
file is seldom read by the build system itself as the $(VERSION)
variable has the same information.
Thanks to Trevor, David and Mark for their contributions.
which breaks all of the FETCH_HEAD logic in nmbug (where FETCH_HEAD is
assumed to point to the master branch).
Instead of relying on FETCH_HEAD, use @{upstream} as the
remote-tracking branch that should be merged/diffed/integrated into
HEAD. @{upstream} was added in Git v1.7.0 (2010-02-12) [1], so
relying on it should be fairly safe. One tricky bit is that bare
repositories don't set upstream tracking branches by default:
$ git clone --bare http://nmbug.tethera.net/git/nmbug-tags.git nmbug-bare
$ cd nmbug-bare
$ git remote show origin
* remote origin
Fetch URL: http://nmbug.tethera.net/git/nmbug-tags.git
Push URL: http://nmbug.tethera.net/git/nmbug-tags.git
HEAD branch: master
Local refs configured for 'git push':
config pushes to config (up to date)
master pushes to master (up to date)
While in a non-bare clone:
$ git clone http://nmbug.tethera.net/git/nmbug-tags.git
$ cd nmbug-tags
$ git remote show origin
* remote origin
Fetch URL: http://nmbug.tethera.net/git/nmbug-tags.git
Push URL: http://nmbug.tethera.net/git/nmbug-tags.git
HEAD branch: master
Remote branches:
config tracked
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (up to date)
From the clone docs [2]:
--bare::
Make a 'bare' Git repository…
Also the branch heads at the remote are copied directly
to corresponding local branch heads, without mapping
them to `refs/remotes/origin/`. When this option is
used, neither remote-tracking branches nor the related
configuration variables are created.
To use @{upstream}, we need to the local vs. remote-tracking
distinction, so this commit adds 'nmbug clone', replacing the
previously suggested --bare clone with a non-bare --no-checkout
--separate-git-dir clone into a temporary work directory. After
which:
gives us the master-branch commit. Existing nmbug users will have to
run the configuration tweaks and re-fetch by hand. If you don't have
any local commits, you could also blow away your NMBGIT repository and
re-clone from scratch:
Besides removing the ambiguity of FETCH_HEAD, this commit allows users
to configure which upstream branch they want nmbug to track via 'git
config', in case they want to change their upstream repository.
Tomi Ollila [Sat, 5 Apr 2014 09:47:29 +0000 (12:47 +0300)]
release-checks: removed manual page version check
Manual pages are now generated and during the generation the version
string is read from `version` file, so this (currently failing) test
checking manual page versions can be removed.
While at it, changed the case pattern *[^0-9.]*
to its portable alternative *[!0-9.]*
Tomi Ollila [Thu, 3 Apr 2014 20:53:03 +0000 (23:53 +0300)]
doc: added 'Init File' section to notmuch-emacs info source
While adding that fixed (also other) typos noticed by aspell(1) run,
and capitalized Emacs and (most) Notmuch terms to match how emacs
Info documentation seems to look in general.
David Bremner [Mon, 27 Jan 2014 14:12:12 +0000 (10:12 -0400)]
compat: add canonicalize_file_name
the POSIX 2008 behaviour of realpath is not available everywhere so we
provide a simple wrapper function. We use (and provide) the gnu
extension canonicalize_file_name to make it cleaner to test for the
feature we need; otherwise we have to rely on realpath segfaulting if
the second argument is null.