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 865CE421171 for ; Thu, 1 Mar 2012 06:44:42 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.8 X-Spam-Level: X-Spam-Status: No, score=-0.8 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, 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 L4PFpEA9S3vC for ; Thu, 1 Mar 2012 06:44:38 -0800 (PST) Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com [74.125.83.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 1782F42117E for ; Thu, 1 Mar 2012 06:44:37 -0800 (PST) Received: by mail-ee0-f53.google.com with SMTP id b47so324676eek.26 for ; Thu, 01 Mar 2012 06:44:37 -0800 (PST) Received-SPF: pass (google.com: domain of daniel@schoepe.org designates 10.14.52.132 as permitted sender) client-ip=10.14.52.132; Authentication-Results: mr.google.com; spf=pass (google.com: domain of daniel@schoepe.org designates 10.14.52.132 as permitted sender) smtp.mail=daniel@schoepe.org; dkim=pass header.i=daniel@schoepe.org Received: from mr.google.com ([10.14.52.132]) by 10.14.52.132 with SMTP id e4mr2122950eec.107.1330613077845 (num_hops = 1); Thu, 01 Mar 2012 06:44:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=schoepe.org; s=google; h=mime-version:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=KgwGMICXRHyr1QxqNF9DZXMVnB+zivZ2FCOLy8C+hcY=; b=H3DW979bCIiEWnZuMLNoxKLyifM4X4WTx6UKotAquO65EaflC+B0iVcN0NyUHGBgZi GDgN5Z3IdmUmEk7zbxp5jnJHw5HofhgzHzR2gswX/TpGNEfZ8CSz+h8/32gWa8CiuC1T w3f7NFjoLthkZemBmzow0WevBC++XsxfT0BxE= MIME-Version: 1.0 Received: by 10.14.52.132 with SMTP id e4mr1609538eec.107.1330613077694; Thu, 01 Mar 2012 06:44:37 -0800 (PST) Received: from localhost (dslb-188-107-168-245.pools.arcor-ip.net. [188.107.168.245]) by mx.google.com with ESMTPS id o49sm7988629eeb.7.2012.03.01.06.44.36 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 01 Mar 2012 06:44:36 -0800 (PST) From: Daniel Schoepe To: notmuch@notmuchmail.org Subject: [PATCH] emacs: Pass a copy to notmuch-saved-search-sort-function Date: Thu, 1 Mar 2012 15:44:19 +0100 Message-Id: <1330613059-5130-2-git-send-email-daniel@schoepe.org> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1330613059-5130-1-git-send-email-daniel@schoepe.org> References: <1330613059-5130-1-git-send-email-daniel@schoepe.org> X-Gm-Message-State: ALoCoQlohK6HxmrGiwY/4IqXxoA2SJpOURyJ0FHpkPMl0glHhRejPheemmVHmRbTd8QiQ6SsXPnG 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, 01 Mar 2012 14:44:42 -0000 notmuch-saved-search-sort-function might destructively modify its input (`sort' does that, for instance), so it should not be given notmuch-saved-searches directly. --- emacs/notmuch-hello.el | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index aad373d..b2b22df 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -575,7 +575,10 @@ Complete list of currently available key bindings: (let ((searches (notmuch-hello-query-counts (if notmuch-saved-search-sort-function (funcall notmuch-saved-search-sort-function - notmuch-saved-searches) + ;; Use a copy, since the sorting + ;; function may have side effects, + ;; e.g. if it just `sort's the input. + (copy-seq notmuch-saved-searches)) notmuch-saved-searches) :show-empty-searches notmuch-show-empty-saved-searches)) found-target-pos) -- 1.7.9.1