(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-body-read-visible)
- (define-key map "c" 'notmuch-show-toggle-citations-visible)
- (define-key map "h" 'notmuch-show-toggle-headers-visible)
(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)
(define-key map (kbd "C-p") 'notmuch-show-previous-line)
(define-key map "q" 'kill-this-buffer)
(define-key map "r" 'notmuch-show-reply)
- (define-key map "s" 'notmuch-show-toggle-signatures-visible)
(define-key map "v" 'notmuch-show-view-all-mime-parts)
(define-key map "w" 'notmuch-show-view-raw-message)
(define-key map "x" 'kill-this-buffer)
(define-key map " " 'notmuch-show-advance-marking-read-and-archiving)
(define-key map "|" 'notmuch-show-pipe-message)
(define-key map "?" 'describe-mode)
+ (define-key map (kbd "TAB") 'notmuch-show-next-button)
+ (define-key map (kbd "M-TAB") 'notmuch-show-previous-button)
map)
"Keymap for \"notmuch show\" buffers.")
(fset 'notmuch-show-mode-map notmuch-show-mode-map)
(if last
(notmuch-show-archive-thread))))))
+(defun notmuch-show-next-button ()
+ "Advance point to the next button in the buffer."
+ (interactive)
+ (goto-char (button-start (next-button (point)))))
+
+(defun notmuch-show-previous-button ()
+ "Move point back to the previous button in the buffer."
+ (interactive)
+ (goto-char (button-start (previous-button (point)))))
+
(defun notmuch-toggle-invisible-action (cite-button)
(let ((invis-spec (button-get button 'invisibility-spec)))
(if (invisible-p invis-spec)
(end-of-line)
; Inverse video for subject
(overlay-put (make-overlay beg (point)) 'face '(:inverse-video t))
- (forward-line 2)
+ (forward-line 1)
+ (end-of-line)
(let ((beg-hidden (point-marker)))
(re-search-forward notmuch-show-header-end-regexp)
(beginning-of-line)
(forward-line)
)
(indent-rigidly beg end depth)
- (overlay-put (make-overlay beg-hidden end)
- 'invisible 'notmuch-show-header)
+ (let ((invis-spec (make-symbol "notmuch-show-header")))
+ (add-to-invisibility-spec (cons invis-spec t))
+ (overlay-put (make-overlay beg-hidden end)
+ 'invisible invis-spec)
+ (goto-char beg)
+ (forward-line)
+ (let ((header-button (make-button (line-beginning-position) (line-end-position))))
+ (button-put header-button 'invisibility-spec (cons invis-spec t))
+ (button-put header-button 'action 'notmuch-toggle-invisible-action)
+ (button-put header-button 'follow-link t)
+ (button-put header-button 'help-echo
+ "mouse-1, RET: Show headers")
+ ))
(goto-char end)
(insert "\n")
(set-marker beg nil)
(notmuch-show-markup-message)))
(notmuch-show-hide-markers))
-(defun notmuch-show-toggle-citations-visible ()
- "Toggle visibility of citations"
- (interactive)
- (if notmuch-show-citations-visible
- (add-to-invisibility-spec 'notmuch-show-citation)
- (remove-from-invisibility-spec 'notmuch-show-citation))
- (set 'notmuch-show-citations-visible (not notmuch-show-citations-visible))
- ; Need to force the redisplay for some reason
- (force-window-update)
- (redisplay t))
-
-(defun notmuch-show-toggle-signatures-visible ()
- "Toggle visibility of signatures"
- (interactive)
- (if notmuch-show-signatures-visible
- (add-to-invisibility-spec 'notmuch-show-signature)
- (remove-from-invisibility-spec 'notmuch-show-signature))
- (set 'notmuch-show-signatures-visible (not notmuch-show-signatures-visible))
- ; Need to force the redisplay for some reason
- (force-window-update)
- (redisplay t))
-
-(defun notmuch-show-toggle-headers-visible ()
- "Toggle visibility of header fields"
- (interactive)
- (if notmuch-show-headers-visible
- (add-to-invisibility-spec 'notmuch-show-header)
- (remove-from-invisibility-spec 'notmuch-show-header))
- (set 'notmuch-show-headers-visible (not notmuch-show-headers-visible))
- ; Need to force the redisplay for some reason
- (force-window-update)
- (redisplay t))
-
(defun notmuch-show-toggle-body-read-visible ()
"Toggle visibility of message bodies of read messages"
(interactive)