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 C9A9F429E26 for ; Mon, 12 Dec 2011 07:40:52 -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 UP7Z69Hd1VTP for ; Mon, 12 Dec 2011 07:40:52 -0800 (PST) Received: from dmz-mailsec-scanner-4.mit.edu (DMZ-MAILSEC-SCANNER-4.MIT.EDU [18.9.25.15]) by olra.theworths.org (Postfix) with ESMTP id 0FE10429E25 for ; Mon, 12 Dec 2011 07:40:52 -0800 (PST) X-AuditID: 1209190f-b7f6e6d0000008df-4c-4ee6208284c8 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP id B6.F9.02271.28026EE4; Mon, 12 Dec 2011 10:40:50 -0500 (EST) 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 pBCFenpk015259; Mon, 12 Dec 2011 10:40:50 -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 pBCFekWb025058 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Mon, 12 Dec 2011 10:40:47 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1Ra81F-0005kO-3p; Mon, 12 Dec 2011 10:42:21 -0500 Date: Mon, 12 Dec 2011 10:42:21 -0500 From: Austin Clements To: Dmitry Kurochkin Subject: Re: [PATCH] emacs: support "notmuch new" as a notmuch-poll-script Message-ID: <20111212154221.GN2760@mit.edu> References: <1323640100-18326-1-git-send-email-jani@nikula.org> <87wra26a5u.fsf@gmail.com> <20111211225822.GH2760@mit.edu> <20111212003103.GI2760@mit.edu> <87wra2ay4e.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wra2ay4e.fsf@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprKKsWRmVeSWpSXmKPExsUixCmqrNuk8MzPYFm3isXVrf3sFk3TnS2u 35zJbPFm5TxWBxaPnbPusnsc/rqQxePW/dfsHs9W3WIOYInisklJzcksSy3St0vgyli4/Bhj wVX+io47J1gaGBt5uhg5OSQETCR+/3nEDGGLSVy4t56ti5GLQ0hgH6PEpdMX2SGcDYwSv6bM Z4RwTjJJ9LU2s4C0CAksYZTYf8K7i5Gdg0VAVeJIDkiUTUBDYtv+5YwgtoiAocSti6/AFjAL pErMfjCJDcQWFvCS2Pi2G2wKr4C2xJF/x1ggxi9jkrh88hwTREJQ4uTMJywQzVoSN/69BIpz ANnSEsv/cYCEOQXUJU7s3MAKYosKqEhMObmNbQKj0Cwk3bOQdM9C6F7AyLyKUTYlt0o3NzEz pzg1Wbc4OTEvL7VI10QvN7NELzWldBMjOPQl+XcwfjuodIhRgINRiYc3yfepnxBrYllxZe4h RkkOJiVR3i65Z35CfEn5KZUZicUZ8UWlOanFhxglOJiVRHibuYFyvCmJlVWpRfkwKWkOFiVx 3rpdD/2EBNITS1KzU1MLUotgsjIcHEoSvN/lgRoFi1LTUyvSMnNKENJMHJwgw3mAhu8AqeEt LkjMLc5Mh8ifYlSUEuc9A5IQAElklObB9cJS0ytGcaBXhHm/gVTxANMaXPcroMFMQIPjUp6A DC5JREhJNTBKfr4kbqAuLmqxuERmvam58nytmPpOl/jOWCaeutk1Pz17HK8cfP5PKdglxF53 759GnilGK7fceB/1P/1fg7lhYduJJ7td2ra1Ldtven7ytIzLxisYZvPfYeDOaZOafZJ5zeLI V5fvZTgXf2osNH7wY4W6m9n14rSDKe4eKZx683McN18U8lNiKc5INNRiLipOBADeUNLVKAMA AA== Cc: Tomi Ollila , 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 15:40:52 -0000 Quoth Dmitry Kurochkin on Dec 12 at 2:21 pm: > On Mon, 12 Dec 2011 12:15:44 +0200, Tomi Ollila wrote: > > On Sun, 11 Dec 2011 19:31:03 -0500, Austin Clements wrote: > > > > > > 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. > > > > +1 > > > > So, it could work like this: > > > > (defun notmuch-poll () > > "FIX DOCSTRING" > > (interactive) > > (if (stringp notmuch notmuch-poll-script) > > (if (string= notmuch-poll-script "") > > (call-process notmuch-command nil nil nil "new") > > (call-process notmuch-poll-script)))) > > > > I.e. in case notmuch-poll-script == nil, (or not string) > > do nothing. In case notmuch-poll-script == "" execute notmuch new > > and if notmuch-poll-script is string with content execute that. > > > > I think the following scheme would be slightly better and more > consistent: > > * nil - run "notmuch new", the new default > * "" - do nothing > * "script" - run script > > Regards, > Dmitry I like it!