From: Jani Nikula Date: Sat, 12 Apr 2014 10:50:02 +0000 (+0300) Subject: Re: [PATCH 1/2] emacs: hello: bugfix: make alphabetically sorted saved searches work X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2eac1ce68f29e933d5dffb8c697094bf5848cbf7;p=notmuch-archives.git Re: [PATCH 1/2] emacs: hello: bugfix: make alphabetically sorted saved searches work --- diff --git a/37/249e17cb668364764cf6cea01625fbc1847d3f b/37/249e17cb668364764cf6cea01625fbc1847d3f new file mode 100644 index 000000000..1475617c0 --- /dev/null +++ b/37/249e17cb668364764cf6cea01625fbc1847d3f @@ -0,0 +1,118 @@ +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 B3954431FBC + for ; Sat, 12 Apr 2014 03:50:16 -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 frfdmXqvWdYZ for ; + Sat, 12 Apr 2014 03:50:09 -0700 (PDT) +Received: from mail-ee0-f43.google.com (mail-ee0-f43.google.com + [74.125.83.43]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 4AB77431FAF for ; Sat, 12 Apr 2014 03:50:09 -0700 + (PDT) +Received: by mail-ee0-f43.google.com with SMTP id e53so4894895eek.2 + for ; Sat, 12 Apr 2014 03:50:05 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:subject:in-reply-to:references + :user-agent:date:message-id:mime-version:content-type; + bh=YZ96Gf4DLF+X8lVbESyyBoU2U7lzYxdGnAwgmxhgYH8=; + b=UzbFNStOrgbVFyD9rHV8bK1PDXrntW0M7OxpaU8C2scOAxlw/sCSEA/kKVs+lUE7NZ + 00MfSPHFCwmqnIbQRZgXDhiVZlsWd88tmYkrP8nkgN2jhBjaGeNViX28g+k95ax2u8cX + eyFgHfbWl8914y+RVq7k//xihoXrOlPHIRkXQIgxYkQx9eacZt+z+vjyaH+ssOk4ZVrE + MR1ODYj8KtgmTp23UZSPX2zP6oG5eFKCrXPawWtXzVhUpxt5jlDEe3BbfwXKNOf94LlI + LjBBQld15L2RxgsZgu4U2V1UiVeg7SbO1yp8iZdfTv0I4X0FOluEhsLyRORenYS933Bv + LcKQ== +X-Gm-Message-State: + ALoCoQnhfN0jem9rxqZaH12pWGzEfFX/sqR7kx1gP9/F2x+WIesvujhX1Deq+GXE2dhNkMz55WET +X-Received: by 10.14.251.204 with SMTP id b52mr36023968ees.36.1397299805056; + Sat, 12 Apr 2014 03:50:05 -0700 (PDT) +Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi. + [88.195.111.91]) by mx.google.com with ESMTPSA id + q49sm24447573eem.34.2014.04.12.03.50.03 for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Sat, 12 Apr 2014 03:50:04 -0700 (PDT) +From: Jani Nikula +To: Mark Walters , notmuch@notmuchmail.org +Subject: Re: [PATCH 1/2] emacs: hello: bugfix: make alphabetically sorted + saved searches work +In-Reply-To: <1397292033-26502-1-git-send-email-markwalters1009@gmail.com> +References: <1397292033-26502-1-git-send-email-markwalters1009@gmail.com> +User-Agent: Notmuch/0.17+187~gf1bfa36 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-pc-linux-gnu) +Date: Sat, 12 Apr 2014 13:50:02 +0300 +Message-ID: <878ura7rfp.fsf@nikula.org> +MIME-Version: 1.0 +Content-Type: text/plain +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: Sat, 12 Apr 2014 10:50:16 -0000 + +On Sat, 12 Apr 2014, Mark Walters wrote: +> My recent changes to the saved search format broke the alphabetically +> sorted saved sort option. This makes it work again. +> +> Also, since the saved-search list is no longer an alist change the +> names in the sort function to avoid confusion. +> --- +> Thanks to Jani for pointing out the bug. + +Looks good, works for me, thanks for the fix. + +BR, +Jani. + +> +> Best wishes +> +> Mark +> +> emacs/notmuch-hello.el | 9 ++++++--- +> 1 file changed, 6 insertions(+), 3 deletions(-) +> +> diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el +> index 4900a24..fca2bcc 100644 +> --- a/emacs/notmuch-hello.el +> +++ b/emacs/notmuch-hello.el +> @@ -39,9 +39,12 @@ (defcustom notmuch-show-empty-saved-searches nil +> :type 'boolean +> :group 'notmuch-hello) +> +> -(defun notmuch-sort-saved-searches (alist) +> - "Generate an alphabetically sorted saved searches alist." +> - (sort (copy-sequence alist) (lambda (a b) (string< (car a) (car b))))) +> +(defun notmuch-sort-saved-searches (saved-searches) +> + "Generate an alphabetically sorted saved searches list." +> + (sort (copy-sequence saved-searches) +> + (lambda (a b) +> + (string< (notmuch-saved-search-get a :name) +> + (notmuch-saved-search-get b :name))))) +> +> (defcustom notmuch-saved-search-sort-function nil +> "Function used to sort the saved searches for the notmuch-hello view. +> -- +> 1.7.10.4 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch