From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6JOBJTnxVWHbugAAgWs5BA (envelope-from ) for ; Thu, 30 Sep 2021 19:17:45 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id gHYBITnxVWEaWAAAbx9fmQ (envelope-from ) for ; Thu, 30 Sep 2021 17:17:45 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DCF8F3129C for ; Thu, 30 Sep 2021 19:17:44 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id A292326D3C; Thu, 30 Sep 2021 13:17:39 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 3CB3A26CF8 for ; Thu, 30 Sep 2021 13:17:37 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 2826C5FD5C; Thu, 30 Sep 2021 13:17:36 -0400 (EDT) Received: (nullmailer pid 4044583 invoked by uid 1000); Thu, 30 Sep 2021 17:17:34 -0000 From: David Bremner To: Ciprian Dorin Craciun , notmuch@notmuchmail.org Subject: Re: Strip spaces in `tags` in `~/.notmuch-config` (and other fields) In-Reply-To: References: Date: Thu, 30 Sep 2021 14:17:34 -0300 Message-ID: <87mtnux9sh.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: J6TDBEMCM74SE3EWJXRFXYD2U7R3HFNU X-Message-ID-Hash: J6TDBEMCM74SE3EWJXRFXYD2U7R3HFNU X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633022265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=4annfu0InbNCg3siBS6v18rdes9WeKs4eh3HWSomvzs=; b=LxyBsioCX824A+gPnvmtaqtkWZOSScK4ZsEhzxxo91wFFF5RrBSRYNU7gLKf6qUJCiO9j3 oYRzHc6+NoygGMmUpczizB1L1hY1v8zL+s7HNXlBV3pm+Tad69c7nXQO+SvxFgTdorn03B tiR4/fwNQVmvI51wCESxuqHXO24ANWw3MowMbPxHKbzlVvPXjOTno55tcVychORBgTRRub 5jnz+50AStcdno2ay/4wCLxyK5d+P947b7BYs153W7KIeiiQfBdGg//NN8t4tIAAU+OjCs 1nL0G6p3HDQBV5xaoJUwHJ3tcIytz+dVH8+MGtV1mWX8vi5QjIQK+VjsJG7LxA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633022265; a=rsa-sha256; cv=none; b=h63cIet+Yf/fuqqwpfeVpbDYSDHpLBJc8YSOTpWoIlI8jjW89ESB5nnQzZgTYHYNnWUbZj WC6IcZ459urzWEn6a2vAstD4OosjLbYMqfW0kzwvf3irCvjxg6kxkqQoDSYNGH5zvd9tyc Xq9M2GBW+30XbfMKAFkqDjcQN2gj0Swkq3L1KTqr2MPlNkY+SjDRR74gRtUjpPFyp07EpT 2D9iZDo20O2VGqcdZhaFwryUcNdY+fSVU3T7W87z5BFmtFPKxQFzzaSPzXjx4fFLoMgu24 x6HkDC2XQtwiQUAqKidtvAsf9BajEzK409rizMMy7GYWf1Vs98SnFFnYp2XFkQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -2.16 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: DCF8F3129C X-Spam-Score: -2.16 X-Migadu-Scanner: scn1.migadu.com X-TUID: 2pUcW7+lBJr3 Ciprian Dorin Craciun 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.