Re: Strip spaces in `tags` in `~/.notmuch-config` (and other fields)

Subject: Re: Strip spaces in `tags` in `~/.notmuch-config` (and other fields)

Date: Thu, 30 Sep 2021 14:17:34 -0300

To: Ciprian Dorin Craciun, notmuch@notmuchmail.org

Cc:

From: David Bremner


Ciprian Dorin Craciun <ciprian.craciun@gmail.com> writes:
>
> Given that the `~/.notmuch-config` resembles an INI file, and given
> how lax the actual syntax is in general, I would suggest the
> following:
>
> * allow white-spaces around `[ section ]`, and `field = value`;

This is somewhat out of our control, as we rely on glib to parse these
files.

> * strip white-spaces (left and right) from values like `tags = unread
> ; inbox ;`;  (but not infix like `tag = some tag ; some other tag;`;)

I will shortly send a patch to implement this. It has the potential
issue that it is no longer possible to enter tags with leading/trailing
spaces in the config file. That doesn't seem like a big deal to me, but
I guess we'll see.

> * allow skipping the last `;` separator from `tags` and similar;
>

This should be working now. The last ; is optional (since notmuch 0.32,
I think).

> Failing that, perhaps add a warning when parsing the configuration file.

This again comes down to the config file parser we are using.  However,
we can (and do) scan the tags afterwards for certain issues, which we
could further extend.
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: