From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 85ECA429E26 for ; Mon, 12 Dec 2011 03:38:30 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 NNBrNLgxFr9T for ; Mon, 12 Dec 2011 03:38:29 -0800 (PST) Received: from mail-gw3.nixu.fi (mail-gw3.nixu.fi [193.209.237.7]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 86CA3429E25 for ; Mon, 12 Dec 2011 03:38:29 -0800 (PST) Received: from pps.filterd (mail-gw3 [127.0.0.1]) by mail-gw3.nixu.fi (8.14.4/8.14.4) with SMTP id pBCBcNJ7003656; Mon, 12 Dec 2011 13:38:23 +0200 Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31]) by mail-gw3.nixu.fi with ESMTP id 114cs0stjr-1 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Mon, 12 Dec 2011 13:38:23 +0200 Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31]) by taco2.nixu.fi (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id pBCBcLq2004979; Mon, 12 Dec 2011 13:38:22 +0200 From: Tomi Ollila To: Dmitry Kurochkin , Austin Clements , Jani Nikula Subject: Re: [PATCH] emacs: support "notmuch new" as a notmuch-poll-script In-Reply-To: <87wra2ay4e.fsf@gmail.com> 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> User-Agent: Notmuch/0.10.2+93~g631d290 (http://notmuchmail.org) Emacs/23.3.1 (i686-pc-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.5.7110, 1.0.211, 0.0.0000 definitions=2011-12-12_02:2011-12-12, 2011-12-12, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1012030000 definitions=main-1112120057 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 11:38:30 -0000 On Mon, 12 Dec 2011 14:21:53 +0400, Dmitry Kurochkin wrote: > 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 You're right. This us MUCH better (something irked me when writing my suggestion but that was for ultimate backward compability); The default value for notmuch-poll-script could be changed to nil. > > Regards, > Dmitry > > > users who want other functionality can reimplement notmuch-poll function > > after notmuch has been loaded (and manage things themselves when internal > > implementation changes ;(). > > > > > > Tomi Tomi