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 E4A25431E82 for ; Sun, 1 Apr 2012 10:09:43 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 Az+wXl-Hg8cN for ; Sun, 1 Apr 2012 10:09:42 -0700 (PDT) Received: from guru.guru-group.fi (guru-group.fi [87.108.86.66]) by olra.theworths.org (Postfix) with ESMTP id 94FF3431FAF for ; Sun, 1 Apr 2012 10:09:42 -0700 (PDT) Received: by guru.guru-group.fi (Postfix, from userid 501) id 9244D68055; Sun, 1 Apr 2012 20:09:38 +0300 (EEST) From: Tomi Ollila To: Jani Nikula , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: do not modify the alist passed to notmuch-sort-saved-searches In-Reply-To: <1333291883-1030-1-git-send-email-jani@nikula.org> References: <1333291883-1030-1-git-send-email-jani@nikula.org>User-Agent: Notmuch/0.12+77~gee11800 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Sun, 01 Apr 2012 17:09:44 -0000 On Sun, Apr 01 2012, Jani Nikula wrote: > Sort modifies its input as a side effect. Pass it a copy in > notmuch-sort-saved-searches to not modify the notmuch-saved-searches > alist. > > --- +1 Tomi > > Earlier version by Daniel Schoepe and discussion in thread starting at > id:"1330633478-1974-1-git-send-email-daniel@schoepe.org". > --- > emacs/notmuch-hello.el | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el > index e9caade..8e37761 100644 > --- a/emacs/notmuch-hello.el > +++ b/emacs/notmuch-hello.el > @@ -41,7 +41,7 @@ > > (defun notmuch-sort-saved-searches (alist) > "Generate an alphabetically sorted saved searches alist." > - (sort alist (lambda (a b) (string< (car a) (car b))))) > + (sort (copy-sequence alist) (lambda (a b) (string< (car a) (car b))))) > > (defcustom notmuch-saved-search-sort-function nil > "Function used to sort the saved searches for the notmuch-hello view. > -- > 1.7.5.4 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch