Re: [lieer] Release v1.1

2020-04-17 Thread Thomas Schneider
Hi Gaute,

Gaute Hope  writes:

> lieer v1.1 has been released with a bunch of minor fixes, and also the
> ability to (experimentally) send e-mail as a primitive sendmail stand-in.
>
>   https://github.com/gauteh/lieer

That’s nice to hear.  I see the release on GitHub, but are you going to
upload it to PyPI as well?  My Gentoo ebuild[0] gets the source from
there, so I noticed it’s not (yet) present on PyPI.

Thanks,
Thomas

[0]: https://github.com/qsuscs/gentoo-overlay/tree/main/net-mail/lieer


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


Re: [PATCH] test: add known_broken test for dumping large stored queries

2020-04-13 Thread Thomas Schneider
David Bremner  writes:

> 'qsx' reported a bug on #notmuch with notmuch-dump and large stored
> queries. This test will pass (on my machine) if the value of `repeat'
> is made smaller.

Feel free to add 'Reported-By: Thomas Schneider ', if
you like.

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


[RFC PATCH] build: Add meson.build for Ruby bindings

2020-02-17 Thread Thomas Schneider
It seems to work so far and doesn’t depend on Ruby’s MakeMakefile, as
the current Makefile does.  However, there is currently no way to
configure a certain Ruby version to build against (the first one that
works is used).

Given that the Ruby bindings themselves are a bit unmaintained, it might
make sense to rewrite them altogether in Ruby using ffi[0].

[0]: https://github.com/ffi/ffi

---
 bindings/ruby/meson.build | 21 +
 meson.build   |  8 
 2 files changed, 29 insertions(+)
 create mode 100644 bindings/ruby/meson.build

diff --git a/bindings/ruby/meson.build b/bindings/ruby/meson.build
new file mode 100644
index ..1b482107
--- /dev/null
+++ b/bindings/ruby/meson.build
@@ -0,0 +1,21 @@
+libnotmuch_ruby_srcs = [
+  'database.c',
+  'directory.c',
+  'filenames.c',
+  'init.c',
+  'message.c',
+  'messages.c',
+  'query.c',
+  'status.c',
+  'tags.c',
+  'thread.c',
+  'threads.c',
+]
+
+lib_notmuch_ruby = library('notmuch', libnotmuch_ruby_srcs,
+  include_directories: [inc_compat,
+inc_lib],
+  link_with: [lib_notmuch],
+  dependencies: [dep_ruby],
+  install: true,
+  install_dir: 
dep_ruby.get_pkgconfig_variable('vendorarchdir'))
diff --git a/meson.build b/meson.build
index 6a924a68..0cf3dd68 100644
--- a/meson.build
+++ b/meson.build
@@ -11,6 +11,13 @@ dep_talloc = dependency('talloc')
 dep_valgrind = dependency('valgrind', required: false)
 dep_bash_completion = dependency('bash-completion', version: '>=1.90',
 required: false)
+ruby_versions = ['2.7', '2.6', '2.5']
+foreach v : ruby_versions
+  dep_ruby = dependency('ruby-@0@'.format(v))
+  if dep_ruby.found()
+break
+  endif
+endforeach
 cmd_python = find_program('python3', 'python', 'python2')
 cmd_doxygen = find_program('doxygen', required: false)
 cmd_ruby = find_program('ruby', required: false)
@@ -29,6 +36,7 @@ subdir('compat')
 subdir('parse-time-string')
 subdir('util')
 subdir('lib')
+subdir('bindings/ruby')
 subdir('test')
 
 notmuch_client_srcs = [
-- 
2.25.0

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


Re: Indentation style

2019-07-28 Thread Thomas Schneider
David Bremner  writes:

> We're using more or less the default for Emacs (you can see the details
> in .dir-locals.el).

Maybe I misunderstood, but this doesn’t really look like Emacs’ defaults
for C.

> I'm a bit dubious that we want to re-whitespace everything, but I'd
> certainly be receptive to matching configuration for other
> editors. Does anyone know if vim indentation can be configured per
> project / directory?

Yes, if you let Vim parse a per-directory .vimrc (similar to forbidding
Emacs to parse .dir-locals.el).

While we’re at it, how about a generic .editorconfig?  The world isn’t
split into good people and dea… uh, Emacs and Vim.

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


Re: Tag duplicate messages with notmuch insert

2018-10-15 Thread Thomas Schneider
David Bremner  writes:

> Just to be clear, I wasn't commenting on whether it was the right thing
> to do or not, just whether it would be hard. It seems likely to be
> annoying to at least some people to have messages show up as unread
> again (or whatever the tags are) when new copies arrive.

Oh, I meant as an option of course, with a default to keep the current
behaviour.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Tag duplicate messages with notmuch insert

2018-10-15 Thread Thomas Schneider
>From notmuch-insert(1):

> If the new message is a duplicate of an existing message in the
> database (it has same Message-ID), it will be added to the maildir
> folder and notmuch database, but the tags will not be changed.

It might however be desired to apply the new tags even when the message
is a duplicate.  How complicated would it be to implement this?
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Display update bug in notmuch new

2018-07-30 Thread Thomas Schneider
Hi,

I discovered an issue in notmuch new: when deleting a large amount of
messages (so that it takes long and displays “$time remaining”), it does
not clean the line afterwards:

---
$ pwd
/home/qsx/.maildir/fnord
$ tar xf /tmp/mails.tar
$ notmuch new
Processed 9001 total files in 4s (2113 files/sec.).
Added 9001 new messages to the database.
$ rm new/*
$ notmuch new
No new mail. Removed 9001 messages.lmost no time remaining).
---

Version information: notmuch 0.27, on GNU/Linux

Steps to reproduce:

---
cd $MAILDIR
cat << EOF > /tmp/test.py
ADDRESS = "t...@example.org"

import mailbox
import email.message
import email.utils
from datetime import datetime

mb = mailbox.Maildir('./test') # will create if not existing

for i in range(1, 9002): # OVER NINE THOUSAND
m = email.message.EmailMessage()
m["From"] = ADDRESS
m["To"] = ADDRESS
m["Date"] = email.utils.localtime(datetime.now())
m["Subject"] = "test {}".format(i)
m["Message-Id"] = email.utils.make_msgid(idstring = "test.{}".format(i))
m.set_content("test {}".format(i))
mb.add(m)
EOF
python3.6 /tmp/test.py
notmuch new
rm -r test
notmuch new
---

--qsx


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


Re: [PATCH] devel: make printmimestructure py3 compatible

2018-06-12 Thread Thomas Schneider
Tomi Ollila  writes:

> On Mon, Jun 11 2018, Daniel Kahn Gillmor wrote:
>
>> Make printmimestructure work in python3 as well as python2.
>>
>> PEP 394 suggests that python scripts that work with both python2 and
>> python3 should have a #!/usr/bin/python command line, so do that too.
>
> I did not see PEP 394 suggesting to change 
>
> -#!/usr/bin/env python
> +#!/usr/bin/python
>
> just that 'python' should be able to run both python2 and python3 code.
>
> after the above change the code will not run on (those stupid) systems
> that install python to e.g. /usr/local/bin/.

For example all BSD systems, where the package manager installs to
/usr/local (and I do not think this is stupid).

> While I am not against this change, the commit message is misleading.

For the above reason, I am against changing the shebang at all.

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


[PATCH] build: Allow user to specify ruby executable

2018-05-09 Thread Thomas Schneider
This way, one can build for a different Ruby than $PATH/ruby
(e. g. different versions, or Ruby in other paths).

Signed-off-by: Thomas Schneider <q...@chaotikum.eu>
---
 bindings/Makefile.local |  2 +-
 configure   | 11 ++-
 test/test-lib.sh|  2 +-
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/bindings/Makefile.local b/bindings/Makefile.local
index 17b561ca..2ba2775c 100644
--- a/bindings/Makefile.local
+++ b/bindings/Makefile.local
@@ -9,7 +9,7 @@ ifeq ($(HAVE_RUBY_DEV),1)
EXTRA_LDFLAGS="$(NO_UNDEFINED_LDFLAGS)" \
LIBNOTMUCH="../../lib/$(LINKER_NAME)" \
NOTMUCH_SRCDIR='$(NOTMUCH_SRCDIR)' \
-   ruby extconf.rb --vendor
+   $(RUBY) extconf.rb --vendor
$(MAKE) -C $(dir)/ruby
 endif
 
diff --git a/configure b/configure
index b177b141..392213b6 100755
--- a/configure
+++ b/configure
@@ -62,6 +62,7 @@ CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)}
 LDFLAGS=${LDFLAGS:-}
 XAPIAN_CONFIG=${XAPIAN_CONFIG:-}
 PYTHON=${PYTHON:-}
+RUBY=${RUBY:-ruby}
 
 # We don't allow the EMACS or GZIP Makefile variables inherit values
 # from the environment as we do with CC and CXX above. The reason is
@@ -118,6 +119,8 @@ Other environment variables can be used to control 
configure itself,
library. [$XAPIAN_CONFIG]
PYTHON  Name of python command to use in
configure and the test suite.
+   RUBYName of ruby command to use in
+   configure and the test suite.
 
 Additionally, various options can be specified on the configure
 command line.
@@ -621,7 +624,7 @@ fi
 have_ruby_dev=0
 if [ $WITH_RUBY = "1" ] ; then
 printf "Checking for ruby development files... "
-if ruby -e "require 'mkmf'"> /dev/null 2>&1; then
+if ${RUBY} -e "require 'mkmf'"> /dev/null 2>&1; then
printf "Yes.\n"
have_ruby_dev=1
 else
@@ -1027,6 +1030,9 @@ WARN_CFLAGS=${WARN_CFLAGS}
 # Name of python interpreter
 PYTHON = ${python}
 
+# Name of ruby interpreter
+RUBY = ${RUBY}
+
 # The prefix to which notmuch should be installed
 # Note: If you change this value here, be sure to ensure that the
 # LIBDIR_IN_LDCONFIG value below is still set correctly.
@@ -1234,6 +1240,9 @@ NOTMUCH_HAVE_MAN=$((have_sphinx))
 # Name of python interpreter
 NOTMUCH_PYTHON=${python}
 
+# Name of ruby interpreter
+NOTMUCH_RUBY=${RUBY}
+
 # Are the ruby development files (and ruby) available? If not skip
 # building/testing ruby bindings.
 NOTMUCH_HAVE_RUBY_DEV=${have_ruby_dev}
diff --git a/test/test-lib.sh b/test/test-lib.sh
index 5b212514..7e064021 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -1003,7 +1003,7 @@ test_python() {
 }
 
 test_ruby() {
-MAIL_DIR=$MAIL_DIR ruby -I $NOTMUCH_SRCDIR/bindings/ruby> OUTPUT
+MAIL_DIR=$MAIL_DIR $NOTMUCH_RUBY -I $NOTMUCH_SRCDIR/bindings/ruby> OUTPUT
 }
 
 test_C () {
-- 
2.17.0

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


Re: emacs-notmuch: Set variables based on From when composing

2018-03-17 Thread Thomas Schneider
David Bremner <da...@tethera.net> writes:

> Thomas Schneider <q...@chaotikum.eu> writes:
>
>> Hello list,
>>
>> I use notmuch with the Emacs frontend and multiple accounts.  I’d like
>> it to set the domain part of Message-Id header of any mail I compose to
>> something sensible, e.g. the FQDN of the host (which does not seem to be
>> easy, see [0]) or the domain part of the From header.
>
> There is some discussion on the wiki of using gnus-alias and
> message-templ with notmuch. The latter is more about setting headers.

Thanks for the pointer.  gnus-alias seems to work so far.  I also use it
to set the Fcc header to avoid duplicating address matches.

>>> I was thinking about setting message-user-fqdn based on the From header
>> in an appropriate hook, but I haven’t found yet where and how to do
>> this.
>
> There is notmuch-mua-send-hook (which by default just runs
> message-send-hook)

This seems to be run too late, so as for now, I use message-setup-hook
and always define the address I want to send as beforehand.

---
(add-hook 'message-setup-hook
  (lambda ()
(make-local-variable 'message-user-fqdn)
(setq message-user-fqdn
  (car (reverse (split-string
 (car (mail-header-parse-address
   (message-field-value "From")))
 "@"))
---

Maybe I could add Message-ID to one of the headers added beforehand so
that I see what is generated.



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


emacs-notmuch: Set variables based on From when composing

2018-03-12 Thread Thomas Schneider
Hello list,

I use notmuch with the Emacs frontend and multiple accounts.  I’d like
it to set the domain part of Message-Id header of any mail I compose to
something sensible, e.g. the FQDN of the host (which does not seem to be
easy, see [0]) or the domain part of the From header.

I was thinking about setting message-user-fqdn based on the From header
in an appropriate hook, but I haven’t found yet where and how to do
this.

In fact, this would be useful for more variables, such as
message-user-organization or message-signature(-file).  Like
notmuch-fcc-dirs, just for other variables.

I’d appreciate any pointers.

Thanks,
--qsx


[0] https://emacs.stackexchange.com/questions/12649/local-hosts-fqdn-in-emacs-25


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