unofficial mirror of notmuch@notmuchmail.org
 help / color / Atom feed
* [PATCH] emacs/tree: add notmuch-tree-filter
@ 2020-04-25 19:42 William Casarin
  2020-05-31 21:11 ` Tomi Ollila
  0 siblings, 1 reply; 3+ messages in thread
From: William Casarin @ 2020-04-25 19:42 UTC (permalink / raw)
  To: notmuch

This implements the notmuch-tree version of notmuch-show-filter-thread
and binds it to the L key.

Signed-off-by: William Casarin <jb55@jb55.com>
---
 emacs/notmuch-tree.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index e5c23de2..8f7738d7 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -328,6 +328,7 @@ FUNC."
     (define-key map "p" 'notmuch-tree-prev-matching-message)
     (define-key map "N" 'notmuch-tree-next-message)
     (define-key map "P" 'notmuch-tree-prev-message)
+    (define-key map "L" 'notmuch-tree-filter)
     (define-key map (kbd "M-p") 'notmuch-tree-prev-thread)
     (define-key map (kbd "M-n") 'notmuch-tree-next-thread)
     (define-key map "k" 'notmuch-tag-jump)
@@ -965,6 +966,14 @@ Complete list of currently available key bindings:
 		      (insert (format " (process returned %d)" exit-status)))
 		    (insert "\n")))))))))
 
+(defun notmuch-tree-filter (query)
+  "Filter or LIMIT the current tree based on a new query string.
+
+Reshows the current tree with matches defined by the new query-string."
+  (interactive (list (notmuch-read-query "Filter tree: ")))
+  (setq notmuch-tree-query-context (if (string= query "") nil query))
+  (notmuch-tree-refresh-view t))
+
 (defun notmuch-tree-process-filter (proc string)
   "Process and filter the output of \"notmuch show\" for tree view"
   (let ((results-buf (process-buffer proc))
-- 
2.25.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] emacs/tree: add notmuch-tree-filter
  2020-04-25 19:42 [PATCH] emacs/tree: add notmuch-tree-filter William Casarin
@ 2020-05-31 21:11 ` Tomi Ollila
  2020-05-31 22:54   ` William Casarin
  0 siblings, 1 reply; 3+ messages in thread
From: Tomi Ollila @ 2020-05-31 21:11 UTC (permalink / raw)
  To: notmuch

On Sat, Apr 25 2020, William Casarin wrote:

> This implements the notmuch-tree version of notmuch-show-filter-thread
> and binds it to the L key.

No reasoning in commit message why 'L' is chosen...

Tomi

>
> Signed-off-by: William Casarin <jb55@jb55.com>
> ---
>  emacs/notmuch-tree.el | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
> index e5c23de2..8f7738d7 100644
> --- a/emacs/notmuch-tree.el
> +++ b/emacs/notmuch-tree.el
> @@ -328,6 +328,7 @@ FUNC."
>      (define-key map "p" 'notmuch-tree-prev-matching-message)
>      (define-key map "N" 'notmuch-tree-next-message)
>      (define-key map "P" 'notmuch-tree-prev-message)
> +    (define-key map "L" 'notmuch-tree-filter)
>      (define-key map (kbd "M-p") 'notmuch-tree-prev-thread)
>      (define-key map (kbd "M-n") 'notmuch-tree-next-thread)
>      (define-key map "k" 'notmuch-tag-jump)
> @@ -965,6 +966,14 @@ Complete list of currently available key bindings:
>  		      (insert (format " (process returned %d)" exit-status)))
>  		    (insert "\n")))))))))
>  
> +(defun notmuch-tree-filter (query)
> +  "Filter or LIMIT the current tree based on a new query string.
> +
> +Reshows the current tree with matches defined by the new query-string."
> +  (interactive (list (notmuch-read-query "Filter tree: ")))
> +  (setq notmuch-tree-query-context (if (string= query "") nil query))
> +  (notmuch-tree-refresh-view t))
> +
>  (defun notmuch-tree-process-filter (proc string)
>    "Process and filter the output of \"notmuch show\" for tree view"
>    (let ((results-buf (process-buffer proc))
> -- 
> 2.25.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] emacs/tree: add notmuch-tree-filter
  2020-05-31 21:11 ` Tomi Ollila
@ 2020-05-31 22:54   ` William Casarin
  0 siblings, 0 replies; 3+ messages in thread
From: William Casarin @ 2020-05-31 22:54 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

Tomi Ollila <tomi.ollila@iki.fi> writes:

> On Sat, Apr 25 2020, William Casarin wrote:
>
>> This implements the notmuch-tree version of notmuch-show-filter-thread
>> and binds it to the L key.
>
> No reasoning in commit message why 'L' is chosen...

oh right this should probably be `l`. I think I thought it was L because
evil rebinds notmuch-show-filter-thread from `l` to `L` and I didn't
realize this until now.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-25 19:42 [PATCH] emacs/tree: add notmuch-tree-filter William Casarin
2020-05-31 21:11 ` Tomi Ollila
2020-05-31 22:54   ` William Casarin

unofficial mirror of notmuch@notmuchmail.org

Archives are clonable:
	git clone --mirror https://yhetil.org/notmuch/0 notmuch/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 notmuch notmuch/ https://yhetil.org/notmuch \
		notmuch@notmuchmail.org
	public-inbox-index notmuch

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.mail.notmuch.general
	nntp://news.gmane.io/gmane.mail.notmuch.general


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git