From c41499731cd1bc6faa240b616993d0376286c0c3 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Wed, 3 Sep 2014 15:27:22 +2000 Subject: [PATCH] Re: [PATCH v2] emacs: jump: sort-order bugfix --- 86/d03c4df6f26a6db701716ea862e9b1b9fb1f5d | 135 ++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 86/d03c4df6f26a6db701716ea862e9b1b9fb1f5d diff --git a/86/d03c4df6f26a6db701716ea862e9b1b9fb1f5d b/86/d03c4df6f26a6db701716ea862e9b1b9fb1f5d new file mode 100644 index 000000000..b1bdaf77c --- /dev/null +++ b/86/d03c4df6f26a6db701716ea862e9b1b9fb1f5d @@ -0,0 +1,135 @@ +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 0B30C431FB6 + for ; Tue, 2 Sep 2014 12:27:32 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -2.3 +X-Spam-Level: +X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_MED=-2.3] 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 6-c+m+xBE2ic for ; + Tue, 2 Sep 2014 12:27:28 -0700 (PDT) +Received: from dmz-mailsec-scanner-3.mit.edu (dmz-mailsec-scanner-3.mit.edu + [18.9.25.14]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 70A4A431FAF + for ; Tue, 2 Sep 2014 12:27:28 -0700 (PDT) +X-AuditID: 1209190e-f79d46d000003643-d0-54061a1e6189 +Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) + (using TLS with cipher AES256-SHA (256/256 bits)) + (Client did not present a certificate) + by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP + id 4B.9D.13891.E1A16045; Tue, 2 Sep 2014 15:27:26 -0400 (EDT) +Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) + by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id s82JRPSD014262; + Tue, 2 Sep 2014 15:27:26 -0400 +Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) + (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s82JRNl4014444 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); + Tue, 2 Sep 2014 15:27:24 -0400 +Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80) + (envelope-from ) + id 1XOtje-0003ck-Ve; Tue, 02 Sep 2014 15:27:23 -0400 +Date: Tue, 2 Sep 2014 15:27:22 -0400 +From: Austin Clements +To: Mark Walters +Subject: Re: [PATCH v2] emacs: jump: sort-order bugfix +Message-ID: <20140902192722.GC4977@csail.mit.edu> +References: <1409661049-23417-1-git-send-email-markwalters1009@gmail.com> + <1409684164-28407-1-git-send-email-markwalters1009@gmail.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <1409684164-28407-1-git-send-email-markwalters1009@gmail.com> +User-Agent: Mutt/1.5.21 (2010-09-15) +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFupjleLIzCtJLcpLzFFi42IR4hRV1pWTYgsxmPNDzGL1XB6L6zdnMjsw + eeycdZfd49mqW8wBTFFcNimpOZllqUX6dglcGaunHGIu2MJbMe3bHsYGxg1cXYwcHBICJhLL + 5yh2MXICmWISF+6tZ+ti5OIQEpjNJHFu7wEoZwOjxJwjr6CcU0wSG/Z8ZIVwVjNK3O38xwTS + zyKgItH8dR2YzSagL7Fi7SRWEFtEQEfi9qEF7CA2s4C0xLffzWA1wgJmEieeP2MBsXkFDCU+ + TzjKCDG0k1Hi5ddOdoiEoMTJmU9YIJq1JG78e8kEcjfIoOX/OEBMTgEviXdrykAqRIFOmHJy + G9sERqFZSJpnIWmehdC8gJF5FaNsSm6Vbm5iZk5xarJucXJiXl5qka6xXm5miV5qSukmRnBQ + S/LtYPx6UOkQowAHoxIPr8QPlhAh1sSy4srcQ4ySHExKorw8ImwhQnxJ+SmVGYnFGfFFpTmp + xYcYJTiYlUR4nb+yhgjxpiRWVqUW5cOkpDlYlMR531pbBQsJpCeWpGanphakFsFkZTg4lCR4 + gyWBhgoWpaanVqRl5pQgpJk4OEGG8wANbwGp4S0uSMwtzkyHyJ9i1OVY1/mtn0mIJS8/L1VK + nLcWpEgApCijNA9uDiwZvWIUB3pLmLcbpIoHmMjgJr0CWsIEtMQtB+SD4pJEhJRUA6N7gPN0 + zricmNvbwxQmfLJm3fFj5818m7PX1lkpf1km1FbK1CO9mnfl6qu2FxdvUd+c9OVz7aa91bG9 + P3a0llxwEBLmct5k8GH9rMh3Us1TVWYL567jFd66doW1l6CgxdPby0rPWF00kf7T8sxal3H3 + JeGDThMdOkq632yv/MrwjnFLqO6VskNKLMUZiYZazEXFiQCX0DWFIQMAAA== +Cc: notmuch@notmuchmail.org +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: Tue, 02 Sep 2014 19:27:32 -0000 + +LGTM. + +Quoth Mark Walters on Sep 02 at 7:56 pm: +> default-value needs its argument to be quoted. +> +> Slightly strangely default-value of 't or nil is 't or nil +> respectively so the code +> +> (default-value notmuch-search-oldest-first) +> +> just gives the current value of notmuch-search-oldest-first rather +> than intended default-value of this variable. +> +> The symptom is that if you are in a search buffer and use notmuch jump +> to run a saved search which does not have an explicitly set sort order +> then the sort order of the saved-search is inherited from the current +> search buffer rather than being the default search order. +> +> Thanks to Jani for finding the bug. +> --- +> +> This time with a fuller commit message. +> +> (Part of the reason I did not send more before is I had not checked +> what the exact outcome of the buggy code was: it was obvious what the +> code was intended to do, and that with the extra quote it +> would do what it was intended to do.) +> +> Best wishes +> +> Mark +> +> +> +> +> +> +> +> emacs/notmuch-jump.el | 2 +- +> 1 file changed, 1 insertion(+), 1 deletion(-) +> +> diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el +> index 5eb0949..0193f8c 100644 +> --- a/emacs/notmuch-jump.el +> +++ b/emacs/notmuch-jump.el +> @@ -51,7 +51,7 @@ (defun notmuch-jump-search () +> (case (plist-get saved-search :sort-order) +> (newest-first nil) +> (oldest-first t) +> - (otherwise (default-value notmuch-search-oldest-first))))) +> + (otherwise (default-value 'notmuch-search-oldest-first))))) +> (push (list key name +> `(lambda () (notmuch-search ',query ',oldest-first))) +> action-map))))) -- 2.26.2