unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Strip spaces in `tags` in `~/.notmuch-config` (and other fields)
@ 2020-04-24 10:36 Ciprian Dorin Craciun
  2020-04-24 11:12 ` David Bremner
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Ciprian Dorin Craciun @ 2020-04-24 10:36 UTC (permalink / raw)
  To: notmuch

[Sorry if I'm double reporting this.  I've tried my best to search for
previous discussions.]


I've tried to manually edit my `~/.notmuch-config`, and I've seen that
the field `tags` was written as `tags=unread;inbox;`.  In order to
increase readability I've decided to update my configuration file by
adding spaces around `=` and `;` as in `tags = unread ; inbox ;`.
Everything worked without a warning, until it didn't...  :)

What happened:  all my emails are now tagged with `unread ` and `
inbox `;  (i.e. whitespace in tags).


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`;
* strip white-spaces (left and right) from values like `tags = unread
; inbox ;`;  (but not infix like `tag = some tag ; some other tag;`;)
* allow skipping the last `;` separator from `tags` and similar;

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


Hope it helps,
Ciprian.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-12-13  9:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).