From: Jani Nikula Date: Tue, 2 Oct 2012 20:18:02 +0000 (+0200) Subject: [PATCH 1/2] emacs: store sort order in the widgets in notmuch-hello X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=205dbc471c027118404fe4ae6e31c33e012ad951;p=notmuch-archives.git [PATCH 1/2] emacs: store sort order in the widgets in notmuch-hello --- diff --git a/6d/22ac58e7cd1f1056183611af9e1fcb33f7baa1 b/6d/22ac58e7cd1f1056183611af9e1fcb33f7baa1 new file mode 100644 index 000000000..b2c3641bf --- /dev/null +++ b/6d/22ac58e7cd1f1056183611af9e1fcb33f7baa1 @@ -0,0 +1,96 @@ +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 894E3431FC0 + for ; Tue, 2 Oct 2012 13:18: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 eSoTrw+1griN for ; + Tue, 2 Oct 2012 13:18:14 -0700 (PDT) +Received: from mail-qa0-f46.google.com (mail-qa0-f46.google.com + [209.85.216.46]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 73436431FBC + for ; Tue, 2 Oct 2012 13:18:14 -0700 (PDT) +Received: by mail-qa0-f46.google.com with SMTP id c26so1065259qad.5 + for ; Tue, 02 Oct 2012 13:18:14 -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:in-reply-to:references + :x-gm-message-state; + bh=LnTYcffzVUTwiOXt7Cbbjf0iwQrEpEtHEmRi1Beewxk=; + b=SvSoH1U/T+ZWTbKOOuKLefp00Ha3X7xLpVQ1Ix2LjfThv0d2hS1oXGQktlDPEYznRP + Wf35ytsAaJTpL+KxZzYQB6M2E/unCgMRtGKTMGkGG+JIOK3Q2JCuudLY5uPf78YPmf3j + n3Hyh1BwVDWcPTF5vUkb6aJXALGHu43dexP52r0Wwqlq1+Rnh22Oc3mjQfVU7nI1wmNi + 5gdyb9qc6eR3k6F7zi3Tle7DUAHq0YRu2xAPP/tp8PeiE2bER6K8tvPuwN4ckrdsroK0 + f+QUD5soIQJhAqj0F5W0v4jMumn3KBvK8/RIpId0sQNZVhk+SF0GH8MA9v0YEbOEZP/Y + hPcw== +Received: by 10.224.76.204 with SMTP id d12mr4040069qak.85.1349209093864; + Tue, 02 Oct 2012 13:18:13 -0700 (PDT) +Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3]) + by mx.google.com with ESMTPS id c9sm3042058qeh.1.2012.10.02.13.18.12 + (version=SSLv3 cipher=OTHER); Tue, 02 Oct 2012 13:18:13 -0700 (PDT) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH 1/2] emacs: store sort order in the widgets in notmuch-hello +Date: Tue, 2 Oct 2012 22:18:02 +0200 +Message-Id: <1349209083-7170-2-git-send-email-jani@nikula.org> +X-Mailer: git-send-email 1.7.2.5 +In-Reply-To: <1349209083-7170-1-git-send-email-jani@nikula.org> +References: <1349209083-7170-1-git-send-email-jani@nikula.org> +X-Gm-Message-State: + ALoCoQm9X07wn5jIspC0fZ75ag5CSFfIulaZ9+eS5Vo11Vkal6QBlFb3DT8ELhJhLnquFTsUi9ox +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 Oct 2012 20:18:17 -0000 + +Move decision about sort order from the notify handler to the widget +setup. This keeps the handler simple when more fancy stuff is added. +--- + emacs/notmuch-hello.el | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el +index 052aaeb..532f06d 100644 +--- a/emacs/notmuch-hello.el ++++ b/emacs/notmuch-hello.el +@@ -311,9 +311,8 @@ diagonal." + append (notmuch-hello-reflect-generate-row ncols nrows row list)))) + + (defun notmuch-hello-widget-search (widget &rest ignore) +- (notmuch-search (widget-get widget +- :notmuch-search-terms) +- notmuch-search-oldest-first ++ (notmuch-search (widget-get widget :notmuch-search-terms) ++ (widget-get widget :notmuch-search-oldest-first) + nil nil #'notmuch-hello-search-continuation)) + + (defun notmuch-saved-search-count (search) +@@ -434,6 +433,7 @@ Such a list can be computed with `notmuch-hello-query-counts'." + (widget-create 'push-button + :notify #'notmuch-hello-widget-search + :notmuch-search-terms query ++ :notmuch-search-oldest-first notmuch-search-oldest-first + name) + (setq column-indent + (1+ (max 0 (- column-width (length name))))))) +-- +1.7.2.5 +