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 DF8756DE10AA for ; Thu, 27 Feb 2020 09:17:18 -0800 (PST) Authentication-Results: arlo.cworth.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JovNVQIq"; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.038 X-Spam-Level: X-Spam-Status: No, score=0.038 tagged_above=-999 required=5 tests=[AWL=-0.011, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] 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 ImmTIkSolvZr for ; Thu, 27 Feb 2020 09:17:17 -0800 (PST) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by arlo.cworth.org (Postfix) with ESMTPS id DC5BF6DE10AD for ; Thu, 27 Feb 2020 09:17:10 -0800 (PST) Received: by mail-wm1-f42.google.com with SMTP id f15so179263wml.3 for ; Thu, 27 Feb 2020 09:17:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+ycxURS3PKddxYCnSoTaQKstkKjMBfiTfMOwyjtAeH4=; b=JovNVQIqqd2v54oalDUO+aHqqohDXml6kod5vt8ELzOAyyD/Vf6HviwzMEUVxWd0rE LNxEJecYsMF8zNDV0O8uyrF3LugjcL7F/pOL1ZcTh28699Kby3o+0HHzeEkTmf1QpCek xYunSbEFcsb+IuKOPeLwo2r5ZclXCgn9zEmXG51x7A6+m2T9b7/cZ1WzowZ3Jjo+u7oD 45QyR+Yj1L5TlxCsmXUkpYYStj28m5QM5X+z607D+TND3xAO4ouvRYRzx6pDhnupjk1R G/h+ZaEUmdTC9kvycknS3iE4C2dHAyb5bkzCqQS1egK0Hv3Yw/sTp6l0qoomyl6aYUjg Pd8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+ycxURS3PKddxYCnSoTaQKstkKjMBfiTfMOwyjtAeH4=; b=OC760Xmf9/gJmfJrXNV2fCBLdXcjN11K0lUK0tIjRIlzJWVQQ1/vroZLu7FkJ3QtHX nYnRSIKE9gMEE3zIwNiGY26VZVDUqAJR0vUQR8E0W1seI1ZmyLUMHIDr4LUrOnWmSbI2 bzx03rXqU0qIR7Ti9nEzH+m2sMdm+Kk6pe0RNhtnFV3PhL/rHOrCiTo8lfWAaoDqy3Fs cYNISxXrEJsDiLcGx3XU1ISw/hybEnAuu86BqgImu9dymxqG5PD+Z94wJKLa11AVnT1D iw1+xqeFxDC9MUh952gJPo3YAYtzOV2JhCY0KEI/cUc63gp2yTLtzI4ZJwQkiGGPG0HJ QI7g== X-Gm-Message-State: APjAAAUckwbuyXrDF4SpHhXQZCLgfWLvJ9MYY56X7jqR0Xm3/faCBAZ9 hwJ9FmUmMVio/01+EgeKk4gKLRvn X-Google-Smtp-Source: APXvYqxy4uf7dw4BABhTeerUuRSb/nalorpycqxtnpjcD8frVP4GFPvq/JepeAX/0o2yyCAjwxmCYg== X-Received: by 2002:a1c:a789:: with SMTP id q131mr502999wme.127.1582823828350; Thu, 27 Feb 2020 09:17:08 -0800 (PST) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id s8sm9066065wrt.57.2020.02.27.09.17.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Feb 2020 09:17:07 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH 6/6] notmuch-hello/jump: allow saved searches to specify unthreaded mode Date: Thu, 27 Feb 2020 17:16:52 +0000 Message-Id: <20200227171652.18187-7-markwalters1009@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200227171652.18187-1-markwalters1009@gmail.com> References: <20200227171652.18187-1-markwalters1009@gmail.com> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Thu, 27 Feb 2020 17:17:19 -0000 Saved searches in notmuch-hello and notmuch-jump can specify whether to use search mode or tree mode. This adds an option for them to specify unthreaded mode. --- emacs/notmuch-hello.el | 29 +++++++++++++++++++---------- emacs/notmuch-jump.el | 10 +++++++--- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 858446df..ab6ee798 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -32,6 +32,9 @@ (declare-function notmuch-poll "notmuch" ()) (declare-function notmuch-tree "notmuch-tree" (&optional query query-context target buffer-name open-target unthreaded)) +(declare-function notmuch-unthreaded + (&optional query query-context target buffer-name open-target)) + (defun notmuch-saved-search-get (saved-search field) "Get FIELD from SAVED-SEARCH. @@ -99,7 +102,8 @@ searches so they still work in customize." (group :format "%v" :inline t (const :format "" :search-type) (choice :tag " Search Type" (const :tag "Search mode" nil) - (const :tag "Tree mode" tree)))))) + (const :tag "Tree mode" tree) + (const :tag "Unthreaded mode" unthreaded)))))) (defcustom notmuch-saved-searches `((:name "inbox" :query "tag:inbox" :key ,(kbd "i")) @@ -122,10 +126,10 @@ a plist. Supported properties are :sort-order Specify the sort order to be used for the search. Possible values are 'oldest-first 'newest-first or nil. Nil means use the default sort order. - :search-type Specify whether to run the search in search-mode - or tree mode. Set to 'tree to specify tree - mode, set to nil (or anything except tree) to - specify search mode. + :search-type Specify whether to run the search in search-mode, + tree mode or unthreaded mode. Set to 'tree to specify tree + mode, 'unthreaded to specify unthreaded mode, and set to nil + (or anything except tree and unthreaded) to specify search mode. Other accepted forms are a cons cell of the form (NAME . QUERY) or a list of the form (NAME QUERY COUNT-QUERY)." @@ -437,13 +441,18 @@ diagonal." append (notmuch-hello-reflect-generate-row ncols nrows row list)))) (defun notmuch-hello-widget-search (widget &rest ignore) - (if (widget-get widget :notmuch-search-type) - (notmuch-tree (widget-get widget - :notmuch-search-terms)) + (cond + ((eq (widget-get widget :notmuch-search-type) 'tree) + (notmuch-tree (widget-get widget + :notmuch-search-terms))) + ((eq (widget-get widget :notmuch-search-type) 'unthreaded) + (notmuch-unthreaded (widget-get widget + :notmuch-search-terms))) + (t (notmuch-search (widget-get widget :notmuch-search-terms) (widget-get widget - :notmuch-search-oldest-first)))) + :notmuch-search-oldest-first))))) (defun notmuch-saved-search-count (search) (car (process-lines notmuch-command "count" search))) @@ -579,7 +588,7 @@ with `notmuch-hello-query-counts'." (newest-first nil) (oldest-first t) (otherwise notmuch-search-oldest-first))) - (search-type (eq (plist-get elem :search-type) 'tree)) + (search-type (plist-get elem :search-type)) (msg-count (plist-get elem :count))) (widget-insert (format "%8s " (notmuch-hello-nice-number msg-count))) diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el index 3e20b8c7..1cdf5b50 100644 --- a/emacs/notmuch-jump.el +++ b/emacs/notmuch-jump.el @@ -56,9 +56,13 @@ fast way to jump to a saved search from anywhere in Notmuch." (oldest-first t) (otherwise (default-value 'notmuch-search-oldest-first))))) (push (list key name - (if (eq (plist-get saved-search :search-type) 'tree) - `(lambda () (notmuch-tree ',query)) - `(lambda () (notmuch-search ',query ',oldest-first)))) + (cond + ((eq (plist-get saved-search :search-type) 'tree) + `(lambda () (notmuch-tree ',query))) + ((eq (plist-get saved-search :search-type) 'unthreaded) + `(lambda () (notmuch-unthreaded ',query))) + (t + `(lambda () (notmuch-search ',query ',oldest-first))))) action-map))))) (setq action-map (nreverse action-map)) -- 2.11.0