New feature: toggle visibility of mime buttons.master
authorVitaly Mayatskikh <v.mayatskih@gmail.com>
Wed, 1 Jul 2009 07:47:02 +0000 (1 09:47 +0200)
committerVitaly Mayatskikh <v.mayatskih@gmail.com>
Wed, 1 Jul 2009 07:47:02 +0000 (1 09:47 +0200)
This patch adds new customizable var: wl-default-mime-button-invisible and
keybinding to hide/unhide mime buttons.

Patch requires change in SEMI.

elmo/elmo-mime.el
wl/wl-summary.el
wl/wl-vars.el

index c9c1028..b3eec05 100644 (file)
@@ -81,7 +81,8 @@ use for keymap of representation buffer.")
                                              original-major-mode
                                              keymap)
   (let ((elmo-message-displaying t)
-       (default-mime-charset 'x-unknown))
+       (default-mime-charset 'x-unknown)
+       (default-mime-button-invisible wl-default-mime-button-invisible))
     (mime-display-message entity
                          preview-buffer
                          nil
index ac04708..7817579 100644 (file)
@@ -430,6 +430,7 @@ See also variable `wl-use-petname'."
   (define-key wl-summary-mode-map "\C-c\C-n" 'wl-summary-next-buffer)
   (define-key wl-summary-mode-map "H"    'wl-summary-toggle-all-header)
   (define-key wl-summary-mode-map "M"    'wl-summary-toggle-mime)
+  (define-key wl-summary-mode-map "\C-cm" 'wl-summary-toggle-mime-buttons)
   (define-key wl-summary-mode-map "B"    'wl-summary-burst)
   (define-key wl-summary-mode-map "Z"    'wl-status-update)
   (define-key wl-summary-mode-map "#"    'wl-summary-print-message)
@@ -5109,6 +5110,13 @@ If ARG is numeric number, decode message as following:
          (wl-message-header-narrowing-toggle)
          (and wpos (set-window-start mwin wpos)))))))
 
+(defun wl-summary-toggle-mime-buttons ()
+  "Toggle visibility of mime buttons."
+  (interactive)
+  (setq wl-default-mime-button-invisible (not wl-default-mime-button-invisible))
+  (wl-message-buffer-cache-clean-up)
+  (wl-summary-redisplay))
+
 (require 'product)
 (product-provide (provide 'wl-summary) (require 'wl-version))
 
index dea7a78..9e5e572 100644 (file)
@@ -3077,6 +3077,10 @@ a symbol `bitmap', `xbm' or `xpm' in order to force the image format."
 (defvar wl-plugged-port-indent 4)
 (defvar wl-plugged-queue-status-column 25)
 
+;; mime
+(defcustom wl-default-mime-button-invisible nil
+  "Hide mime buttons by default.")
+
 ;;;; Obsolete variables.
 
 ;; 2005-01-23