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 20CD3431FAF for ; Sat, 3 Mar 2012 13:37:04 -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 lFNG5V4ePaj4 for ; Sat, 3 Mar 2012 13:37:02 -0800 (PST) Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 2E446431FAE for ; Sat, 3 Mar 2012 13:37:02 -0800 (PST) Received: by lahc1 with SMTP id c1so3532774lah.26 for ; Sat, 03 Mar 2012 13:36:59 -0800 (PST) Received-SPF: pass (google.com: domain of jani@nikula.org designates 10.152.135.148 as permitted sender) client-ip=10.152.135.148; Authentication-Results: mr.google.com; spf=pass (google.com: domain of jani@nikula.org designates 10.152.135.148 as permitted sender) smtp.mail=jani@nikula.org Received: from mr.google.com ([10.152.135.148]) by 10.152.135.148 with SMTP id ps20mr13370101lab.20.1330810619185 (num_hops = 1); Sat, 03 Mar 2012 13:36:59 -0800 (PST) Received: by 10.152.135.148 with SMTP id ps20mr11005413lab.20.1330810619090; Sat, 03 Mar 2012 13:36:59 -0800 (PST) Received: from localhost (dsl-hkibrasgw4-fe50f800-253.dhcp.inet.fi. [84.248.80.253]) by mx.google.com with ESMTPS id hv2sm14791084lbb.9.2012.03.03.13.36.56 (version=SSLv3 cipher=OTHER); Sat, 03 Mar 2012 13:36:57 -0800 (PST) From: Jani Nikula To: Daniel Schoepe , notmuch@notmuchmail.org Subject: Re: [PATCH v2] emacs: Pass a copy to notmuch-saved-search-sort-function In-Reply-To: <1330633478-1974-2-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> <1330633478-1974-2-git-send-email-daniel@schoepe.org> User-Agent: Notmuch/0.11.1+289~ga123fab (http://notmuchmail.org) Emacs/23.3.1 (i686-pc-linux-gnu) Date: Sat, 03 Mar 2012 23:36:54 +0200 Message-ID: <87r4x9fjt5.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gm-Message-State: ALoCoQkujERZmGNEBk3YRc7u+awb/tsGPftGnTFQdjhmJor2/3aL9Q6BnFq1bP8KhRTSORzOQYNG 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: Sat, 03 Mar 2012 21:37:04 -0000 On Thu, 1 Mar 2012 21:24:38 +0100, Daniel Schoepe wrote: > 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. Hi Daniel, thanks for fixing this. Works for me. Full disclosure: I put the broken sort usage there in the first place... BR, Jani. > --- > 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 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch