* gnus-art.el (gnus-article-delete-text-of-type): Enable it to remove MIME
authorKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 16 Dec 2005 11:57:51 +0000 (11:57 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 16 Dec 2005 11:57:51 +0000 (11:57 +0000)
 buttons associated with multipart/alternative parts.
(gnus-mime-display-alternative): Tag buttons using `article-type' text property.

* gnus-msg.el (gnus-copy-article-buffer): Remove MIME buttons associated with
 multipart/alternative parts.

* gnus-art.el (gnus-signature-separator): Fix custom type.

* mm-decode.el (mm-inlined-types): Fix custom type.
(mm-keep-viewer-alive-types): Ditto.
(mm-automatic-display): Ditto.
(mm-attachment-override-types): Ditto.
(mm-inline-override-types): Ditto.
(mm-automatic-external-display): Ditto.

lisp/ChangeLog
lisp/gnus-art.el
lisp/gnus-msg.el
lisp/mm-decode.el

index 5f6803a..287c6c5 100644 (file)
@@ -1,3 +1,22 @@
+2005-12-16  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-article-delete-text-of-type): Enable it to
+       remove MIME buttons associated with multipart/alternative parts.
+       (gnus-mime-display-alternative): Tag buttons using `article-type'
+       text property.
+
+       * gnus-msg.el (gnus-copy-article-buffer): Remove MIME buttons
+       associated with multipart/alternative parts.
+
+       * gnus-art.el (gnus-signature-separator): Fix custom type.
+
+       * mm-decode.el (mm-inlined-types): Fix custom type.
+       (mm-keep-viewer-alive-types): Ditto.
+       (mm-automatic-display): Ditto.
+       (mm-attachment-override-types): Ditto.
+       (mm-inline-override-types): Ditto.
+       (mm-automatic-external-display): Ditto.
+
 2005-12-15  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * spam-report.el (spam-report-user-mail-address)
index 1a2b21c..c653f41 100644 (file)
@@ -229,7 +229,9 @@ only of boring text.  Boring text is controlled by
 This can also be a list of regexps.  In that case, it will be checked
 from head to tail looking for a separator.  Searches will be done from
 the end of the buffer."
-  :type '(repeat string)
+  :type '(choice :format "%{%t%}: %[Value Menu%]\n%v"
+                (regexp)
+                (repeat :tag "List of regexp" regexp))
   :group 'gnus-article-signature)
 
 (defcustom gnus-signature-limit nil
@@ -1675,10 +1677,24 @@ Initialized from `text-mode-syntax-table.")
   "Delete text of TYPE in the current buffer."
   (save-excursion
     (let ((b (point-min)))
-      (while (setq b (text-property-any b (point-max) 'article-type type))
-       (delete-region
-        b (or (text-property-not-all b (point-max) 'article-type type)
-              (point-max)))))))
+      (if (eq type 'multipart)
+         ;; Remove MIME buttons associated with multipart/alternative parts.
+         (progn
+           (goto-char b)
+           (while (if (get-text-property (point) 'gnus-part)
+                      (setq b (point))
+                    (when (setq b (next-single-property-change (point)
+                                                               'gnus-part))
+                      (goto-char b)
+                      t))
+             (end-of-line)
+             (skip-chars-forward "\n")
+             (when (eq (get-text-property b 'article-type) 'multipart)
+               (delete-region b (point)))))
+       (while (setq b (text-property-any b (point-max) 'article-type type))
+         (delete-region
+          b (or (text-property-not-all b (point-max) 'article-type type)
+                (point-max))))))))
 
 (defun gnus-article-delete-invisible-text ()
   "Delete all invisible text in the current buffer."
@@ -5103,7 +5119,7 @@ If displaying \"text/html\" is discouraged \(see
             ,gnus-mouse-face-prop ,gnus-article-mouse-face
             face ,gnus-article-button-face
             gnus-part ,id
-            gnus-data ,handle))
+            article-type multipart))
          (widget-convert-button 'link from (point)
                                 :action 'gnus-widget-press-button
                                 :button-keymap gnus-widget-button-keymap)
index 43ce979..3887942 100644 (file)
@@ -847,6 +847,7 @@ header line with the old Message-ID."
              (delete-region (point) (point-max))
              (insert yank-string))
            (gnus-article-delete-text-of-type 'annotation)
+           (gnus-article-delete-text-of-type 'multipart)
            (gnus-remove-text-with-property 'gnus-prev)
            (gnus-remove-text-with-property 'gnus-next)
            (gnus-remove-text-with-property 'gnus-decoration)
index 439dc75..a0b1aa0 100644 (file)
@@ -283,7 +283,7 @@ before the external MIME handler is invoked."
   "List of media types that are to be displayed inline.
 See also `mm-inline-media-tests', which says how to display a media
 type inline."
-  :type '(repeat string)
+  :type '(repeat regexp)
   :group 'mime-display)
 
 (defcustom mm-keep-viewer-alive-types
@@ -292,7 +292,7 @@ type inline."
   "List of media types for which the external viewer will not be killed
 when selecting a different article."
   :version "22.1"
-  :type '(repeat string)
+  :type '(repeat regexp)
   :group 'mime-display)
 
 (defcustom mm-automatic-display
@@ -304,7 +304,7 @@ when selecting a different article."
     "application/pkcs7-signature" "application/x-pkcs7-mime"
     "application/pkcs7-mime")
   "A list of MIME types to be displayed automatically."
-  :type '(repeat string)
+  :type '(repeat regexp)
   :group 'mime-display)
 
 (defcustom mm-attachment-override-types '("text/x-vcard"
@@ -313,17 +313,17 @@ when selecting a different article."
                                          "application/pkcs7-signature"
                                          "application/x-pkcs7-signature")
   "Types to have \"attachment\" ignored if they can be displayed inline."
-  :type '(repeat string)
+  :type '(repeat regexp)
   :group 'mime-display)
 
 (defcustom mm-inline-override-types nil
   "Types to be treated as attachments even if they can be displayed inline."
-  :type '(repeat string)
+  :type '(repeat regexp)
   :group 'mime-display)
 
 (defcustom mm-automatic-external-display nil
   "List of MIME type regexps that will be displayed externally automatically."
-  :type '(repeat string)
+  :type '(repeat regexp)
   :group 'mime-display)
 
 (defcustom mm-discouraged-alternatives nil