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