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 1E06A429E5F for ; Wed, 18 Jan 2012 00:25:28 -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 EZC7rfe+OqxC for ; Wed, 18 Jan 2012 00:25:27 -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 81C65429E27 for ; Wed, 18 Jan 2012 00:25:27 -0800 (PST) Received: by wibhr12 with SMTP id hr12so4203767wib.26 for ; Wed, 18 Jan 2012 00:25:26 -0800 (PST) Received: by 10.180.99.225 with SMTP id et1mr34882909wib.2.1326875126262; Wed, 18 Jan 2012 00:25:26 -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 em13sm21142959wid.7.2012.01.18.00.25.24 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 Jan 2012 00:25:25 -0800 (PST) Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000) id 177ADA0397; Wed, 18 Jan 2012 08:25:23 +0000 (GMT) To: Dmitry Kurochkin , notmuch@notmuchmail.org Subject: Re: [PATCH 2/3] emacs: use a single history for all searches In-Reply-To: <1326828850-8519-2-git-send-email-dmitry.kurochkin@gmail.com> References: <1326828850-8519-1-git-send-email-dmitry.kurochkin@gmail.com> <1326828850-8519-2-git-send-email-dmitry.kurochkin@gmail.com> User-Agent: Notmuch/0.11+64~g42e8f66 (http://notmuchmail.org) Emacs/24.0.92.1 (x86_64-pc-linux-gnu) From: David Edmondson Date: Wed, 18 Jan 2012 08:25:22 +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: Wed, 18 Jan 2012 08:25:28 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 17 Jan 2012 23:34:09 +0400, Dmitry Kurochkin wrote: > There are two ways to do search in Emacs UI: search widget in > notmuch-hello buffer and `notmuch-search' function bound to "s". > Before the change, these search mechanisms used different history > lists. The patch makes notmuch-hello search use the same history list > as `notmuch-search' function. The test output updates included here should be with the previous patch, shouldn't they? > -(defun notmuch-search (query &optional oldest-first target-thread target= -line continuation) > - "Run \"notmuch search\" with the given query string and display result= s. > +(defun notmuch-search (&optional query oldest-first target-thread target= -line continuation) > + "Run \"notmuch search\" with the given `query' and display results. >=20=20 > -The optional parameters are used as follows: > +If `query' is nil, it is read interactively from the minibuffer. > +Other optional parameters are used as follows: >=20=20 > oldest-first: A Boolean controlling the sort order of returned threads > target-thread: A thread ID (with the thread: prefix) that will be made > current if it appears in the search results. > target-line: The line number to move to if the target thread does not > appear in the search results." > - (interactive (list (notmuch-read-query "Notmuch search: "))) > + (interactive) > + (if (null query) > + (setq query (notmuch-read-query "Notmuch search: ")) > + (setq query (notmuch-trim query)) > + (let ((history-delete-duplicates t)) > + (add-to-history 'notmuch-search-history query))) Should user-typed queries be trimmed? --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk8WgfIACgkQaezQq/BJZRbYLwCfffPUJlC6tUhKu76bVhHLnU/r bSQAn2gPV4si8AKGm+P842o+SkfahG1F =c6L2 -----END PGP SIGNATURE----- --=-=-=--