[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Couple of useful (?) patches



Patches revised. mime-view-buttons-visible allows to render mime
buttons as was previously (it has been changed by first attempt), but
Wl hides buttons in reply anyway.

Index: mime-view.el
===================================================================
RCS file: /cvs/root/semi/mime-view.el,v
retrieving revision 1.151.2.28
diff -p -u -w -r1.151.2.28 mime-view.el
--- mime-view.el	24 Oct 2010 10:39:22 -0000	1.151.2.28
+++ mime-view.el	10 Apr 2011 03:20:45 -0000
@@ -82,6 +82,13 @@ buttom. Nil means don't scroll at all."
   :group 'mime-view
   :type 'boolean)
 
+(defcustom mime-view-content-types-to-show '(application)
+  "Content types which have MIME buttons rendered."
+  :group 'mime-view
+  :type '(repeat sexp))
+
+(defvar mime-hide-buttons-in-reply nil)
+
 ;;; @ in raw-buffer (representation space)
 ;;;
 
@@ -1095,11 +1102,14 @@ MEDIA-TYPE must be (TYPE . SUBTYPE), TYP
     (or situation
 	(setq situation
 	      (mime-find-entity-preview-situation entity default-situation)))
-    (let ((button-is-invisible
-	   (or (not mime-view-buttons-visible)
-	       (eq (cdr (or (assq '*entity-button situation)
-			    (assq 'entity-button situation)))
-		   'invisible)))
+    (let* ((entity-button (cdr (or (assq '*entity-button situation)
+                                   (assq 'entity-button situation))))
+           (button-is-visible
+            (or mime-view-buttons-visible
+                (and entity-button
+                     (not (eq entity-button 'invisible)))
+                (member (cdr (assq 'type (mime-entity-content-type entity)))
+                        mime-view-content-types-to-show)))
 	  (header-is-visible
 	   (eq (cdr (or (assq '*header situation)
 			(assq 'header situation)))
@@ -1112,11 +1122,8 @@ MEDIA-TYPE must be (TYPE . SUBTYPE), TYP
       (set-buffer preview-buffer)
       (setq nb (point))
       (narrow-to-region nb nb)
-      (or button-is-invisible
-          ;; (if (mime-view-entity-button-visible-p entity)
-	  (mime-view-insert-entity-button entity)
-          ;;   )
-	  )
+      (when (and button-is-visible (not mime-hide-buttons-in-reply))
+	  (mime-view-insert-entity-button entity))
       (if header-is-visible
 	  (let ((header-presentation-method
 		 (or (cdr (assq 'header-presentation-method situation))

Index: wl/wl-summary.el
===================================================================
RCS file: /cvs/root/wanderlust/wl/wl-summary.el,v
retrieving revision 1.450
diff -p -u -w -r1.450 wl-summary.el
--- wl/wl-summary.el	18 Oct 2010 07:43:32 -0000	1.450
+++ wl/wl-summary.el	10 Apr 2011 03:21:04 -0000
@@ -4031,6 +4031,9 @@ Return t if message exists."
 
 (defun wl-summary-reply-with-citation (&optional arg)
   (interactive "P")
+  (let ((mime-hide-buttons-in-reply t))
+    (wl-message-buffer-cache-clean-up)
+    (wl-summary-redisplay))
   (when (wl-summary-reply arg t)
     (goto-char (point-max))
     (wl-draft-yank-original)

-- 
wbr, Vitaly