Re: [PATCH] emacs-show: open excluded matches if no other matches
authorJani Nikula <jani@nikula.org>
Fri, 13 Apr 2012 08:57:13 +0000 (08:57 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:19 +0000 (09:46 -0800)
59/19c161a81358d47f81e94be0da7ed541ce6781 [new file with mode: 0644]

diff --git a/59/19c161a81358d47f81e94be0da7ed541ce6781 b/59/19c161a81358d47f81e94be0da7ed541ce6781
new file mode 100644 (file)
index 0000000..b2f6367
--- /dev/null
@@ -0,0 +1,119 @@
+Return-Path: <jani@nikula.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 55F84431FB6\r
+       for <notmuch@notmuchmail.org>; Fri, 13 Apr 2012 01:57:22 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 kdt5FEiEyCpu for <notmuch@notmuchmail.org>;\r
+       Fri, 13 Apr 2012 01:57:21 -0700 (PDT)\r
+Received: from mail-qc0-f181.google.com (mail-qc0-f181.google.com\r
+       [209.85.216.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 61099431FAF\r
+       for <notmuch@notmuchmail.org>; Fri, 13 Apr 2012 01:57:21 -0700 (PDT)\r
+Received: by qcsk26 with SMTP id k26so2175663qcs.26\r
+       for <notmuch@notmuchmail.org>; Fri, 13 Apr 2012 01:57:19 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=google.com; s=20120113;\r
+       h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
+       :mime-version:content-type:x-gm-message-state;\r
+       bh=EPCqCdRwv6ONOLnxfrOlgQ/S8pln126MvQWsBjWvc9Q=;\r
+       b=mkTzfqFtMF2WCC5ceiNiO8Brd4uSORocmsMlMaNIG7jGKmTtwlXLIuc8PhDCvANxUb\r
+       Gf2nOxQwn1obuDc/IJly+SIH7JjRjqJ73m+JDs3nqEhgfppfPtMhi+HwbbUwIBBcKdob\r
+       G6+AhFcosqAsD0HoItdbhln03y4SRE+DO1xvOcwTHtDFMrPsGIP2E+YHlJP6mQKBTc6D\r
+       jbM6OsAjeJ93T1qVgxG9ZolFRcihmEDRby2CAzMFE6QYM03J1uaqtZiK7LjQIL/f8s+/\r
+       iGSXWbEFum68ikDpmbT977CMykjnK0SynK7gtI2xf+OexbR19SpGkpihZS3ahypUNKpD\r
+       Aapw==\r
+Received: by 10.224.173.194 with SMTP id q2mr1417250qaz.15.1334307439702;\r
+       Fri, 13 Apr 2012 01:57:19 -0700 (PDT)\r
+Received: from localhost ([92.243.24.172])\r
+       by mx.google.com with ESMTPS id dx8sm7609556qab.5.2012.04.13.01.57.17\r
+       (version=SSLv3 cipher=OTHER); Fri, 13 Apr 2012 01:57:18 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>,\r
+       Jameson Graef Rollins <jrollins@finestructure.net>,\r
+       Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] emacs-show: open excluded matches if no other matches\r
+In-Reply-To: <m2ty0odaej.fsf@guru.guru-group.fi>\r
+References: <1331836090-30560-1-git-send-email-markwalters1009@gmail.com>\r
+       <8762d44vkv.fsf@servo.finestructure.net>\r
+       <m2ty0odaej.fsf@guru.guru-group.fi>\r
+User-Agent: Notmuch/0.11.1+222~ga47a98c (http://notmuchmail.org) Emacs/23.1.1\r
+       (i686-pc-linux-gnu)\r
+Date: Fri, 13 Apr 2012 08:57:13 +0000\r
+Message-ID: <87k41kj9g6.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Gm-Message-State:\r
+ ALoCoQlVg+oxqlKs58VOkXs1uSll2xlmqNuQ8QW0dqluGDElhagBnVb/mhIYGnGq70N00rThP+yT\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: Fri, 13 Apr 2012 08:57:22 -0000\r
+\r
+On Thu, 12 Apr 2012 22:20:52 +0300, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
+> On Thu, Apr 12 2012, Jameson Graef Rollins wrote:\r
+> \r
+> > On Thu, Mar 15 2012, Mark Walters <markwalters1009@gmail.com> wrote:\r
+> >> Currently emacs show does not open matching but excluded\r
+> >> messages. This is normally the desired behaviour but is probably not\r
+> >> ideal if only excluded messages match. This patch opens all the\r
+> >> matching (necessarily excluded) messages in this case and goes to the\r
+> >> first one.\r
+> >\r
+> > Hi, Mark.  I have tested this patch and it LGTM.  I think this is the\r
+> > behavior we want, since it's no fun to open up a show buffer and have\r
+> > all messages in the thread closed.  That doesn't make much sense.\r
+> \r
+> I disagree: If I open up a show buffer I'd like to have all messages\r
+> in the thread closed if search terms do not match. But that is my\r
+> opinion and inconsistent with current behaviour.\r
+> \r
+> (Therefore I already +1:d this patch)\r
+> \r
+> An example: I have thread of 100 messages and 1 of those is unread.\r
+> Search terms is tag:unread. I enter the thread: 99 messages closed\r
+> and this one open. Now unread is automatically removed. If I go back\r
+> to search view (by pressing q) and re-choose the same thread,\r
+> current behaviour is to open all 100 messages. I'd like to see all\r
+> 100 messages closed.\r
+\r
+IIUC this would still show all messages closed. Messages that don't\r
+match will be closed. The change is that if there are messages that\r
+match, but all of them are excluded, then open the messages anyway.\r
+\r
+In your example, only if you have *another* message that is both\r
+tag:unread and tag:deleted (or some other excluded tag) it would show up\r
+the second time you enter show view.\r
+\r
+I actually think I'd still want the above to show all messages closed,\r
+unless the excluded tag was explicitly specified in the search. The idea\r
+of exclusions is to reduce "noise" in the view, why open them? If you\r
+have those 100 messages in a thread, and you want to see the interesting\r
+(i.e. non-excluded) messages, I'd rather see 0 open if 0 are\r
+interesting, instead of 100 non-interesting if they are all excluded.\r
+\r
+Perhaps a function to toggle the open/close of excluded messages would\r
+be a better idea. But then I don't use exclusions ATM, so maybe I just\r
+don't understand, and won't be affected either way. *shrug*.\r
+\r
+\r
+BR,\r
+Jani.\r