unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: do not modify the alist passed to notmuch-sort-saved-searches
@ 2012-04-01 14:51 Jani Nikula
  2012-04-01 17:09 ` Tomi Ollila
  2012-04-06 15:34 ` David Bremner
  0 siblings, 2 replies; 3+ messages in thread
From: Jani Nikula @ 2012-04-01 14:51 UTC (permalink / raw)
  To: notmuch

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.

---

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] emacs: do not modify the alist passed to notmuch-sort-saved-searches
  2012-04-01 14:51 [PATCH] emacs: do not modify the alist passed to notmuch-sort-saved-searches Jani Nikula
@ 2012-04-01 17:09 ` Tomi Ollila
  2012-04-06 15:34 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: Tomi Ollila @ 2012-04-01 17:09 UTC (permalink / raw)
  To: Jani Nikula, notmuch

On Sun, Apr 01 2012, Jani Nikula <jani@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@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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] emacs: do not modify the alist passed to notmuch-sort-saved-searches
  2012-04-01 14:51 [PATCH] emacs: do not modify the alist passed to notmuch-sort-saved-searches Jani Nikula
  2012-04-01 17:09 ` Tomi Ollila
@ 2012-04-06 15:34 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2012-04-06 15:34 UTC (permalink / raw)
  To: Jani Nikula, notmuch

Jani Nikula <jani@nikula.org> writes:

> 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.

Pushed.

d

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-06 15:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-01 14:51 [PATCH] emacs: do not modify the alist passed to notmuch-sort-saved-searches Jani Nikula
2012-04-01 17:09 ` Tomi Ollila
2012-04-06 15:34 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).