[PATCH] 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)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:45:57 +0000 (09:45 -0800)
cc/217536e90930bfad458154ff78896413af8fce [new file with mode: 0644]

diff --git a/cc/217536e90930bfad458154ff78896413af8fce b/cc/217536e90930bfad458154ff78896413af8fce
new file mode 100644 (file)
index 0000000..87fa346
--- /dev/null
@@ -0,0 +1,90 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 82E94431E82\r
+       for <notmuch@notmuchmail.org>; Sun,  1 Apr 2012 07:51:30 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id S0LYRXqEjGxL for <notmuch@notmuchmail.org>;\r
+       Sun,  1 Apr 2012 07:51:29 -0700 (PDT)\r
+Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com\r
+       [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 3551D431FAF\r
+       for <notmuch@notmuchmail.org>; Sun,  1 Apr 2012 07:51:29 -0700 (PDT)\r
+Received: by bkwj4 with SMTP id j4so1830232bkw.26\r
+       for <notmuch@notmuchmail.org>; Sun, 01 Apr 2012 07:51:27 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=google.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state;\r
+       bh=NBwuEl5yf+Bia14QGbvzrzsfVf8J6NY8ALtnkLuI65s=;\r
+       b=YPBlxfE8BS8dlaeqZeq14FWoWofGUS/+W3TZ8N42ZXAYlB7ILFYtI05ZIeeC8MbXxQ\r
+       eerEZ1rWUOjMspmt8Rh5Fa7HwyoyImKaooUaIySCQ/VgY8fioLDq+ymGnjMcqI8XKGVj\r
+       4/ytpmyb4CgNHbtE7zo19xTa74wXfCeE2FASp83xmrqbhtLAFVy/xRd+0OkvYJpA6Ldf\r
+       6Vlg/vjpVKgDIueVCB/UFajRT160nLx7dX4kkfe7ZTP0ubiI76qnzlKxm/Ly/4YhZbGx\r
+       vgdMv6yxAckj9s1QXePD1NJySV/uOaEsCsbKgIjpCQgNkOwbFQu2jNa5cE3GL65gwc3y\r
+       QbAg==\r
+Received: by 10.205.121.138 with SMTP id gc10mr2253068bkc.23.1333291887603;\r
+       Sun, 01 Apr 2012 07:51:27 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw4-fe50f800-253.dhcp.inet.fi.\r
+       [84.248.80.253])\r
+       by mx.google.com with ESMTPS id r8sm12610655bki.2.2012.04.01.07.51.25\r
+       (version=SSLv3 cipher=OTHER); Sun, 01 Apr 2012 07:51:26 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: do not modify the alist passed to\r
+       notmuch-sort-saved-searches\r
+Date: Sun,  1 Apr 2012 17:51:23 +0300\r
+Message-Id: <1333291883-1030-1-git-send-email-jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.5.4\r
+X-Gm-Message-State:\r
+ ALoCoQmrFStU26vZEZYVQlpsvZqIbZ2qRUfw0DThkNUye0jLL4N9pOrOl4vV2ey9xpWRxsF8Nu06\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 01 Apr 2012 14:51:30 -0000\r
+\r
+Sort modifies its input as a side effect. Pass it a copy in\r
+notmuch-sort-saved-searches to not modify the notmuch-saved-searches\r
+alist.\r
+\r
+---\r
+\r
+Earlier version by Daniel Schoepe and discussion in thread starting at\r
+id:"1330633478-1974-1-git-send-email-daniel@schoepe.org".\r
+---\r
+ emacs/notmuch-hello.el |    2 +-\r
+ 1 files changed, 1 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
+index e9caade..8e37761 100644\r
+--- a/emacs/notmuch-hello.el\r
++++ b/emacs/notmuch-hello.el\r
+@@ -41,7 +41,7 @@\r
+ \r
+ (defun notmuch-sort-saved-searches (alist)\r
+   "Generate an alphabetically sorted saved searches alist."\r
+-  (sort alist (lambda (a b) (string< (car a) (car b)))))\r
++  (sort (copy-sequence alist) (lambda (a b) (string< (car a) (car b)))))\r
+ \r
+ (defcustom notmuch-saved-search-sort-function nil\r
+   "Function used to sort the saved searches for the notmuch-hello view.\r
+-- \r
+1.7.5.4\r
+\r