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 5970D429E26 for ; Mon, 12 Dec 2011 02:22:32 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, 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 hGnthQW-roak for ; Mon, 12 Dec 2011 02:22:31 -0800 (PST) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 7F0A9429E25 for ; Mon, 12 Dec 2011 02:22:31 -0800 (PST) Received: by bkat8 with SMTP id t8so5598427bka.26 for ; Mon, 12 Dec 2011 02:22:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; bh=nBF66l9+dDpv0s+OPusNq13T5XRSGHYf8G/BlTpVz5Q=; b=KdytxnlgtQEjrEh85uvr+9+tLZkcxbKrqvXwc6GvAatLHgZ07C9nOVZut7qiz3wsmI WAzdkS09C6u4htpyW+V7P9lE6pW3D1QF+TTIF0OLN3p54wMrVKYIqkYg0B/lWGp7mD6B fEsvCBjoXr+DdjC1R6sc+q31mZJxeqqUhd0uk= Received: by 10.205.127.65 with SMTP id gz1mr9812176bkc.106.1323685349930; Mon, 12 Dec 2011 02:22:29 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id h7sm30568330bkw.12.2011.12.12.02.22.28 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 12 Dec 2011 02:22:29 -0800 (PST) From: Dmitry Kurochkin To: Tomi Ollila , Austin Clements , Jani Nikula Subject: Re: [PATCH] emacs: support "notmuch new" as a notmuch-poll-script In-Reply-To: References: <1323640100-18326-1-git-send-email-jani@nikula.org> <87wra26a5u.fsf@gmail.com> <20111211225822.GH2760@mit.edu> <20111212003103.GI2760@mit.edu> User-Agent: Notmuch/0.10.2+94~g948b41d (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Mon, 12 Dec 2011 14:21:53 +0400 Message-ID: <87wra2ay4e.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 10:22:32 -0000 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 > users who want other functionality can reimplement notmuch-poll function > after notmuch has been loaded (and manage things themselves when internal > implementation changes ;(). > > > Tomi > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch