From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 6C80D6DE110A for ; Mon, 25 Sep 2017 22:36:58 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.015 X-Spam-Level: X-Spam-Status: No, score=-0.015 tagged_above=-999 required=5 tests=[AWL=0.094, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FSL_HELO_NON_FQDN_1=0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dE2w0UdLhrpP for ; Mon, 25 Sep 2017 22:36:57 -0700 (PDT) Received: from charon (jb55.com [45.79.91.128]) by arlo.cworth.org (Postfix) with ESMTPS id DC4DA6DE1006; Mon, 25 Sep 2017 22:36:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d= jb55.com; h=from:to:subject:date:message-id; s=default; bh=Y0bXAkXLv3z9a2ZcfBxSOOPolOw+1PS+Lui7dveqoWc=; b=SY/UDFrYfPTIvU4UcncZmYsJJOWXtOc7ouWkKYflyM+6jjBsFB5vGWneuEnwQ5C1EWLsa7BJv+4noW0ZW73HAl4krXSMwZvO/0JTwMgozbxhOwy7hLG2lLgDh6xsmMGg7UJXU31oBFO1uT3L4Tg6RlRWDxEW9CODS+eZ+EOsWrHLdybRkRmylUGRkImgmCI/pX0g3yO6oRuh/tgTmlElOK1Q8FTgF982lmpGoT6sKBrXfCMNDDH9JOgZy6jl282rUUt70kuXpzqRZKOFWitjM2Jc5nHNS3i5up37CX11sDqfIqr2BPbbGdCG/atFz6RZkt5siBz6jsSN9I3cZfv5qQ== Received: from jb55.com (70-36-49-138.dyn.novuscom.net [70.36.49.138]) by jb55.com (OpenSMTPD) with ESMTPSA id 1298fa37 TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Tue, 26 Sep 2017 05:36:45 +0000 (UTC) From: William Casarin To: notmuch@notmuchmail.org Subject: [PATCH 6/6] emacs: add notmuch-search-change-order Date: Mon, 25 Sep 2017 22:35:47 -0700 Message-Id: <20170926053547.18564-7-jb55@jb55.com> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170926053547.18564-1-jb55@jb55.com> References: <20170926053547.18564-1-jb55@jb55.com> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 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, 26 Sep 2017 05:36:58 -0000 notmuch-search-change-order pops up a completing-read minibuffer completion window for choosing sort-orders. --- emacs/notmuch.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 334458b7..93b4e582 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -178,6 +178,7 @@ there will be called at other points of notmuch execution." (define-key map "r" 'notmuch-search-reply-to-thread-sender) (define-key map "R" 'notmuch-search-reply-to-thread) (define-key map "o" 'notmuch-search-toggle-order) + (define-key map "O" 'notmuch-search-change-order) (define-key map "c" 'notmuch-search-stash-map) (define-key map "t" 'notmuch-search-filter-by-tag) (define-key map "l" 'notmuch-search-filter) @@ -1044,6 +1045,19 @@ same relative position within the new buffer." (subject-ascending 'subject-descending) (subject-descending 'subject-ascending))) +(defun notmuch-search-change-order (&optional sort-order) + "Change the current search order. + +This command changes the order for current search. The default +sort order is defuned by `notmuch-search-sort-order'." + (interactive) + (let ((so (if sort-order sort-order + (cdr (assoc (completing-read + "Select a sort order:" notmuch-sort-orders) + notmuch-sort-orders))))) + (set 'notmuch-search-sort-order so) + (notmuch-search-refresh-view))) + (defun notmuch-search-toggle-order () "Toggle the current search order. -- 2.13.2