unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: andreas@rammhold.de
To: Michael J Gruber <git@grubix.eu>
Cc: notmuch@notmuchmail.org
Subject: Re: [RFC 0/2] add --new-tags= to notmuch-new(1)
Date: Thu, 16 Sep 2021 14:24:14 +0200	[thread overview]
Message-ID: <20210916122414.udswscp7hn6tvkae@wrt> (raw)
In-Reply-To: <163179378465.773443.12112139662488774678.git@grubix.eu>

On 14:03 16.09.21, Michael J Gruber wrote:
> I very much sympathize with your setup. But I think the real solution
> would be one of these options:
> 
> - use a lock file to prevent your scripts from running concurrently OR

That would work. I'd love if that could be moved into notmuch such
that running `notmuch new` will keep a (global) lock until all of the
messages have been processed and all of the hooks have been executed.

This is probably tricky to get right consistently across the notmuch
code base. At least that was one of the comments I recall from a
conversation on IRC when that topic was brought up.

> - match "tag:new and folder:UNIQUEFOLDER" (or "path:FOO/**")
>   This should be a perfect substitute for your new-UNIQUE tag.

How would the files end up in the UNIQUEFOLDER? What I probably forgot
to mention is that I do not sync only on the Mailbox boundary. I have an
IAMP IDLE instance for "Inbox" on all of the accounts and then more for
other folders in those accounts. I could probably script that (wouldn't
take more than an evening I am sure) but requires a lot more additional
code.


> As for the implementation you suggest: Basically, you implement
> overriding the "new.tags" config, and I'm wondering whether it would be
> worthwhile to implement "notmuch --config-value" instead:
> 
> --config-value=SECTION.ITEM=VALUE
> 	Override the config setting for SECTION.ITEM with the VALUE for
> 	this invocation. This takes precedence over any setting in the
> 	config file.

That is an interesting idea. How would you implement that? Right now it
looks like all changes in configuration are written to disk when you
change them. That would require keeping a copy of all the settings in
RAM (which is probably already the case) and only mutating those without
writing to disk.


> I know this raises the question which config any hooks will see, but
> that is the same for your implementation.

Yeah, I was thinking about that as well. I did check if notmuch actually
passed anything via environment vars to the hooks. That doesn't seem to
be the case.

> You can override the complete config by specifying a different file
> already, of course, so you could script that.

Yes, that is also something I considered but I'd rather avoid that. I've
had some issues with defining the notmuch configuration in the past. For
some reason it always failed to find the file or load the correct one :(
Was probably some local issue - I hope.

  reply	other threads:[~2021-09-16 12:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16 10:25 [RFC 0/2] add --new-tags= to notmuch-new(1) andreas
2021-09-16 10:25 ` [RFC 1/2] lib/config: introduce notmuch_config_values_from_string function andreas
2021-09-16 10:25 ` [RFC 2/2] CLI/notmuch: add --new-tags argument to notmuch-new(1) andreas
2021-09-16 12:03 ` [RFC 0/2] add --new-tags= " Michael J Gruber
2021-09-16 12:24   ` andreas [this message]
2021-09-16 14:43     ` Michael J Gruber
2021-09-20 23:57 ` David Bremner

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=20210916122414.udswscp7hn6tvkae@wrt \
    --to=andreas@rammhold.de \
    --cc=git@grubix.eu \
    --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).