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 8FD4A431FB6 for ; Thu, 29 Mar 2012 13:27:42 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.29 X-Spam-Level: X-Spam-Status: No, score=-2.29 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3, T_MIME_NO_TEXT=0.01] 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 YdOpFz8LXqvt for ; Thu, 29 Mar 2012 13:27:40 -0700 (PDT) Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu [131.215.239.19]) by olra.theworths.org (Postfix) with ESMTP id 358B2431FAE for ; Thu, 29 Mar 2012 13:27:40 -0700 (PDT) Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1]) by fire-doxen-postvirus (Postfix) with ESMTP id DB22F328064; Thu, 29 Mar 2012 13:27:39 -0700 (PDT) X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new Received: from finestructure.net (DHCP-123-229.caltech.edu [131.215.123.229]) (Authenticated sender: jrollins) by fire-doxen-submit (Postfix) with ESMTP id 20FE32E50CC1; Thu, 29 Mar 2012 13:27:37 -0700 (PDT) Received: by finestructure.net (Postfix, from userid 1000) id EC5F8139; Thu, 29 Mar 2012 13:27:36 -0700 (PDT) From: Jameson Graef Rollins To: Mark Anderson , Notmuch Mail Subject: Re: Goto command for existing search windows In-Reply-To: <3wdmx6z5rzx.fsf@testarossa.amd.com> References: <3wd1uod7px7.fsf@testarossa.amd.com> <3wdmx6z5rzx.fsf@testarossa.amd.com> User-Agent: Notmuch/0.12+78~g127fa56 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Thu, 29 Mar 2012 13:27:36 -0700 Message-ID: <87iphn40g7.fsf@servo.finestructure.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; 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: Thu, 29 Mar 2012 20:27:42 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable On Thu, Mar 29 2012, Mark Anderson wrote: > On Tue, 27 Mar 2012 14:24:36 -0600, Mark Anderson wrote: >> I was looking for a function which would find a buffer based on one of >> my saved searches, and perform the search if it didn't exist. >>=20 >> I've gotten it a bit closer, if I perform the search that matches a >> saved search, then this routine will find it because of the magic in >> notmuch-search-buffer-title, but perhaps someone else feels up to >> searching through the saved searches directly? Hey, Mark. I think you can be a little simpler. The title for search buffers is based on the search, so a buffer will always be reused for an identical search. You don't need to do any fancy buffer searching. For instance, the following works perfectly for me, and I believe produces the same results as your technique: (defun jnotmuch-inbox () "Search: inbox" (interactive) (notmuch-search "tag:inbox" t)) (define-key notmuch-hello-mode-map "2" 'jnotmuch-inbox) (define-key notmuch-search-mode-map "2" 'jnotmuch-inbox) (define-key notmuch-show-mode-map "2" 'jnotmuch-inbox) jamie. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCAAGBQJPdMW4AAoJEO00zqvie6q8ZYYP+gJfYFM8ndCeQkKYebrTwoA8 Q7KkQ2a4f7FF6/6/iyOclGACzzEHEudciykqbT4ig3J1k221r2lCMUgTJpY4PFIi b4c24LhBSlO0gx4V+T2assWN3QqILk3CSfOefvLzMZr5Rmiuw/4i0knnHeG/a1fA ZJmbec2VY2nOwcP4388DMi+ktr9Ms7VnJsJ4Sr5JrwEGukDzv1AMNaAX9aqEY+ES sFvQ7N6K48dnaV6P0rzRyfmW9/Vt96KkmkKkLmm45656/y9lkECpWCrKu0uT9I7t KmJdGwV5f2b3KgPBpexCkjEEeh4ss7/ygwY+qQACQucHnL3/VhBVEZ3ISljQSSrx QxY6qCceLUKBdw+1s+8udjJxTPpsRT4nJnE3gWsgkNH1mv/skJYqQqVn6ir5LeTa 8uBcFHt8adIFinvRqmHUxJcnLLFdXKuBb9QFIq78IMHmu+kmZhxN21G0+TOT++TI JJTEd2cmsZC7AtWyufM1WQGZTTozz+c6aQ5rgYL45bZx5zgGnqddEKulvIyooOCy k6Gc1YUeAF/NMACkT4BHEN72YD1VoM36bGlM9lIe236gcehMQmeNIuZev4U2lFoo PCGB2D3fpJm6DLStflztxOROLYPcYWur5c9VPJfH6w9pBCIrCjcgv9qaMJleqTiW UIocEOOrPdDeDhmdISP3 =LwmH -----END PGP SIGNATURE----- --=-=-=--