Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 4E3E7431FAF for ; Fri, 13 Apr 2012 02:29:10 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.098 X-Spam-Level: X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BY87sy-FVfvp for ; Fri, 13 Apr 2012 02:29:08 -0700 (PDT) Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 9F103431FAE for ; Fri, 13 Apr 2012 02:29:08 -0700 (PDT) Received: from smtp.qmul.ac.uk ([138.37.6.40]) by mail2.qmul.ac.uk with esmtp (Exim 4.71) (envelope-from ) id 1SIcoP-0005IA-MN; Fri, 13 Apr 2012 10:29:02 +0100 Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223] helo=localhost) by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1SIcoP-0007ik-70; Fri, 13 Apr 2012 10:29:01 +0100 From: Mark Walters To: Jani Nikula , Tomi Ollila , Jameson Graef Rollins , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs-show: open excluded matches if no other matches In-Reply-To: <87k41kj9g6.fsf@nikula.org> References: <1331836090-30560-1-git-send-email-markwalters1009@gmail.com> <8762d44vkv.fsf@servo.finestructure.net> <87k41kj9g6.fsf@nikula.org> User-Agent: Notmuch/0.12+110~gbc97b4a (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Fri, 13 Apr 2012 10:29:19 +0100 Message-ID: <87fwc80ykw.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Sender-Host-Address: 94.192.233.223 X-QM-SPAM-Info: Sender has good ham record. :) X-QM-Body-MD5: 07cb8ff1279e44b1bf2690591dd4169e (of first 20000 bytes) X-SpamAssassin-Score: -1.8 X-SpamAssassin-SpamBar: - X-SpamAssassin-Report: The QM spam filters have analysed this message to determine if it is spam. We require at least 5.0 points to mark a message as spam. This message scored -1.8 points. Summary of the scoring: * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, * medium trust * [138.37.6.40 listed in list.dnswl.org] * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (markwalters1009[at]gmail.com) * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay * domain * 0.5 AWL AWL: From: address is in the auto white-list X-QM-Scan-Virus: ClamAV says the message is clean X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 09:29:10 -0000 On Fri, 13 Apr 2012, Jani Nikula wrote: > On Thu, 12 Apr 2012 22:20:52 +0300, Tomi Ollila wrote: >> On Thu, Apr 12 2012, Jameson Graef Rollins wrote: >> >> > On Thu, Mar 15 2012, Mark Walters wrote: >> >> Currently emacs show does not open matching but excluded >> >> messages. This is normally the desired behaviour but is probably not >> >> ideal if only excluded messages match. This patch opens all the >> >> matching (necessarily excluded) messages in this case and goes to the >> >> first one. >> > >> > Hi, Mark. I have tested this patch and it LGTM. I think this is the >> > behavior we want, since it's no fun to open up a show buffer and have >> > all messages in the thread closed. That doesn't make much sense. >> >> I disagree: If I open up a show buffer I'd like to have all messages >> in the thread closed if search terms do not match. But that is my >> opinion and inconsistent with current behaviour. >> >> (Therefore I already +1:d this patch) >> >> An example: I have thread of 100 messages and 1 of those is unread. >> Search terms is tag:unread. I enter the thread: 99 messages closed >> and this one open. Now unread is automatically removed. If I go back >> to search view (by pressing q) and re-choose the same thread, >> current behaviour is to open all 100 messages. I'd like to see all >> 100 messages closed. > > IIUC this would still show all messages closed. Messages that don't > match will be closed. The change is that if there are messages that > match, but all of them are excluded, then open the messages anyway. This patch does not affect the behaviour in this case, but the code existing code does expand all messages in a thread if none match (the use of basic-args and args in notmuch-show-build-buffer). > In your example, only if you have *another* message that is both > tag:unread and tag:deleted (or some other excluded tag) it would show up > the second time you enter show view. > > I actually think I'd still want the above to show all messages closed, > unless the excluded tag was explicitly specified in the search. The idea > of exclusions is to reduce "noise" in the view, why open them? If you > have those 100 messages in a thread, and you want to see the interesting > (i.e. non-excluded) messages, I'd rather see 0 open if 0 are > interesting, instead of 100 non-interesting if they are all excluded. I think that is entirely plausible as a way to go (though I would also be happy with the behaviour after this patch). But I think that should be a subsequent patch because to be consistent it would have to change the existing behaviour for no matches (and no excludes) to be all closed. > Perhaps a function to toggle the open/close of excluded messages would > be a better idea. That might be useful regardless. I could add a function to do this, which could be called by the above patch if we want the behaviour it introduces. Do you think that is worth doing? > But then I don't use exclusions ATM, so maybe I just > don't understand, and won't be affected either way. *shrug*. That is one problem: there are lots of potential use cases and its not clear which of them people will use and which we should encourage. I use a `bizarre' one: I exclude all of my mailing list mail (including notmuch) so that it doesn't show up in my personal mail searches. So I guess I am using the excludes to return to the bad old days of `folders'. (I am not recommending this to anyone, I partly did it as a good stress test for the exclude stuff, but it does seem to mostly work.) Best wishes Mark