Re: [PATCH] Add 'd'elete keybinding to search and show views
authorJameson Rollins <jrollins@finestructure.net>
Wed, 21 Apr 2010 23:32:39 +0000 (19:32 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:36:45 +0000 (09:36 -0800)
cd/fe483a2323103529e3881b8db513bb89a76979 [new file with mode: 0644]

diff --git a/cd/fe483a2323103529e3881b8db513bb89a76979 b/cd/fe483a2323103529e3881b8db513bb89a76979
new file mode 100644 (file)
index 0000000..555cfe1
--- /dev/null
@@ -0,0 +1,142 @@
+Return-Path: <jrollins@finestructure.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 6B9594196F2\r
+       for <notmuch@notmuchmail.org>; Wed, 21 Apr 2010 16:32:56 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -4.19\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-4.19 tagged_above=-999 required=5\r
+       tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_MIME_NO_TEXT=0.01]\r
+       autolearn=ham\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id n6BxOZWqVntC for <notmuch@notmuchmail.org>;\r
+       Wed, 21 Apr 2010 16:32:55 -0700 (PDT)\r
+Received: from serrano.cc.columbia.edu (serrano.cc.columbia.edu [128.59.29.6])\r
+       by olra.theworths.org (Postfix) with ESMTP id 8CFBA431FC1\r
+       for <notmuch@notmuchmail.org>; Wed, 21 Apr 2010 16:32:55 -0700 (PDT)\r
+Received: from servo.finestructure.net (geco.phys.columbia.edu\r
+       [128.59.170.159])\r
+       (user=jgr2110 author=jrollins@finestructure.net mech=PLAIN bits=0)\r
+       by serrano.cc.columbia.edu (8.14.3/8.14.3) with ESMTP id o3LNWjmg020774\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Wed, 21 Apr 2010 19:32:45 -0400 (EDT)\r
+Received: from jrollins by servo.finestructure.net with local (Exim 4.71)\r
+       (envelope-from <jrollins@finestructure.net>)\r
+       id 1O4jPR-0002Ah-Bx; Wed, 21 Apr 2010 19:32:45 -0400\r
+From: Jameson Rollins <jrollins@finestructure.net>\r
+To: Dirk Hohndel <hohndel@infradead.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] Add 'd'elete keybinding to search and show views\r
+In-Reply-To: <1271891763-10757-2-git-send-email-hohndel@infradead.org>\r
+References: <1271891763-10757-1-git-send-email-hohndel@infradead.org>\r
+       <1271891763-10757-2-git-send-email-hohndel@infradead.org>\r
+Date: Wed, 21 Apr 2010 19:32:39 -0400\r
+Message-ID: <87y6ggmlew.fsf@servo.finestructure.net>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+       micalg=pgp-sha256; protocol="application/pgp-signature"\r
+X-No-Spam-Score: Local\r
+X-Scanned-By: MIMEDefang 2.68 on 128.59.29.6\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 21 Apr 2010 23:32:56 -0000\r
+\r
+--=-=-=\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On Wed, 21 Apr 2010 16:16:02 -0700, Dirk Hohndel <hohndel@infradead.org> wr=\r
+ote:\r
+> Straight forward addition to the Emacs UI. The 'd' keybinding\r
+> is implemented very similar to the 'a' keybinding - it only\r
+> adds a +deleted tag as well. This tag is used by notmuchsync\r
+> to delete (-p "prune") files in the mailstore.\r
+>=20\r
+> I'm sending this mostly as an RFC - I use this and like it, but\r
+> people seem to have strong feelings as to how they want to deal=20\r
+> with deleting email (or for some people, how they don't want to\r
+> do that at all).\r
+\r
+Hey, Dirk.  I'm definitely on board with this idea, and have in fact\r
+been doing exactly the same thing with my personal customizations as you\r
+propose (including using the 'd' key).\r
+\r
+I only have a couple of nit-picky comments about your proposed\r
+implementation:\r
+\r
+On Wed, 21 Apr 2010 16:16:03 -0700, Dirk Hohndel <hohndel@infradead.org> wr=\r
+ote:\r
+> -(defun notmuch-show-archive-thread-internal (show-next)\r
+> +(defun notmuch-show-archive-or-delete-thread-internal (show-next delete)\r
+>    ;; Remove the tag from the current set of messages.\r
+>    (goto-char (point-min))\r
+> -  (loop do (notmuch-show-remove-tag "inbox")\r
+> +  (loop do (progn\r
+> +         (notmuch-show-remove-tag "inbox")\r
+> +         (if delete\r
+> +             (notmuch-show-add-tag "deleted")))\r
+>      until (not (notmuch-show-goto-message-next)))\r
+>    ;; Move to the next item in the search results, if any.\r
+>    (let ((parent-buffer notmuch-show-parent-buffer))\r
+> @@ -925,6 +929,20 @@ to stdout or stderr will appear in the *Messages* bu=\r
+ffer."\r
+>        (if show-next\r
+>            (notmuch-search-show-thread))))))\r
+\r
+I'm not sure I like the idea of piggybacking on the\r
+notmuch-show-archive-thread-internal function.  Why not just make a new\r
+separate notmuch-show-delete-thread-internal function?  I think it makes\r
+the code clearer and easier to parse for the calls to these functions\r
+(otherwise it's a little unclear what "t t" and "nil nil" and so on\r
+mean).\r
+\r
+> +(defun notmuch-search-delete-thread ()\r
+> +  "Delete the currently selected thread (remove its \"inbox\" tag and ad=\r
+d \"deleted\" tag).\r
+> +\r
+> +This function advances the next thread when finished."\r
+> +  (interactive)\r
+> +  (notmuch-search-remove-tag-thread "inbox")\r
+> +  (notmuch-search-add-tag-thread "deleted")\r
+> +  (forward-line))\r
+\r
+I'm also not a fan of these functions (notmuch-search-delete-thread and\r
+notmuch-show-delete-thread) removing the "inbox" tag.  Just because I\r
+want to mark a messages as deleted doesn't mean that I want to archive\r
+it.  I would really like to keep these concepts distinct if possible.\r
+\r
+jamie.\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.10 (GNU/Linux)\r
+\r
+iQIcBAEBCAAGBQJLz4sXAAoJEO00zqvie6q8N6QP/AiGCUOESJ09ga3TPi9v+JBC\r
+nnE+OSrTmFaDQfksC8WC5vdcjoEevDb+FOJenKgh47gJToDxlE6LvbC53l9hiOvU\r
+8ls2UgKDgv5jFAf2ryKdSypjSwn7Ncyw+i0OwtpiA06rTBzRLVb/iNvoExAWgHN+\r
+vJMHUM13Jv71H1tDbmMw40xb6Rd8vZRSUYB6jfyGBR89bwkgHxWMil6a4JApfEQh\r
+zpAMT7UY28yjSo5zpBMV2oqM246CBvKUSL4gdrQpVpudz2H/myF0DrsYt0AnIpf+\r
+yZEpPOYi0rAtI7e2XZLTTeqopTFS2bttKfmq/3uSQia8c1YgGpLhT/hVwDgmm/Ub\r
+6m763fabQUaioKFPsPDyRYQY+64eEH/LRbtD0hAMsfbJYoAJhr0IHKNx8SAg8aaf\r
+HfHKFwXoiYT9a1VpSmoq5Z7vlhu/uLlSZiq7vPVYufsjW9ZiLj9yRCT45NzzKlxn\r
+KAdXGRV5MrHkZhw7YbCThwoVBgH2aFfNkOc94y4Z5ibK5DihXUN7nz/n+YQSbpoA\r
+Gqpr/9obmvXTrvaq7cdUykeYqanZSFF4MMa56k0wzhBwJBVCkqb+Ev5RkjdC+oc2\r
+9XFIgrFffgkFJrkK2voAWwfek6phLew1CC+iu+qCFxTui9J73irE8H+PXkb11f5w\r
+RqVa8/gn2kpPuDIpojoS\r
+=RUcJ\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r