emacs: Remove the notmuch-show-toggle-body command (with "b" binding)

In the recent switch to a JSON-based emacs interface, RET now toggles
message visibility anywhere in the message, (rather than only on the
summary line). So we no longer need this separate "b" binding for this.

Additionally, the body toggle was implemented independently from RET,
so after hiding a message with "b" one could not make it visible with
RET. This confusing state is now no longer possible, (since the
:body-visible property is removed entirely).
This commit is contained in:
Carl Worth 2010-04-21 12:32:29 -07:00
parent e26d767897
commit b825204f0d

View file

@ -460,8 +460,6 @@ message at DEPTH in the current thread."
;; Headers are hidden by default. ;; Headers are hidden by default.
(notmuch-show-headers-visible msg nil) (notmuch-show-headers-visible msg nil)
;; Bodies are visible by default.
(notmuch-show-body-visible msg t)
;; Message visibility depends on whether it matched the search ;; Message visibility depends on whether it matched the search
;; criteria. ;; criteria.
@ -559,7 +557,6 @@ function is used. "
(define-key map "V" 'notmuch-show-view-raw-message) (define-key map "V" 'notmuch-show-view-raw-message)
(define-key map "v" 'notmuch-show-view-all-mime-parts) (define-key map "v" 'notmuch-show-view-all-mime-parts)
(define-key map "c" 'notmuch-show-stash-map) (define-key map "c" 'notmuch-show-stash-map)
(define-key map "b" 'notmuch-show-toggle-body)
(define-key map "h" 'notmuch-show-toggle-headers) (define-key map "h" 'notmuch-show-toggle-headers)
(define-key map "-" 'notmuch-show-remove-tag) (define-key map "-" 'notmuch-show-remove-tag)
(define-key map "+" 'notmuch-show-add-tag) (define-key map "+" 'notmuch-show-add-tag)
@ -678,13 +675,11 @@ All currently available key bindings:
(defun notmuch-show-message-visible (props visible-p) (defun notmuch-show-message-visible (props visible-p)
(if visible-p (if visible-p
;; If we're making the message visible then the visibility of ;; When making the message visible, the headers may or not be
;; the constituent elements depends on their own properties, not ;; visible. So we check that property separately.
;; that of the message as a whole. (let ((headers-visible (plist-get props :headers-visible)))
(let ((headers-visible (plist-get props :headers-visible))
(body-visible (plist-get props :body-visible)))
(notmuch-show-element-visible props headers-visible :headers-invis-spec) (notmuch-show-element-visible props headers-visible :headers-invis-spec)
(notmuch-show-element-visible props body-visible :body-invis-spec)) (notmuch-show-element-visible props t :body-invis-spec))
(notmuch-show-element-visible props nil :headers-invis-spec) (notmuch-show-element-visible props nil :headers-invis-spec)
(notmuch-show-element-visible props nil :body-invis-spec)) (notmuch-show-element-visible props nil :body-invis-spec))
@ -695,11 +690,6 @@ All currently available key bindings:
(notmuch-show-element-visible props visible-p :headers-invis-spec)) (notmuch-show-element-visible props visible-p :headers-invis-spec))
(notmuch-show-set-prop :headers-visible visible-p props)) (notmuch-show-set-prop :headers-visible visible-p props))
(defun notmuch-show-body-visible (props visible-p)
(if (plist-get props :message-visible)
(notmuch-show-element-visible props visible-p :body-invis-spec))
(notmuch-show-set-prop :body-visible visible-p))
;; Functions for setting and getting attributes of the current ;; Functions for setting and getting attributes of the current
;; message. ;; message.
@ -767,10 +757,6 @@ All currently available key bindings:
"Is the current message visible?" "Is the current message visible?"
(notmuch-show-get-prop :message-visible)) (notmuch-show-get-prop :message-visible))
(defun notmuch-show-body-visible-p ()
"Is the body of the current message visible?"
(notmuch-show-get-prop :body-visible))
(defun notmuch-show-headers-visible-p () (defun notmuch-show-headers-visible-p ()
"Are the headers of the current message visible?" "Are the headers of the current message visible?"
(notmuch-show-get-prop :headers-visible)) (notmuch-show-get-prop :headers-visible))
@ -947,15 +933,6 @@ to stdout or stderr will appear in the *Messages* buffer."
(not (plist-get props :headers-visible)))) (not (plist-get props :headers-visible))))
(force-window-update)) (force-window-update))
(defun notmuch-show-toggle-body ()
"Toggle the visibility of the current message body."
(interactive)
(let ((props (notmuch-show-get-message-properties)))
(notmuch-show-body-visible
props
(not (plist-get props :body-visible))))
(force-window-update))
(defun notmuch-show-toggle-message () (defun notmuch-show-toggle-message ()
"Toggle the visibility of the current message." "Toggle the visibility of the current message."
(interactive) (interactive)