Newsgroups: fj.editor.emacs,fj.mail
Path: galaxy.trc.rwcp.or.jp!jaist-news!morioka
From: morioka@jaist.ac.jp (=?ISO-2022-JP?B?GyRCPGkyLBsoQiAbJEJDTkknGyhC?=
 (MORIOKA Tomohiko))
Subject: gnus-mime.el version 1.3
Content-Type: multipart/mixed; boundary="Multipart Sun Nov 21 16:05:19 1993"
Message-ID: <MORIOKA.93Nov21160519@is15e0s03.jaist.ac.jp>
Sender: news@jaist.ac.jp (News System Administrator)
Content-Transfer-Encoding: 7bit
Organization: Japan Advanced Institute of Science and Technology, Ishikawa,
	Japan
Mime-Version: 1.0
Date: Sun, 21 Nov 1993 07:05:19 GMT
Lines: 224
Xref: galaxy.trc.rwcp.or.jp fj.editor.emacs:4184 fj.mail:1449
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.mail&nb=1449&hd=a
X-reformat-date: Mon, 18 Oct 2004 15:18:22 +0900
X-reformat-comment: Tabs were expanded into 4 column tabstops by the Galaxy's archiver. See http://katsu.watanabe.name/ancientfj/galaxy-format.html for more info.

--Multipart Sun Nov 21 16:05:19 1993
Content-Type: text/plain; charset=ISO-2022-JP

  gnus-mime.el $B$O(B tiny-mime patch for GNUS $B$N8e7Q$G$9!#(Bgnus-mime.el $B$O(B
tiny-mime patch $B$KHf$Y$F<!$N$h$&$JFCD'$r;}$C$F$$$^$9!#(B

 (1) gnus.el $B$K(B patch $B$rEv$F$kI,MW$,$J$/!"(Bgnus-mime.el $B$r(B load $B$9$k$@(B
     $B$1$GNI$$!#(B

 (2) message header $B$N(B decoding $B$H(B body-part $B$N(B decoding $B$r40A4$KJ,N%(B
     $B$7$?!#(B

     (a) $B=>Mh!"(BM-t $B$K3d$jEv$F$i$l$F$$$?!"(BMIME $B$N(B decoding $BK!$K4X$9$k%H(B
         $B%0%k$O(B message header $B$r(B decode $B$9$k$+$7$J$$$+$rA*Br$9$k$@$1(B
         $B$H$J$C$?!#(B

     (b) metamail $B$r;H$C$?(B body-part $B$b4^$a$?(B full-decoding $B$O!"%-!<$r(B
         $B2!$7$?;~0l2s8B$j$N<B9T$H$7!"%b!<%I$H$O$7$J$$$3$H$K$7$?!#$3$N(B 
         MIME decoding $B5!G=$O(B Summary mode $B$N(B v $B%-!<$K3d$jEv$F$i$l$F$$(B
         $B$k!#(B

  (2) $B$O$\$/<+?H$,;H$$$K$/$$$H;W$C$F$$$?$3$H$N2~A1$K$J$C$F$$$k$D$b$j$G(B
$B$9!#$^$@(B fj $B$G$O(B text/plain $B0J30$N(B Content-Type: $B$O0lHLE*$G$O$"$j$^$;(B
$B$s$,!"2hA|$H$+2;$H$+(B anon-ftp $B$H$+$rK\3JE*$K;H$&$H!"Kh2s(B decode $B$5$l$k(B
$B$H]5F+$7$/$J$j$^$9!#(B

  gnus-mime.el $B$O!"(BGNUS 3.14.4 $B$d(B 4.1 $B0J30$N%P!<%8%g%s$N(B GNUS $B$K$bBP1~(B
$B$9$k$3$H$K$7$^$7$?!#<B:]$K$O(B 3.14.1 $B$7$+;n$7$F$$$^$;$s$,!"$H$j$"$($:!"(B
MIME $BBP1~$G$J$$%P!<%8%g%s$N(B GNUS $B$G$b(B MIME $B5!G=$,;H$($k$h$&$K$J$k$O$:(B
$B$G$9!#(B

  gnus-mime.el $B$r;H$&$K$O:GDc8B(B tiny-mime.el $B$,I,MW$G$9!#(Bbody-part $B$^(B
$B$G$b4^$a$?(B MIME $B40A4BP1~$r$7$?$$>l9g$O!"(Bmetamail $B$H(B Umerin $B$5$s$N(B 
metamail.el $B$rMQ0U$7$F2<$5$$!#(B

  $B$G$O!"Nc$K$h$C$F!"$_$s$J$NBg9%$-$J(B (^_^) MIME $B7A<0$G!"0J2<$K!"%W%m%0(B
$B%i%`$r:\$;$^$9!#(BMIME $B$N(B body-part $BBP1~$NJ}$O(B MIME $B$G=hM}$7$F2<$5$$!#$=(B
$B$&$G$J$$J}$O!"(Beditor $BEy$G@Z$j=P$7$F2<$5$$!#(B

--Multipart Sun Nov 21 16:05:19 1993
Content-Type: application/octet-stream; name="gnus-mime.el"; type=elisp
Content-Transfer-Encoding: 7bit

;;;
;;; $Id: gnus-mime.el,v 1.3 1993/11/20 18:53:09 morioka Exp morioka $
;;;
;;;   A MIME extension for GNUS
;;;
;;; by Morioka Tomohiko, 1993/11/20

(require 'tiny-mime)

(defvar mime/header-decoding-mode t "*Decode MIME header if non-nil.")

(defun mime/set-header-decoding-mode (m)
  (if m
      (progn
(setq mime/header-decoding-mode t)
(mime/set-header-decoding-method 'mime/decode-message-header)
)
    (progn
      (setq mime/header-decoding-mode nil)
      (mime/set-header-decoding-method nil)
      )))

;;; @ toggle MIME header decoding mode, decoding or non decoding.
;;;
(defun gnus-summary-toggle-mime-header (arg)
  "Toggle MIME header processing.
With arg, turn MIME processing on iff arg is positive."
  (interactive "P")
  (setq mime/header-decoding-mode
(if (null arg)
    (not mime/header-decoding-mode)
  arg))
  (if mime/header-decoding-mode
      (mime/set-header-decoding-method 'mime/decode-message-header)
    (mime/set-header-decoding-method nil)
    )
  ;; The following is a trick to force to read the current article again.
  (setq gnus-have-all-headers (not gnus-have-all-headers))
  (gnus-summary-select-article (not gnus-have-all-headers) t)
  )

;;; @ to decode subject in mode-line
;;
;; This function imported from gnus.el.
;;
;; New implementation in gnus 3.14.3
;;
(defun gnus-article-set-mode-line ()
  "Set Article mode line string.
If you don't like it, define your own gnus-article-set-mode-line."
  (let ((maxlen 15);Maximum subject length
(subject
 (if gnus-current-headers
     (mime/decode-string (nntp-header-subject gnus-current-headers))
   "")
 ))
    ;; The value must be a string to escape %-constructs because of subject.
    (setq mode-line-buffer-identification
  (format "GNUS: %s%s %s%s%s"
  gnus-newsgroup-name
  (if gnus-current-article
      (format "/%d" gnus-current-article) "")
  (rightful-boundary-short-string subject
  (min (string-width subject)
       maxlen))
  (if (> (string-width subject) maxlen) "..." "")
  (make-string (max 0 (- 17 (string-width subject))) ? )
  )))
  (set-buffer-modified-p t))

;;; @ MIME full decode message
;;;
(defun gnus-summary-mime-decode-article (arg)
  "MIME full-decode this article."
  (interactive "P")
  (setq gnus-show-mime t)
  ;; The following is a trick to force to read the current article again.
  (setq gnus-have-all-headers (not gnus-have-all-headers))
  (gnus-summary-select-article (not gnus-have-all-headers) t)
  (setq gnus-show-mime nil)
  )

(setq gnus-startup-hook
      '(lambda ()
 (if (string-match "^GNUS [0-3]" gnus-version)
     (progn
       ;; definition for GNUS 3.*
       
       (fset 'gnus-summary-select-article 'gnus-Subject-select-article)
       (fset 'gnus-Article-set-mode-line 'gnus-article-set-mode-line)
       
       (defun mime/set-header-decoding-method (f)
 (setq gnus-Article-prepare-hook f))
       
       ;; @@ to decode subjects in *Summary* buffer
       (setq gnus-Select-group-hook
     '(lambda ()
(mapcar '(lambda (header)
   (nntp-set-header-subject
    header
    (mime/decode-string (gnus-header-subject header))
    ))
gnus-newsgroup-headers)
))
       
       (setq gnus-Subject-mode-hook
     '(lambda ()
(define-key gnus-Subject-mode-map
  "\et" 'gnus-summary-toggle-mime-header)
(define-key gnus-Subject-mode-map
  "v" 'gnus-summary-mime-decode-article)
))
       
       (setq gnus-Article-mode-hook
     '(lambda ()
(or (assq 'mime/header-decoding-mode minor-mode-alist)
    (setq minor-mode-alist
  (cons (list 'mime/header-decoding-mode " MIME")
minor-mode-alist)))
))
       
       (if (not (string-match "^GNUS 3\.14\.4" gnus-version))
   (progn
     ;; @@ MIME full decode message
     (defun gnus-summary-mime-decode-article (arg)
       "MIME full-decode this article."
       (interactive "P")
       (let ((gnus-Article-prepare-hook 'metamail-buffer))
 ;; The following is a trick
 ;; to force to read the current article again.
 (setq gnus-have-all-headers (not gnus-have-all-headers))
 (gnus-summary-select-article (not gnus-have-all-headers) t)
 ))
     ))
       )
   (progn
     ;; definition for GNUS 4.*
     
     (defun mime/set-header-decoding-method (f)
       (setq gnus-article-prepare-hook f))
     
     ;; @@ to decode subjects in *Summary* buffer
     (setq gnus-select-group-hook
   '(lambda ()
      (mapcar '(lambda (header)
 (nntp-set-header-subject
  header
  (mime/decode-string (gnus-header-subject header))
  ))
      gnus-newsgroup-headers)
      ))
     
     (setq gnus-summary-mode-hook
   '(lambda ()
      (define-key gnus-summary-mode-map
"\et" 'gnus-summary-toggle-mime-header)
      (define-key gnus-summary-mode-map
"v" 'gnus-summary-mime-decode-article)
      ))
     
     (setq gnus-article-mode-hook
   '(lambda ()
      (or (assq 'mime/header-decoding-mode minor-mode-alist)
  (setq minor-mode-alist
(cons (list 'mime/header-decoding-mode " MIME")
      minor-mode-alist)))
      ))
     ))
 
 (mime/set-header-decoding-method 'mime/decode-message-header)
 ))

(setq gnus-Startup-hook gnus-startup-hook)
--Multipart Sun Nov 21 16:05:19 1993
Content-Type: text/plain; charset=ISO-2022-JP

$B(.!X7r9/$HH~MF$N$?$a$K?)8e$K0lGU$N9HCc!Y(,(,(,(,(,(,(,(,(,(,(,(,(,(,(/(B
$B(-(B                    $B<i2,(B $BCNI'(B (MORIOKA Tomohiko)                  $B(-(B
$B(-!!(B                                    Email: <morioka@jaist.ac.jp>$B(-(B
$B(1(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(0(B
--Multipart Sun Nov 21 16:05:19 1993--
