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 5A851431FCB for ; Thu, 1 Mar 2012 12:24:54 -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 qOjNJqrq3-0q for ; Thu, 1 Mar 2012 12:24:53 -0800 (PST) Received: from mail-ey0-f181.google.com (mail-ey0-f181.google.com [209.85.215.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 1DC52431FAF for ; Thu, 1 Mar 2012 12:24:49 -0800 (PST) Received: by eaa1 with SMTP id 1so504934eaa.26 for ; Thu, 01 Mar 2012 12:24:49 -0800 (PST) Received-SPF: pass (google.com: domain of daniel@schoepe.org designates 10.213.9.8 as permitted sender) client-ip=10.213.9.8; Authentication-Results: mr.google.com; spf=pass (google.com: domain of daniel@schoepe.org designates 10.213.9.8 as permitted sender) smtp.mail=daniel@schoepe.org; dkim=pass header.i=daniel@schoepe.org Received: from mr.google.com ([10.213.9.8]) by 10.213.9.8 with SMTP id j8mr692921ebj.102.1330633489013 (num_hops = 1); Thu, 01 Mar 2012 12:24:49 -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=ycvLYn4YlGE8Vp8BciYfo7uhNRzWJ3Ap6mGnbKZuM8c=; b=Jq1WBF2S8Iq9K0fA+SHpafNnwYM8W/WxjaPGFrWWqqsU0is6tGCmyi85mihE9pRK3w gG/yZgSmvqtsjT/qYjtVnowsVPf9Yc7+iXzCtNOqoB6hjZ49C3jCOqphxPE9ij3D5T+Q b39arZtyVPQI+DPEb1cluhFuBdvZfw40GM9z0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=ycvLYn4YlGE8Vp8BciYfo7uhNRzWJ3Ap6mGnbKZuM8c=; b=W+Mm38U4lV5iMtceCXRjkmk59o6eEF7En9VL1uPyNkLuCu4aqSAG3woqPCKq0VN/A3 0K8OS46MEqWfnw9FmV1bKlF189WhyhS1vKkGWh94l+RsZpSTdEEnInrG0pDCYYz5KZd5 YYlLnG50RhYhOJ+LKBc+x0VK8PYqB41eabQCG4ofxJ8CAhyW9+ogJAonrrpnFfaUbA6j yJ9CIvWRZFElT4kSA6ApMfnEyk1eKsbVHzMxa+Pp4s7jOMsEGVd/C2Z6PSXWUFg92PHn OPMfzx6P/uQ0CLEjCch6S0Tk2PQaFbgPUUaie666TIklm/+3cNNZldNFVm/2k22oitz+ ne+A== MIME-Version: 1.0 Received: by 10.213.9.8 with SMTP id j8mr525815ebj.102.1330633488389; Thu, 01 Mar 2012 12:24:48 -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 n52sm11126487eea.5.2012.03.01.12.24.46 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 01 Mar 2012 12:24:47 -0800 (PST) From: Daniel Schoepe To: notmuch@notmuchmail.org Subject: [PATCH v2] emacs: Pass a copy to notmuch-saved-search-sort-function Date: Thu, 1 Mar 2012 21:24:38 +0100 Message-Id: <1330633478-1974-2-git-send-email-daniel@schoepe.org> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1330633478-1974-1-git-send-email-daniel@schoepe.org> References: <1330613059-5130-1-git-send-email-daniel@schoepe.org> <1330633478-1974-1-git-send-email-daniel@schoepe.org> X-Gm-Message-State: ALoCoQlqNdG0Zjt+gHWKmdd/SYWCdyXlFkDswf6J7SnASrZr6A8pNHuYVdy+f4X42tV8Z5r1pvs+ 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 20:24:54 -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..e089290 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-sequence notmuch-saved-searches)) notmuch-saved-searches) :show-empty-searches notmuch-show-empty-saved-searches)) found-target-pos) -- 1.7.9.1