[PATCH 1/2] doc: don't build notmuch-emacs.info for configure --without-emacs

2019-06-10 Thread David Bremner
Since the docstrings are not built in the case of --without-emacs,
even if emacs is detected, don't let sphinx build the emacs docs. This
avoids a large number of error messages due to missing includes. It's
actually a bit surprising sphinx doesn't generate an error for the
missing include files.
---
 doc/Makefile.local | 2 +-
 doc/conf.py| 7 ---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/doc/Makefile.local b/doc/Makefile.local
index 719172fe..a88beb46 100644
--- a/doc/Makefile.local
+++ b/doc/Makefile.local
@@ -4,7 +4,7 @@ dir := doc
 
 # You can set these variables from the command line.
 SPHINXOPTS:= -q
-SPHINXBUILD   = HAVE_EMACS=${HAVE_EMACS} sphinx-build
+SPHINXBUILD   = HAVE_EMACS=${HAVE_EMACS} WITH_EMACS=${WITH_EMACS} sphinx-build
 DOCBUILDDIR  := $(dir)/_build
 
 # Internal variables.
diff --git a/doc/conf.py b/doc/conf.py
index 5f8c9f1c..8afff929 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -29,9 +29,10 @@ release = version
 # directories to ignore when looking for source files.
 exclude_patterns = ['_build']
 
-# If we don't have emacs, don't build the notmuch-emacs docs, as they need
-# emacs to generate the docstring include files
-if os.environ.get('HAVE_EMACS') != '1':
+# If we don't have emacs (or the user configured --without-emacs),
+# don't build the notmuch-emacs docs, as they need emacs to generate
+# the docstring include files
+if os.environ.get('HAVE_EMACS') != '1' or os.environ.get('WITH_EMACS') != '1':
 exclude_patterns.append('notmuch-emacs.rst')
 
 # The name of the Pygments (syntax highlighting) style to use.
-- 
2.20.1

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 2/2] doc: Don't install emacs docs when they are not built

2019-06-10 Thread David Bremner
In 40b025 we stopped building the notmuch-emacs documentation if
HAVE_EMACS=0 (i.e. no emacs was detected by configure). Unfortunately
we continued to try to install the (non-existent) documentation, which
causes build/install failures.

As a bonus, we also avoid installing the documentation if the user
configures --without-emacs.

Thanks to Ralph Seichter for reporting the problem, and testing
previous versions of this fix.
---
 doc/Makefile.local | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/doc/Makefile.local b/doc/Makefile.local
index a88beb46..d733b51e 100644
--- a/doc/Makefile.local
+++ b/doc/Makefile.local
@@ -28,7 +28,11 @@ MAN_GZIP_FILES := $(addsuffix .gz,${MAN_ROFF_FILES})
 MAN1_TEXI := $(patsubst 
$(srcdir)/doc/man1/%.rst,$(DOCBUILDDIR)/texinfo/%.texi,$(MAN1_RST))
 MAN5_TEXI := $(patsubst 
$(srcdir)/doc/man5/%.rst,$(DOCBUILDDIR)/texinfo/%.texi,$(MAN5_RST))
 MAN7_TEXI := $(patsubst 
$(srcdir)/doc/man7/%.rst,$(DOCBUILDDIR)/texinfo/%.texi,$(MAN7_RST))
-INFO_TEXI_FILES := $(MAN1_TEXI) $(MAN5_TEXI) $(MAN7_TEXI) 
$(DOCBUILDDIR)/texinfo/notmuch-emacs.texi
+INFO_TEXI_FILES := $(MAN1_TEXI) $(MAN5_TEXI) $(MAN7_TEXI)
+ifeq ($(HAVE_EMACS)$(WITH_EMACS),11)
+   INFO_TEXI_FILES := $(INFO_TEXI_FILES) 
$(DOCBUILDDIR)/texinfo/notmuch-emacs.texi
+endif
+
 INFO_INFO_FILES := $(INFO_TEXI_FILES:.texi=.info)
 
 .PHONY: sphinx-html sphinx-texinfo sphinx-info
-- 
2.20.1

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] doc: Don't install emacs docs when they are not built

2019-06-10 Thread David Bremner
Tomi Ollila  writes:
>
> Interestingly, in your commit message you mention that changing := to =
> makes a difference. I would have thought that assigning INFO_INFO_FILES
> with := would have expanded INFO_TEXI_FILES just 2 lines below after
> its introduction. 

Ah. Silly me. The non-working version had the following line in it

$(INFO_TEXI_FILES):= $(INFO_TEXI_FILES) 
$(DOCBUILDDIR)/texinfo/notmuch-emacs.texi

The reason that does have _something_ do with variable expansion, just
not what I claimed ;). I think I'll go back to the ifeq version, it's more
like what we use other places.

d
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: Ye olde Apple mktemp

2019-06-10 Thread Ralph Seichter
* Ralph Seichter:

> The following local patch solves the issue for me [...]

Well, it does solve the mktemp call failing due to a missing
parameter. There is however additional fun [1] to be had once mktemp
succeeds:

-snip-
Checking for GMime session key extraction support... gpg: can't connect to the 
agent: File name too long
gpg: error getting the KEK: No agent running
gpg: error reading '[stdin]': No agent running
gpg: import from '[stdin]' failed: No agent running
No.
*** Error: Could not extract session keys from encrypted message.

This is likely due to your GMime having been built against a old
version of GPGME.

Please try to rebuild your version of GMime against a more recent
version of GPGME (at least GPGME 1.8.0).
Your current GPGME development version is: 1.13.0-unknown
-snip-

I found a GNUPGHOME length limit mentioned in a Debian bug [2] and other
places; looks like the Notmuch build is running into that limit. That
configure does not regcognize GPGME 1.13.0 is of course only a minor
issue, but the GnuPG error breaks the build.

-Ralph

[1] 
https://build.macports.org/builders/ports-10.10_x86_64-builder/builds/88616/steps/install-port/logs/stdio
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=847206
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 2/2] test: replace use of gdb with LD_PRELOAD shims in T070-insert.sh

2019-06-10 Thread Ralph Seichter
* Daniel Kahn Gillmor:

> Perhaps Ralph Seichter (explicitly cc'ed above) could comment on how
> it'll affect homebrew?

MacPorts, actually. ;-) I have not yet been able to look into this patch
series, but I hope to be able to do so soonish.

-Ralph
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] doc: Don't install emacs docs when they are not built

2019-06-10 Thread Tomi Ollila
On Mon, Jun 10 2019, David Bremner wrote:

> In 40b025 we stopped building the notmuch-emacs documentation if
> HAVE_EMACS=0 (i.e. no emacs was detected by configure). Unfortunately
> we continued to try to install the (non-existent) documentation, which
> causes build/install failures.
>
> As a bonus, we also avoid installing the documentation if the user
> configures --without-emacs.
>
> We use '$(if )' instead of 'ifeq' here (and change ':=' to '=') to
> make sure that WITH_EMACS and HAVE_EMACS are defined before we expand
> INFO_TEXI_FILES.
>
> Thanks to Ralph Seichter for reporting the problem, and testing
> previous versions of this fix.
> ---
>  doc/Makefile.local | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/doc/Makefile.local b/doc/Makefile.local
> index 719172fe..92c41b57 100644
> --- a/doc/Makefile.local
> +++ b/doc/Makefile.local
> @@ -28,7 +28,9 @@ MAN_GZIP_FILES := $(addsuffix .gz,${MAN_ROFF_FILES})
>  MAN1_TEXI := $(patsubst 
> $(srcdir)/doc/man1/%.rst,$(DOCBUILDDIR)/texinfo/%.texi,$(MAN1_RST))
>  MAN5_TEXI := $(patsubst 
> $(srcdir)/doc/man5/%.rst,$(DOCBUILDDIR)/texinfo/%.texi,$(MAN5_RST))
>  MAN7_TEXI := $(patsubst 
> $(srcdir)/doc/man7/%.rst,$(DOCBUILDDIR)/texinfo/%.texi,$(MAN7_RST))
> -INFO_TEXI_FILES := $(MAN1_TEXI) $(MAN5_TEXI) $(MAN7_TEXI) 
> $(DOCBUILDDIR)/texinfo/notmuch-emacs.texi
> +INFO_TEXI_FILES = $(MAN1_TEXI) $(MAN5_TEXI) $(MAN7_TEXI) \
> + $(if $(filter 11,$(HAVE_EMACS)$(WITH_EMACS)), 
> $(DOCBUILDDIR)/texinfo/notmuch-emacs.texi,)
> +
>  INFO_INFO_FILES := $(INFO_TEXI_FILES:.texi=.info)

Interestingly, in your commit message you mention that changing := to =
makes a difference. I would have thought that assigning INFO_INFO_FILES
with := would have expanded INFO_TEXI_FILES just 2 lines below after
its introduction. 

Anyway, it if helps, good (and change LGTM). I'm just a bit curious...

Tomi

>  
>  .PHONY: sphinx-html sphinx-texinfo sphinx-info
> -- 
> 2.20.1
>
> ___
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: Ye olde Apple mktemp

2019-06-10 Thread Tomi Ollila
On Mon, Jun 10 2019, Ralph Seichter wrote:

> Another quirk that occurs during the configuration phase on older macOS
> versions (when they were still called OS X, actually) in the MacPorts
> build farm:
>
>   Checking for GMime session key extraction support...
>   usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
>  mktemp [-d] [-q] [-u] -t prefix
>   No.
>
> Hooray for that ancient mktemp binary. :-/ The following local patch
> solves the issue for me:
>
> diff --git a/configure b/configure
> index 8b80f0e0..fa715946 100755
> --- a/configure
> +++ b/configure
> @@ -529,7 +529,7 @@ int main () {
>  return 0;
>  }
>  EOF
> -if ! TEMP_GPG=$(mktemp -d); then
> +if ! TEMP_GPG=$(mktemp -d -t /tmp); then
>  printf 'No.\nCould not make tempdir for testing session-key 
> support.\n'
>  errors=$((errors + 1))
>  elif ${CC} ${CFLAGS} ${gmime_cflags} _check_session_keys.c 
> ${gmime_ldflags} -o _check_session_keys \
>
> Alas, "mktemp -d -t /tmp" is incompatible with GNU coreutils' mktemp,
> while "mktemp -d -p /tmp" is not understood by Apple's variant because
> of the "-p". I don't know what syntax would be universally acceptable.
>
> Is there a way to pass platform-dependent parameters to mktemp with the
> current build mechanics?

Hmm, we have:

test/test-lib.sh:TEST_TMPDIR=$(mktemp -d 
"${TMPDIR:-/tmp}/notmuch-test-$$.XX")

does that test work ?

does

TEMP_GPG=$(mktemp -d /tmp/tmp.XX)

make any difference ?

if it doesn't, then we just have to do uname=$(uname) earlier
and add `-t` to mktemp(1) parameters in case it is darwin
(ot something) 

Tomi

>
> -Ralph
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH V2] test: aggregate-results.sh: consistent style. zero forks.

2019-06-10 Thread Tomi Ollila
- all variables in $((...)) without leading $
- all comparisons use -gt, -eq or -ne
- no -a nor -o inside [ ... ] expressions
- all indentation levels using one tab

Dropped unnecessary empty string check when reading results files.

Replaced pluralize() which was executed in subshell with
pluralize_s(). pluralize_s sets $s to 's' or '' based on value of
$1. Calls to pluralize_s are done in context of current shell, so
no forks to subshells executed.
---

V2: added quotes all "$variable" references where empty values or
IFS characters could make a difference. Not in this script, but
servers better example as a usage style elsewhere (where it could
matter).

 test/aggregate-results.sh | 92 +++
 1 file changed, 36 insertions(+), 56 deletions(-)

diff --git a/test/aggregate-results.sh b/test/aggregate-results.sh
index 63228546..05fb0a92 100755
--- a/test/aggregate-results.sh
+++ b/test/aggregate-results.sh
@@ -13,81 +13,61 @@ do
while read type value
do
case $type in
-   '')
-   continue ;;
fixed)
-   fixed=$(($fixed + $value)) ;;
+   fixed=$((fixed + value)) ;;
success)
-   success=$(($success + $value)) ;;
+   success=$((success + value)) ;;
failed)
-   failed=$(($failed + $value)) ;;
+   failed=$((failed + value)) ;;
broken)
-   broken=$(($broken + $value)) ;;
+   broken=$((broken + value)) ;;
total)
-   total=$(($total + $value)) ;;
+   total=$((total + value)) ;;
esac
done <"$file"
 done
 
-pluralize () {
-case $2 in
-   1)
-   case $1 in
-   test)
-   echo test ;;
-   failure)
-   echo failure ;;
-   esac
-   ;;
-   *)
-   case $1 in
-   test)
-   echo tests ;;
-   failure)
-   echo failures ;;
-   esac
-   ;;
-esac
-}
+pluralize_s () { [ "$1" -eq 1 ] && s='' || s='s'; }
 
 echo "Notmuch test suite complete."
-if [ "$fixed" = "0" ] && [ "$failed" = "0" ]; then
-tests=$(pluralize "test" $total)
-printf "All $total $tests "
-if [ "$broken" = "0" ]; then
-   echo "passed."
-else
-   failures=$(pluralize "failure" $broken)
-   echo "behaved as expected ($broken expected $failures)."
-fi;
+
+if [ "$fixed" -eq 0 ] && [ "$failed" -eq 0 ]; then
+   pluralize_s "$total"
+   printf "All $total test$s "
+   if [ "$broken" -eq 0 ]; then
+   echo "passed."
+   else
+   pluralize_s "$broken"
+   echo "behaved as expected ($broken expected failure$s)."
+   fi
 else
-echo "$success/$total tests passed."
-if [ "$broken" != "0" ]; then
-   tests=$(pluralize "test" $broken)
-   echo "$broken broken $tests failed as expected."
-fi
-if [ "$fixed" != "0" ]; then
-   tests=$(pluralize "test" $fixed)
-   echo "$fixed broken $tests now fixed."
-fi
-if [ "$failed" != "0" ]; then
-   tests=$(pluralize "test" $failed)
-   echo "$failed $tests failed."
-fi
+   echo "$success/$total tests passed."
+   if [ "$broken" -ne 0 ]; then
+   pluralize_s "$broken"
+   echo "$broken broken test$s failed as expected."
+   fi
+   if [ "$fixed" -ne 0 ]; then
+   pluralize_s "$fixed"
+   echo "$fixed broken test$s now fixed."
+   fi
+   if [ "$failed" -ne 0 ]; then
+   pluralize_s "$failed"
+   echo "$failed test$s failed."
+   fi
 fi
 
-skipped=$(($total - $fixed - $success - $failed - $broken))
-if [ "$skipped" != "0" ]; then
-tests=$(pluralize "test" $skipped)
-echo "$skipped $tests skipped."
+skipped=$((total - fixed - success - failed - broken))
+if [ "$skipped" -ne 0 ]; then
+   pluralize_s "$skipped"
+   echo "$skipped test$s skipped."
 fi
 
 # Note that we currently do not consider skipped tests as failing the
 # build.
 
-if [ $success -gt 0 -a $fixed -eq 0 -a $failed -eq 0 ]
+if [ "$success" -gt 0 ] && [ "$fixed" -eq 0 ] && [ "$failed" -eq 0 ]
 then
-exit 0
+   exit 0
 else
-exit 1
+   exit 1
 fi
-- 
2.21.0

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Ye olde Apple mktemp

2019-06-10 Thread Ralph Seichter
Another quirk that occurs during the configuration phase on older macOS
versions (when they were still called OS X, actually) in the MacPorts
build farm:

  Checking for GMime session key extraction support...
  usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
 mktemp [-d] [-q] [-u] -t prefix
  No.

Hooray for that ancient mktemp binary. :-/ The following local patch
solves the issue for me:

diff --git a/configure b/configure
index 8b80f0e0..fa715946 100755
--- a/configure
+++ b/configure
@@ -529,7 +529,7 @@ int main () {
 return 0;
 }
 EOF
-if ! TEMP_GPG=$(mktemp -d); then
+if ! TEMP_GPG=$(mktemp -d -t /tmp); then
 printf 'No.\nCould not make tempdir for testing session-key support.\n'
 errors=$((errors + 1))
 elif ${CC} ${CFLAGS} ${gmime_cflags} _check_session_keys.c 
${gmime_ldflags} -o _check_session_keys \

Alas, "mktemp -d -t /tmp" is incompatible with GNU coreutils' mktemp,
while "mktemp -d -p /tmp" is not understood by Apple's variant because
of the "-p". I don't know what syntax would be universally acceptable.

Is there a way to pass platform-dependent parameters to mktemp with the
current build mechanics?

-Ralph
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] fix misspelling

2019-06-10 Thread Tomi Ollila
On Mon, Jun 10 2019, Daniel Kahn Gillmor wrote:

> Signed-off-by: Daniel Kahn Gillmor 
> ---
>  lib/messages.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/messages.c b/lib/messages.c
> index 04fa19f8..7ddfaf26 100644
> --- a/lib/messages.c
> +++ b/lib/messages.c
> @@ -117,7 +117,7 @@ _notmuch_messages_has_next (notmuch_messages_t *messages)
>   return false;
>  
>  if (! messages->is_of_list_type)
> - INTERNAL_ERROR("_notmuch_messages_has_next not implimented for msets");
> + INTERNAL_ERROR("_notmuch_messages_has_next not implemented for msets");

Looks like David's handwriting... >;)

LGTM.

Tomi

>  
>  return (messages->iterator->next != NULL);
>  }
> -- 
> 2.20.1
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] python: bind add_property/remove_property and related methods

2019-06-10 Thread VA

Le 09/06/2019 à 21:58, Daniel Kahn Gillmor a écrit :

We do expose this functionality in the library, so it's not the end of
the world to expose it in the python bindings, but i do worry a little
bit about encouraging people to fiddle with markers set by the indexer.


Conflicts could be easily avoided by recommending a prefix like 
"x--" to property names (see link below).



So: no objections from me to the idea of the functionality here -- if
someone thinks this is useful for some project, i hope they'll speak up
for how they plan to use it.


I'm writing a MUA, and am using properties to store an excerpt of each 
message, so the MUA can show a preview of each message (like the Gmail 
web app, or Apple mail client).


Some pleople recently suggested sync info or other MUA metadata:
https://notmuchmail.org/pipermail/notmuch/2019/027403.html


That said, i'd love it if at least the docstrings for functions which
modify properties included some concise, thoughtful suggestion that
encourages collaboration with the community and urges caution when
potentially tampering with properties used by other parts of the
ecosystem.


I took the documentation from notmuch.h but only edited to be consistent 
with Python. Those warnings should also be added in notmuch.h, right?

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: STYLE and uncrustify

2019-06-10 Thread Daniel Kahn Gillmor
Hi Bremner--

Thanks for doing this kind of cleanup work.  Long-term consistency is
worth the short-term pain.  The main short-term pain comes from dealing
with changes that are in-flight.  As someone with a couple of series
that are in flight, of course i'd prefer that you merge my changes
first, before you apply this cleanup so i don't have to rebase.  :P But
i care more that we get the cleanup done, and i'm also fine with
rebasing if you do that. (rebasing against a consistent codebase is
easy, compared to planning and implementing features and fixes
correctly)

rip the band-aid off!

On Fri 2019-06-07 07:58:24 -0300, David Bremner wrote:
> I'm pondering running uncrustify on all/most of the notmuch codebase,
> but I noticed a few things that uncrustify does are either not
> documented in STYLE, or maybe contradicted.
>
> 1) Should block comments start with '*' ? Uncrustify thinks yes, STYLE
>is silent, the codebase says mostly yes.  I think update STYLE to
>match uncrustify here.
>
> 2) Should there be a space after '!'? Uncrustify says yes, STYLE is
>silent, the codebase is inconsistent. Updating STYLE would be the
>easy thing here, but I remember previous discussions being
>inconclusive.

I'm fine going with uncrustify's decision for these two points.

> 3) Similar for space between '++' and '--' and operand

for whatever reason, i find myself preferring these attached without a
space between ++ and -- and the operand, whether as a prefix or postfix
operator.  If it's possible (i don't really know uncrustify) i'd like to
have the codebase say both "foo++" and "++foo".  But if it's hard to
convince uncrustify, or if anyone else has a preference for "foo ++"
i'll cope.

> 4) uncrustify wants to move 'const char* foo' to 'const char *foo'.

Yes, please.  I prefer keeping the * next to the variable.

 --dkg


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] fix misspelling

2019-06-10 Thread Daniel Kahn Gillmor
Signed-off-by: Daniel Kahn Gillmor 
---
 lib/messages.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/messages.c b/lib/messages.c
index 04fa19f8..7ddfaf26 100644
--- a/lib/messages.c
+++ b/lib/messages.c
@@ -117,7 +117,7 @@ _notmuch_messages_has_next (notmuch_messages_t *messages)
return false;
 
 if (! messages->is_of_list_type)
-   INTERNAL_ERROR("_notmuch_messages_has_next not implimented for msets");
+   INTERNAL_ERROR("_notmuch_messages_has_next not implemented for msets");
 
 return (messages->iterator->next != NULL);
 }
-- 
2.20.1

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] python: bind add_property/remove_property and related methods

2019-06-10 Thread Daniel Kahn Gillmor
Hi VA--

On Sat 2019-06-08 17:37:10 +0200, VA wrote:
> These methods were simply missing from the Python bindings.
> From 47dcf1659377f1ec8a237fbe474a5412123d0aa1 Mon Sep 17 00:00:00 2001
> From: hydrargyrum 
> Date: Sun, 27 Jan 2019 09:43:57 +0100
> Subject: [PATCH] python: bind add_property/remove_property and related methods
>
> Methods for manipulating properties were not bound in Python.

Thanks for offering this patch.

I think we've thus far deliberately avoided exposing property
manipulation from python because properties have (by convention i think)
tended to be things that are set or cleared only by the notmuch indexer
itself.  (see notmuch-properties(7) for description of those properties)

We do expose this functionality in the library, so it's not the end of
the world to expose it in the python bindings, but i do worry a little
bit about encouraging people to fiddle with markers set by the indexer.

as nomtuch-properties(7) says:

   Extensions  to  notmuch  which make use of properties are encouraged to
   report the specific properties used to the upstream notmuch project, as
   a way of avoiding collisions in the property namespace.

So: no objections from me to the idea of the functionality here -- if
someone thinks this is useful for some project, i hope they'll speak up
for how they plan to use it.

That said, i'd love it if at least the docstrings for functions which
modify properties included some concise, thoughtful suggestion that
encourages collaboration with the community and urges caution when
potentially tampering with properties used by other parts of the
ecosystem.

--dkg


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 1/2] debian: bump Standards-Version to 4.3.0 (no changes needed)

2019-06-10 Thread Daniel Kahn Gillmor
/usr/share/doc/debian-policy/upgrading-checklist.txt.gz suggests that
notmuch is already compliant with debian-policy 4.3.0.

Signed-off-by: Daniel Kahn Gillmor 
---
 debian/control | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index 31d6471c..56849500 100644
--- a/debian/control
+++ b/debian/control
@@ -29,7 +29,7 @@ Build-Depends:
  gnupg ,
  bash-completion (>=1.9.0~),
  texinfo
-Standards-Version: 4.1.3
+Standards-Version: 4.3.0
 Homepage: https://notmuchmail.org/
 Vcs-Git: https://git.notmuchmail.org/git/notmuch -b release
 Vcs-Browser: https://git.notmuchmail.org/git/notmuch
-- 
2.20.1

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] append _unused to the expression defined using unused() macro

2019-06-10 Thread Daniel Kahn Gillmor
On Thu 2019-05-30 22:56:14 +0300, Tomi Ollila wrote:
> This way if variables defined using unused() macro are actually
> used then code will not compile...
>
> - removed unused usage around one argc and one argv since those
>   were used
>
> - changed one unused (char *argv[]) to unused (char **argv) to
>   work with modified unused() macro definition

lgtm.  i've tested it against the master branch, and it works fine.  I
like the belt-and-suspenders approach.

   --dkg


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH v2 2/2] test: replace use of gdb with LD_PRELOAD shims in T070-insert.sh

2019-06-10 Thread Daniel Kahn Gillmor
From: David Bremner 

This removes the dependency of this test script on gdb, and
considerably speeds up the running of the tests.

---

dkg cleaned up the placement of gen_insert_msg, and used printf's %q
to handle the perverse case where $gen_msg_filename happens to have a
U+0022 QUOTATION MARK ('"') in it.

Signed-off-by: Daniel Kahn Gillmor 
---
 test/T070-insert.sh | 48 -
 1 file changed, 17 insertions(+), 31 deletions(-)

diff --git a/test/T070-insert.sh b/test/T070-insert.sh
index 48165caa..017124fc 100755
--- a/test/T070-insert.sh
+++ b/test/T070-insert.sh
@@ -2,8 +2,6 @@
 test_description='"notmuch insert"'
 . $(dirname "$0")/test-lib.sh || exit 1
 
-test_require_external_prereq gdb
-
 # subtests about file permissions assume that we're working with umask
 # 022 by default.
 umask 022
@@ -246,19 +244,19 @@ test_expect_code 1 "notmuch insert $gen_msg_filename 2>&1"
 notmuch config set new.tags $OLDCONFIG
 
 # DUPLICATE_MESSAGE_ID is not tested here, because it should actually pass.
-
-for code in OUT_OF_MEMORY XAPIAN_EXCEPTION FILE_NOT_EMAIL \
-READ_ONLY_DATABASE UPGRADE_REQUIRED PATH_ERROR; do
-cat < index-file-$code.gdb
-set breakpoint pending on
-set logging file index-file-$code.log
-set logging on
-break notmuch_database_index_file
-commands
-return NOTMUCH_STATUS_$code
-continue
-end
-run
+# pregenerate all of the test shims
+for code in  FILE_NOT_EMAIL READ_ONLY_DATABASE UPGRADE_REQUIRED PATH_ERROR 
OUT_OF_MEMORY XAPIAN_EXCEPTION; do
+make_shim shim-$code <
+#include 
+notmuch_status_t
+notmuch_database_index_file (notmuch_database_t *notmuch,
+ const char *filename,
+ notmuch_indexopts_t *indexopts,
+ notmuch_message_t **message_ret)
+{
+  return NOTMUCH_STATUS_$code;
+}
 EOF
 done
 
@@ -266,30 +264,18 @@ gen_insert_msg
 
 for code in  FILE_NOT_EMAIL READ_ONLY_DATABASE UPGRADE_REQUIRED PATH_ERROR; do
 test_begin_subtest "EXIT_FAILURE when index_file returns $code"
-test_expect_code 1 \
- "${TEST_GDB} --batch-silent --return-child-result \
--ex 'set args insert < $gen_msg_filename' \
--x index-file-$code.gdb notmuch"
+test_expect_code 1 "$(printf "notmuch_with_shim shim-%q insert < %q" 
"$code" "$gen_msg_filename")"
 
 test_begin_subtest "success exit with --keep when index_file returns $code"
-test_expect_code 0 \
- "${TEST_GDB} --batch-silent --return-child-result \
--ex 'set args insert --keep < $gen_msg_filename' \
--x index-file-$code.gdb notmuch"
+test_expect_code 0 "$(printf "notmuch_with_shim shim-%q insert --keep < 
%q" "$code" "$gen_msg_filename")"
 done
 
 for code in OUT_OF_MEMORY XAPIAN_EXCEPTION ; do
 test_begin_subtest "EX_TEMPFAIL when index_file returns $code"
-test_expect_code 75 \
- "${TEST_GDB} --batch-silent --return-child-result \
--ex 'set args insert < $gen_msg_filename' \
--x index-file-$code.gdb notmuch"
+test_expect_code 75 "$(printf "notmuch_with_shim shim-%q insert < %q" 
"$code" "$gen_msg_filename")"
 
 test_begin_subtest "success exit with --keep when index_file returns $code"
-test_expect_code 0 \
- "${TEST_GDB} --batch-silent --return-child-result \
--ex 'set args insert --keep < $gen_msg_filename' \
--x index-file-$code.gdb notmuch"
+test_expect_code 0 "$(printf "notmuch_with_shim shim-%q insert --keep < 
%q" "$code" "$gen_msg_filename")"
 done
 
 test_done
-- 
2.20.1

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch vim failing to show rfc822 attachments

2019-06-10 Thread Daniel Kahn Gillmor
Hi Kay--

On Tue 2019-05-07 01:51:50 +0200, Kay wrote:

> I've recently switched to using notmuch for mail management and I like
> it so far. The only thing stopping me from full joy is that neither alot
> nor the notmuch vim frontend can display message/rfc822 attachments.

that sounds frustrating!

As i think you can see from the silence on the list, notmuch vim doesn't
get a lot of developer attention right now.  If you can demonstrate the
problem with notmuch 0.29, or from a local git development copy, and you
have a fix you'd like to propose, folks would probably look at it.

If you want help with alot, i recommend using the issue tracker at
https://github.com/pazz/alot

sorry to not have a better answer for you!

  --dkg


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 2/2] test: replace use of gdb with LD_PRELOAD shims in T070-insert.sh

2019-06-10 Thread Daniel Kahn Gillmor
On Sun 2019-05-26 10:08:54 -0300, David Bremner wrote:
> This removes the dependency of this test script on gdb, and
> considerably speeds up the running of the tests.

This series looks good to me.  I've tested it with moreutils parallel
installed, and it reduces total CPU time for the parallel test suite
from ~76 seconds of CPU to ~56 seconds, a > %25 reduction in CPU cost
for the whole test suite, despite touching only one test.  This is
awesome work.

I also like the elegance of the proposed change.  It would be great to
see it extended to the rest of our test suite's dependency on GDB if we
can do it. (T050, T060, and T380 i think)

Details on my profiling:

On the current master (bc396c967c7cd8e7a109858e428d7bf97173f7a7),
without these changes applied, the whole test suite consumes this much
CPU on my 4-core intel i5-2540M (2.60GHz):

real0m33.106s
user1m1.150s
sys 0m14.998s

On the same machine, with the pair of patches applied, the whole test
suite consumes this:

real0m27.557s
user0m44.172s
sys 0m12.018s

Caveat: i don't know how well LD_PRELOAD works on non-GNU/Linux
platforms, and we're not using LD_PRELOAD elsewhere in the test suite
yet.  Perhaps Ralph Seichter (explicitly cc'ed above) could comment on
how it'll affect homebrew?  Do we need to consider a variant for
platforms that can't do LD_PRELOAD?

One nit-pick below:

> diff --git a/test/T070-insert.sh b/test/T070-insert.sh
> index 48165caa..ab26ecd4 100755
> --- a/test/T070-insert.sh
> +++ b/test/T070-insert.sh
> @@ -2,8 +2,6 @@
>  test_description='"notmuch insert"'
>  . $(dirname "$0")/test-lib.sh || exit 1
>  
> -test_require_external_prereq gdb
> -
>  # subtests about file permissions assume that we're working with umask
>  # 022 by default.
>  umask 022
> @@ -246,50 +244,38 @@ test_expect_code 1 "notmuch insert $gen_msg_filename 
> 2>&1"
>  notmuch config set new.tags $OLDCONFIG
>  
>  # DUPLICATE_MESSAGE_ID is not tested here, because it should actually pass.
> +gen_insert_msg
>  
> -for code in OUT_OF_MEMORY XAPIAN_EXCEPTION FILE_NOT_EMAIL \
> -READ_ONLY_DATABASE UPGRADE_REQUIRED PATH_ERROR; do
> -cat < index-file-$code.gdb
> -set breakpoint pending on
> -set logging file index-file-$code.log
> -set logging on
> -break notmuch_database_index_file
> -commands
> -return NOTMUCH_STATUS_$code
> -continue
> -end
> -run
> +# pregenerate all of the test shims
> +for code in  FILE_NOT_EMAIL READ_ONLY_DATABASE UPGRADE_REQUIRED PATH_ERROR 
> OUT_OF_MEMORY XAPIAN_EXCEPTION; do
> +make_shim shim-$code < +#include 
> +#include 
> +notmuch_status_t
> +notmuch_database_index_file (notmuch_database_t *notmuch,
> + const char *filename,
> + notmuch_indexopts_t *indexopts,
> + notmuch_message_t **message_ret)
> +{
> +  return NOTMUCH_STATUS_$code;
> +}
>  EOF
>  done
>  
> -gen_insert_msg
> -

Why put the shim generation below gen_insert_msg?  If it were above, it
would make the comment about DUPLICATE_MESSAGE_ID less confusing, and
the changeset could be shorter.

  --dkg


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] test: aggregate-results.sh: consistent style. zero forks.

2019-06-10 Thread Daniel Kahn Gillmor
On Tue 2019-06-04 22:46:24 +0300, Tomi Ollila wrote:
> - all variables in $((...)) without leading $
> - all comparisons use -gt, -eq or -ne
> - no -a nor -o inside [ ... ] expressions
> - all indentation levels using one tab
>
> Dropped unnecessary empty string check when reading results files.
>
> Replaced pluralize() which was executed in subshell with
> pluralize_s(). pluralize_s sets $s to 's' or '' based on value of
> $1. Calls to pluralize_s are done in context of current shell, so
> no forks to subshells executed.

I'm fine with all these changes, but:

> -if [ "$fixed" = "0" ] && [ "$failed" = "0" ]; then
> +if [ $fixed -eq 0 ] && [ $failed -eq 0 ]; then

I think we've set $fixed and $failed above to a non-empty string value,
so this is technically correct.  But the shell programmer nit-picker in
me gets nervous seeing any variable used inside a test without proper
wrapping, and i'm going to have trouble adopting $foo instead of "$foo"
in other shell scripts.  it seems to require a lot of global reasoning
about the state of a given variable to use it without quotes safely, and
it introduces some subtle requirements (like, no unsetting these
variables and no setting them to the empty string).

So anyway, i don't see the harm in using "$foo" instead in this case,
and it seems like it actually reduces the cognitive burden of
maintiaining the code.  i'm happy to listen to any compelling story
yo've got for why this is an important change, but i'd prefer to avoid
it.  (i don't at all mind unwrapping "0" to 0 though)

thanks for doing this cleanup!

 --dkg


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [WIP PATCH] test: make test-serially to run test serially

2019-06-10 Thread Daniel Kahn Gillmor
On Wed 2019-05-08 19:46:25 +0300, Tomi Ollila wrote:
> This is easier and less error prone than mistyping NOTMUCH_TEST_SERIALIZE
> manually from command line (mistype make test-serially and it just doesn't
> work)
> ---
>
> quick first version. this works, but someone(tm) w/ native english experience
> could say how the naming sounds like...

This is an unusual use of make in my experience (i'm not used to seeing
variables exported in what looks like a rule dependency line), but i'm
not particularly fluent in make in the first place, so take that with a
grain of salt.

As a native en_US speaker, i have no problem with "make test-serially"
(though my usual idiom is to invoke the test suite with "make check" for
some reason).

But if this is useful for even one person who actively cares about the
notmuch codebase (Tomi), i think it should be merged.

--dkg


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: Cycle-expand all org-style in show-mode and search all

2019-06-10 Thread Daniel Kahn Gillmor
Hi Pierre--

sorry for the delay in responding here, i'd missed this proposal when it
came in!

I *think* what you're trying to do here is, when reading a thread in
emacs' notmuch-show mode, you want to use "C-s" (I-search?) to find
whatever you're searching for in the folded messages as well as the
expanded ones.  Is that right?  do you always want to search in the
folded messages, or only sometimes?

In my own use of notmuch-emacs, i confess i've appreciated only
searching in expanded messages sometimes, and resented having to use
M-RET to expand-all before searching other times.  I don't know whether
i'd prefer one or the other in any given situation, and i guess i'd like
to be able to switch between them, but i'm not sure how to do that in a
user-friendly way.

On Wed 2019-04-10 12:33:23 +0200, Pierre Neidhardt wrote:
> The attached patch seems to work.
> What do you think?

I don't think i understand well enough what this change is trying to do,
even from reading the thread.  And the commit message itself is
*definitely* not enough to understand what the intent of the patch is.
It certainly doesn't seem to be related to the thread's subject line
"cycle-expand all org-style in show-mode and search all".

We generally try to make notmuch commit messages contain enough
motivation that when you go back and read it a year later you can tell
what you were trying to do here. (some of us are very forgetful!)

You don't need to copy the entire upstream emacs documentation for
invisible text or anything, but it'd be good to have the commit message
explain the problem encountered, and at least point at the mechanism the
patch is using to try to fix it.  Ideally, it should put a little bit of
thought into similar scenarios that it is *not* trying to change, so
that we can tell that it's scoped correctly.

One way to legitimately cut down on the length of the commit message
(and to ensure that your fix doesn't itself get broken later) is to
include a change to the test suite in your commit.  A good addition to
the test suite shows a plausible series of actions, and documents what
the correct output *should* be.  (even better if the use case is broken
before your patch, and fixed afterward!)

So anyway, could you take a stab at regenerate the 

(as an aside, i note that you signed your e-mail to the list, but the
patch appears to be outside the cryptographic signature.  Is seems
suboptimal -- you'd surely like us to evaluate your signature over the
message *including* the patch.  how was this message generated?  if it
was in notmuch-emacs, can you help me to recreate the steps you took so
that maybe we can fix it up or at least document it as a dangerous
path?)

--dkg


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] debian: enable build hardening features

2019-06-10 Thread Daniel Kahn Gillmor
Debian's build hardening toolchain options produce binary artifacts
that are more resistant to compromise.  The most visible change for
notmuch today is likely to be the addition of the "bindnow" linker
flag, which contributes to making the "Global Offset Table" fully
read-only.

See https://wiki.debian.org/Hardening for more details.

Signed-off-by: Daniel Kahn Gillmor 
---
 debian/rules | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/debian/rules b/debian/rules
index d056edb6..ebd10481 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,6 +2,8 @@
 
 python3_all = py3versions -s | xargs -n1 | xargs -t -I {} env {}
 
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
 %:
dh $@ --with python2,python3,elpa
 
-- 
2.20.1

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 2/2] test: replace use of gdb with LD_PRELOAD shims in T070-insert.sh

2019-06-10 Thread Daniel Kahn Gillmor
One more nit-pick:

On Sun 2019-05-26 10:08:54 -0300, David Bremner wrote:
> +test_expect_code 0 "notmuch_with_shim shim-$code insert --keep < 
> \"$gen_msg_filename\""

This kind of business breaks obscurely if $gen_msg_filename happens to
have U+0022 QUOTATION MARK in it.  That's a pretty perverse situation,
but i'd generally prefer to use bash's builtin printf's %q for
robustness.

A revised patch will follow shortly that fixes both of my nitpicks.

  --dkg


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 2/2] debian: Add appropriate substitution variables to debian/control

2019-06-10 Thread Daniel Kahn Gillmor
Without this change, dh_gencontrol emits:

dpkg-gencontrol: warning: package python-notmuch: substitution variable 
${python:Provides} unused, but is defined
dpkg-gencontrol: warning: package python-notmuch: substitution variable 
${python:Versions} unused, but is defined
dpkg-gencontrol: warning: package notmuch-mutt: substitution variable 
${perl:Depends} unused, but is defined

Signed-off-by: Daniel Kahn Gillmor 
---
 debian/control | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index 56849500..ff646c6b 100644
--- a/debian/control
+++ b/debian/control
@@ -77,6 +77,8 @@ Package: python-notmuch
 Architecture: all
 Section: python
 Depends: ${misc:Depends}, ${python:Depends}, libnotmuch5 (>= ${source:Version})
+Provides: ${python:Provides}
+XB-Python-Version: ${python:Versions}
 Description: Python interface to the notmuch mail search and index library
  Notmuch is a system for indexing, searching, reading, and tagging
  large collections of email messages in maildir or mh format. It uses
@@ -152,7 +154,8 @@ Depends:
  notmuch (>= 0.4),
  libmail-box-perl, libmailtools-perl,
  libstring-shellquote-perl, libterm-readline-gnu-perl,
- ${misc:Depends}
+ ${misc:Depends},
+ ${perl:Depends},
 Recommends: mutt
 Enhances: notmuch, mutt
 Description: thread-based email index, search and tagging (Mutt interface)
-- 
2.20.1

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] emacs: add keywords to notmuch-emacs-mua.desktop

2019-06-10 Thread Daniel Kahn Gillmor
Debian's lintian has an informational alert
desktop-entry-lacks-keywords-entry, which recommends including
Keywords= in a .desktop file.

I dug around a bit in /usr/share/applications/*.desktop to make sure
that we covered the range of keywords other e-mail applications are
using.  If anyone has other suggestions for keywords, they can add
them to this list.

Signed-off-by: Daniel Kahn Gillmor 
---
 emacs/notmuch-emacs-mua.desktop | 1 +
 1 file changed, 1 insertion(+)

diff --git a/emacs/notmuch-emacs-mua.desktop b/emacs/notmuch-emacs-mua.desktop
index 0d9af2a4..752a1d7b 100644
--- a/emacs/notmuch-emacs-mua.desktop
+++ b/emacs/notmuch-emacs-mua.desktop
@@ -8,3 +8,4 @@ Icon=emblem-mail
 Terminal=false
 Type=Application
 Categories=Network;Email;
+Keywords=Mail;E-mail;Email;
-- 
2.20.1

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [BUG] emacs: notmuch-mua-attachment-check finds triggering string inside forwarded messages

2019-06-10 Thread Daniel Kahn Gillmor
On Wed 2019-05-08 19:19:18 +0200, Örjan Ekeberg wrote:

> I have found what seems to be a bug, or at least a misbehaviour of the
> "missing attachment warning" implemented by the otherwise so nice
> notmuch-mua-attachment-check.
>
> It works fine to detect the regexp for attachments in simple messages.
> The problem is that it also triggers the warning if a matching string is
> present inside a forwarded message.  This is particularly annoying when
> forwarding messages originating from MS-Exchange since those seem to
> always include a hidden header "X-MS-Has-Attach" where the word "Attach"
> constantly leads to false missing-attachment warnings.

I've tagged this with notmuch::bug so that it shows up at
https://nmbug.notmuchmail.org/status/, and i'm directly cc'ing dme,
since i think he's the author of notmuch-mua-attachment-check.  

> Would it be possible to somehow restrict the regexp search to the part
> of the message actually being authored?  Would it be too simplistic to
> end the search at the first occurrence of "\n\n<#" ?

that's pretty simplistic, but does seem better than the status quo.  do
you have a proposed patch?

--dkg


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [emacs] Auto-rotate pictures

2019-06-10 Thread Daniel Kahn Gillmor
Hi Pierre--

On Wed 2019-04-03 11:10:54 +0200, Pierre Neidhardt wrote:

> Some pictures embed "exif" metadata with autorotate information.
> I know that mu4e can autorotate inlined pictures.
> I guess it wouldn't be too hard to implement this for Emacs Notmuch
> either.

If you have pointers to how mu4e does the autorotation, that might
encourage one of the elisp hackers who reads this list see how to get
notmuch-emacs to do the same thing.

i am not one of the elisp hackers, sadly :(

  --dkg


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] doc: Don't install emacs docs when they are not built

2019-06-10 Thread David Bremner
In 40b025 we stopped building the notmuch-emacs documentation if
HAVE_EMACS=0 (i.e. no emacs was detected by configure). Unfortunately
we continued to try to install the (non-existent) documentation, which
causes build/install failures.

As a bonus, we also avoid installing the documentation if the user
configures --without-emacs.

We use '$(if )' instead of 'ifeq' here (and change ':=' to '=') to
make sure that WITH_EMACS and HAVE_EMACS are defined before we expand
INFO_TEXI_FILES.

Thanks to Ralph Seichter for reporting the problem, and testing
previous versions of this fix.
---
 doc/Makefile.local | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/Makefile.local b/doc/Makefile.local
index 719172fe..92c41b57 100644
--- a/doc/Makefile.local
+++ b/doc/Makefile.local
@@ -28,7 +28,9 @@ MAN_GZIP_FILES := $(addsuffix .gz,${MAN_ROFF_FILES})
 MAN1_TEXI := $(patsubst 
$(srcdir)/doc/man1/%.rst,$(DOCBUILDDIR)/texinfo/%.texi,$(MAN1_RST))
 MAN5_TEXI := $(patsubst 
$(srcdir)/doc/man5/%.rst,$(DOCBUILDDIR)/texinfo/%.texi,$(MAN5_RST))
 MAN7_TEXI := $(patsubst 
$(srcdir)/doc/man7/%.rst,$(DOCBUILDDIR)/texinfo/%.texi,$(MAN7_RST))
-INFO_TEXI_FILES := $(MAN1_TEXI) $(MAN5_TEXI) $(MAN7_TEXI) 
$(DOCBUILDDIR)/texinfo/notmuch-emacs.texi
+INFO_TEXI_FILES = $(MAN1_TEXI) $(MAN5_TEXI) $(MAN7_TEXI) \
+   $(if $(filter 11,$(HAVE_EMACS)$(WITH_EMACS)), 
$(DOCBUILDDIR)/texinfo/notmuch-emacs.texi,)
+
 INFO_INFO_FILES := $(INFO_TEXI_FILES:.texi=.info)
 
 .PHONY: sphinx-html sphinx-texinfo sphinx-info
-- 
2.20.1

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch