Re: [notmuch] [PATCH] add notmuch-show-delete keybinding 'd'
authorJames Vasile <james@hackervisions.org>
Thu, 25 Feb 2010 14:21:33 +0000 (09:21 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:36:17 +0000 (09:36 -0800)
8c/5a9b9b6c05abb81f33a23cd2e16d300fa25f5d [new file with mode: 0644]

diff --git a/8c/5a9b9b6c05abb81f33a23cd2e16d300fa25f5d b/8c/5a9b9b6c05abb81f33a23cd2e16d300fa25f5d
new file mode 100644 (file)
index 0000000..68faaa7
--- /dev/null
@@ -0,0 +1,108 @@
+Return-Path: <james@hackervisions.org>\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 0EFA6431FAE\r
+       for <notmuch@notmuchmail.org>; Thu, 25 Feb 2010 06:21:49 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.216\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.216 tagged_above=-999 required=5\r
+       tests=[AWL=-0.317, BAYES_50=0.001, RDNS_DYNAMIC=0.1] autolearn=no\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 roTOtG7IGgmL for <notmuch@notmuchmail.org>;\r
+       Thu, 25 Feb 2010 06:21:48 -0800 (PST)\r
+Received: from hackervisions.org (67-207-143-141.slicehost.net\r
+       [67.207.143.141])\r
+       by olra.theworths.org (Postfix) with ESMTP id 9836B431FBF\r
+       for <notmuch@notmuchmail.org>; Thu, 25 Feb 2010 06:21:48 -0800 (PST)\r
+Received: from ool-18bd392a.dyn.optonline.net ([24.189.57.42]\r
+       helo=wyzanski.hackervisions.org)\r
+       by hv with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69)\r
+       (envelope-from <james@hackervisions.org>)\r
+       id 1Nkeb1-0000nN-0p; Thu, 25 Feb 2010 09:21:43 -0500\r
+Date: Thu, 25 Feb 2010 09:21:33 -0500\r
+Message-ID: <87635ll7ki.wl%james@hackervisions.org>\r
+From: James Vasile <james@hackervisions.org>\r
+To: "Sebastian Spaeth" <Sebastian@SSpaeth.de>\r
+In-Reply-To: <87eik9bn8l.fsf@SSpaeth.de>\r
+References:\r
+ <1161359196.2247691263984967906.JavaMail.root@zimbra1-e1.priv.proxad.net>\r
+       <87sk8qwjlt.fsf@yoom.home.cworth.org>\r
+       <87tyt61mrl.fsf@servo.finestructure.net>        <87eik9bn8l.fsf@SSpaeth.de>\r
+X-Mailer: Wanderlust/2.15.6\r
+User-Agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=)\r
+       APEL/10.7 Emacs/23.1 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)\r
+MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka")\r
+Content-Type: text/plain; charset=US-ASCII\r
+Cc: notmuch <notmuch@notmuchmail.org>\r
+Subject: Re: [notmuch] [PATCH] add notmuch-show-delete keybinding 'd'\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: Thu, 25 Feb 2010 14:21:49 -0000\r
+\r
+At Thu, 25 Feb 2010 11:53:14 +0100,\r
+Sebastian Spaeth wrote:\r
+> \r
+> On Wed, 24 Feb 2010 14:01:18 -0500, Jameson Rollins <jrollins@finestructure.net> wrote:\r
+> > > 2. It removes the "inbox" and "unread" tags while adding the tag to\r
+> > >    indicate deletion.\r
+> > \r
+> > Hey, Carl.  Why is this last point important? [...]Why should it modify any other\r
+> > tags?  A message/thread should be allowed to be both deleted and in the\r
+> > inbox.\r
+> \r
+> As long as deleted threads/messages show up in the default views, I\r
+> don't want them to show up in my inbox or show up as unread. I agree\r
+> that it might be possible to have "unread" yet "delete"d emails. But in\r
+> reality, if I delete a message I don't want it to pop up in my inbox.\r
+> \r
+> Feel free to apply patches however you want though, thanks to emacs,\r
+> I'll be able to get my desired behavior nonetheless :).\r
+> \r
+> > As for "unread", I think that should be handled by actually reading the\r
+> > message, not by manually applying a state to it.\r
+> \r
+> I agree, but deleting a message in my world view resets the unread tag\r
+> (as in, I don't want to read it anymore).\r
+\r
+This elisp might help.  I run these when deleting messages in search\r
+or show modes.  Basically, this means I never see deleted threads\r
+again.  I also use these to mark spam.\r
+\r
+(defun notmuch-tags-strip-properties (tags)\r
+  "return list of tags with emacs text properties removed\r
+\r
+tags is a list of tags where each tag is a string with emacs text\r
+properties\r
+"\r
+  (mapcar '(lambda (tag)\r
+           (set-text-properties 0 (length tag) nil tag)\r
+           tag)\r
+         tags))\r
+\r
+(defun notmuch-show-remove-all-tags ()\r
+  "Remove all tags from the currently selected thread."\r
+  (apply 'notmuch-show-remove-tag\r
+        (notmuch-tags-strip-properties (notmuch-show-get-tags))))\r
+\r
+(defun notmuch-search-remove-tags (&rest tags)\r
+  "Remove multiple tags from the currently selected thread."\r
+  (mapc 'notmuch-search-remove-tag tags))\r
+\r
+(defun notmuch-search-remove-all-tags ()\r
+  "Remove all tags from the currently selected thread."\r
+  (apply 'notmuch-search-remove-tags\r
+        (notmuch-tags-strip-properties (notmuch-search-get-tags))))\r