summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Edmondson <dme@dme.org>2010-04-22 09:24:03 +0100
committerCarl Worth <cworth@cworth.org>2010-04-23 17:24:01 -0700
commite6bc99f31ffc644fde059ab6fb31b3289c13c8f1 (patch)
tree22210e75ba003f1e9bf4cb94e785e42dce33dbf3
parent8adaad690e19351f63c38c1c2e28d37608300612 (diff)
emacs/notmuch-show.el: Add `notmuch-show-toggle-all' bound to M-RET
`notmuch-show-toggle-all' changes the visibility all of the messages in the current thread. By default it makes all of the messages visible. With a prefix argument, it makes them all not visible.
-rw-r--r--emacs/notmuch-show.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 55bab45..95874bb 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -526,6 +526,7 @@ function is used. "
(define-key map "p" 'notmuch-show-previous-open-message)
(define-key map (kbd "DEL") 'notmuch-show-rewind)
(define-key map " " 'notmuch-show-advance-and-archive)
+ (define-key map (kbd "M-RET") 'notmuch-show-toggle-all)
(define-key map (kbd "RET") 'notmuch-show-toggle-message)
map)
"Keymap for \"notmuch show\" buffers.")
@@ -906,6 +907,18 @@ to stdout or stderr will appear in the *Messages* buffer."
(not (plist-get props :message-visible))))
(force-window-update))
+(defun notmuch-show-toggle-all ()
+ "Change the visibility all of the messages in the current
+thread. By default make all of the messages visible. With a
+prefix argument, make them all not visible."
+ (interactive)
+ (save-excursion
+ (goto-char (point-min))
+ (loop do (notmuch-show-message-visible (notmuch-show-get-message-properties)
+ (not current-prefix-arg))
+ until (not (notmuch-show-goto-message-next))))
+ (force-window-update))
+
(defun notmuch-show-next-button ()
"Advance point to the next button in the buffer."
(interactive)