unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: bind C-u Z to notmuch-tree-from-search-thread
@ 2019-11-13  8:00 William Casarin
  2019-11-13  9:35 ` David Edmondson
  2019-11-13 17:34 ` Teemu Likonen
  0 siblings, 2 replies; 5+ messages in thread
From: William Casarin @ 2019-11-13  8:00 UTC (permalink / raw)
  To: notmuch; +Cc: Teemu Likonen, Johan Parin, David Edmondson, William Casarin

This is an unbound function that is quite useful. It opens a selected
thread in notmuch-tree from the current search query.

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

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 773d1206..b5c361ca 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -517,10 +517,13 @@ thread."
 		      (concat "*" (truncate-string-to-width subject 30 nil nil t) "*"))
       (message "End of search results."))))
 
-(defun notmuch-tree-from-search-current-query ()
+(put 'notmuch-tree-from-search-current-query 'notmuch-prefix-doc
+     "Show the selected thread with notmuch-tree")
+(defun notmuch-tree-from-search-current-query (&optional search-thread)
   "Call notmuch tree with the current query"
-  (interactive)
-  (notmuch-tree notmuch-search-query-string))
+  (interactive "P")
+  (if search-thread (notmuch-tree-from-search-thread)
+    (notmuch-tree notmuch-search-query-string)))
 
 (defun notmuch-tree-from-search-thread ()
   "Show the selected thread with notmuch-tree"

base-commit: 7ad7cfbff232431377562271901ee00202bf0bd0
-- 
2.23.0

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

* Re: [PATCH] emacs: bind C-u Z to notmuch-tree-from-search-thread
  2019-11-13  8:00 [PATCH] emacs: bind C-u Z to notmuch-tree-from-search-thread William Casarin
@ 2019-11-13  9:35 ` David Edmondson
  2019-11-13  9:37   ` William Casarin
  2019-11-13 17:34 ` Teemu Likonen
  1 sibling, 1 reply; 5+ messages in thread
From: David Edmondson @ 2019-11-13  9:35 UTC (permalink / raw)
  To: William Casarin, notmuch; +Cc: Teemu Likonen, Johan Parin, William Casarin

On Wednesday, 2019-11-13 at 00:00:04 -08, William Casarin wrote:

> This is an unbound function that is quite useful. It opens a selected
> thread in notmuch-tree from the current search query.

Seems fine to me. Not crazy about the binding, but it will suffice.

> Signed-off-by: William Casarin <jb55@jb55.com>
> ---
>  emacs/notmuch.el | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> index 773d1206..b5c361ca 100644
> --- a/emacs/notmuch.el
> +++ b/emacs/notmuch.el
> @@ -517,10 +517,13 @@ thread."
>  		      (concat "*" (truncate-string-to-width subject 30 nil nil t) "*"))
>        (message "End of search results."))))
>  
> -(defun notmuch-tree-from-search-current-query ()
> +(put 'notmuch-tree-from-search-current-query 'notmuch-prefix-doc
> +     "Show the selected thread with notmuch-tree")
> +(defun notmuch-tree-from-search-current-query (&optional search-thread)
>    "Call notmuch tree with the current query"
> -  (interactive)
> -  (notmuch-tree notmuch-search-query-string))
> +  (interactive "P")
> +  (if search-thread (notmuch-tree-from-search-thread)
> +    (notmuch-tree notmuch-search-query-string)))
>  
>  (defun notmuch-tree-from-search-thread ()
>    "Show the selected thread with notmuch-tree"
>
> base-commit: 7ad7cfbff232431377562271901ee00202bf0bd0
> -- 
> 2.23.0

dme.
-- 
But he said, leave me alone, I'm a family man.

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

* Re: [PATCH] emacs: bind C-u Z to notmuch-tree-from-search-thread
  2019-11-13  9:35 ` David Edmondson
@ 2019-11-13  9:37   ` William Casarin
  0 siblings, 0 replies; 5+ messages in thread
From: William Casarin @ 2019-11-13  9:37 UTC (permalink / raw)
  To: David Edmondson, notmuch; +Cc: Teemu Likonen, Johan Parin

David Edmondson <dme@dme.org> writes:

> On Wednesday, 2019-11-13 at 00:00:04 -08, William Casarin wrote:
>
>> This is an unbound function that is quite useful. It opens a selected
>> thread in notmuch-tree from the current search query.
>
> Seems fine to me. Not crazy about the binding, but it will suffice.

yeah I use this more than Z, so I would like a single-char binding. I
wasn't sure and was hoping someone else had a better idea.

Cheers,
Will

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

* Re: [PATCH] emacs: bind C-u Z to notmuch-tree-from-search-thread
  2019-11-13  8:00 [PATCH] emacs: bind C-u Z to notmuch-tree-from-search-thread William Casarin
  2019-11-13  9:35 ` David Edmondson
@ 2019-11-13 17:34 ` Teemu Likonen
  2019-11-13 17:48   ` William Casarin
  1 sibling, 1 reply; 5+ messages in thread
From: Teemu Likonen @ 2019-11-13 17:34 UTC (permalink / raw)
  To: William Casarin, notmuch; +Cc: Johan Parin, David Edmondson, William Casarin

[-- Attachment #1: Type: text/plain, Size: 606 bytes --]

William Casarin [2019-11-13T00:00:04-08] wrote:

> This is an unbound function that is quite useful. It opens a selected
> thread in notmuch-tree from the current search query.

I agree that it is good idea to bind notmuch-tree-from-search-thread
command and thus make it show in "C-h m" *Help* buffer. I prefer M-RET
because
  - it is quick to type
  - it feels like variant of RET (notmuch-search-show-thread).

-- 
///  OpenPGP key: 4E1055DC84E9DFF613D78557719D69D324539450
//  https://keys.openpgp.org/search?q=tlikonen@iki.fi
/  https://keybase.io/tlikonen  https://github.com/tlikonen

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 694 bytes --]

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

* Re: [PATCH] emacs: bind C-u Z to notmuch-tree-from-search-thread
  2019-11-13 17:34 ` Teemu Likonen
@ 2019-11-13 17:48   ` William Casarin
  0 siblings, 0 replies; 5+ messages in thread
From: William Casarin @ 2019-11-13 17:48 UTC (permalink / raw)
  To: Teemu Likonen, notmuch; +Cc: Johan Parin, David Edmondson

Teemu Likonen <tlikonen@iki.fi> writes:

> William Casarin [2019-11-13T00:00:04-08] wrote:
>
>> This is an unbound function that is quite useful. It opens a selected
>> thread in notmuch-tree from the current search query.
>
> I agree that it is good idea to bind notmuch-tree-from-search-thread
> command and thus make it show in "C-h m" *Help* buffer. I prefer M-RET
> because
>   - it is quick to type
>   - it feels like variant of RET (notmuch-search-show-thread).

I never thought of that but it I like it.

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

end of thread, other threads:[~2019-11-13 17:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-13  8:00 [PATCH] emacs: bind C-u Z to notmuch-tree-from-search-thread William Casarin
2019-11-13  9:35 ` David Edmondson
2019-11-13  9:37   ` William Casarin
2019-11-13 17:34 ` Teemu Likonen
2019-11-13 17:48   ` William Casarin

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).