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 BC1CA429E25 for ; Sun, 11 Dec 2011 14:56:49 -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 wa552FCZHCIa for ; Sun, 11 Dec 2011 14:56:49 -0800 (PST) Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU [18.9.25.12]) by olra.theworths.org (Postfix) with ESMTP id 17310431FB6 for ; Sun, 11 Dec 2011 14:56:49 -0800 (PST) X-AuditID: 1209190c-b7f806d0000008d6-57-4ee535304b8c Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP id 7A.32.02262.03535EE4; Sun, 11 Dec 2011 17:56:48 -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 pBBMulnI017573; Sun, 11 Dec 2011 17:56:48 -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 pBBMujTg027853 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sun, 11 Dec 2011 17:56:46 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1RZsLe-0004Gz-Il; Sun, 11 Dec 2011 17:58:22 -0500 Date: Sun, 11 Dec 2011 17:58:22 -0500 From: Austin Clements To: Jani Nikula , Dmitry Kurochkin Subject: Re: [PATCH] emacs: support "notmuch new" as a notmuch-poll-script Message-ID: <20111211225822.GH2760@mit.edu> References: <1323640100-18326-1-git-send-email-jani@nikula.org> <87wra26a5u.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wra26a5u.fsf@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphleLIzCtJLcpLzFFi42IRYrdT1zUwfepncO+7pMXVrf3sFk3TnS2u 35zJ7MDssXPWXXaPW/dfs3s8W3WLOYA5issmJTUnsyy1SN8ugSujfe1ttoLl3BVzGj6zNjD+ 5uhi5OSQEDCRePfyDSOELSZx4d56NhBbSGAfo8TnmfFdjFxA9gZGif49m1khnJNMEtuWPIVy ljBKfDg8kx2khUVAVeLjhCvMIDabgIbEtv3LwcaKCERKtDQ+YAKxmQWkJb79bgazhQW8JDa+ 7WYBsXkFtCXu75vHArE6RuL0gYlMEHFBiZMzn7BA9GpJ3Pj3EijOATZn+T+wDzgF1CV+TfoN Vi4qoCIx5eQ2tgmMQrOQdM9C0j0LoXsBI/MqRtmU3Crd3MTMnOLUZN3i5MS8vNQiXUO93MwS vdSU0k2MoEDnlOTZwfjmoNIhRgEORiUe3hPPHvsJsSaWFVfmHmKU5GBSEuWdZ/zUT4gvKT+l MiOxOCO+qDQntfgQowQHs5IIr93dJ35CvCmJlVWpRfkwKWkOFiVx3updD/2EBNITS1KzU1ML UotgsjIcHEoSvJNNgIYKFqWmp1akZeaUIKSZODhBhvMADW8DqeEtLkjMLc5Mh8ifYlSUEudd AJIQAElklObB9cIS0StGcaBXhHn7QKp4gEkMrvsV0GAmoMFxKSBXF5ckIqSkGhgtjF5eKc5s FHYWPSp3oedK3Gznw+6n//ZO+KJy73HP1bdxS7uVcnlPHjy1vkfjZ9i5K8eZb+gdm3hHROmX ituPVk2Vp9axbJahzpbhpxl+cGs76bQ/i/iwQNxMmLXzeuIZXuNdOsmTftdfSTmaZ7Of7ReT qSDv6vqPy1pTfLcFL+Tu3mVxuFSJpTgj0VCLuag4EQD+8TzZHwMAAA== 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: Sun, 11 Dec 2011 22:56:49 -0000 Quoth Dmitry Kurochkin on Dec 12 at 2:00 am: > Hi Jani. > > On Sun, 11 Dec 2011 23:48:20 +0200, Jani Nikula 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?