From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/23628 Path: main.gmane.org!not-for-mail From: Shenghuo ZHU Newsgroups: gmane.emacs.gnus.general Subject: Restore broken multipart headers (patch: 89-zsh5) Date: 01 Jul 1999 05:17:05 -0400 Organization: U of Rochester Sender: owner-ding@hpc.uh.edu Message-ID: <2nemisviem.fsf@tiger.jia.vnet> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035161325 3019 80.91.224.250 (21 Oct 2002 00:48:45 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 00:48:45 +0000 (UTC) Return-Path: Original-Received: from farabi.math.uh.edu (farabi.math.uh.edu [129.7.128.57]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id FAA03628 for ; Thu, 1 Jul 1999 05:17:23 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by farabi.math.uh.edu (8.9.1/8.9.1) with ESMTP id EAB01999; Thu, 1 Jul 1999 04:17:00 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 01 Jul 1999 04:17:33 -0500 (CDT) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id EAA07944 for ; Thu, 1 Jul 1999 04:17:21 -0500 (CDT) Original-Received: from cayuga.cs.rochester.edu (cayuga.cs.rochester.edu [192.5.53.209]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id FAA03618 for ; Thu, 1 Jul 1999 05:16:21 -0400 (EDT) Original-Received: from heart.cs.rochester.edu (heart.cs.rochester.edu [192.5.53.109]) by cayuga.cs.rochester.edu (8.9.3/Q) with ESMTP id FAA07678 for ; Thu, 1 Jul 1999 05:16:17 -0400 (EDT) Original-Received: (from zsh@localhost) by heart.cs.rochester.edu (8.9.3/8.9.3) id FAA12377; Thu, 1 Jul 1999 05:17:05 -0400 Original-To: Gnus Mailing List X-Attribution: ZSH X-Face: 'IF:e51ib'Qbl^(}l^&4-J`'P!@[4~O|&k#:@Gld#b/]oMq&`&FVY._3+b`mzp~Jeve~/#/ ERD!OTe<86UhyN=l`mrPY)M7_}`Ktt\K+58Z!hu7>qU,i.N7TotU[FYE(f1;}`g2xj!u*l`^&=Q!g{ *q|ddto|nkt"$r,K$[)"|6,elPH= GJ6Q Original-Lines: 15 User-Agent: Gnus/5.070089 (Pterodactyl Gnus v0.89) XEmacs/21.2 (Chiyoda) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:23628 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:23628 --=-=-= If you get a multipart message but the MIME headers are removed by some agent, this patch enables pgnus display it as original one by pressing 'W M r' or clicking menu 'Article/MIME/Broken multipart'. 1999-07-01 Shenghuo ZHU * gnus-art.el (article-restore-broken-multipart): New function. * gnus-sum.el: Add menu and key. --=-=-= Content-Type: application/x-patch Content-Disposition: attachment; filename=89-zsh5.diff Content-Transfer-Encoding: 8bit --- gnus-art.el 1999/07/01 08:44:50 1.1 +++ gnus-art.el 1999/07/01 09:02:06 @@ -2337,6 +2337,36 @@ (concat (gnus-newsgroup-directory-form newsgroup) "/news")) gnus-article-save-directory))) +(defun article-restore-broken-multipart nil + "Restore broken multipart." + (interactive) + (let (boundary pt ihandles buffer-read-only) + (with-current-buffer gnus-original-article-buffer + (article-goto-body) + (setq pt (point)) + (while (and (not boundary) + (re-search-forward "^--\\(.*[^ ]\\) *$" nil t)) + (setq boundary (match-string 1)) + (forward-line) + (unless (re-search-forward (concat "^--" (regexp-quote boundary) + "\\(--\\)? *$") nil t) + (setq boundary nil)))) + (when boundary + (article-goto-body) + (save-restriction + (narrow-to-region (point) (point-max)) + (delete-region (point) (point-max)) + (insert-buffer-substring + gnus-original-article-buffer pt) + (setq ihandles + (cons "multipart/mixed" + (mm-dissect-multipart + (list "multipart/mixed" + (cons 'boundary boundary))))) + (delete-region (point-min) (point-max))) + (gnus-display-mime ihandles) + (set (make-local-variable 'gnus-article-mime-handles) ihandles)))) + (eval-and-compile (mapcar (lambda (func) @@ -2391,6 +2421,7 @@ article-emphasize article-treat-dumbquotes article-normalize-headers + article-restore-broken-multipart (article-show-all . gnus-article-show-all-headers)))) ;;; --- gnus-sum.el 1999/07/01 08:47:45 1.2 +++ gnus-sum.el 1999/07/01 08:51:26 @@ -1518,6 +1518,7 @@ "w" gnus-article-decode-mime-words "c" gnus-article-decode-charset "v" gnus-mime-view-all-parts + "r" gnus-article-restore-broken-multipart "b" gnus-article-view-part) (gnus-define-keys (gnus-summary-wash-time-map "T" gnus-summary-wash-map) @@ -1637,6 +1638,7 @@ ["Words" gnus-article-decode-mime-words t] ["Charset" gnus-article-decode-charset t] ["QP" gnus-article-de-quoted-unreadable t] + ["Broken multipart" gnus-article-restore-broken-multipart t] ["View all" gnus-mime-view-all-parts t]) ("Date" ["Local" gnus-article-date-local t] --=-=-= -- Shenghuo --=-=-=--