Re: some issues with emacs 25

2016-11-11 Thread David Bremner
Matthew Lear  writes:

> I can trigger the bug if I discard text/plain though. Did you try that? 
>  Original message From: David Bremner  
> Date: 11/11/2016  11:40  (GMT+00:00) To: Matthew Lear , 
> Matt Armstrong  Cc: notmuch@notmuchmail.org Subject: 
> Re: some issues with emacs 25 
> Matthew Lear  writes:
>
>> On 09/11/16 23:55, David Bremner wrote:
>>> I can't find an html only public-message so far to give a full
>>> backtrace.
>> If it helps, here is some text in *bold *with some changes in red that
>> you can test with :-D
>
> FWIW, this doesn't trigger the bug with default settings + (setq
> notmuch-mua-compose-in 'new-window) because it has a text part.
>

I'm not sure what you mean by "discard", but closing it isn't enough. I
think more of your settings are needed to replicate the problem with a
multipart/alternative message.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH v3] completion: complete mimetype: search prefix

2016-11-11 Thread Tomi Ollila
On Wed, Nov 02 2016, Jani Nikula  wrote:

> Use /etc/mime.types if available, parsed using a sed one-liner, and
> fall back to a handful of common types otherwise.
>
> ---
>
> v2: smarter sed thanks to Lucas Hoffmann
>
> v3: use Tomi's sed... though I'm not sure what the improvement is...

LGTM.

The difference is that using '\t' is GNU sed extension -- other seds just
consider that being 't' -- Using [[:space:]] works also on macOS, *BSD...

> ---
>  completion/notmuch-completion.bash | 32 
>  1 file changed, 32 insertions(+)
>
> diff --git a/completion/notmuch-completion.bash 
> b/completion/notmuch-completion.bash
> index 78047b5f424d..d44b2a2811f0 100644
> --- a/completion/notmuch-completion.bash
> +++ b/completion/notmuch-completion.bash
> @@ -58,6 +58,34 @@ _notmuch_email()
>   sed 's/[^<]*<\([^>]*\)>/\1/' | tr "[:upper:]" "[:lower:]" | sort -u
>  }
>  
> +_notmuch_mimetype()
> +{
> +# use mime types from mime-support package if available, and fall
> +# back to a handful of common ones otherwise
> +if [ -r "/etc/mime.types" ]; then
> + sed -n '/^[[:alpha:]]/{s/[[:space:]].*//;p;}' /etc/mime.types
> +else
> + cat < +application/gzip
> +application/msword
> +application/pdf
> +application/zip
> +audio/mpeg
> +audio/ogg
> +image/gif
> +image/jpeg
> +image/png
> +message/rfc822
> +text/calendar
> +text/html
> +text/plain
> +text/vcard
> +text/x-diff
> +text/x-vcalendar
> +EOF
> +fi
> +}
> +
>  _notmuch_search_terms()
>  {
>  local cur prev words cword split
> @@ -85,6 +113,10 @@ _notmuch_search_terms()
>   COMPREPLY=( $(compgen -d "$path/${cur##folder:}" | \
>   sed "s|^$path/||" | grep -v "\(^\|/\)\(cur\|new\|tmp\)$" ) )
>   ;;
> + mimetype:*)
> + compopt -o nospace
> + COMPREPLY=( $(compgen -P "mimetype:" -W "`_notmuch_mimetype 
> ${cur}`" -- ${cur##mimetype:}) )
> + ;;
>   *)
>   local search_terms="from: to: subject: attachment: mimetype: tag: 
> id: thread: folder: path: date: lastmod:"
>   compopt -o nospace
> -- 
> 2.1.4
>
> ___
> 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: [PATCH v2] emacs: add compatability functions for emacs 23

2016-11-11 Thread David Bremner
Tomi Ollila  writes:


>> 2) It's getting hard to debug emacs23 problems, and developer time is
>>scarce, so at the same time, deprecate emacs23 support, so e.g. after
>>the next major release we can just drop it.
>
> It is not hard at all. Just do not mess w/ mixed environments >;).

I guess a more accurate way of saying it is that I don't want to spend
time on it anymore. So I think I want to deprecate it anyway, with the
understanding that we'll keep supporting as long as we (we being someone
who is not me) can, but no guarantees.

d



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


Re: [PATCH v2] emacs: add compatability functions for emacs 23

2016-11-11 Thread Tomi Ollila
On Fri, Nov 11 2016, David Bremner  wrote:

> David Bremner  writes:
>
>> The plot thickens. With this patch applied, I can generate an emacs
>> segfault with
>>
>> 1) EMACS=emacs23 ./devel/try-emacs-mua -q
>>
>> 2) M-x notmuch-search 
>>
>> 3) tag:inbox 
>
> OK, I managed to figure out the problem. I had byte compiled the emacs
> code with emacs24, and loading that in emacs23 caused all heck to break
> loose. With the byte compilation done with a matching version of emacs,
> the test suite passes.

I tested this (almost 2 weeks ago :/) using debian wheezy (7.11) docker
container and all relevant (i.e. emacs) tests passed.

>
> So my conclusions from all this fun:
>
> 1) since Mark went to the trouble of doing the compatiblity functions,
>we may as well get emacs23 working again.
>
> 2) It's getting hard to debug emacs23 problems, and developer time is
>scarce, so at the same time, deprecate emacs23 support, so e.g. after
>the next major release we can just drop it.

It is not hard at all. Just do not mess w/ mixed environments >;).

But this compatIbility change is not just emacs 23 -- iirc there were some
changes required to get emacs 24.1, 24.2, and 24.3 to work. It might be
easier to keep testing using emacs 23 until we deprecate everything before
emacs 24.4 (released October 20, 2014) -- or supporting emacs23 gets
nontrivial while supporting older emacs24 releases is still trivial (*)

(*) tried same with emacs22. when it got too hard we just did
ab30a846a49f576e1bfcd73f2ec41def474a6d96

I put the (new, shiny! ;) docker creation script I used to create this
wheezy container to:

https://github.com/domo141/nottoomuch/blob/dogfood/devel/test-in-docker.sh

(with https://github.com/domo141/nottoomuch/blob/dogfood/devel/test-on-macos.sh 
!)

> 3) With the caveat that we plan to drop the compat functions, I leave it
>to mark's judgement whether it's worth putting them in a seperate
>file, or just adding the FSF copyright to the top of the file.

compat functions will eventually be dropped (along with the code we already
have there to support emacs23)...

sepArate >;)

... but that said I'd suggest if there is going to be FSF copyright in the
file, create separate file for that.

and, also append 'g' to s/compatability/compatibility/ so that *all*
strings are replaced with correctly spelled version ;D

Tomi

PS: using google via smtpmail is pain... Now trying 3rd time... 5th...

got text message to go to google.com/blocked -- now 7th try...

8th... 9th...

Ok. It just fails. Sending the ordinary way (w/o google recipients, then).
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH v2] emacs: add compatability functions for emacs 23

2016-11-11 Thread David Bremner
David Bremner  writes:

> The plot thickens. With this patch applied, I can generate an emacs
> segfault with
>
> 1) EMACS=emacs23 ./devel/try-emacs-mua -q
>
> 2) M-x notmuch-search 
>
> 3) tag:inbox 

OK, I managed to figure out the problem. I had byte compiled the emacs
code with emacs24, and loading that in emacs23 caused all heck to break
loose. With the byte compilation done with a matching version of emacs,
the test suite passes.

So my conclusions from all this fun:

1) since Mark went to the trouble of doing the compatiblity functions,
   we may as well get emacs23 working again.

2) It's getting hard to debug emacs23 problems, and developer time is
   scarce, so at the same time, deprecate emacs23 support, so e.g. after
   the next major release we can just drop it.

3) With the caveat that we plan to drop the compat functions, I leave it
   to mark's judgement whether it's worth putting them in a seperate
   file, or just adding the FSF copyright to the top of the file.

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


Re: some issues with emacs 25

2016-11-11 Thread Matthew Lear
I can trigger the bug if I discard text/plain though. Did you try that? 
 Original message From: David Bremner  Date: 
11/11/2016  11:40  (GMT+00:00) To: Matthew Lear , Matt 
Armstrong  Cc: notmuch@notmuchmail.org Subject: Re: some 
issues with emacs 25 
Matthew Lear  writes:

> On 09/11/16 23:55, David Bremner wrote:
>> I can't find an html only public-message so far to give a full
>> backtrace.
> If it helps, here is some text in *bold *with some changes in red that
> you can test with :-D

FWIW, this doesn't trigger the bug with default settings + (setq
notmuch-mua-compose-in 'new-window) because it has a text part.

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


Re: [PATCH v2] emacs: add compatability functions for emacs 23

2016-11-11 Thread David Bremner
David Bremner  writes:

> Mark Walters  writes:
>
>> Some of the recent changes to the emacs code have used functions
>> introduced in emacs 24. The functions used are read-char-choice and
>> setq-local. This changeset adds compatability functions to
>> notmuch-lib so that it should work on emacs 23.
>> ---
>
>> 1) please could someone with emacs 23 see if the testsuite passes? My
>> system with emacs 23 is so outdated the test suite doesn't run (wrong
>> python versions I think).
>
> I get many failures like
>
> emacsclient.emacs23: connect: Connection refused
> emacsclient.emacs23: error accessing socket 
> "/tmp/emacs1000/notmuch-test-suite-21492"
>
> At a guess, somehow the server is shutting down/dying. I did manage to
> manually run an emacs server on this machine, and the socket is being
> created in the file system.

The plot thickens. With this patch applied, I can generate an emacs
segfault with

1) EMACS=emacs23 ./devel/try-emacs-mua -q

2) M-x notmuch-search 

3) tag:inbox 

without the patch, I get a search view, and the message

Wrong type argument: number-or-marker-p, entry-main

I'm not able to trigger a lisp backtrace.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH v2] emacs: add compatability functions for emacs 23

2016-11-11 Thread David Bremner
Mark Walters  writes:

> Some of the recent changes to the emacs code have used functions
> introduced in emacs 24. The functions used are read-char-choice and
> setq-local. This changeset adds compatability functions to
> notmuch-lib so that it should work on emacs 23.
> ---

> 1) please could someone with emacs 23 see if the testsuite passes? My
> system with emacs 23 is so outdated the test suite doesn't run (wrong
> python versions I think).

I get many failures like

emacsclient.emacs23: connect: Connection refused
emacsclient.emacs23: error accessing socket 
"/tmp/emacs1000/notmuch-test-suite-21492"

At a guess, somehow the server is shutting down/dying. I did manage to
manually run an emacs server on this machine, and the socket is being
created in the file system.

> 2) Is the copyright notice I have included above the two functions
> sufficient, and suitably placed?

I think it would be best to modify the copyright at the top of the
file. So to avoid confusing (if for some unforseen reason we wanted to
relicense this file), it might be best to go with a seperate file. But
lets see if someone can figure out the issue with the test suite before
putting much more effort into it.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


convert debian packaging to dh-elpa

2016-11-11 Thread David Bremner
The main part which needs sanity checking is 

[PATCH 1/3] emacs: generate notmuch-pkg.el

It may make sense later (after we drop support for emacs23) to make
our standard install also use package.el. 

This is mainly for information; you can see it drops a lot more than
it adds.  People maintaining packages for old derivatives might have
to revert this commit

[PATCH 2/3] debian: convert to use dh-elpa

Initially I thought about doing just a debian upload, but I'll
probably do another point release with some emacs bugfixes from Mark.

[PATCH 3/3] debian: changelog stanza for 0.23.1-2
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 2/3] debian: convert to use dh-elpa

2016-11-11 Thread David Bremner
This packaging helper eliminates most of the boilerplate from packaging
emacs extensions for debian. It requires package.el compatible metadata.
---
 debian/control   | 14 +--
 debian/elpa-notmuch.elpa |  1 +
 debian/notmuch-emacs.dirs|  1 -
 debian/notmuch-emacs.emacsen-compat  |  1 -
 debian/notmuch-emacs.emacsen-install | 48 
 debian/notmuch-emacs.emacsen-remove  | 34 -
 debian/notmuch-emacs.install |  1 -
 debian/notmuch-emacs.postinst|  7 --
 debian/notmuch-emacs.prerm   |  3 ---
 debian/rules |  2 +-
 10 files changed, 9 insertions(+), 103 deletions(-)
 create mode 100644 debian/elpa-notmuch.elpa
 delete mode 100644 debian/notmuch-emacs.dirs
 delete mode 100644 debian/notmuch-emacs.emacsen-compat
 delete mode 100755 debian/notmuch-emacs.emacsen-install
 delete mode 100755 debian/notmuch-emacs.emacsen-remove
 delete mode 100644 debian/notmuch-emacs.install
 delete mode 100644 debian/notmuch-emacs.postinst
 delete mode 100644 debian/notmuch-emacs.prerm

diff --git a/debian/control b/debian/control
index 4027a79..a8c7ce2 100644
--- a/debian/control
+++ b/debian/control
@@ -17,6 +17,7 @@ Build-Depends:
  python-all (>= 2.6.6-3~),
  python3-all (>= 3.1.2-7~),
  dh-python,
+ dh-elpa (>= 1.3),
  python-sphinx (>= 1.0),
  ruby, ruby-dev (>>1:1.9.3~),
  emacs24-nox | emacs24 (>=24~) | emacs24-lucid (>=24~) |
@@ -111,13 +112,12 @@ Description: Ruby interface to the notmuch mail search 
and index library
 
 Package: notmuch-emacs
 Architecture: all
-Section: mail
-Breaks: notmuch (<<0.6~254~)
-Replaces: notmuch (<<0.6~254~)
-Depends: ${misc:Depends}, notmuch (>= ${source:Version}),
- emacs23 (>= 23~) | emacs23-nox (>=23~) | emacs23-lucid (>=23~) |
- emacs24 (>= 24~) | emacs24-nox (>=24~) | emacs24-lucid (>=24~),
- emacsen-common (>= 2.0.8)
+Description: thread-based email index, search and tagging (transitional 
package)
+ This dummy package help ease transition to the new package elpa-notmuch
+
+Package: elpa-notmuch
+Architecture: all
+Depends: ${misc:Depends}, ${elpa:Depends}
 Description: thread-based email index, search and tagging (emacs interface)
  Notmuch is a system for indexing, searching, reading, and tagging
  large collections of email messages in maildir or mh format. It uses
diff --git a/debian/elpa-notmuch.elpa b/debian/elpa-notmuch.elpa
new file mode 100644
index 000..b4e9e17
--- /dev/null
+++ b/debian/elpa-notmuch.elpa
@@ -0,0 +1 @@
+emacs/*.el
diff --git a/debian/notmuch-emacs.dirs b/debian/notmuch-emacs.dirs
deleted file mode 100644
index caeb400..000
--- a/debian/notmuch-emacs.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/share/emacs/site-lisp/notmuch
diff --git a/debian/notmuch-emacs.emacsen-compat 
b/debian/notmuch-emacs.emacsen-compat
deleted file mode 100644
index 573541a..000
--- a/debian/notmuch-emacs.emacsen-compat
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/debian/notmuch-emacs.emacsen-install 
b/debian/notmuch-emacs.emacsen-install
deleted file mode 100755
index cce95c3..000
--- a/debian/notmuch-emacs.emacsen-install
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/sh
-# /usr/lib/emacsen-common/packages/install/notmuch-emacs
-set -e
-
-FLAVOR=$1
-PACKAGE=notmuch
-
-case "${FLAVOR}" in
-emacs)
-   return 0
-   ;;
-xemacs*|emacs2[12])
-   # patches welcome.
-   echo install/${PACKAGE}: skipping install for unsupported emacsen 
flavor ${FLAVOR}
-   exit 0
-   ;;
-*)
-   echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR}
-esac
-
-
-elc_dir=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
-el_dir=/usr/share/emacs/site-lisp/${PACKAGE}
-
-byte_compile_options="--quick --directory=${el_dir} -batch -f 
batch-byte-compile"
-
-echo install/${PACKAGE}: byte-compiling for ${FLAVOR}
-
-[ -d ${elc_dir} ] || mkdir ${elc_dir}
-
-# Create symlinks to the .el files (see section 6E in debian-emacs
-# polcy).  This makes complation easy, and also allows find-function
-# and find-library to work properly.
-(cd ${elc_dir} && ln -sf ${el_dir}/*.el .)
-
-# Byte compile them
-(cd ${elc_dir}
- set +e
- ${FLAVOR} ${byte_compile_options} *.el > Install.log 2>&1
- if test $? -ne 0
- then
-   cat Install.log
-   exit 1
- fi
- set -e
- gzip -9f Install.log)
-
-exit 0;
diff --git a/debian/notmuch-emacs.emacsen-remove 
b/debian/notmuch-emacs.emacsen-remove
deleted file mode 100755
index a555320..000
--- a/debian/notmuch-emacs.emacsen-remove
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-# /usr/lib/emacsen-common/packages/remove/notmuch
-
-set -e
-
-FLAVOR=$1
-PACKAGE=notmuch
-elc_dir=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
-
-case "${FLAVOR}" in
-emacs)
-   return 0
-   ;;
-xemacs*|emacs2[12])
-   # patches welcome.
-   echo install/${PACKAGE}: skipping removal for unsupported emacsen 
flavor ${FLAVOR}
-   exit 0
-   ;;
-*)
-   echo remove/${PACKAGE}: Handling r

[PATCH 3/3] debian: changelog stanza for 0.23.1-2

2016-11-11 Thread David Bremner
---
 debian/changelog | 8 
 1 file changed, 8 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 2c7cd23..05d3522 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+notmuch (0.23.1-2) unstable; urgency=medium
+
+  * Convert notmuch-emacs to dh-elpa, new binary package elpa-notmuch
+  * Bug fix: "maintainer script(s) do not start on #!", thanks to
+trei...@debian.org; (Closes: #843287).
+
+ -- David Bremner   Thu, 10 Nov 2016 22:36:04 -0400
+
 notmuch (0.23.1-1) unstable; urgency=medium
 
   * New upstream bugfix release
-- 
2.10.2

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


[PATCH 1/3] emacs: generate notmuch-pkg.el

2016-11-11 Thread David Bremner
This file contains metadata for the built in (as of emacs 24) packaging
system.
---
 Makefile.local| 3 +++
 emacs/.gitignore  | 1 +
 emacs/Makefile.local  | 8 +++-
 emacs/notmuch-pkg.el.tmpl | 6 ++
 4 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 emacs/notmuch-pkg.el.tmpl

diff --git a/Makefile.local b/Makefile.local
index d1b0585..0a122ab 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -19,9 +19,12 @@ DATE:=$(shell date +%F)
 endif
 
 VERSION:=$(shell cat ${srcdir}/version)
+ELPA_VERSION:=$(subst ~,_,$(VERSION))
 ifeq ($(filter release release-message pre-release 
update-versions,$(MAKECMDGOALS)),)
 ifeq ($(IS_GIT),yes)
 VERSION:=$(shell git --git-dir=${srcdir}/.git describe --abbrev=7 --match 
'[0-9.]*'|sed -e s/_/~/ -e s/-/+/ -e s/-/~/)
+# drop the ~g$sha1 part
+ELPA_VERSION:=$(word 1,$(subst ~, ,$(VERSION)))
 # Write the file 'version.stamp' in case its contents differ from $(VERSION)
 FILE_VERSION:=$(shell test -f version.stamp && read vs < version.stamp || vs=; 
echo $$vs)
 ifneq ($(FILE_VERSION),$(VERSION))
diff --git a/emacs/.gitignore b/emacs/.gitignore
index 9fa1c44..8e15eed 100644
--- a/emacs/.gitignore
+++ b/emacs/.gitignore
@@ -1,3 +1,4 @@
 .eldeps*
 *.elc
 notmuch-version.el
+notmuch-pkg.el
diff --git a/emacs/Makefile.local b/emacs/Makefile.local
index 2d6aedb..e4f7a04 100644
--- a/emacs/Makefile.local
+++ b/emacs/Makefile.local
@@ -27,6 +27,12 @@ $(dir)/notmuch-version.el: 
$(srcdir)/$(dir)/notmuch-version.el.tmpl
@sed -e 's/%AG%/Generated file (from $( $@
 
+$(dir)/notmuch-pkg.el: $(srcdir)/$(dir)/notmuch-pkg.el.tmpl
+   @sed -e 's/%AG%/Generated file (from $( $@
+
+all: $(dir)/notmuch-pkg.el
+install-emacs: $(dir)/notmuch-pkg.el
 
 emacs_images := \
$(srcdir)/$(dir)/notmuch-logo.png
@@ -84,4 +90,4 @@ endif
mkdir -p "$(DESTDIR)$(emacsetcdir)"
install -m0644 $(emacs_images) "$(DESTDIR)$(emacsetcdir)"
 
-CLEAN := $(CLEAN) $(emacs_bytecode) $(dir)/notmuch-version.el
+CLEAN := $(CLEAN) $(emacs_bytecode) $(dir)/notmuch-version.el 
$(dir)/notmuch-pkg.el
diff --git a/emacs/notmuch-pkg.el.tmpl b/emacs/notmuch-pkg.el.tmpl
new file mode 100644
index 000..de97baa
--- /dev/null
+++ b/emacs/notmuch-pkg.el.tmpl
@@ -0,0 +1,6 @@
+;; %AG%
+(define-package
+  "notmuch"
+  %VERSION%
+  "Emacs based front-end (MUA) for notmuch"
+  nil)
-- 
2.10.2

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


Re: some issues with emacs 25

2016-11-11 Thread David Bremner
Matthew Lear  writes:

> On 09/11/16 23:55, David Bremner wrote:
>> I can't find an html only public-message so far to give a full
>> backtrace.
> If it helps, here is some text in *bold *with some changes in red that
> you can test with :-D

FWIW, this doesn't trigger the bug with default settings + (setq
notmuch-mua-compose-in 'new-window) because it has a text part.

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