unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Ciprian Dorin Craciun <ciprian.craciun@gmail.com>,
	notmuch@notmuchmail.org
Subject: Re: Strip spaces in `tags` in `~/.notmuch-config` (and other fields)
Date: Thu, 30 Sep 2021 14:17:34 -0300	[thread overview]
Message-ID: <87mtnux9sh.fsf@tethera.net> (raw)
In-Reply-To: <CA+Tk8fzjPLaEd3vL1f9ebk_bF_RV8PDTLzDupraTkCLCpJAmCg@mail.gmail.com>

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.

  parent reply	other threads:[~2021-09-30 17:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24 10:36 Strip spaces in `tags` in `~/.notmuch-config` (and other fields) Ciprian Dorin Craciun
2020-04-24 11:12 ` David Bremner
2021-09-30 17:17 ` David Bremner [this message]
2021-09-30 17:17 ` [PATCH 1/2] test: known broken tests for leading/trailing ws in config David Bremner
2021-09-30 17:17   ` [PATCH 2/2] config: ignore leading/trailing spaces in ';'-delimited lists David Bremner
2021-09-30 18:28     ` [PATCH 1/2] test: known broken tests for escape characters in config files David Bremner
2021-09-30 18:28       ` [PATCH 2/2] lib/config: use g_key_file_get_string to read config values David Bremner
2021-09-30 18:59         ` [PATCH v2] " David Bremner
2021-12-04 16:31   ` [PATCH 1/2] test: known broken tests for leading/trailing ws in config David Bremner
2021-12-05 12:41 ` Strip spaces in `tags` in `~/.notmuch-config` (and other fields) David Bremner
2021-12-13  9:09   ` Ciprian Craciun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mtnux9sh.fsf@tethera.net \
    --to=david@tethera.net \
    --cc=ciprian.craciun@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).