Gnus development mailing list
 help / color / mirror / Atom feed
* Disable mailcap support
@ 2003-09-28 16:11 Florian Weimer
  2003-09-28 22:56 ` Jesper Harder
  2003-09-29 19:35 ` Reiner Steib
  0 siblings, 2 replies; 14+ messages in thread
From: Florian Weimer @ 2003-09-28 16:11 UTC (permalink / raw)


After some discussion with RMS after he posted
<mailman.944.1061837187.29551.info-gnu@gnu.org>, we have come to the
conclusion that it might be a good idea to disable mailcap processing.

Reiner Steib kindly wrote the patch reproduced, which makes Gnus'
behavior more configurable.

I'd like to see 'mm-enable-external' disabled in the default
configuration, but my judgement in such matters is typically quite
drastic.  Comments?

--- mm-decode.el.~6.94.~	Thu Aug 28 11:06:58 2003
+++ mm-decode.el	Mon Sep 22 22:42:34 2003
@@ -151,6 +151,18 @@
   :type 'boolean
   :group 'mime-display)
 
+(defcustom mm-enable-external t
+  "Indicate if external MIME handlers should be used.
+
+If t, all defined external MIME handlers are used.  If nil, files are saved by
+`mailcap-save-binary-file'.  If it is the symbol `ask', you are prompted
+before the external MIME handler is invoked."
+  :version "21.4"
+  :type '(choice (const :tag "Always" t)
+		 (const :tag "Never" nil)
+		 (const :tag "Ask" ask))
+  :group 'mime-display)
+
 (defcustom mm-inline-media-tests
   '(("image/jpeg"
      mm-inline-image
@@ -619,7 +631,12 @@
     (if (mm-handle-displayed-p handle)
 	(mm-remove-part handle)
       (let* ((type (mm-handle-media-type handle))
-	     (method (mailcap-mime-info type)))
+	     (method (mailcap-mime-info type))
+	     (filename (or (mail-content-type-get
+			    (mm-handle-disposition handle) 'filename)
+			   (mail-content-type-get
+			    (mm-handle-type handle) 'name)
+			   "<file>")))
 	(if (and (mm-inlinable-p handle)
 		 (mm-inlined-p handle))
 	    (progn
@@ -634,8 +651,20 @@
 		  (forward-line 1)
 		  (mm-insert-inline handle (mm-get-part handle))
 		  'inline)
-	      (mm-display-external
-	       handle (or method 'mailcap-save-binary-file)))))))))
+	      (cond
+	       ((eq mm-enable-external 'ask)
+		(if (and method
+			 (y-or-n-p (concat
+				    "Display part using external program `"
+				    (format method filename) "'? ")))
+		    (mm-display-external handle method)
+		  (mm-display-external handle 'mailcap-save-binary-file)))
+	       (mm-enable-external
+		(mm-display-external
+		 handle (or method 'mailcap-save-binary-file)))
+	       (t
+		(mm-display-external
+		 handle 'mailcap-save-binary-file))))))))))
 
 (defun mm-display-external (handle method)
   "Display HANDLE using METHOD."



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2004-01-03 19:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-28 16:11 Disable mailcap support Florian Weimer
2003-09-28 22:56 ` Jesper Harder
2003-09-29 18:04   ` Florian Weimer
2003-09-29 21:47     ` Jesper Harder
2003-11-09 15:35       ` Florian Weimer
2004-01-03 19:28       ` Reiner Steib
2003-09-29 19:35 ` Reiner Steib
2003-09-29 21:27   ` Jesper Harder
2003-09-30 18:04     ` Reiner Steib
2003-09-30 23:37       ` Jesper Harder
2003-10-02 18:02         ` Reiner Steib
2003-10-02 22:25           ` Jesper Harder
2003-10-03 18:10             ` Reiner Steib
2003-10-17 17:17           ` Lars Magne Ingebrigtsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).