[PATCH] emacs: do not modify the alist passed to notmuch-sort-saved-searches

Tomi Ollila tomi.ollila at iki.fi
Sun Apr 1 10:09:38 PDT 2012


On Sun, Apr 01 2012, Jani Nikula <jani at nikula.org> 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 at 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 at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list