Re: introduce exception handling at top level of libnotmuch

2020-07-03 Thread David Bremner
Daniel Kahn Gillmor  writes:

>
> I think this looks fine, and it isn't a huge amount of boilerplate.
>
> Please merge.
>
>   --dkg

OK, merged to master, thanks for the review.

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH] emacs: Add notmuch-show-local-dates option

2020-07-03 Thread David Bremner
Daniel Kahn Gillmor  writes:

> But if the sender is in TZ=Europe/Berlin, i would see:
>
> Date: Fri, 03 Jul 2020 13:22:36 -0400 [Fri, 03 Jul 2020 19:22:36 +0200]
>
> (Note that RFC 5322 Date format shows the hour offset, but not the
> actual TZ -- i can't tell from -0400 whether someone is in
> TZ=America/New_York or TZ=America/Manaus)
>
> Is there anyone who would complain about this just being the default
> behavior -- with no additional settings to change?

The bikeshed must be blue! Uh, I mean what about narrowish screens (80
columns or so) and or deeply indented threads?

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH] emacs: Add notmuch-show-local-dates option

2020-07-03 Thread Daniel Kahn Gillmor
On Thu 2020-07-02 18:02:34 -0400, Kevin Foley wrote:
> Daniel Kahn Gillmor  writes:
>> and it could take three values:
>>
>>  - nil (default), shows the Date: header as received
>>  - t, shows the timestamp from the Date: header in local time, 
>>with the as-received header in parens afterward (see below)
>>  - "only", shows only the timestamp in localtime
>>
>
> I feel like "only" makes more sense as the option to be used for t, and
> having "both" as another option.

I'm fine either way.

>> so if your system is TZ=UTC, and notmuch-show-date-header-localtime is
>> set to t, and you're looking at a message sent from TZ=America/New_York,
>> you might see:
>>
>> Date: Thu, 02 Jul 2020 19:34:53 + (Thu, 02 Jul 2020 15:34:53 -0400)
>
> Actually, seeing it written out here makes me realize some people could
> potentially prefer:
>
> Date: {sent-tz-datetime} ({system-tz-datetime})
>
> or some other kind of formatting.
>
> Would it make sense to allow a function instead of "both", which would
> be passed the time and let the user return it formatted how they would
> like?  Or is that over-complicating things?

For a toolkit, i like the idea of a function.  For an end-user-facing
MUA, i like opinionated decisions that do obviously the right thing,
without requiring the user to fiddle with anything.

We're struggling a bit here because notmuch-emacs is sort of in the
middle of these two things -- sometimes the one, other times the other.

Pushing on the "just do the right thing" front:

What if there were no configuration variable at all, and it just always
shows "both" ?  Or, even cleverer, what if it only shows both if the
current TZ differs from the sender's TZ?

So if i'm in TZ=America/New_York, and the sender is in
TZ=America/New_York, i would just see the normal header:

Date: Fri, 03 Jul 2020 13:22:36 -0400

But if the sender is in TZ=Europe/Berlin, i would see:

Date: Fri, 03 Jul 2020 13:22:36 -0400 [Fri, 03 Jul 2020 19:22:36 +0200]

(Note that RFC 5322 Date format shows the hour offset, but not the
actual TZ -- i can't tell from -0400 whether someone is in
TZ=America/New_York or TZ=America/Manaus)

Is there anyone who would complain about this just being the default
behavior -- with no additional settings to change?

 --dkg


signature.asc
Description: PGP signature
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [RFC PATCH] lib: document new database_open API

2020-07-03 Thread David Bremner
David Bremner  writes:

> There is not much code to back this so far. This is just me thinking
> out loud at this point.  The location calculation is done (and also
> easy).  The challenging part is probably updating
> notmuch_database_get_config to do what this comment promises.

There's always something I forget.

If you want to look at this in a more friendly way

1) apply the patch
2) make build-man
3) man -l doc/_build/man/man3/notmuch.3
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


[RFC PATCH] lib: document new database_open API

2020-07-03 Thread David Bremner
Several aspects of this are potentially controversial:

1) The use of environment variables as fallback. I understand the
discomfort with having a library function check the environment, but
this seems to be functionality people want, and it is better to
implement it once.

2) The use of both NULL and "" to do different things for config_path.

3) The new API is pretty complex, compared to the previous one.
---

There is not much code to back this so far. This is just me thinking
out loud at this point.  The location calculation is done (and also
easy).  The challenging part is probably updating
notmuch_database_get_config to do what this comment promises.

I suspect database_create will probably need to be updated to match.

Another question is if we should have an opaque set of options to pass
to open (in the style notmuch_indexopts_t).  Currently this is just
future proofing as far as I know.

 lib/notmuch.h | 138 --
 1 file changed, 111 insertions(+), 27 deletions(-)

diff --git a/lib/notmuch.h b/lib/notmuch.h
index ceb5a018..6a46b80a 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -301,52 +301,136 @@ typedef enum {
 } notmuch_database_mode_t;
 
 /**
- * Open an existing notmuch database located at 'path'.
+ * Deprecated alias for notmuch_database_open_with_config with
+ * config_path=error_message=NULL
+ * @deprecated Deprecated as of libnotmuch 5.2 (notmuch 0.31)
+ */
+NOTMUCH_DEPRECATED(5, 2)
+notmuch_status_t
+notmuch_database_open (const char *path,
+  notmuch_database_mode_t mode,
+  notmuch_database_t **database);
+/**
+ * Deprecated alias for notmuch_database_open_with_config with
+ * config_path=NULL
+ *
+ * @deprecated Deprecated as of libnotmuch 5.2 (notmuch 0.31)
+ *
+ */
+NOTMUCH_DEPRECATED(5, 2)
+notmuch_status_t
+notmuch_database_open_verbose (const char *path,
+  notmuch_database_mode_t mode,
+  notmuch_database_t **database,
+  char **error_message);
+
+/**
+ * Open an existing notmuch database located at 'database_path', using
+ * configuration in 'config_path'.
+ *
+ * @param[in]  database_path
+ * @parblock
+ * Path to existing database.
+ *
+ * A notmuch database is a Xapian database containing appropriate
+ * metadata.
  *
  * The database should have been created at some time in the past,
  * (not necessarily by this process), by calling
- * notmuch_database_create with 'path'. By default the database should be
- * opened for reading only. In order to write to the database you need to
- * pass the NOTMUCH_DATABASE_MODE_READ_WRITE mode.
+ * notmuch_database_create.
+ *
+ * If 'database_path' is NULL, use the location specified
+ *
+ * - in the environment variable NOTMUCH_DATABASE, if non-empty
+ *
+ * - by $XDG_DATA_HOME/notmuch/$NOTMUCH_PROFILE where XDG_DATA_HOME
+ *   defaults to "$HOME/.local/share" and NOTMUCH_PROFILE defaults to
+ *   "default"
+ *
+ * If 'database_path' is non-NULL, but does not appear to be a Xapian
+ * database, check for a directory '.notmuch/xapian' below
+ * 'database_path'.
+ *
+ * @endparblock
+ * @param[in]  mode
+ * @parblock
+ * Mode to open database
+ *
+ * By default the database will be opened for reading only. In order
+ * to write to the database you need to pass the
+ * #NOTMUCH_DATABASE_MODE_READ_WRITE mode.
+ *
+ * @endparblock
+ * @param[in]  config_path
+ * @parblock
+ * Path to config file.
+ *
+ * Config file is key-value, with mandatory sections. See
+ * notmuch-config(5) for more information. The key-value pair
+ * overrides the corresponding configuration data stored in the
+ * database (see notmuch_database_get_config)
  *
- * An existing notmuch database can be identified by the presence of a
- * directory named ".notmuch" below 'path'.
+ * If config_path is NULL use the path specified
+ *
+ * - in environment variable NOTMUCH_CONFIG, if non-empty
+ *
+ * - by  XDG_CONFIG_HOME/notmuch/ where
+ *   XDG_CONFIG_HOME defaults to "$HOME/.config".
+ *
+ * - by $HOME/.notmuch-config
+ *
+ * If config_path is "" (empty string) then do not
+ * open any configuration file.
+ * @endparblock
+ * @param[in] profile:
+ * @parblock
+ * Name of profile (configuration/database variant).
+ *
+ * If non-NULL, append to the directory / file path determined by
+ * config_path.
+ *
+ * If NULL then use
+ * - environment variable NOTMUCH_PROFILE if defined,
+ * - otherwise "default" for directories and "" (empty string) for paths.
+ *
+ * @endparblock
+ * @param[out] database
+ * @parblock
+ * Pointer to database object. May not be NULL.
  *
  * The caller should call notmuch_database_destroy when finished with
  * this database.
  *
  * In case of any failure, this function returns an error status and
- * sets *database to NULL (after printing an error message on stderr).
+ * sets *database to NULL.
  *
- * Return value:
+ * @endparblock
+ * @param[out] error_message
+ * If non-NU

Re: [PATCH] bindings/python-cffi: copy version file into bindings dir

2020-07-03 Thread David Bremner
David Bremner  writes:

> Attempt to avoid breaking "pip install ."
>
> As far as I can tell, we need to have a copy (not just a relative
> symlink) of the version file.

Applied, as part of 0.30~rc3. Let me know if this is still broken for
pip users. I tried "pip install .", but that's all I know.

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH 1/2] configure: can gpgme can verify signatures when decrypting with a session key?

2020-07-03 Thread David Bremner
Daniel Kahn Gillmor  writes:

> If https://dev.gnupg.org/T3464 is unresolved in the version of gpgme
> we are testing against, then we should know about it, because it
> affects the behavior of notmuch.
>

series is applied as part of 0.30~rc3

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH] doc: update name of gmime package to install

2020-07-03 Thread David Bremner
David Bremner  writes:

> Fedora still has an old gmime-devel which is 2.6.x. This is no longer
> supported by notmuch.

Applied, with s/yum/dnf/ in 0.30~rc3

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH] build: produce signatures for release candidate tarballs.

2020-07-03 Thread David Bremner
David Bremner  writes:

> Today Defalos on #notmuch asked for a signed tarball for
> 0.30~rc2. This is a minimal change to support this in the future.  The
> question of automagically uploading will need more thought; currently
> I like the fact that tags from pre-releases are only pushed manually.

Applied (and used) as part of 0.30~rc3

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: Feature freeze for notmuch 0.30: June 1

2020-07-03 Thread David Bremner
David Bremner  writes:

> I've tagged a 3rd release candidate (which is of course rc2, because
> this week I belong to the cult of 0 based indexing). All of the blockers
> I know of are fixed, and I'd consider us in "deep freeze", hopefully to
> release in a week or so if there are no nasty bugs discovered.

I've tagged a fourth release candidate 0.30~rc3, uploaded to notmuchmail.org and
Debian experimental.

The main issue I'm aware of is a rumoured file descriptor with the new
python bindings. I can't hold the release indefinitely for this. If
someone can produce a small standalone reproducer and send it to the
list now, I'll have a look at it. Otherwise the problem will have to
wait for a bug fix release.


signature.asc
Description: PGP signature
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: Newbie: On Outlook Exchange how to use notmuch to connect to it?

2020-07-03 Thread Georg Faerber
On 20-07-02 14:59:59, Daniel Kahn Gillmor wrote:
> Notmuch only works with a local maildir. So what you need is a way to
> get a copy of your messages from Exchange and build a local maildir.
> 
> I'm afraid i don't have a good answer for that -- it will typically
> depend on how Exchange is configured. If Exchange has an IMAP
> connector enabled, you can use a tool like imap-dl (from the
> mailscripts package), getmail, or offlineimap to retrieve the messages
> via IMAP and stash them in a local maildir.
> 
> If Exchange doesn't have an IMAP connector enabled, then you'll need
> to learn more about what interfaces are available for you to fetch the
> underlying messages.

In case your Exchange doesn't offer IMAP, davmail [1] might be of help,
which supports Outlook Web Access as well.

Cheers,
Georg


[1] http://davmail.sourceforge.net/
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org