unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: Teemu Likonen <tlikonen@iki.fi>, Notmuch Mail <notmuch@notmuchmail.org>
Cc: "Antoine Beaupré" <anarcat@orangeseeds.org>
Subject: Re: proposing "notmuch purge"
Date: Tue, 14 Jan 2020 14:23:36 -0500	[thread overview]
Message-ID: <87r201j0zr.fsf@fifthhorseman.net> (raw)
In-Reply-To: <87d0bm1vjf.fsf@iki.fi>

[-- Attachment #1: Type: text/plain, Size: 1762 bytes --]

On Tue 2020-01-14 07:01:08 +0200, Teemu Likonen wrote:
> We would need "notmuch search --exclude=false tag:deleted" to really
> find all messages with tag:deleted.

I agree that we ought to deliberately avoid the exclude_tags when
purging.

> I think that the "SEARCH-TERMS" part should be configurable, not
> hard-coded. A user could have setting like
> "search.purge_tags=deleted;spam" and that would lead to search terms
> "tag:deleted OR tag:spam" in the purge operation.

I want the user to be able to run "notmuch purge", with no arguments, to
"Do What I Mean"™

I also want the "purge" subcommand to have its own configuration
space -- it's *not* a specialized form of "search".

So if we choose to make it configurable, i have two (mutually-exclusive)
counter-proposals to yours above.  In either case, if the user supplies
search terms, they are used instead of pulling from the config

a) the config variable is "purge.tags", and by default (if no setting is
   present) its value is "deleted".  "notmuch purge" with no search
   terms expands this value into a tags-based selection.

b) "notmuch purge" with no search terms looks for a special stored query
   named "query.purge".  If that is not present, it uses "tags:deleted".

(b) is slightly more flexible than (a), in that the user can configure
it to use arbitrary queries, not just tags, though both behave
identically in a default (not-explicitly-configured) setup.

fwiw, i'd also like to consider exposing this functionality from
libnotmuch, not just from the cli (so that it can be used by MUAs that
are based solely on the library), but if there are good arguments for
avoiding this in the library, i'd be happy to hear them.

            --dkg


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

  parent reply	other threads:[~2020-01-14 19:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-13 22:28 proposing "notmuch purge" Daniel Kahn Gillmor
2020-01-13 22:33 ` Antoine Beaupré
2020-01-14  5:01 ` Teemu Likonen
2020-01-14  5:36   ` Teemu Likonen
2020-01-14 19:23   ` Daniel Kahn Gillmor [this message]
2020-01-14 19:55     ` Jameson Graef Rollins
2020-01-14 20:03       ` Antoine Beaupré
2020-01-14 22:25         ` Daniel Kahn Gillmor
2020-01-15  5:36       ` Teemu Likonen
2020-01-15  9:58         ` Örjan Ekeberg
2020-01-14 22:48 ` Ryan Tate
2020-01-14 23:08   ` Jameson Graef Rollins
2020-01-15  1:43   ` Antoine Beaupré
2020-01-14 22:59 ` Brian May
2020-01-14 23:24   ` Daniel Kahn Gillmor

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=87r201j0zr.fsf@fifthhorseman.net \
    --to=dkg@fifthhorseman.net \
    --cc=anarcat@orangeseeds.org \
    --cc=notmuch@notmuchmail.org \
    --cc=tlikonen@iki.fi \
    /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).