* [PATCH 1/3] notmuch.el: Add keybinding to toggle display of message body and headers.
@ 2009-12-01 6:13 Kan-Ru Chen
[not found] ` <1259648033-30653-2-git-send-email-kanru@kanru.info>
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Kan-Ru Chen @ 2009-12-01 6:13 UTC (permalink / raw)
To: notmuch
I really missed this feature. Added notmuch-show-toggle-current-body and
notmuch-show-toggle-current-header and bind them to 'b' and 'h'.
Signed-off-by: Kan-Ru Chen <kanru@kanru.info>
---
notmuch.el | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/notmuch.el b/notmuch.el
index 65473ba..2526020 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -62,7 +62,9 @@
; overlays-at to query and manipulate the current overlay.
(define-key map "a" 'notmuch-show-archive-thread)
(define-key map "A" 'notmuch-show-mark-read-then-archive-thread)
+ (define-key map "b" 'notmuch-show-toggle-current-body)
(define-key map "f" 'notmuch-show-forward-current)
+ (define-key map "h" 'notmuch-show-toggle-current-header)
(define-key map "m" 'message-mail)
(define-key map "n" 'notmuch-show-next-message)
(define-key map "N" 'notmuch-show-mark-read-then-next-open-message)
@@ -560,6 +562,26 @@ which this thread was originally shown."
(force-window-update)
(redisplay t))
+(defun notmuch-show-toggle-current-body ()
+ "Toggle the current message body."
+ (interactive)
+ (save-excursion
+ (notmuch-show-move-to-current-message-summary-line)
+ (unless (button-at (point))
+ (notmuch-show-next-button))
+ (push-button))
+ )
+
+(defun notmuch-show-toggle-current-header ()
+ (interactive)
+ (save-excursion
+ (notmuch-show-move-to-current-message-summary-line)
+ (next-line)
+ (unless (button-at (point))
+ (notmuch-show-next-button))
+ (push-button))
+ )
+
(define-button-type 'notmuch-button-invisibility-toggle-type 'action 'notmuch-toggle-invisible-action 'follow-link t)
(define-button-type 'notmuch-button-citation-toggle-type 'help-echo "mouse-1, RET: Show citation"
:supertype 'notmuch-button-invisibility-toggle-type)
--
1.6.5.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] notmuch.el: Use emacs built-in forward-button and backward-button
[not found] ` <1259648033-30653-2-git-send-email-kanru@kanru.info>
@ 2009-12-01 6:13 ` Kan-Ru Chen
2010-02-05 19:45 ` Carl Worth
0 siblings, 1 reply; 6+ messages in thread
From: Kan-Ru Chen @ 2009-12-01 6:13 UTC (permalink / raw)
To: notmuch
There are built-ins, so why not use them?
Signed-off-by: Kan-Ru Chen <kanru@kanru.info>
---
notmuch.el | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/notmuch.el b/notmuch.el
index 5b8513c..4d08c83 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -547,12 +547,12 @@ which this thread was originally shown."
(defun notmuch-show-next-button ()
"Advance point to the next button in the buffer."
(interactive)
- (goto-char (button-start (next-button (point)))))
+ (forward-button 1))
(defun notmuch-show-previous-button ()
"Move point back to the previous button in the buffer."
(interactive)
- (goto-char (button-start (previous-button (point)))))
+ (backward-button 1))
(defun notmuch-toggle-invisible-action (cite-button)
(let ((invis-spec (button-get button 'invisibility-spec)))
--
1.6.5.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] notmuch.el: Add collapse all and expand all to notmuch-show
2009-12-01 6:13 [PATCH 1/3] notmuch.el: Add keybinding to toggle display of message body and headers Kan-Ru Chen
[not found] ` <1259648033-30653-2-git-send-email-kanru@kanru.info>
@ 2009-12-01 6:17 ` Kan-Ru Chen
2010-02-05 19:45 ` Carl Worth
2010-02-05 19:32 ` [PATCH 1/3] notmuch.el: Add keybinding to toggle display of message body and headers Carl Worth
2 siblings, 1 reply; 6+ messages in thread
From: Kan-Ru Chen @ 2009-12-01 6:17 UTC (permalink / raw)
To: notmuch
These two functions behave like gmail's collapse all and expand all
commands. notmuch-show-collapse-all is bound to 'B' but
notmuch-show-expand-all has no keybindig because I thought it is not often
used.
Signed-off-by: Kan-Ru Chen <kanru@kanru.info>
---
notmuch.el | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/notmuch.el b/notmuch.el
index 2526020..5b8513c 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -63,6 +63,7 @@
(define-key map "a" 'notmuch-show-archive-thread)
(define-key map "A" 'notmuch-show-mark-read-then-archive-thread)
(define-key map "b" 'notmuch-show-toggle-current-body)
+ (define-key map "B" 'notmuch-show-collapse-all)
(define-key map "f" 'notmuch-show-forward-current)
(define-key map "h" 'notmuch-show-toggle-current-header)
(define-key map "m" 'message-mail)
@@ -582,6 +583,30 @@ which this thread was originally shown."
(push-button))
)
+(defun notmuch-show-collapse-all ()
+ (interactive)
+ (save-excursion
+ (beginning-of-buffer)
+ (while (not (notmuch-show-last-message-p))
+ (unless (button-at (point))
+ (notmuch-show-next-button))
+ (let ((invis-spec (button-get (button-at (point)) 'invisibility-spec)))
+ (add-to-invisibility-spec invis-spec))
+ (notmuch-show-next-open-message)
+ )))
+
+(defun notmuch-show-expand-all ()
+ (interactive)
+ (save-excursion
+ (beginning-of-buffer)
+ (while (not (notmuch-show-last-message-p))
+ (unless (button-at (point))
+ (notmuch-show-next-button))
+ (let ((invis-spec (button-get (button-at (point)) 'invisibility-spec)))
+ (remove-from-invisibility-spec invis-spec))
+ (notmuch-show-next-message)
+ )))
+
(define-button-type 'notmuch-button-invisibility-toggle-type 'action 'notmuch-toggle-invisible-action 'follow-link t)
(define-button-type 'notmuch-button-citation-toggle-type 'help-echo "mouse-1, RET: Show citation"
:supertype 'notmuch-button-invisibility-toggle-type)
--
1.6.5.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] notmuch.el: Add keybinding to toggle display of message body and headers.
2009-12-01 6:13 [PATCH 1/3] notmuch.el: Add keybinding to toggle display of message body and headers Kan-Ru Chen
[not found] ` <1259648033-30653-2-git-send-email-kanru@kanru.info>
2009-12-01 6:17 ` [PATCH 2/3] notmuch.el: Add collapse all and expand all to notmuch-show Kan-Ru Chen
@ 2010-02-05 19:32 ` Carl Worth
2 siblings, 0 replies; 6+ messages in thread
From: Carl Worth @ 2010-02-05 19:32 UTC (permalink / raw)
To: Kan-Ru Chen, notmuch
[-- Attachment #1: Type: text/plain, Size: 463 bytes --]
On Tue, 1 Dec 2009 14:13:51 +0800, Kan-Ru Chen <kanru@kanru.info> wrote:
> I really missed this feature. Added notmuch-show-toggle-current-body and
> notmuch-show-toggle-current-header and bind them to 'b' and 'h'.
Thanks! I pushed this out, (along with a fix to use forward-line instead
of next-line, and also adding the missing documentation for the
notmuch-show-toggle-current-header function).
-Carl
PS. Sorry I took so long on an obviously-useful patch!
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] notmuch.el: Add collapse all and expand all to notmuch-show
2009-12-01 6:17 ` [PATCH 2/3] notmuch.el: Add collapse all and expand all to notmuch-show Kan-Ru Chen
@ 2010-02-05 19:45 ` Carl Worth
0 siblings, 0 replies; 6+ messages in thread
From: Carl Worth @ 2010-02-05 19:45 UTC (permalink / raw)
To: Kan-Ru Chen, notmuch
[-- Attachment #1: Type: text/plain, Size: 1389 bytes --]
On Tue, 1 Dec 2009 14:17:32 +0800, Kan-Ru Chen <kanru@kanru.info> wrote:
> These two functions behave like gmail's collapse all and expand all
> commands. notmuch-show-collapse-all is bound to 'B' but
> notmuch-show-expand-all has no keybindig because I thought it is not often
> used.
I haven't applied this one for a few reasons:
1. I don't know what the functions are support to do.
The commit log says "behave like gmail" but I don't know what that
means personally. And the functions don't have any documentation
strings.
I assume that these functions are either showing or hiding all
message bodies in the current thread?
2. You provided a binding for collapse, but not expand. I don't like
functionality which lets a user hide a bunch of data, and then not be
able to get it back---that's really annoying if the user hits the key
accidentally.
Personally, I think I'd be much more likely to use expand before
collapse, (for example, to easily see the context when a new message
arrives in a thread that I'd previously read so comes up collapsed by
default).
Should we perhaps make something which temporarily makes all hidden
messages visible but then toggles back to the previous subset of some
show messages? Once again, I'm worried about providing trapdoor
interfaces where the user can't get back to the previous state easily.
-Carl
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] notmuch.el: Use emacs built-in forward-button and backward-button
2009-12-01 6:13 ` [PATCH 3/3] notmuch.el: Use emacs built-in forward-button and backward-button Kan-Ru Chen
@ 2010-02-05 19:45 ` Carl Worth
0 siblings, 0 replies; 6+ messages in thread
From: Carl Worth @ 2010-02-05 19:45 UTC (permalink / raw)
To: Kan-Ru Chen, notmuch
[-- Attachment #1: Type: text/plain, Size: 168 bytes --]
On Tue, 1 Dec 2009 14:13:53 +0800, Kan-Ru Chen <kanru@kanru.info> wrote:
> There are built-ins, so why not use them?
Naturally. Thanks again---this is pushed.
-Carl
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-02-05 19:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-01 6:13 [PATCH 1/3] notmuch.el: Add keybinding to toggle display of message body and headers Kan-Ru Chen
[not found] ` <1259648033-30653-2-git-send-email-kanru@kanru.info>
2009-12-01 6:13 ` [PATCH 3/3] notmuch.el: Use emacs built-in forward-button and backward-button Kan-Ru Chen
2010-02-05 19:45 ` Carl Worth
2009-12-01 6:17 ` [PATCH 2/3] notmuch.el: Add collapse all and expand all to notmuch-show Kan-Ru Chen
2010-02-05 19:45 ` Carl Worth
2010-02-05 19:32 ` [PATCH 1/3] notmuch.el: Add keybinding to toggle display of message body and headers Carl Worth
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).