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 6CD16431FAF for ; Mon, 16 Jan 2012 09:03:53 -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 nL4NPpax7VCL for ; Mon, 16 Jan 2012 09:03:52 -0800 (PST) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id A7A6A431FAE for ; Mon, 16 Jan 2012 09:03:52 -0800 (PST) Received: by wibhr12 with SMTP id hr12so2636065wib.26 for ; Mon, 16 Jan 2012 09:03:51 -0800 (PST) Received: by 10.180.73.72 with SMTP id j8mr10933009wiv.2.1326733431575; Mon, 16 Jan 2012 09:03:51 -0800 (PST) Received: from hotblack-desiato.hh.sledj.net (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25]) by mx.google.com with ESMTPS id m42sm4897478wbn.0.2012.01.16.09.03.49 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Jan 2012 09:03:50 -0800 (PST) Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000) id 62A6AA0397; Mon, 16 Jan 2012 17:03:48 +0000 (GMT) To: Pieter Praet , notmuch Subject: Re: [PATCH] v2 [RFC] emacs: merge overhauled `notmuch-cycle-notmuch-buffers' into `notmuch' In-Reply-To: <1326732415-21894-1-git-send-email-pieter@praet.org> References: <87r4yza95m.fsf@praet.org> <1326732415-21894-1-git-send-email-pieter@praet.org> User-Agent: Notmuch/0.11+64~g42e8f66 (http://notmuchmail.org) Emacs/24.0.92.1 (x86_64-pc-linux-gnu) From: David Edmondson Date: Mon, 16 Jan 2012 17:03:44 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" 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, 16 Jan 2012 17:03:53 -0000 --=-=-= Content-Type: text/plain On Mon, 16 Jan 2012 17:46:55 +0100, Pieter Praet wrote: > Make `notmuch-cycle-notmuch-buffers' more Lispy and merge into `notmuch', > eliminating the need to hog yet another keybind. ... > diff --git a/emacs/notmuch.el b/emacs/notmuch.el > index ef4dcc7..539b3a0 100644 > --- a/emacs/notmuch.el > +++ b/emacs/notmuch.el > @@ -1067,7 +1067,20 @@ current search results AND that are tagged with the given tag." > (defun notmuch () > "Run notmuch and display saved searches, known tags, etc." > (interactive) > - (notmuch-hello)) > + (let* ((old-buffer (current-buffer)) > + (interesting-buffers > + (delq nil (mapcar (lambda (b) > + (if (notmuch-interesting-buffer b) b)) > + (buffer-list)))) > + (next-buffer (first > + (delq nil (mapcar (lambda (b) > + (unless (eq old-buffer b) b)) > + interesting-buffers))))) This feels _less_ lispy. Any occurrences of '(delq nil ...)' strike me as odd. What's wrong with '(loop ... collect ...)'? > + (if next-buffer > + (progn > + (switch-to-buffer next-buffer) > + (bury-buffer old-buffer)) > + (notmuch-hello)))) Integrating with `notmuch' is fine with me. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk8UWHAACgkQaezQq/BJZRZ0nQCdETn7sd+T1fIcEMTq8GqiWhHW iqQAnRWL3N+PynOG+OiXEZTYXotRE49D =Joz7 -----END PGP SIGNATURE----- --=-=-=--