[PATCH v2] emacs: jump: sort-order bugfix
authorMark Walters <markwalters1009@gmail.com>
Tue, 2 Sep 2014 18:56:04 +0000 (19:56 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:04:24 +0000 (10:04 -0800)
b1/fdd5116a9ebba13e9b636a06a7cc5f41b1ee57 [new file with mode: 0644]

diff --git a/b1/fdd5116a9ebba13e9b636a06a7cc5f41b1ee57 b/b1/fdd5116a9ebba13e9b636a06a7cc5f41b1ee57
new file mode 100644 (file)
index 0000000..7c50030
--- /dev/null
@@ -0,0 +1,117 @@
+Return-Path: <markwalters1009@gmail.com>\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 1D54B431FB6\r
+       for <notmuch@notmuchmail.org>; Tue,  2 Sep 2014 11:56:16 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       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 Tp19j1Zt1E1E for <notmuch@notmuchmail.org>;\r
+       Tue,  2 Sep 2014 11:56:12 -0700 (PDT)\r
+Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
+       [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 5396F431FAF\r
+       for <notmuch@notmuchmail.org>; Tue,  2 Sep 2014 11:56:12 -0700 (PDT)\r
+Received: by mail-wi0-f181.google.com with SMTP id e4so8460713wiv.8\r
+       for <notmuch@notmuchmail.org>; Tue, 02 Sep 2014 11:56:11 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
+       bh=cVqEsYRH4tK+Nu22njLQhfxrgzaDCvGWFGcVn9VB6AY=;\r
+       b=NR/PXZBRom5vs4QzaPTlTcew8o+Hbk0h8FlfrTPUiag14ZNUvzyCuolYqHAOJVunnD\r
+       E+8OLGj9imHpgCLRG+WYKMsX5SZcUN8BS+z27fJAi9Q/ECN/tA5hqI+DnPnDfsdZovYP\r
+       C2ul0+Ftsw1XYsiB69QO2kPOVs+KBN9Wb44gGzH3vVot5Wn8ML0nWY1Fk4J71z2O5qyX\r
+       kAl1hsEiVX7gdV460iT1lUTCB66rXkMEhLcNDOYLe6Nso1BtZtS2BAkv+cX+MTpRsjJQ\r
+       Xbc6QQLhh1EsjxQ1H0SSDFNkXxaYT9cX/qFbDqBvVoEQvwMlKrLwNoZmFa9ChhLm1oJz\r
+       lRTQ==\r
+X-Received: by 10.180.207.105 with SMTP id lv9mr29463607wic.23.1409684170929; \r
+       Tue, 02 Sep 2014 11:56:10 -0700 (PDT)\r
+Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162])\r
+       by mx.google.com with ESMTPSA id\r
+       ys5sm11262926wjc.25.2014.09.02.11.56.09 for <multiple recipients>\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Tue, 02 Sep 2014 11:56:09 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2] emacs: jump: sort-order bugfix\r
+Date: Tue,  2 Sep 2014 19:56:04 +0100\r
+Message-Id: <1409684164-28407-1-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <1409661049-23417-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1409661049-23417-1-git-send-email-markwalters1009@gmail.com>\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: Tue, 02 Sep 2014 18:56:16 -0000\r
+\r
+default-value needs its argument to be quoted.\r
+\r
+Slightly strangely default-value of 't or nil is 't or nil\r
+respectively so the code\r
+\r
+(default-value notmuch-search-oldest-first)\r
+\r
+just gives the current value of notmuch-search-oldest-first rather\r
+than intended default-value of this variable.\r
+\r
+The symptom is that if you are in a search buffer and use notmuch jump\r
+to run a saved search which does not have an explicitly set sort order\r
+then the sort order of the saved-search is inherited from the current\r
+search buffer rather than being the default search order.\r
+\r
+Thanks to Jani for finding the bug.\r
+---\r
+\r
+This time with a fuller commit message.\r
+\r
+(Part of the reason I did not send more before is I had not checked\r
+what the exact outcome of the buggy code was: it was obvious what the\r
+code was intended to do, and that with the extra quote it\r
+would do what it was intended to do.)\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+ emacs/notmuch-jump.el |    2 +-\r
+ 1 file changed, 1 insertion(+), 1 deletion(-)\r
+\r
+diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el\r
+index 5eb0949..0193f8c 100644\r
+--- a/emacs/notmuch-jump.el\r
++++ b/emacs/notmuch-jump.el\r
+@@ -51,7 +51,7 @@ (defun notmuch-jump-search ()\r
+                (case (plist-get saved-search :sort-order)\r
+                  (newest-first nil)\r
+                  (oldest-first t)\r
+-                 (otherwise (default-value notmuch-search-oldest-first)))))\r
++                 (otherwise (default-value 'notmuch-search-oldest-first)))))\r
+           (push (list key name\r
+                       `(lambda () (notmuch-search ',query ',oldest-first)))\r
+                 action-map)))))\r
+-- \r
+1.7.10.4\r
+\r