]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: do not modify the alist passed to notmuch-sort-saved-searches
authorJani Nikula <jani@nikula.org>
Sun, 1 Apr 2012 14:51:23 +0000 (17:51 +0300)
committerDavid Bremner <bremner@debian.org>
Fri, 6 Apr 2012 15:34:16 +0000 (12:34 -0300)
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.

emacs/notmuch-hello.el

index 28f39f19a8cb4724642e51b522d2b64282139510..6b4b2c14de5cd16fc1a2c74da4f199c228ea19e7 100644 (file)
@@ -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.