Gnus development mailing list
 help / color / mirror / Atom feed
* mm-inline-override-types
@ 1999-10-29 18:36 David S. Goldberg
  0 siblings, 0 replies; only message in thread
From: David S. Goldberg @ 1999-10-29 18:36 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 478 bytes --]

A week or so ago I posted patches adding support for specifying MIME
types that are contained in mm-inlined-types by virtue of regexp
(e.g. text/.* includes text/html) but the user prefers to have treated
as attachment.  Those patches were broken.  I did not do sufficient
testing.  The ones I attach here appear to be working as intended
now.  
-- 
Dave Goldberg
Post: The Mitre Corporation\MS B325\202 Burlington Rd.\Bedford, MA 01730
Phone: 781-271-3887
Email: dsg@mitre.org

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: ChangeLog.patch --]
[-- Type: text/x-patch, Size: 603 bytes --]

diff -u /afs/rcf/user/dsg/elisp/gnus/lisp/ChangeLog.0.97 /afs/rcf/user/dsg/elisp/gnus/lisp/ChangeLog
--- /afs/rcf/user/dsg/elisp/gnus/lisp/ChangeLog.0.97	Fri Oct 29 10:46:35 1999
+++ /afs/rcf/user/dsg/elisp/gnus/lisp/ChangeLog	Fri Oct 29 10:46:35 1999
@@ -1,3 +1,11 @@
+1999-10-20  David S. Goldberg  <dsg@mitre.org>
+
+	* mm-decode.el mm-inline-override-types: New variable
+
+	* mm-decode.el (mm-inline-override-p): New function
+
+	* mm-decode.el (mm-inlined-p): Use it
+
 Mon Sep 27 15:18:05 1999  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
 
 	* gnus.el: Pterodactyl Gnus v0.97 is released.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: texi.ChangeLog.patch --]
[-- Type: text/x-patch, Size: 521 bytes --]

diff -u /afs/rcf/user/dsg/elisp/gnus/pgnus/texi/ChangeLog.0.97 /afs/rcf/user/dsg/elisp/gnus/pgnus/texi/ChangeLog
--- /afs/rcf/user/dsg/elisp/gnus/pgnus/texi/ChangeLog.0.97	Fri Oct 29 14:03:16 1999
+++ /afs/rcf/user/dsg/elisp/gnus/pgnus/texi/ChangeLog	Fri Oct 29 14:03:16 1999
@@ -1,3 +1,7 @@
+1999-10-29  David S. Goldberg  <dsg@mitre.org>
+
+	* emacs-mime.texi (Customization): Document mm-inline-override-types
+
 1999-09-25 10:58:17  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 	* message.texi (Forwarding): Updated.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: gnus-art.el.patch --]
[-- Type: text/x-patch, Size: 879 bytes --]

diff -u /afs/rcf/user/dsg/elisp/gnus/lisp/gnus-art.el.0.97 /afs/rcf/user/dsg/elisp/gnus/lisp/gnus-art.el
--- /afs/rcf/user/dsg/elisp/gnus/lisp/gnus-art.el.0.97	Fri Oct 29 13:39:41 1999
+++ /afs/rcf/user/dsg/elisp/gnus/lisp/gnus-art.el	Fri Oct 29 13:39:41 1999
@@ -3129,10 +3129,11 @@
 	  (when (string-match (pop ignored) type)
 	    (throw 'ignored nil)))
 	(if (and (setq not-attachment
-		       (or (not (mm-handle-disposition handle))
-			   (equal (car (mm-handle-disposition handle))
-				  "inline")
-			   (mm-attachment-override-p handle)))
+		       (and (not (mm-inline-override-p handle))
+			    (or (not (mm-handle-disposition handle))
+				(equal (car (mm-handle-disposition handle))
+				       "inline")
+				(mm-attachment-override-p handle))))
 		 (mm-automatic-display-p handle)
 		 (or (mm-inlined-p handle)
 		     (mm-automatic-external-display-p type)))

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: mm-decode.el.patch --]
[-- Type: text/x-patch, Size: 1511 bytes --]

diff -u /afs/rcf/user/dsg/elisp/gnus/lisp/mm-decode.el.0.97 /afs/rcf/user/dsg/elisp/gnus/lisp/mm-decode.el
--- /afs/rcf/user/dsg/elisp/gnus/lisp/mm-decode.el.0.97	Fri Oct 29 10:51:27 1999
+++ /afs/rcf/user/dsg/elisp/gnus/lisp/mm-decode.el	Fri Oct 29 10:51:27 1999
@@ -142,6 +142,9 @@
 (defvar mm-attachment-override-types '("text/plain" "text/x-vcard")
   "Types that should have \"attachment\" ignored if they can be displayed inline.")
 
+(defvar mm-inline-override-types nil
+  "Types that should be treated as attachments even if they can be displayed inline.")
+
 (defvar mm-automatic-external-display nil
   "List of MIME type regexps that will be displayed externally automatically.")
 
@@ -476,7 +479,8 @@
 	(type (mm-handle-media-type handle))
 	method result)
     (while (setq method (pop methods))
-      (when (and (string-match method type)
+      (when (and (not (mm-inline-override-p handle))
+		 (string-match method type)
 		 (mm-inlinable-p handle))
 	(setq result t
 	      methods nil)))
@@ -491,6 +495,16 @@
       (while (setq ty (pop types))
 	(when (and (string-match ty type)
 		   (mm-inlinable-p handle))
+	  (throw 'found t))))))
+
+(defun mm-inline-override-p (handle)
+  "Say whether HANDLE should have inline behavior overridden."
+  (let ((types mm-inline-override-types)
+	(type (mm-handle-media-type handle))
+	ty)
+    (catch 'found
+      (while (setq ty (pop types))
+	(when (string-match ty type)
 	  (throw 'found t))))))
 
 (defun mm-automatic-external-display-p (type)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: emacs-mime.texi.patch --]
[-- Type: text/x-patch, Size: 956 bytes --]

diff -u /afs/rcf/user/dsg/elisp/gnus/pgnus/texi/emacs-mime.texi.0.97 /afs/rcf/user/dsg/elisp/gnus/pgnus/texi/emacs-mime.texi
--- /afs/rcf/user/dsg/elisp/gnus/pgnus/texi/emacs-mime.texi.0.97	Fri Oct 29 14:00:48 1999
+++ /afs/rcf/user/dsg/elisp/gnus/pgnus/texi/emacs-mime.texi	Fri Oct 29 14:00:48 1999
@@ -899,6 +899,14 @@
 makes the library display all inline images as inline, regardless of
 their size.
 
+@item mm-inline-override-p
+@code{mm-inlined-types} may include regular expressions, for example to
+specify that all @samp{text/.*} parts be displayed inline.  If a user
+prefers to have a type that matches such a regular expression be treated
+as an attachment, that can be accomplished by setting this variable to a
+list containing that type.  For example assuming @code{mm-inlined-types}
+includes @samp{text/.*}, then including @samp{text/html} in this
+variable will cause @samp{text/html} parts to be treated as attachments.
 
 @end table
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-10-29 18:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-10-29 18:36 mm-inline-override-types David S. Goldberg

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).