From 38363440dfbddf8033b9bdf9405176532c26e0ad Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Sun, 1 Apr 2012 17:51:23 +0300 Subject: [PATCH] [PATCH] emacs: do not modify the alist passed to notmuch-sort-saved-searches --- cc/217536e90930bfad458154ff78896413af8fce | 90 +++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 cc/217536e90930bfad458154ff78896413af8fce diff --git a/cc/217536e90930bfad458154ff78896413af8fce b/cc/217536e90930bfad458154ff78896413af8fce new file mode 100644 index 000000000..87fa346ab --- /dev/null +++ b/cc/217536e90930bfad458154ff78896413af8fce @@ -0,0 +1,90 @@ +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 82E94431E82 + for ; Sun, 1 Apr 2012 07:51:30 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 S0LYRXqEjGxL for ; + Sun, 1 Apr 2012 07:51:29 -0700 (PDT) +Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com + [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 3551D431FAF + for ; Sun, 1 Apr 2012 07:51:29 -0700 (PDT) +Received: by bkwj4 with SMTP id j4so1830232bkw.26 + for ; Sun, 01 Apr 2012 07:51:27 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=google.com; s=20120113; + h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; + bh=NBwuEl5yf+Bia14QGbvzrzsfVf8J6NY8ALtnkLuI65s=; + b=YPBlxfE8BS8dlaeqZeq14FWoWofGUS/+W3TZ8N42ZXAYlB7ILFYtI05ZIeeC8MbXxQ + eerEZ1rWUOjMspmt8Rh5Fa7HwyoyImKaooUaIySCQ/VgY8fioLDq+ymGnjMcqI8XKGVj + 4/ytpmyb4CgNHbtE7zo19xTa74wXfCeE2FASp83xmrqbhtLAFVy/xRd+0OkvYJpA6Ldf + 6Vlg/vjpVKgDIueVCB/UFajRT160nLx7dX4kkfe7ZTP0ubiI76qnzlKxm/Ly/4YhZbGx + vgdMv6yxAckj9s1QXePD1NJySV/uOaEsCsbKgIjpCQgNkOwbFQu2jNa5cE3GL65gwc3y + QbAg== +Received: by 10.205.121.138 with SMTP id gc10mr2253068bkc.23.1333291887603; + Sun, 01 Apr 2012 07:51:27 -0700 (PDT) +Received: from localhost (dsl-hkibrasgw4-fe50f800-253.dhcp.inet.fi. + [84.248.80.253]) + by mx.google.com with ESMTPS id r8sm12610655bki.2.2012.04.01.07.51.25 + (version=SSLv3 cipher=OTHER); Sun, 01 Apr 2012 07:51:26 -0700 (PDT) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH] emacs: do not modify the alist passed to + notmuch-sort-saved-searches +Date: Sun, 1 Apr 2012 17:51:23 +0300 +Message-Id: <1333291883-1030-1-git-send-email-jani@nikula.org> +X-Mailer: git-send-email 1.7.5.4 +X-Gm-Message-State: + ALoCoQmrFStU26vZEZYVQlpsvZqIbZ2qRUfw0DThkNUye0jLL4N9pOrOl4vV2ey9xpWRxsF8Nu06 +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 14:51:30 -0000 + +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 + -- 2.26.2