Re: [PATCH] Add 'd'elete keybinding to search and show views
authorDirk Hohndel <hohndel@infradead.org>
Thu, 22 Apr 2010 00:20:41 +0000 (17:20 +1700)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:36:45 +0000 (09:36 -0800)
5c/d753278663d1fa82471029ea9480fbd739bcc8 [new file with mode: 0644]

diff --git a/5c/d753278663d1fa82471029ea9480fbd739bcc8 b/5c/d753278663d1fa82471029ea9480fbd739bcc8
new file mode 100644 (file)
index 0000000..3b87701
--- /dev/null
@@ -0,0 +1,136 @@
+Return-Path: <BATV+bbc4756b788e67be553a+2433+infradead.org+hohndel@bombadil.srs.infradead.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 101704196F2\r
+       for <notmuch@notmuchmail.org>; Wed, 21 Apr 2010 17:20:44 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -4.2\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5\r
+       tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3] 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 CkPJHyzbgMx3 for <notmuch@notmuchmail.org>;\r
+       Wed, 21 Apr 2010 17:20:42 -0700 (PDT)\r
+Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id C03DB431FC1\r
+       for <notmuch@notmuchmail.org>; Wed, 21 Apr 2010 17:20:42 -0700 (PDT)\r
+Received: from localhost ([::1] helo=x200.gr8dns.org)\r
+       by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux))\r
+       id 1O4k9q-0003Fl-7g; Thu, 22 Apr 2010 00:20:42 +0000\r
+Received: by x200.gr8dns.org (Postfix, from userid 500)\r
+       id 94549C0212; Wed, 21 Apr 2010 17:20:41 -0700 (PDT)\r
+From: Dirk Hohndel <hohndel@infradead.org>\r
+To: Jameson Rollins <jrollins@finestructure.net>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] Add 'd'elete keybinding to search and show views\r
+In-Reply-To: <87y6ggmlew.fsf@servo.finestructure.net>\r
+References: <1271891763-10757-1-git-send-email-hohndel@infradead.org>\r
+       <1271891763-10757-2-git-send-email-hohndel@infradead.org>\r
+       <87y6ggmlew.fsf@servo.finestructure.net>\r
+Date: Wed, 21 Apr 2010 17:20:41 -0700\r
+Message-ID: <m3fx2oz6au.fsf@x200.gr8dns.org>\r
+User-Agent: notmuch 0.2-52-ga28d2fe (Emacs 23.1.1/i386-redhat-linux-gnu)\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-SRS-Rewrite: SMTP reverse-path rewritten from <hohndel@infradead.org> by\r
+       bombadil.infradead.org See http://www.infradead.org/rpr.html\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, 22 Apr 2010 00:20:44 -0000\r
+\r
+On Wed, 21 Apr 2010 19:32:39 -0400, Jameson Rollins <jrollins@finestructure.net> wrote:\r
+> On Wed, 21 Apr 2010 16:16:02 -0700, Dirk Hohndel <hohndel@infradead.org> wrote:\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
+> > \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 \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
+Great. \r
\r
+> I only have a couple of nit-picky comments about your proposed\r
+> implementation:\r
+\r
+That's why I sent this out...\r
\r
+> On Wed, 21 Apr 2010 16:16:03 -0700, Dirk Hohndel <hohndel@infradead.org> wrote:\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* buffer."\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
+It's the C programmer in me who hates code duplication. This way, if the\r
+algorithm for walking the mails in the thread changes, you only fix it\r
+once. But I see your point about weird options... in C I'd have\r
+constants named THREAD_DELETE and THREAD_ARCHIVE_ONLY that I'd pass\r
+around...\r
+\r
+> \r
+> > +(defun notmuch-search-delete-thread ()\r
+> > +  "Delete the currently selected thread (remove its \"inbox\" tag and add \"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
+Well, that would take away a big reason for adding this -\r
+convenience. In the end it's user experience design. The question is\r
+(based on expected behavior) - do you expect a deleted email to stay\r
+visible in your inbox. I don't - and I know that many people do.\r
+\r
+So while I agree with the other conclusion in the thread that "deleted"\r
+as tag for deleted messages doesn't have to be configurable - maybe this\r
+feature wants to be configurable.\r
+\r
+notmuch-archive-deleted or something like that\r
+\r
+/D\r
+\r
+-- \r
+Dirk Hohndel\r
+Intel Open Source Technology Center\r