]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: Remove the notmuch-show-toggle-body command (with "b" binding)
authorCarl Worth <cworth@cworth.org>
Wed, 21 Apr 2010 19:32:29 +0000 (12:32 -0700)
committerCarl Worth <cworth@cworth.org>
Wed, 21 Apr 2010 19:52:38 +0000 (12:52 -0700)
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

index c17261692bc30c03eef9f720a9c0f5fa48668813..6b63d17ce6c1f189119eaa9ef41fdbe9e1ff729c 100644 (file)
@@ -460,8 +460,6 @@ message at DEPTH in the current thread."
 
     ;; Headers are hidden by default.
     (notmuch-show-headers-visible msg nil)
 
     ;; 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.
 
     ;; 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 "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)
        (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
 
 (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 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))
 
     (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))
 
       (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.
 
 ;; 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))
 
   "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))
 (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))
 
      (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)
 (defun notmuch-show-toggle-message ()
   "Toggle the visibility of the current message."
   (interactive)