From b825204f0df565d06d47f2323b438bac110a8c76 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 21 Apr 2010 12:32:29 -0700 Subject: [PATCH] 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). --- emacs/notmuch-show.el | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index c1726169..6b63d17c 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -460,8 +460,6 @@ message at DEPTH in the current thread." ;; Headers are hidden by default. (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 ;; criteria. @@ -559,7 +557,6 @@ function is used. " (define-key map "V" 'notmuch-show-view-raw-message) (define-key map "v" 'notmuch-show-view-all-mime-parts) (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 "-" 'notmuch-show-remove-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) (if visible-p - ;; If we're making the message visible then the visibility of - ;; the constituent elements depends on their own properties, not - ;; that of the message as a whole. - (let ((headers-visible (plist-get props :headers-visible)) - (body-visible (plist-get props :body-visible))) + ;; When making the message visible, the headers may or not be + ;; visible. So we check that property separately. + (let ((headers-visible (plist-get props :headers-visible))) (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 :body-invis-spec)) @@ -695,11 +690,6 @@ All currently available key bindings: (notmuch-show-element-visible props visible-p :headers-invis-spec)) (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 ;; message. @@ -767,10 +757,6 @@ All currently available key bindings: "Is the current 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 () "Are the headers of the current message 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)))) (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 () "Toggle the visibility of the current message." (interactive)