From b1e14d1c88718a66f6a69ca935884f0080de6304 Mon Sep 17 00:00:00 2001 From: vitaly Date: Tue, 19 Jan 2010 13:34:09 +0000 Subject: [PATCH] Control visibility of MIME buttons in view mode via mime-view-buttons-visible custom --- ChangeLog | 5 +++++ mime-view.el | 15 ++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6780db4..f3f48e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-01-19 Vitaly Mayatskikh + * mime-view.el (toplevel): New defcustom: mime-view-buttons-visible + * mime-view.el (mime-display-entity): Use mime-view-buttons-visible + to control visibility of MIME buttons. + 2007-06-18 Daiki Ueno * mime-edit.el (turn-on-mime-edit): Remove redundant comments and diff --git a/mime-view.el b/mime-view.el index ecbde85..fb11744 100644 --- a/mime-view.el +++ b/mime-view.el @@ -77,6 +77,10 @@ buttom. Nil means don't scroll at all." :group 'mime-view :type '(repeat file)) +(defcustom mime-view-buttons-visible t + "Toggle visibility of MIME buttons." + :group 'mime-view + :type 'boolean) ;;; @ in raw-buffer (representation space) ;;; @@ -1091,9 +1095,10 @@ MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t. t means default." (setq situation (mime-find-entity-preview-situation entity default-situation))) (let ((button-is-invisible - (eq (cdr (or (assq '*entity-button situation) - (assq 'entity-button situation))) - 'invisible)) + (or mime-view-buttons-visible + (eq (cdr (or (assq '*entity-button situation) + (assq 'entity-button situation))) + 'invisible))) (header-is-visible (eq (cdr (or (assq '*header situation) (assq 'header situation))) @@ -1134,10 +1139,6 @@ MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t. t means default." (if (functionp body-presentation-method) (funcall body-presentation-method entity situation) (mime-display-text/plain entity situation))) - (when button-is-invisible - (goto-char (point-max)) - (mime-view-insert-entity-button entity) - ) (unless header-is-visible (goto-char (point-max)) (insert "\n")) -- 1.7.10.4