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 22F6C431FC4 for ; Thu, 12 Jul 2012 20:38:55 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 n4TURv6Jpj07 for ; Thu, 12 Jul 2012 20:38:53 -0700 (PDT) Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU [18.7.68.34]) by olra.theworths.org (Postfix) with ESMTP id 532C9431FAE for ; Thu, 12 Jul 2012 20:38:53 -0700 (PDT) X-AuditID: 12074422-b7f1f6d00000090b-ab-4fff984c5370 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP id 64.51.02315.C489FFF4; Thu, 12 Jul 2012 23:38:52 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q6D3cqlj006672; Thu, 12 Jul 2012 23:38:52 -0400 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q6D3coMa008373 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Thu, 12 Jul 2012 23:38:51 -0400 (EDT) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1SpWiQ-0005ao-Hn; Thu, 12 Jul 2012 23:38:50 -0400 Date: Thu, 12 Jul 2012 23:38:50 -0400 From: Austin Clements To: Jani Nikula Subject: Re: [PATCH 1/3] emacs: add no-display arg to notmuch-hello-refresh-hook Message-ID: <20120713033850.GM7332@mit.edu> References: <37899e28dbf67e4620a53279a869be3174c02d6f.1339775602.git.jani@nikula.org> <20120710014946.GB7332@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprDKsWRmVeSWpSXmKPExsUixCmqrOsz47+/wZ2lphZN050trt+cyezA 5HHr/mt2j2erbjEHMEVx2aSk5mSWpRbp2yVwZXTfWcde8Feg4ubTN+wNjK28XYycHBICJhIn rm5ihLDFJC7cW8/WxcjFISSwj1Hi8rc3UM4GRoklS/YwQzgnmST2N09jgnCWMEo0333CBtLP IqAqceL2UVYQm01AQ2Lb/uVgc0UEFCU2n9wPZjMLSEt8+93MBGILCwRJ9N46CGbzCmhLtG24 zQ63e8KSjcwQCUGJkzOfsEA060js3HoHaBkH2KDl/zggwvISzVtng5VzCgRKNDw6CWaLCqhI TDm5jW0Co/AsJJNmIZk0C2HSLCSTFjCyrGKUTcmt0s1NzMwpTk3WLU5OzMtLLdI11cvNLNFL TSndxAiKBHYXpR2MPw8qHWIU4GBU4uH9FfvfX4g1say4MvcQoyQHk5Io78rJQCG+pPyUyozE 4oz4otKc1OJDjBIczEoivArTgHK8KYmVValF+TApaQ4WJXHeayk3/YUE0hNLUrNTUwtSi2Cy MhwcShK8q6cDNQoWpaanVqRl5pQgpJk4OEGG8wANnwFSw1tckJhbnJkOkT/FqCglztsMkhAA SWSU5sH1whLVK0ZxoFeEeeeDVPEAkxxc9yugwUxAg2f9/AcyuCQRISXVwBjP8Ichx29dwMSA 0kb5+pPPUhJ1Dnabfg1a12bPcdCVW7h1g9H0jkvHjzccnjd5gsuqNtnagOjAt8zr0t5sOdW7 4Xzkxbuc/08V+Ub2Xz1h9WK2pPimHwc3nPrOErodmK71LmSJfbmR9tHY8/abOFZeZd3q5J5P drnOpkV5hvNjGvTXT97YpMRSnJFoqMVcVJwIAGZOpzAvAwAA Cc: notmuch@notmuchmail.org 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 Jul 2012 03:38:55 -0000 Quoth Jani Nikula on Jul 10 at 8:10 am: > On Jul 10, 2012 4:49 AM, "Austin Clements" <[1]amdragon@mit.edu> wrote: > > > > Quoth Jani Nikula on Jun 15 at  6:53 pm: > > > Add no-display arg to notmuch-hello-refresh-hook to allow each hook to > > > decide what is appropriate when no-display is t, which is typically > > > the case when called non-interactively. This is used by the following > > > patch. > > > > > > This breaks existing hooks people might have, which will now need to > > > accept the argument. > > > > > > Signed-off-by: Jani Nikula <[2]jani@nikula.org> > > > > This seems like an overloaded use of no-display.  If I'm reading the > > code right, no-display indicates whether or not the notmuch-hello > > buffer should be switched to and seems like a workaround for some > > particular corner-case (I'm not even sure what).  This seems like a > > strange condition to predicate a hook on (but maybe I just don't > > understand).  What condition, abstractly speaking, is > > notmuch-hello-refresh-status-message trying to run under? > > IIUC, no-display is useful for calling refresh from outside of emacs, e.g. > from post-new hook in an automated fashion, so you can have an up-to-date > buffer when you switch to it. There's no point in displaying the refresh > message when you don't also switch to the buffer, is there? And this way > you'll get the diff between the manual (through user interaction) > refreshes of the buffer, not between two cron jobs. Oh, I see. This makes more sense. The only use of no-display in the notmuch code I can find appears to be to refresh the hello buffer when you exit a search buffer started from hello, when it might actually make sense to run the difference hook in your patch (I assume it wants to avoid switching to the hello buffer in this case because the buffer order may have changed? Of course, there are other ways to get to the hello buffer other than exiting a search buffer started from it... I found all of this code very confusing). Maybe this just needs better documentation?