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 0593A429E26 for ; Sun, 11 Dec 2011 16:29:32 -0800 (PST) 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 nHOIAfXpUogn for ; Sun, 11 Dec 2011 16:29:28 -0800 (PST) Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU [18.7.68.36]) by olra.theworths.org (Postfix) with ESMTP id 8E8E0429E25 for ; Sun, 11 Dec 2011 16:29:28 -0800 (PST) X-AuditID: 12074424-b7ef76d0000008dc-47-4ee54ae84533 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP id CA.B8.02268.8EA45EE4; Sun, 11 Dec 2011 19:29:28 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id pBC0TRRH025152; Sun, 11 Dec 2011 19:29:27 -0500 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 pBC0TQVR010315 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sun, 11 Dec 2011 19:29:27 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1RZtnL-0004ME-80; Sun, 11 Dec 2011 19:31:03 -0500 Date: Sun, 11 Dec 2011 19:31:03 -0500 From: Austin Clements To: Jani Nikula Subject: Re: [PATCH] emacs: support "notmuch new" as a notmuch-poll-script Message-ID: <20111212003103.GI2760@mit.edu> References: <1323640100-18326-1-git-send-email-jani@nikula.org> <87wra26a5u.fsf@gmail.com> <20111211225822.GH2760@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+NgFlrMKsWRmVeSWpSXmKPExsUixG6nrvvC66mfQftSVourW/vZLZqmO1tc vzmT2YHZY+esu+wet+6/Zvd4tuoWcwBzFJdNSmpOZllqkb5dAlfGtDlvGAteilU0Xu1kbGCc IdjFyMkhIWAicfX2aRYIW0ziwr31bF2MXBxCAvsYJTY+msUK4WxglGi8t4gdwjnJJHGm4RAT SIuQwBJGia8PZEBsFgFVif+zP7OD2GwCGhLb9i9nBLFFBBQlNp/cD2RzcDALeEl8ny8JEhYG Mje+7WYBCfMKaEtMnlwDMf4oo8Sbjc+ZQWp4BQQlTs58AnYds4COxM6td9ggxkhLLP/HARGW l2jeOhusnFMgUOL6jKdgtqiAisSUk9vYJjAKz0IyaRaSSbMQJs1CMmkBI8sqRtmU3Crd3MTM nOLUZN3i5MS8vNQiXXO93MwSvdSU0k2M4LhwUdnB2HxI6RCjAAejEg/vwfuP/YRYE8uKK3MP MUpyMCmJ8j72fOonxJeUn1KZkVicEV9UmpNafIhRgoNZSYTX7u4TPyHelMTKqtSifJiUNAeL kjhvw66HfkIC6YklqdmpqQWpRTBZGQ4OJQleZWD8CwkWpaanVqRl5pQgpJk4OEGG8wANDwWp 4S0uSMwtzkyHyJ9iVJQS51UESQiAJDJK8+B6YWnrFaM40CvCvF4gVTzAlAfX/QpoMBPQ4LgU kKuLSxIRUlINjLsPKlnOV9j6sLD70vwr2U2MyU++fxX0vHH0uccudsY5DFy5uyf6hGS//3FL fqtW89xzqlOVHdaKlp0t/7O3cOfGI+lnTn/tz1nhL6dwW1j+e1eXhXi8kvSjyA1n2Lbd0UxO q8t+Mf20ske0yK9AA2//L447VWbkrl/OMMs5S+9AmPv0b/ou3EosxRmJhlrMRcWJAF42mE02 AwAA 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: Mon, 12 Dec 2011 00:29:32 -0000 Quoth Jani Nikula on Dec 12 at 1:10 am: > On Dec 12, 2011 12:56 AM, "Austin Clements" <[1]amdragon@mit.edu> wrote: > > > > Quoth Dmitry Kurochkin on Dec 12 at  2:00 am: > > > Hi Jani. > > > > > > On Sun, 11 Dec 2011 23:48:20 +0200, Jani Nikula <[2]jani@nikula.org> > wrote: > > > > Let notmuch-poll-script be a function as well as a string. Make > default > > > > value nil instead of an empty string, but allow "" for backwards > > > > compatibility. Add a notmuch poll function to call "notmuch new" > using the > > > > configured notmuch-command. > > > > > > > > This allows taking better advantage of the "notmuch new" hooks from > emacs > > > > without intermediate scripts. > > > > > > > > > > I was just thinking about working on this myself :) > > > > > > I think a better solution would be to allow running a command with > > > arguments.  Creating a elisp function just to run a command with some > > > parameters feels wrong.  This way we would have to add another > function > > > each time we want to add another argument. > > > > This seems a little awkward to me, too, though perhaps it's the best > > way.  Other approaches to consider include accepting a list for > > notmuch-poll-script (e.g., ("notmuch" "new")) or leaving it as a > > string but treating it as a shell command so "notmuch new" would Just > > Work.  Personally, I think the latter is the most intuitive, but it > > would be worth looking at how other customizable external commands are > > done in Emacs. > > > > A function seems powerful, but also like overkill.  Can you give a use > > case for a function that wouldn't be more easily solved by one of the > > above approaches? > > The only reason I had for using a function was running notmuch using > notmuch-command. Any ideas how to do that with the Just Works approach? Oh, I see. I'd missed that. So here's another idea, prefaced with a rant. It's bothered me for a long time that notmuch-emacs didn't just know by default how to check for new mail. What MUA doesn't know how to check for new mail? Why does a new user of notmuch have to tell it how to check for new mail? Of course, this *had* to be configured before because everyone had their own way of checking for new mail. Hooks eliminate this unnecessary flexibility and make "notmuch new" the one true way to check for new mail---as it ought to be---and in turn make the notmuch-poll-script variable obsolete. So, what about changing the default "" setting of notmuch-poll-script from meaning "do nothing and be useless" to meaning "run notmuch new (using notmuch-command)"? It will then automatically do the right thing for new users, while still being backward-compatible and allowing an escape hatch for bizarre situations.