From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <markwalters1009@gmail.com>
Received: from localhost (localhost [127.0.0.1])
 by arlo.cworth.org (Postfix) with ESMTP id 7F6626DE0FD2
 for <notmuch@notmuchmail.org>; Sun, 18 Sep 2016 10:04:38 -0700 (PDT)
X-Virus-Scanned: Debian amavisd-new at cworth.org
X-Spam-Flag: NO
X-Spam-Score: 0.132
X-Spam-Level: 
X-Spam-Status: No, score=0.132 tagged_above=-999 required=5 tests=[AWL=-0.298, 
 DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
 FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001,
 FREEMAIL_REPLY=1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01,
 RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled
Received: from arlo.cworth.org ([127.0.0.1])
 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id YwMqFfjyqMtD for <notmuch@notmuchmail.org>;
 Sun, 18 Sep 2016 10:04:37 -0700 (PDT)
Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46])
 by arlo.cworth.org (Postfix) with ESMTPS id F022C6DE0FB6
 for <notmuch@notmuchmail.org>; Sun, 18 Sep 2016 10:04:36 -0700 (PDT)
Received: by mail-wm0-f46.google.com with SMTP id w84so40142593wmg.1
 for <notmuch@notmuchmail.org>; Sun, 18 Sep 2016 10:04:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=from:to:cc:subject:date:message-id;
 bh=AnZroQOpTTxIfsQX8uPLOpmvXeOUoEIhU/1VygZk5w4=;
 b=um/EilWvGmK9db19j/1xaqxY9k3zkjwHUXLFiqU5JZqIpzoaV99N8TeEN3XlWpPFBr
 +r+V5bjTAMkhWYcvx6iMnML1X3KH2ralT2kDvHIIa78BX5EV5OoqyGfuNtOFcKChw/MC
 V9RQtm4o8m1fjHlPbwHh2IW3rI6pvrdquthcvw8gBXH0MS+Pf7FtrofY4w4/3EiVuVJx
 qG/8KrC4APgbEH9YlTIxGkaF+CueDZA1xWZGj73hgobsPc0thLXvT/4ajeJFjVBw6wWe
 bmZdH3VW2Ly6wRTdptqS+byCKbkwfHEH7kifYYIVapIRBA7vi0Szjwj+EWjYX533RTiE
 82tQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:from:to:cc:subject:date:message-id;
 bh=AnZroQOpTTxIfsQX8uPLOpmvXeOUoEIhU/1VygZk5w4=;
 b=fxbPU7oCWQVdFhMCuJulf/l/Rf8wKhjSsFNIuBr05PTWxRPkT/vMPUUzfeDM5Lfq1B
 /DXNS290AnyXfFAgSu52mrDkX3K/DgEL19yu67hd+BmlUtofnqelfHFx8TvUiEaryaLq
 9jxzMJaYDN34puVyITSbN1lRoc6+SwRJbuwzZw6BPodH/VNJF8GRo7LTi6nmCLYWErZ5
 Yfj91/QJn4P7oWQGkpmrnGlvNNTvbyNKFSkatzb5vrp630zUUTt9sNY2aaOXttG7Be9x
 HgHmYOOhqCk0ab9eq42ge9dqfRdATMSa5NSDBjAJ8KEtgzti0k2dHRzBlCUok81XwpHL
 GiuA==
X-Gm-Message-State: AE9vXwNSp4OkNIBWjvm+cBkUQf/XLpvmGsBFyPd7ievYjxGWyO7B8iz0TsZ5sb7+D7S+GQ==
X-Received: by 10.194.191.228 with SMTP id hb4mr14975726wjc.213.1474218275394; 
 Sun, 18 Sep 2016 10:04:35 -0700 (PDT)
Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162])
 by smtp.gmail.com with ESMTPSA id gr7sm18767872wjc.1.2016.09.18.10.04.34
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 18 Sep 2016 10:04:34 -0700 (PDT)
From: Mark Walters <markwalters1009@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH v2 0/2] Jump tagging
Date: Sun, 18 Sep 2016 18:04:29 +0100
Message-Id: <1474218271-8312-1-git-send-email-markwalters1009@gmail.com>
X-Mailer: git-send-email 2.1.4
X-BeenThere: notmuch@notmuchmail.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "Use and development of the notmuch mail system."
 <notmuch.notmuchmail.org>
List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,
 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
List-Post: <mailto:notmuch@notmuchmail.org>
List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,
 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
X-List-Received-Date: Sun, 18 Sep 2016 17:04:38 -0000

This is version 2 of the patch
id:1474146583-28476-1-git-send-email-markwalters1009@gmail.com

I have tried to respond to most of the feedback. Most of the changes
are folded in to the first patch, which does the basic jump
tagging. The second patch is an attempt at allowing non-automatically
reversed tagging operations. Note neither patch is properly documented
yet.

Changes are

1) I added some more default operations in the tagging jump map, for spam and flagged.

2) You can now specify the tag changes either as a list, or as a
variable name which is the list of tag changes. For example "a" in the
tagging jumpmap is now bound to the notmuch-archive-tags so
automatically picks up the users choice of archive tags.

3) As ctrl-u is often cumbersome, and as you may decide you want to
reverse a tag operation once you are already in the tag jump map, "r"
jumps to the reverse tag map (r again returns you to the forward map)

4) The jump tag list now appears in the order they are listed in the
variable (rather than the reverse order).

5) Omit the tick box option for the name, and just have it always used,
but if the user leaves it empty the tag changes (or the variable name)
will be used as the name.

The main change I did not make was to make any of these a toggle: I
think r as reverse is sufficient and a toggle will do weird things in
too many cases. This way it is clear that "k d" *always* add the
deleted tag, whereas "k r d" always removes it.

Finally, bremner asked about non-reversible changes. I have
implemented it as follows. When you specify the tag changes you can
use any of +tag -tag #tag and =tag. The latter two mean +tag and -tag
when done forward but are omitted when reversed.

Thus, for example, "d" for deleted is set (by default) as +deleted
=inbox which means "k d" does "+deleted -inbox" but the reverse
operation "k r d" just does "-deleted" (i.e., it does not do +inbox).

The final code is a little ugly, because it has several cases to
consider, I think for a user it is all quite straightforward. Indeed,
if a user doesn't know about #,= prefixes then they lose nothing.

(There is one potential breakage: if people have any of the automatic
tags (unread,archive etc) setup so that they include tags starting =
or # and they don't specify the + or - for them (we default to +) then
the unarchive function will break. Given the benefits, and the pretty
unusual nature of this setup, this is probably acceptable)

Best wishes

Mark


Mark Walters (2):
  emacs: add tag jump menu
  emacs: tag: allow non-automatically-reversible tag operations

 emacs/notmuch-lib.el  |  4 +++
 emacs/notmuch-show.el |  1 +
 emacs/notmuch-tag.el  | 99 ++++++++++++++++++++++++++++++++++++++++++++++-----
 emacs/notmuch-tree.el |  1 +
 emacs/notmuch.el      |  1 +
 5 files changed, 97 insertions(+), 9 deletions(-)

-- 
2.1.4