* [PATCH] emacs: add show view bindings to move to previous/next thread
@ 2013-03-01 18:03 Jani Nikula
0 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2013-03-01 18:03 UTC (permalink / raw)
To: notmuch
We have most of the plumbing in place, add the bindings M-n and M-p.
---
emacs/notmuch-show.el | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index acaef8e..4f2e8e0 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -40,6 +40,7 @@
(declare-function notmuch-call-notmuch-process "notmuch" (&rest args))
(declare-function notmuch-fontify-headers "notmuch" nil)
(declare-function notmuch-search-next-thread "notmuch" nil)
+(declare-function notmuch-search-previous-thread "notmuch" nil)
(declare-function notmuch-search-show-thread "notmuch" nil)
(defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")
@@ -1270,6 +1271,8 @@ reset based on the original query."
(define-key map "P" 'notmuch-show-previous-message)
(define-key map "n" 'notmuch-show-next-open-message)
(define-key map "p" 'notmuch-show-previous-open-message)
+ (define-key map (kbd "M-n") 'notmuch-show-next-thread-show)
+ (define-key map (kbd "M-p") 'notmuch-show-previous-thread-show)
(define-key map (kbd "DEL") 'notmuch-show-rewind)
(define-key map " " 'notmuch-show-advance-and-archive)
(define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all)
@@ -1842,6 +1845,27 @@ argument, hide all of the messages."
(if show-next
(notmuch-search-show-thread)))))
+(defun notmuch-show-previous-thread (&optional show-previous)
+ "Move to the next item in the search results, if any."
+ (interactive "P")
+ (let ((parent-buffer notmuch-show-parent-buffer))
+ (notmuch-kill-this-buffer)
+ (when (buffer-live-p parent-buffer)
+ (switch-to-buffer parent-buffer)
+ (notmuch-search-previous-thread)
+ (if show-previous
+ (notmuch-search-show-thread)))))
+
+(defun notmuch-show-next-thread-show ()
+ "Show the next thread in the search results, if any."
+ (interactive)
+ (notmuch-show-next-thread t))
+
+(defun notmuch-show-previous-thread-show ()
+ "Show the previous thread in the search results, if any."
+ (interactive)
+ (notmuch-show-previous-thread t))
+
(defun notmuch-show-archive-thread (&optional unarchive)
"Archive each message in thread.
--
1.7.10.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 1/2] emacs: add show view bindings to move to previous/next thread
@ 2013-05-25 12:14 Jani Nikula
2013-05-25 12:14 ` [PATCH 2/2] TODO: keybindings for next/previous thread done Jani Nikula
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Jani Nikula @ 2013-05-25 12:14 UTC (permalink / raw)
To: notmuch; +Cc: Tomi Ollila
We have most of the plumbing in place, add the bindings M-n and M-p.
---
v2: reduce duplication by adding PREVIOUS argument to
notmuch-show-next-thread instead of adding a separate function for
moving to previous thread (Mark)
---
emacs/notmuch-show.el | 28 ++++++++++++++++++++++++----
1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index d56154e..a903395 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -39,6 +39,7 @@
(declare-function notmuch-call-notmuch-process "notmuch" (&rest args))
(declare-function notmuch-search-next-thread "notmuch" nil)
+(declare-function notmuch-search-previous-thread "notmuch" nil)
(declare-function notmuch-search-show-thread "notmuch" nil)
(defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")
@@ -1273,6 +1274,8 @@ reset based on the original query."
(define-key map "P" 'notmuch-show-previous-message)
(define-key map "n" 'notmuch-show-next-open-message)
(define-key map "p" 'notmuch-show-previous-open-message)
+ (define-key map (kbd "M-n") 'notmuch-show-next-thread-show)
+ (define-key map (kbd "M-p") 'notmuch-show-previous-thread-show)
(define-key map (kbd "DEL") 'notmuch-show-rewind)
(define-key map " " 'notmuch-show-advance-and-archive)
(define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all)
@@ -1834,17 +1837,34 @@ argument, hide all of the messages."
(interactive)
(backward-button 1))
-(defun notmuch-show-next-thread (&optional show-next)
- "Move to the next item in the search results, if any."
+(defun notmuch-show-next-thread (&optional show previous)
+ "Move to the next item in the search results, if any.
+
+If SHOW is non-nil, open the next item in a show
+buffer. Otherwise just highlight the next item in the search
+buffer. If PREVIOUS is non-nil, move to the previous item in the
+search results instead."
(interactive "P")
(let ((parent-buffer notmuch-show-parent-buffer))
(notmuch-kill-this-buffer)
(when (buffer-live-p parent-buffer)
(switch-to-buffer parent-buffer)
- (notmuch-search-next-thread)
- (if show-next
+ (if previous
+ (notmuch-search-previous-thread)
+ (notmuch-search-next-thread))
+ (if show
(notmuch-search-show-thread)))))
+(defun notmuch-show-next-thread-show ()
+ "Show the next thread in the search results, if any."
+ (interactive)
+ (notmuch-show-next-thread t))
+
+(defun notmuch-show-previous-thread-show ()
+ "Show the previous thread in the search results, if any."
+ (interactive)
+ (notmuch-show-next-thread t t))
+
(defun notmuch-show-archive-thread (&optional unarchive)
"Archive each message in thread.
--
1.7.10.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/2] TODO: keybindings for next/previous thread done
2013-05-25 12:14 [PATCH 1/2] emacs: add show view bindings to move to previous/next thread Jani Nikula
@ 2013-05-25 12:14 ` Jani Nikula
2013-06-01 1:05 ` David Bremner
2013-05-25 13:39 ` [PATCH 1/2] emacs: add show view bindings to move to previous/next thread Mark Walters
2013-05-25 21:13 ` [PATCH] " Mark Walters
2 siblings, 1 reply; 8+ messages in thread
From: Jani Nikula @ 2013-05-25 12:14 UTC (permalink / raw)
To: notmuch; +Cc: Tomi Ollila
---
devel/TODO | 2 --
1 file changed, 2 deletions(-)
diff --git a/devel/TODO b/devel/TODO
index f63385d..844555e 100644
--- a/devel/TODO
+++ b/devel/TODO
@@ -34,8 +34,6 @@ current message/thread and make searches not return deleted messages
by default, (unless the user asks explicitly for deleted messages in
the search query).
-Add keybindings for next/previous thread.
-
Add support to "mute" a thread (add a "muted" tag and then don't
display threads in searches by default where any message of the thread
has the "muted" tag).
--
1.7.10.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] emacs: add show view bindings to move to previous/next thread
2013-05-25 12:14 [PATCH 1/2] emacs: add show view bindings to move to previous/next thread Jani Nikula
2013-05-25 12:14 ` [PATCH 2/2] TODO: keybindings for next/previous thread done Jani Nikula
@ 2013-05-25 13:39 ` Mark Walters
2013-05-25 18:08 ` Jani Nikula
2013-05-25 21:13 ` [PATCH] " Mark Walters
2 siblings, 1 reply; 8+ messages in thread
From: Mark Walters @ 2013-05-25 13:39 UTC (permalink / raw)
To: Jani Nikula, notmuch; +Cc: Tomi Ollila
Hi
> We have most of the plumbing in place, add the bindings M-n and M-p.
>
> ---
>
> v2: reduce duplication by adding PREVIOUS argument to
> notmuch-show-next-thread instead of adding a separate function for
> moving to previous thread (Mark)
> ---
> emacs/notmuch-show.el | 28 ++++++++++++++++++++++++----
> 1 file changed, 24 insertions(+), 4 deletions(-)
>
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index d56154e..a903395 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -39,6 +39,7 @@
>
> (declare-function notmuch-call-notmuch-process "notmuch" (&rest args))
> (declare-function notmuch-search-next-thread "notmuch" nil)
> +(declare-function notmuch-search-previous-thread "notmuch" nil)
> (declare-function notmuch-search-show-thread "notmuch" nil)
>
> (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")
> @@ -1273,6 +1274,8 @@ reset based on the original query."
> (define-key map "P" 'notmuch-show-previous-message)
> (define-key map "n" 'notmuch-show-next-open-message)
> (define-key map "p" 'notmuch-show-previous-open-message)
> + (define-key map (kbd "M-n") 'notmuch-show-next-thread-show)
> + (define-key map (kbd "M-p") 'notmuch-show-previous-thread-show)
> (define-key map (kbd "DEL") 'notmuch-show-rewind)
> (define-key map " " 'notmuch-show-advance-and-archive)
> (define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all)
> @@ -1834,17 +1837,34 @@ argument, hide all of the messages."
> (interactive)
> (backward-button 1))
>
> -(defun notmuch-show-next-thread (&optional show-next)
> - "Move to the next item in the search results, if any."
> +(defun notmuch-show-next-thread (&optional show previous)
> + "Move to the next item in the search results, if any.
> +
> +If SHOW is non-nil, open the next item in a show
> +buffer. Otherwise just highlight the next item in the search
> +buffer. If PREVIOUS is non-nil, move to the previous item in the
> +search results instead."
> (interactive "P")
> (let ((parent-buffer notmuch-show-parent-buffer))
> (notmuch-kill-this-buffer)
> (when (buffer-live-p parent-buffer)
> (switch-to-buffer parent-buffer)
> - (notmuch-search-next-thread)
> - (if show-next
> + (if previous
> + (notmuch-search-previous-thread)
> + (notmuch-search-next-thread))
> + (if show
> (notmuch-search-show-thread)))))
Did you want this to not exit back to the search results if you do M-p
on the first result? I attach a version below that does exit back (so
M-p and M-n behave the same.
Best wishes
Mark
From 22f03457a4c1884d35cf3de32f55977b980b7960 Mon Sep 17 00:00:00 2001
From: Jani Nikula <jani@nikula.org>
Date: Sat, 25 May 2013 15:14:25 +0300
Subject: [PATCH 1/2] emacs: add show view bindings to move to previous/next
thread
We have most of the plumbing in place, add the bindings M-n and M-p.
---
emacs/notmuch-show.el | 30 +++++++++++++++++++++++++-----
1 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index d56154e..2b33007 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -39,6 +39,7 @@
(declare-function notmuch-call-notmuch-process "notmuch" (&rest args))
(declare-function notmuch-search-next-thread "notmuch" nil)
+(declare-function notmuch-search-previous-thread "notmuch" nil)
(declare-function notmuch-search-show-thread "notmuch" nil)
(defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")
@@ -1273,6 +1274,8 @@ reset based on the original query."
(define-key map "P" 'notmuch-show-previous-message)
(define-key map "n" 'notmuch-show-next-open-message)
(define-key map "p" 'notmuch-show-previous-open-message)
+ (define-key map (kbd "M-n") 'notmuch-show-next-thread-show)
+ (define-key map (kbd "M-p") 'notmuch-show-previous-thread-show)
(define-key map (kbd "DEL") 'notmuch-show-rewind)
(define-key map " " 'notmuch-show-advance-and-archive)
(define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all)
@@ -1834,16 +1837,33 @@ argument, hide all of the messages."
(interactive)
(backward-button 1))
-(defun notmuch-show-next-thread (&optional show-next)
- "Move to the next item in the search results, if any."
+(defun notmuch-show-next-thread (&optional show previous)
+ "Move to the next item in the search results, if any.
+
+If SHOW is non-nil, open the next item in a show
+buffer. Otherwise just highlight the next item in the search
+buffer. If PREVIOUS is non-nil, move to the previous item in the
+search results instead."
(interactive "P")
(let ((parent-buffer notmuch-show-parent-buffer))
(notmuch-kill-this-buffer)
(when (buffer-live-p parent-buffer)
(switch-to-buffer parent-buffer)
- (notmuch-search-next-thread)
- (if show-next
- (notmuch-search-show-thread)))))
+ (and (if previous
+ (notmuch-search-previous-thread)
+ (notmuch-search-next-thread))
+ show
+ (notmuch-search-show-thread)))))
+
+(defun notmuch-show-next-thread-show ()
+ "Show the next thread in the search results, if any."
+ (interactive)
+ (notmuch-show-next-thread t))
+
+(defun notmuch-show-previous-thread-show ()
+ "Show the previous thread in the search results, if any."
+ (interactive)
+ (notmuch-show-next-thread t t))
(defun notmuch-show-archive-thread (&optional unarchive)
"Archive each message in thread.
--
1.7.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] emacs: add show view bindings to move to previous/next thread
2013-05-25 13:39 ` [PATCH 1/2] emacs: add show view bindings to move to previous/next thread Mark Walters
@ 2013-05-25 18:08 ` Jani Nikula
0 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2013-05-25 18:08 UTC (permalink / raw)
To: Mark Walters, notmuch; +Cc: Tomi Ollila
On Sat, 25 May 2013, Mark Walters <markwalters1009@gmail.com> wrote:
> Did you want this to not exit back to the search results if you do M-p
> on the first result? I attach a version below that does exit back (so
> M-p and M-n behave the same.
Oh, that was just pure fail from my part. Sorry about that, Mark, and
thanks so much for fixing it. Your amended version is better.
Thanks,
Jani.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] emacs: add show view bindings to move to previous/next thread
2013-05-25 12:14 [PATCH 1/2] emacs: add show view bindings to move to previous/next thread Jani Nikula
2013-05-25 12:14 ` [PATCH 2/2] TODO: keybindings for next/previous thread done Jani Nikula
2013-05-25 13:39 ` [PATCH 1/2] emacs: add show view bindings to move to previous/next thread Mark Walters
@ 2013-05-25 21:13 ` Mark Walters
2013-05-26 23:36 ` David Bremner
2 siblings, 1 reply; 8+ messages in thread
From: Mark Walters @ 2013-05-25 21:13 UTC (permalink / raw)
To: notmuch
From: Jani Nikula <jani@nikula.org>
We have most of the plumbing in place, add the bindings M-n and M-p.
---
emacs/notmuch-show.el | 30 +++++++++++++++++++++++++-----
1 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index d56154e..2b33007 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -39,6 +39,7 @@
(declare-function notmuch-call-notmuch-process "notmuch" (&rest args))
(declare-function notmuch-search-next-thread "notmuch" nil)
+(declare-function notmuch-search-previous-thread "notmuch" nil)
(declare-function notmuch-search-show-thread "notmuch" nil)
(defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")
@@ -1273,6 +1274,8 @@ reset based on the original query."
(define-key map "P" 'notmuch-show-previous-message)
(define-key map "n" 'notmuch-show-next-open-message)
(define-key map "p" 'notmuch-show-previous-open-message)
+ (define-key map (kbd "M-n") 'notmuch-show-next-thread-show)
+ (define-key map (kbd "M-p") 'notmuch-show-previous-thread-show)
(define-key map (kbd "DEL") 'notmuch-show-rewind)
(define-key map " " 'notmuch-show-advance-and-archive)
(define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all)
@@ -1834,16 +1837,33 @@ argument, hide all of the messages."
(interactive)
(backward-button 1))
-(defun notmuch-show-next-thread (&optional show-next)
- "Move to the next item in the search results, if any."
+(defun notmuch-show-next-thread (&optional show previous)
+ "Move to the next item in the search results, if any.
+
+If SHOW is non-nil, open the next item in a show
+buffer. Otherwise just highlight the next item in the search
+buffer. If PREVIOUS is non-nil, move to the previous item in the
+search results instead."
(interactive "P")
(let ((parent-buffer notmuch-show-parent-buffer))
(notmuch-kill-this-buffer)
(when (buffer-live-p parent-buffer)
(switch-to-buffer parent-buffer)
- (notmuch-search-next-thread)
- (if show-next
- (notmuch-search-show-thread)))))
+ (and (if previous
+ (notmuch-search-previous-thread)
+ (notmuch-search-next-thread))
+ show
+ (notmuch-search-show-thread)))))
+
+(defun notmuch-show-next-thread-show ()
+ "Show the next thread in the search results, if any."
+ (interactive)
+ (notmuch-show-next-thread t))
+
+(defun notmuch-show-previous-thread-show ()
+ "Show the previous thread in the search results, if any."
+ (interactive)
+ (notmuch-show-next-thread t t))
(defun notmuch-show-archive-thread (&optional unarchive)
"Archive each message in thread.
--
1.7.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] emacs: add show view bindings to move to previous/next thread
2013-05-25 21:13 ` [PATCH] " Mark Walters
@ 2013-05-26 23:36 ` David Bremner
0 siblings, 0 replies; 8+ messages in thread
From: David Bremner @ 2013-05-26 23:36 UTC (permalink / raw)
To: Mark Walters, notmuch
Mark Walters <markwalters1009@gmail.com> writes:
> From: Jani Nikula <jani@nikula.org>
>
> We have most of the plumbing in place, add the bindings M-n and M-p.
pushed,
d
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] TODO: keybindings for next/previous thread done
2013-05-25 12:14 ` [PATCH 2/2] TODO: keybindings for next/previous thread done Jani Nikula
@ 2013-06-01 1:05 ` David Bremner
0 siblings, 0 replies; 8+ messages in thread
From: David Bremner @ 2013-06-01 1:05 UTC (permalink / raw)
To: Jani Nikula, notmuch; +Cc: Tomi Ollila
Jani Nikula <jani@nikula.org> writes:
> ---
> devel/TODO | 2 --
> 1 file changed, 2 deletions(-)
pushed,
d
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-06-01 1:06 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-25 12:14 [PATCH 1/2] emacs: add show view bindings to move to previous/next thread Jani Nikula
2013-05-25 12:14 ` [PATCH 2/2] TODO: keybindings for next/previous thread done Jani Nikula
2013-06-01 1:05 ` David Bremner
2013-05-25 13:39 ` [PATCH 1/2] emacs: add show view bindings to move to previous/next thread Mark Walters
2013-05-25 18:08 ` Jani Nikula
2013-05-25 21:13 ` [PATCH] " Mark Walters
2013-05-26 23:36 ` David Bremner
-- strict thread matches above, loose matches on Subject: below --
2013-03-01 18:03 Jani Nikula
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).