From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/23623 Path: main.gmane.org!not-for-mail From: Shenghuo ZHU Newsgroups: gmane.emacs.gnus.general Subject: Re: mm-uu handles forwarded messages (patch: 89-zsh3+2) Date: 01 Jul 1999 00:55:03 -0400 Organization: U of Rochester Sender: owner-ding@hpc.uh.edu Message-ID: <2nso79m0k8.fsf_-_@tiger.jia.vnet> References: <2npv2eoekc.fsf@tiger.jia.vnet> <2npv2erx07.fsf_-_@tiger.jia.vnet> <199906301606.MAA18882@alderaan.gsfc.nasa.gov> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035161321 2990 80.91.224.250 (21 Oct 2002 00:48:41 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 00:48:41 +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 AAA27547 for ; Thu, 1 Jul 1999 00:58:54 -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 XAB01148; Wed, 30 Jun 1999 23:55:07 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 30 Jun 1999 23:55:44 -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 XAA06018 for ; Wed, 30 Jun 1999 23:55:32 -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 AAA27413 for ; Thu, 1 Jul 1999 00:54:32 -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 AAA06582 for ; Thu, 1 Jul 1999 00:54:23 -0400 (EDT) Original-Received: (from zsh@localhost) by heart.cs.rochester.edu (8.9.3/8.9.3) id AAA04220; Thu, 1 Jul 1999 00:55:04 -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 In-Reply-To: "Edward J. Sabol"'s message of "Wed, 30 Jun 1999 12:06:33 -0400 (EDT)" Original-Lines: 35 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:23623 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:23623 --=-=-= >>>>> "Edward" == Edward J Sabol writes: Edward> RMAIL uses "^------- Start of forwarded message -------$" for Edward> begin and "^------- End of forwarded message -------$" for the Edward> end marker. Could you add support for those as well Edward> (especially since RMAIL is part of Emacs)? Edward> Would this work? Edward> (defconst mm-uu-forward-begin-line "^-+ \\\(Start of f\\\|F\\\)orwarded message") Edward> or just Edward> (defconst mm-uu-forward-begin-line "^-+ \\\(Start of \\\)?Forwarded message") Thanks. Edward> if you're sure case-fold-search will always be non-nil. I've added it into functions. 1999-07-01 Shenghuo ZHU * mm-uu.el (mm-uu-forward-begin-line): New variable. (mm-uu-forward-end-line): New variable. (mm-uu-begin-line): Handle forwarded message. (mm-uu-identifier-alist): Ditto. (mm-uu-dissect): Ditto. --=-=-= Content-Type: application/x-patch Content-Disposition: attachment; filename=89-zsh3+2.diff Content-Transfer-Encoding: 8bit --- mm-uu.el 1999/06/29 17:01:48 1.1 +++ mm-uu.el 1999/07/01 04:50:24 @@ -1,13 +1,11 @@ ;;; mm-uu.el -- Return uu stuffs as mm handles -;; Copyright (c) 1998 by Shenghuo Zhu +;; Copyright (c) 1998,99 by Shenghuo Zhu ;; Author: Shenghuo Zhu -;; $Revision: 5.10 $ -;; Keywords: news postscript uudecode binhex shar +;; Keywords: postscript uudecode binhex shar forward + +;; This file is part of pgnus. -;; This file is not part of GNU Emacs, but the same permissions -;; apply. -;; ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) @@ -17,17 +15,23 @@ ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. -;; + ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Commentary: -;; + ;;; Code: +(require 'mail-parse) +(require 'message) +(require 'nnheader) +(require 'mm-decode) +(require 'mailcap) + (eval-and-compile (autoload 'binhex-decode-region "binhex") (autoload 'binhex-decode-region-external "binhex") @@ -59,14 +63,21 @@ (defconst mm-uu-shar-begin-line "^#! */bin/sh") (defconst mm-uu-shar-end-line "^exit 0") -(defvar mm-uu-begin-line +;;; Thanks to Edward J. Sabol and +;;; Peter von der Ah\'e +(defconst mm-uu-forward-begin-line "^-+ \\(Start of \\)?Forwarded message") +(defconst mm-uu-forward-end-line "^-+ End of forwarded message") + +(defconst mm-uu-begin-line (concat mm-uu-postscript-begin-line "\\|" mm-uu-uu-begin-line "\\|" mm-uu-binhex-begin-line "\\|" - mm-uu-shar-begin-line)) + mm-uu-shar-begin-line "\\|" + mm-uu-forward-begin-line)) -(defvar mm-uu-identifier-alist - '((?% . postscript) (?b . uu) (?: . binhex) (?# . shar))) +(defconst mm-uu-identifier-alist + '((?% . postscript) (?b . uu) (?: . binhex) (?# . shar) + (?- . forward))) (defvar mm-dissect-disposition "inline" "The default disposition of uu parts. @@ -77,7 +88,9 @@ (defun mm-uu-dissect () "Dissect the current buffer and return a list of uu handles." (let (ct ctl cte charset text-start start-char end-char - type file-name end-line result text-plain-type) + type file-name end-line result text-plain-type + start-char-1 end-char-1 + (case-fold-search t)) (save-excursion (save-restriction (mail-narrow-to-head) @@ -97,9 +110,9 @@ (if charset (list (cons 'charset charset))))) (while (re-search-forward mm-uu-begin-line nil t) - (beginning-of-line) - (setq start-char (point)) + (setq start-char (match-beginning 0)) (forward-line) ;; in case of failure + (setq start-char-1 (point)) (setq type (cdr (assq (aref (match-string 0) 0) mm-uu-identifier-alist))) (setq file-name @@ -112,6 +125,7 @@ (intern (concat "mm-uu-" (symbol-name type) "-end-line")))) (when (re-search-forward end-line nil t) + (setq end-char-1 (match-beginning 0)) (forward-line) (setq end-char (point)) (when (or (not (eq type 'binhex)) @@ -128,6 +142,9 @@ ((eq type 'postscript) (mm-make-handle (mm-uu-copy-to-buffer start-char end-char) '("application/postscript"))) + ((eq type 'forward) + (mm-make-handle (mm-uu-copy-to-buffer start-char-1 end-char-1) + '("message/rfc822"))) ((eq type 'uu) (mm-make-handle (mm-uu-copy-to-buffer start-char end-char) (list (or (and file-name @@ -172,7 +189,8 @@ (mail-narrow-to-head) (goto-char (point-max))) (forward-line) - (let (type end-line result) + (let (type end-line result + (case-fold-search t)) (while (and (not result) (re-search-forward mm-uu-begin-line nil t)) (forward-line) (setq type (cdr (assq (aref (match-string 0) 0) --=-=-= -- Shenghuo ZHU --=-=-=--