From: morioka Date: Mon, 2 Mar 1998 13:46:49 +0000 (+0000) Subject: tm 5.9 X-Git-Tag: tm5_9~1 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=224af77b00762fe2de67db0eb88973a0dd7a5d76;p=elisp%2Ftm.git tm 5.9 --- diff --git a/Makefile b/Makefile index 87ddbbc..804e1b9 100644 --- a/Makefile +++ b/Makefile @@ -4,29 +4,10 @@ CFLAGS = -O UTILS = ol2 decode-b METHODS = tm-au tm-file tm-image tm-latex tm-mpeg -OLFILES = tiny-mime-jp.ol signature-jp.ol tiny-mime-eng.ol -TEXFILES= tiny-mime-jp.tex signature-jp.tex tiny-mime-eng.tex -DVIFILES= tm-jp.dvi \ - tiny-mime-jp.dvi signature-jp.dvi tiny-mime-eng.dvi -PSFILES = tm-jp.ps \ - tiny-mime-jp.ps signature-jp.ps tiny-mime-eng.ps -GOMI = *.aux *.toc *.log $(TEXFILES) $(DVIFILES) *.ps $(UTILS) +GOMI = $(UTILS) +FILES = README.eng Makefile *.el *.c methods doc -FILES = README.eng *.ol *.pln \ - Makefile *.el *.c methods tm-jp.tex $(TEXFILES) - -TARFILE = tm5.5.tar - -.SUFFIXES: .ol .tex .dvi .ps - -.ol.tex: - ol2 < $< | plain2 -tex -tstyle=a4j > $@ - -.tex.dvi: - jlatex $< - -.dvi.ps: - dvi2ps $< > $@ +TARFILE = tm5.9.tar all: $(UTILS) $(DVI) @@ -37,19 +18,14 @@ decode-b: decode-b.c $(CC) $(CFLAGS) decode-b.c -o decode-b -tex: $(TEXFILES) - -$(TEXFILES): $(OLFILES) - - -dvi: $(DVIFILES) - -$(DVIFILES): $(TEXFILES) - +tex: ol2 + (cd doc; make tex) -ps: $(PSFILES) +dvi: ol2 + (cd doc; make dvi) -$(PSFILES): $(DVIFILES) +ps: ol2 + (cd doc; make ps) install: $(UTILS) methods @@ -59,8 +35,10 @@ install: $(UTILS) methods clean: rm $(GOMI) + (cd doc; make clean) tar: $(FILES) + (cd doc; make tex) tar cvf $(TARFILE) $(FILES) gzip -9 $(TARFILE) diff --git a/README.eng b/README.eng index 7b4d119..4ddc0f2 100644 --- a/README.eng +++ b/README.eng @@ -1,6 +1,6 @@ [README for tm (English Version)] by MORIOKA Tomohiko -1994/09/26 +1994/10/17 1 What's tm? @@ -11,7 +11,26 @@ Tm is a MIME package for GNU Emacs. Tm has following functions: - MIME extenders for mh-e, GNUS and RMAIL -2 Modules +2 Documents + +This package includes following documents. + +(1) English edition + +- doc/tm-eng.tex : tm Reference Manual (LaTeX) +- doc/tiny-mime-eng.ol : tiny-mime.el Reference Manual (Emacs Outline) +- doc/tiny-mime-eng.tex : tiny-mime.el Reference Manual (LaTeX) + +(2) Japanese edition + +- doc/tm-jp.tex : tm Reference Manual (LaTeX) +- doc/tiny-mime-jp.ol : tiny-mime.el Reference Manual (Emacs Outline) +- doc/tiny-mime-jp.tex : tiny-mime.el Reference Manual (LaTeX) +- doc/signature-jp.ol : signature.el Reference Manual (Emacs Outline) +- doc/signature-jp.tex : signature.el Reference Manual (LaTeX) + + +3 Modules Tm has following modules: @@ -19,14 +38,15 @@ Tm has following modules: - tm-view : MIME viewer - tm-misc : library module for tm-MUAs - tm-MUAs : MIME extender for MUAs - - tm-mh-e : tm-MUA for mh-e - - tm-gnus : tm-MUA for GNUS + - tm-mh-e : tm-MUA for mh-e + - tm-gnus : tm-MUA for GNUS - tm-rmail : tm-MUA for RMAIL + - tm-vm : tm-MUA for vm - tm-setup: set up module for tm-MUAs - mime-setup: set up module for MIME -3 Install +4 Install (1) Edit Makefile for your environment. @@ -39,13 +59,17 @@ Tm has following modules: (5) Copy *.el to your emacs lisp directory. -4 .emacs +5 .emacs Please insert (load "mime-setup") or (load "tm-setup") in .emacs. If you use mime-setup, you should prepare mime.el. +If you want use vm, please insert following in .vm or .emacs: + + (load "tm-vm") + -5 How to use mime/viewer-mode +6 How to use mime/viewer-mode In tm-MUAs, you can use mime/viewer-mode if you press `v' key in Summary mode. mime/viewer-mode has following functions: diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..409403b --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,38 @@ +OLFILES = tiny-mime-jp.ol signature-jp.ol tiny-mime-eng.ol +TEXFILES= tiny-mime-jp.tex signature-jp.tex tiny-mime-eng.tex +DVIFILES= tm-jp.dvi tm-eng.dvi \ + tiny-mime-jp.dvi signature-jp.dvi tiny-mime-eng.dvi +PSFILES = tm-jp.ps \ + tiny-mime-jp.ps signature-jp.ps tiny-mime-eng.ps +GOMI = *.aux *.toc *.log $(TEXFILES) $(DVIFILES) *.ps *~ + +.SUFFIXES: .ol .tex .dvi .ps + +.ol.tex: + ol2 < $< | plain2 -tex -tstyle=a4j > $@ + +.tex.dvi: + jlatex $< + jlatex $< + +.dvi.ps: + dvi2ps $< > $@ + +all: $(DVI) + +tex: $(TEXFILES) + +$(TEXFILES): $(OLFILES) + + +dvi: $(DVIFILES) + +$(DVIFILES): $(TEXFILES) + + +ps: $(PSFILES) + +$(PSFILES): $(DVIFILES) + +clean: + rm $(GOMI) diff --git a/doc/signature-jp.ol b/doc/signature-jp.ol new file mode 100644 index 0000000..795362b --- /dev/null +++ b/doc/signature-jp.ol @@ -0,0 +1,35 @@ +$B!X(Bsignature.el $B@bL@=q!Y(B +by. $B2,It(B $Bl9g$O(B .emacs $B$K0J2<$N$h$&$J$b(B +$B$N$rF~$l$F2<$5$$!#(B + +[[E +---------------------------------------------------------------------- +(setq signature-file-alist + '( + (("Newsgroups" . "jokes") . "~/.signature-jokes") + (("Newsgroups" . ("zxr" "nzr")) . "~/.signature-sun") + (("To" . ("ishimaru" "z-suzuki")) . "~/.signature-sun") + (("To" . "tea") . "~/.signature-jokes") + (("To" . ("sim" "oku" "takuo")) . "~/.signature-formal") + )) +---------------------------------------------------------------------- +]]E + + $B$^$?!"(B*insert-signature* $B$K?t0z?t$rM?$($k$3$H$K$h$j!"BPOCE*$K(B +`signature-file-name'-DISTRIBUTION $B$N7A$NL>A0$r;}$D%U%!%$%k$r;XDj(B +$B$9$k$3$H$,$G$-$^$9!#Nc$($P(B `C-u C-c C-s'(*insert-signature*) $B$H(B +$BF~NO$9$k$H!"%_%K%P%C%U%!$G(B + + Insert your signature: ~/.signature- + +$B$HJ9$$$F$-$^$9$N$G!"@ZBXMQ$KMQ0U$5$l$?%U%!%$%k$N$J$+$+$i!"5a$a$k$b$N$r(B +$B%3%s%W%j!<%7%g%s$r;H$C$FMQ0U$KA*Br$9$k$3$H$,$G$-$^$9!#6uJ8;zNs$r(B +$BF~NO$9$l$P!"(B`signature-file-name' $B$G;XDj$5$l$k%U%!%$%k$,FI$_9~$^$l$^$9!#(B diff --git a/doc/signature-jp.tex b/doc/signature-jp.tex new file mode 100644 index 0000000..ed7b800 --- /dev/null +++ b/doc/signature-jp.tex @@ -0,0 +1,56 @@ +\documentstyle[a4j]{jarticle} +\setcounter{secnumdepth}{6} +\setcounter{tocdepth}{6} +\topsep=0.1cm +\parsep=0.1cm +\itemsep=0.0cm +\begin{document} +\title{ +signature.el ÀâÌÀ½ñ} +\author{ +²¬Éô ¼÷ÃË\\ +} +\date{ +1994ǯ8·î1Æü} +\maketitle +\medskip +\par +signature.el ¤Ï signature ¤Î¼«Æ°ÀÚÂؤ¨ tool ¤Ç¤¹¡£*insert-signature* +¤ò¹Ô¤¦¤³¤È¤Ë¤è¤ê¡¢`signature-insert-at-eof' ¤ÎÃͤ¬ non-nil ¤Î¤È¤­¥Ð¥Ã +¥Õ¥¡¤ÎËöÈø¤Ë¡¢nil ¤Î¤È¤­¤Ï¥«¥ì¥ó¥È¥Ý¥¤¥ó¥È¤Ë¡¢signature ¥Õ¥¡¥¤¥ë¤¬ÆÉ¤ß +¹þ¤Þ¤ì¤Þ¤¹¡£É¸½àŪ¤Êsignature ¤Ï¡¢ÊÑ¿ô `signature-file-name' ¤Ç»ØÄꤷ +¤Æ²¼¤µ¤¤(¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï "\verb+~+/.signature")¡£message header ¤Î field ¤Ë¹ç +¤ï¤»¤Æ signature ¤Î¼«Æ°ÀÚÂؤò¹Ô¤Ê¤¤¤¿¤¤¾ì¹ç¤Ï .emacs ¤Ë°Ê²¼¤Î¤è¤¦¤Ê¤â +¤Î¤òÆþ¤ì¤Æ²¼¤µ¤¤¡£ +\medskip +{\baselineskip=10pt +\begin{verbatim} +---------------------------------------------------------------------- +(setq signature-file-alist + '( + (("Newsgroups" . "jokes") . "~/.signature-jokes") + (("Newsgroups" . ("zxr" "nzr")) . "~/.signature-sun") + (("To" . ("ishimaru" "z-suzuki")) . "~/.signature-sun") + (("To" . "tea") . "~/.signature-jokes") + (("To" . ("sim" "oku" "takuo")) . "~/.signature-formal") + )) +---------------------------------------------------------------------- +\end{verbatim}} +\medskip +\par +¤Þ¤¿¡¢*insert-signature* ¤Ë¿ô°ú¿ô¤òÍ¿¤¨¤ë¤³¤È¤Ë¤è¤ê¡¢ÂÐÏÃŪ¤Ë +`signature-file-name'-DISTRIBUTION ¤Î·Á¤Î̾Á°¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤ò»ØÄê +¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£Î㤨¤Ð `C-u C-c C-s'(*insert-signature*) ¤È +ÆþÎϤ¹¤ë¤È¡¢¥ß¥Ë¥Ð¥Ã¥Õ¥¡¤Ç +\medskip +{\list{}{\leftmargin=4ex}\item[] +\begin{description} +\item[Insert your signature:]\verb+~+/.signature- +\medskip +\end{description} +\endlist} +\par +¤Èʹ¤¤¤Æ¤­¤Þ¤¹¤Î¤Ç¡¢ÀÚÂØÍѤËÍÑ°Õ¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¤Ê¤«¤«¤é¡¢µá¤á¤ë¤â¤Î¤ò +¥³¥ó¥×¥ê¡¼¥·¥ç¥ó¤ò»È¤Ã¤ÆÍÑ°Õ¤ËÁªÂò¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¶õʸ»úÎó¤ò +ÆþÎϤ¹¤ì¤Ð¡¢`signature-file-name' ¤Ç»ØÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¤¬Æɤ߹þ¤Þ¤ì¤Þ¤¹¡£ +\end{document} diff --git a/doc/tiny-mime-eng.ol b/doc/tiny-mime-eng.ol new file mode 100644 index 0000000..47421ab --- /dev/null +++ b/doc/tiny-mime-eng.ol @@ -0,0 +1,104 @@ +[[R +\title{tiny-mime manual (English Version)} +\author{Morioka Tomohiko} +\date{1994/8/4} +\maketitle +]]R + +* Overview + + tiny-mime is a multilingual MIME style message header +encoder/decoder based on RFC 1522 for Mule, NEmacs, and NEpoch. I +modified Mr.Enami's ISO-2022-JP Base64 MIME header decoder and make +it. Mr.Enami's program can decode only ISO-2022-JP Base64 header. But, +current tiny-mime has following functions: + + - unfolding at decoding + - encoding/decoding multilingual character sets, such as, + ISO-2022-JP, ISO-2022-JP-2, ISO-2022-CN, ISO-2022-KR, ISO-8859-*, + US-ASCII, EUC-KR + - B and Q-encoding + + +* character set and encoding + +** Mule + + Mule can use multilingual text, so in Mule, tiny-mime supports +ISO-2022-JP, ISO-2022-JP-2, US-ASCII, ISO-8859-1..9, ISO-2022-CN, +ISO-2022-KR, EUC-KR, et al. + + Additionally, you can add or change encoding/decoding for character +sets by function mime/set-charset-and-encoding. + +** NEmacs and NEpoch + + NEmacs can use Japanese and English only, so in NEmacs, tiny-mime +supports encoding/decoding only ISO-2022-JP and US-ASCII. + + And decoding ISO-8859-* encoded-words if they includes only ASCII. + + +* How to use tiny-mime.el (simple way) + +** decoding + + Please load tiny-mime.el, and do following command on the buffer +which you want to decode. + + M-x mime/decode-message-header + + And you can decode region by + + M-x mime/decode-region + +** encoding + + Please load tiny-mime.el, and do following command on the buffer +which you want to encode. + + M-x mime/encode-message-header + + + +* variables + +** mime/no-encoding-header-fields + + You can specify list of fields which you don't want to +encode. Default value is ("X-Nsubject"). + +example: don't encode Subject and X-Nsubject fields + +[[E +---------------------------------------------------------------------- +(setq mime/no-encoding-header-fields '("X-Nsubject" "Subject")) +---------------------------------------------------------------------- +]]E + + +* How to add or change character sets + + In Mule, you can add or change character sets by function +mime/set-charset-and-encoding. + + Function: mime/set-charset-and-encoding lc cs charset encoding + + lc: leading-char + cs: coding-system. Please specify nil if you don't want to use + coding-system for 1 octet character. + charset: MIME character set + encoding: encoding method for encoder + + +example 1: encode EUC-KR B encoding for KS C5601-1987 characters + + (mime/set-charset-and-encoding lc-kr *euc-kr* "EUC-KR" "B") + + +example 2: encode/decode koi8-r Q encoding + + (mime/set-charset-and-encoding lc-prv11 nil "KOI8-R" "Q") + +[WARNING] In this version, handling for private character is very ad +hoc. (^_^; I want to improve. diff --git a/doc/tiny-mime-eng.tex b/doc/tiny-mime-eng.tex new file mode 100644 index 0000000..2fbb020 --- /dev/null +++ b/doc/tiny-mime-eng.tex @@ -0,0 +1,158 @@ +\documentstyle[a4j]{jarticle} +\setcounter{secnumdepth}{6} +\setcounter{tocdepth}{6} +\topsep=0.1cm +\parsep=0.1cm +\itemsep=0.0cm +\begin{document} +\title{tiny-mime manual (English Version)} +\author{Morioka Tomohiko} +\date{1994/8/4} +\maketitle +\medskip + +\section{Overview} +\medskip +\par +tiny-mime is a multilingual MIME style message header +encoder/decoder based on RFC 1522 for Mule, NEmacs, and NEpoch. I +modified Mr.Enami's ISO-2022-JP Base64 MIME header decoder and make +it. Mr.Enami's program can decode only ISO-2022-JP Base64 header. But, +current tiny-mime has following functions: +\medskip +\begin{itemize} +\item unfolding at decoding +\item encoding/decoding multilingual character sets, such as, +ISO-2022-JP, ISO-2022-JP-2, ISO-2022-CN, ISO-2022-KR, ISO-8859-*, +US-ASCII, EUC-KR +\item B and Q-encoding +\medskip +\medskip +\end{itemize} + +\section{character set and encoding} +\medskip + +\subsection{Mule} +\medskip +\par +Mule can use multilingual text, so in Mule, tiny-mime supports +ISO-2022-JP, ISO-2022-JP-2, US-ASCII, ISO-8859-1..9, ISO-2022-CN, +ISO-2022-KR, EUC-KR, et al. +\medskip +\par +Additionally, you can add or change encoding/decoding for character +sets by function mime/set-charset-and-encoding. +\medskip + +\subsection{NEmacs and NEpoch} +\medskip +\par +NEmacs can use Japanese and English only, so in NEmacs, tiny-mime +supports encoding/decoding only ISO-2022-JP and US-ASCII. +\medskip +\par +And decoding ISO-8859-* encoded-words if they includes only ASCII. +\medskip +\medskip + +\section{How to use tiny-mime.el (simple way)} +\medskip + +\subsection{decoding} +\medskip +{\baselineskip=10pt +\begin{verbatim} + Please load tiny-mime.el, and do following command on the buffer +which you want to decode. +\end{verbatim}} +\medskip +{\list{}{\leftmargin=8ex}\item[] +\par +M-x mime/decode-message-header +\endlist} +\medskip +{\baselineskip=10pt +\begin{verbatim} + And you can decode region by +\end{verbatim}} +\medskip +{\baselineskip=10pt +\begin{verbatim} + M-x mime/decode-region +\end{verbatim}} +\medskip + +\subsection{encoding} +\medskip +{\baselineskip=10pt +\begin{verbatim} + Please load tiny-mime.el, and do following command on the buffer +which you want to encode. +\end{verbatim}} +\medskip +{\list{}{\leftmargin=8ex}\item[] +\par +M-x mime/encode-message-header +\endlist} +\medskip +\medskip +\medskip + +\section{variables} +\medskip + +\subsection{mime/no-encoding-header-fields} +\medskip +\par +You can specify list of fields which you don't want to +encode. Default value is ("X-Nsubject"). +\medskip +\begin{description} +\item[example:]don't encode Subject and X-Nsubject fields +\medskip +\end{description} +{\baselineskip=10pt +\begin{verbatim} +---------------------------------------------------------------------- +(setq mime/no-encoding-header-fields '("X-Nsubject" "Subject")) +---------------------------------------------------------------------- +\end{verbatim}} +\medskip +\medskip + +\section{How to add or change character sets} +\medskip +\par +In Mule, you can add or change character sets by function +mime/set-charset-and-encoding. +\medskip +\begin{description} +\item[Function:]mime/set-charset-and-encoding lc cs charset encoding +\medskip +\begin{description} +\item[lc:]leading-char +\item[cs:]coding-system. Please specify nil if you don't want to use +coding-system for 1 octet character. +\item[charset:]MIME character set +\item[encoding:]encoding method for encoder +\medskip +\medskip +\end{description} +\end{description} +\begin{description} +\item[example 1:]encode EUC-KR B encoding for KS C5601-1987 characters +\medskip +\par +(mime/set-charset-and-encoding lc-kr *euc-kr* "EUC-KR" "B") +\medskip +\medskip +\item[example 2:]encode/decode koi8-r Q encoding +\medskip +\par +(mime/set-charset-and-encoding lc-prv11 nil "KOI8-R" "Q") +\medskip +\item[{[}WARNING{]}]In this version, handling for private character is very ad +hoc. (\verb+^+\_\verb+^+; I want to improve. +\end{description} +\end{document} diff --git a/doc/tiny-mime-jp.ol b/doc/tiny-mime-jp.ol new file mode 100644 index 0000000..2b5368d --- /dev/null +++ b/doc/tiny-mime-jp.ol @@ -0,0 +1,260 @@ +$B!X(Btiny-mime.el $B@bL@=q!Y(B +by. $Be$GF0:n$9$k(B MIME message +header $B$N(B encoder/decoder $B$G$9!#%*%j%8%J%k$O!"@N!"$($J$_(B $B$D$0$H$b(B $B$5$s(B +$B$,(B fj.editor.emacs $B$KEj9F$5$l$?(B MIME message header $B$N(B decoder $B$G$9!#(B + + $B8=:_$G$O!"Ev;~$N$b$N$KHf$Y!"(B + + $B!&(Bdecoding $B;~$K$*$1$k(B unfolding $B5!G=(B + $B!&(BISO-2022-JP $B$K2C$(!"(BISO-8859-*, US-ASCII $B$J$I$N(B encoding/decoding + $B!&(BQ-encoding $B$N(B decoding + +$B$H$$$C$?5!G=$r;}$C$F$$$^$9!#(B + + +* tiny-mime.el $B$N%5%]!<%H$9$k(B character set, encoding + + tiny-mime.el $B$O!"e$G!"(B + + M-x mime/decode-message-header + +$B$re$G!"(B + + M-x mime/encode-message-header + +$B$rl9g!"(Btiny-mime.el $B$,(B encode $B$7$J$/$F$b!"(B +mime.el $B$,(B encode $B$9$k$N$G!"(Bmime.el $B$N(B message header encoder $B$,F/$+$J(B +$B$$$h$&$K$K@_Dj$7$^$9!#(B + +** mime/use-X-Nsubject + + $B$3$NJQ?t$NCM$,(B t $B$N>l9g!"(Bmessage header $B$r(B encode $B$9$k;~!"(Bencode $B$7(B +$B$?7k2L!"(BSubject $B$K(B encoded-word $B$,4^$^$l$k>l9g!"(BSubject $B$r(B decode $B$7$?(B +$B$b$N$rF~$l$?(B X-Nsubject $B$r:n@.$7$^$9!#(B + + default $B$G$O(B nil $B$,;XDj$5$l$F$$$^$9!#(B + +$B!NCm0U!O(BMule $B$G(B ISO-2022-JP $B$K4^$^$l$k$b$N0J30$NJ8;z=89g$r;H$&>l9g$O!"(B +$B$3$l$r;XDj$7$J$$J}$,8-L@$G$9!#(B + +** mail-header-separator + + $B4X?t(B mime/encode-message-header $B$K$*$1$k(B message header $B$H(B body part +$B$N6h@Z$j$rI=$9JQ?t$G$9!#Nc$($P!"(BGNUS $B$G$O(B "--text follows this line--" +$B$,;XDj$5$l$^$9!#(B + +$B!NCm0U!O$3$NJQ?t$NJ8;zNs$O!"(Bversion 2.6 $B$h$j@55,I=8=$G$O$J$/$J$j$^$7$?!#(B + + +* mailer, news reader $B$X$NAH$_9~$_(B + + $BF|>oE*$K!"L50U<1$K(B MIME header $B$rK\Mh$N8@8l$G8+$?$$$H$$$&$N$OEvA3$N(B +$BM_5a$G$9!#$=$3$G!"(Btiny-mime.el $B$r(B mailer $B$d(B news reader $B$KAH$_9~$`$H<+(B +$BF0E*$K(B MIME header $B$N(B encode/decode $B$,$G$-$^$9!#(B + + $B$^$?!"(Bmetamail $B$r;H$C$F$*$i$l$kJ}$G$b!"IaCJ$O(B message header $B$N(B +decode $B$@$1$GNI$/$F!"3($d2;$J$I$r:F@8$9$k;~$@$1(B metamail $B$r;H$&$H$$$&(B +$B$h$&$J;H$$J}$b$G$-$^$9!#(B + + $B$3$NL\E*$rl9g$N$?$a$K!"(B + + (mime/decode-string $BJ8;zNs(B) + +$B$H$$$&4X?t$bMQ0U$7$F$$$^$9!#(B + + GNUS $B$H(B mh-e $B$K4X$7$F$O!"(Btm-gnus, tm-mh-e $B$H$$$&(B MIME $BBP1~2=%b%8%e!<(B +$B%k$rMQ0U$7$F$$$^$9!#(B + + $B$3$l$i$N!"3F(B MUA $B$KBP1~$9$k%b%8%e!<%k$r(B load $B$9$k$H(B tiny-mime.el $B$K(B +$B$h$k(B MIME header $B$NI|85$H(B tm-body $B$rMxMQ$7$?(B MIME body $B$N:F@8$,9T$J$((B +$B$^$9!#(B + + $B>\$7$/$O!"$=$l$>$l$N@bL@=q$r$*FI$_2<$5$$!#(B + + +* mime.el $B$H$NJ;MQ(B + + mime.el $B$HJ;MQ$9$kNc$r<($7$^$9!#$3$NNc$N>l9g!"(BISO-2022-JP $BJ8;zNs$N(B +encode $B$O(B tiny-mime.el $B$,9T$J$$!"$=$l0J30$NJ8;z=89g$KB0$9$kJ8;zNs$O(B +mime.el $B$,(B encode $B$7$^$9!#(B + + $B$^$?!"(Btiny-mime.el $B$,(B encode $B$7$J$+$C$?J8;zNs$b(B mime.el $B$,(B encode $B$9(B +$B$k$N$G!"7k2LE*$K!"I,$:A4$F$N(B field $B$,(B encode $B$5$l$k$3$H$KCm0U$7$F2<$5(B +$B$$!#(B + +[[E +---------------------------------------------------------------------- +;;; +;;; for Edit MIME mode +;;; +(autoload 'mime-mode "mime" "Edit MIME message." t) +(autoload 'mime-convert-buffer "mime" "convert to MIME." t) +(autoload 'insert-signature "signature" "Insert signature" t) +(add-hook 'mime-mode-hook + (function + (lambda () + (define-key (current-local-map) + "\C-c\C-s" (function insert-signature)) + ))) + +;; MIME header $B$N(B encoder $B$r(B tiny-mime $B$N$b$N$r;H$&!#(B +(setq mime-translate-hook 'mime/encode-message-header) + +;;; +;;; for GNUS +;;; +(add-hook 'news-reply-mode-hook (function mime-mode)) +(setq gnus-signature-file nil) + +;;; +;;; for mh-e +;;; +(add-hook 'mh-letter-mode-hook + (function + (lambda () + (mime/decode-message-header) + (mime-mode) + (make-local-variable 'mail-header-separator) + (setq mail-header-separator "--------")) + )) +---------------------------------------------------------------------- +]]E + +** $BFCDj$N(B field $B$r(B encode $B$7$?$/$J$$>l9g(B + + $BFCDj$N(B field $B$r(B encode $B$7$?$/$J$$>l9g!"(Btiny-mime.el $B$NJQ?t(B +mime/no-encoding-header-fields $B$K$h$C$F!"(Btiny-mime.el $B$K$h$k(B encode $B$r(B +$B$d$a$k$3$H$,$G$-$^$9$,!"(Bmime.el $B$,(B encode $B$9$k$N$G$O0UL#$,$"$j$^$;$s!#(B +$B$=$3$G!"l9g$O!"(Bnil $B$r;XDj$9$k!#(B + charset: MIME $B$N(B charset. + encoding: encode $B$9$k:]$N(B encoding. + + + $BNc!'(B KS C5601-1987 $B$r(B EUC-KR $B$N(B B encoding $B$9$k$h$&$K@_Dj$9$k(B + + (mime/set-charset-and-encoding lc-kr *euc-kr* "EUC-KR" "B") + + + $BNc!'(B koi8-r $B$r(B Q encoding $B$9$k$h$&$K@_Dj$9$k!#(B + + (mime/set-charset-and-encoding lc-prv11 nil "KOI8-R" "Q") + + +$B!NCm0U!O8=:_$N$H$3$m!"(Bprivate character $B$N@_Dj$OFq$"$j$G$9!#(B(^_^; diff --git a/doc/tiny-mime-jp.tex b/doc/tiny-mime-jp.tex new file mode 100644 index 0000000..3beb18b --- /dev/null +++ b/doc/tiny-mime-jp.tex @@ -0,0 +1,353 @@ +\documentstyle[a4j]{jarticle} +\setcounter{secnumdepth}{6} +\setcounter{tocdepth}{6} +\topsep=0.1cm +\parsep=0.1cm +\itemsep=0.0cm +\begin{document} +\title{ +tiny-mime.el ÀâÌÀ½ñ} +\author{ +¼é²¬ ÃÎɧ\\ +} +\date{ +1994ǯ7·î27Æü} +\maketitle +\medskip +\par +¤³¤ÎÀâÌÀ½ñ¤Ï ol2 ¤È plain2 ¤òÍѤ¤¤ë¤³¤È¤Ë¤è¤Ã¤Æ LaTeX ·Á¼°¤ËÊÑ´¹¤¹¤ë +¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +\medskip +\medskip + +\section{tiny-mime.el ¤È¤Ï} +\medskip +\par +tiny-mime.el ¤Ï Mule, NEmacs, NEpoch ¾å¤ÇÆ°ºî¤¹¤ë MIME message +header ¤Î encoder/decoder ¤Ç¤¹¡£¥ª¥ê¥¸¥Ê¥ë¤Ï¡¢ÀΡ¢¤¨¤Ê¤ß ¤Ä¤°¤È¤â ¤µ¤ó +¤¬ fj.editor.emacs ¤ËÅê¹Æ¤µ¤ì¤¿ MIME message header ¤Î decoder ¤Ç¤¹¡£ +\medskip +\par +¸½ºß¤Ç¤Ï¡¢Åö»þ¤Î¤â¤Î¤ËÈæ¤Ù¡¢ +\medskip +\begin{itemize} +\item decoding »þ¤Ë¤ª¤±¤ë unfolding µ¡Ç½ +\item ISO-2022-JP ¤Ë²Ã¤¨¡¢ISO-8859-*, US-ASCII ¤Ê¤É¤Î encoding/decoding +\item Q-encoding ¤Î decoding +\medskip +\end{itemize} +\par +¤È¤¤¤Ã¤¿µ¡Ç½¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£ +\medskip +\medskip + +\section{tiny-mime.el ¤Î¥µ¥Ý¡¼¥È¤¹¤ë character set, encoding} +\medskip +\par +tiny-mime.el ¤Ï¡¢¼¡¤Î character set, encoding ¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£ +\medskip + +\subsection{Mule} +\medskip +\par +ISO-2022-JP, US-ASCII, ISO-8859-1..9, ISO-2022-CN, ISO-2022-KR, +EUC-KR ¤Ê¤É¤Î encoding/decoding ¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£¤Þ¤¿¡¢´Ø¿ô +mime/set-charset-and-encoding ¤ÇÄɲá¦Êѹ¹¤¬¤Ç¤­¤Þ¤¹¡£ +\medskip + +\subsection{NEmacs, NEpoch} +\medskip +\par +ISO-2022-JP, US-ASCII ¤Î encoding/decoding ¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£ +\medskip +\par +¤Þ¤¿¡¢ISO-8859-*¤Ç¤¢¤Ã¤Æ¤â¡¢encoded-text ¤Ë´Þ¤Þ¤ì¤ëʸ»úÎó¤¬¼ÂºÝ¤Ë¤Ï +ASCII ¤Çɽ¤»¤ëÈϰϤʤéɽ¼¨¤·¤Þ¤¹¡£ +\medskip +\medskip + +\section{tiny-mime.el ¤Î´Êñ¤Ê»È¤¤Êý} +\medskip + +\subsection{decode} +\medskip +\par +tiny-mime.el ¤ò load ¤·¤Æ¡¢decode ¤·¤¿¤¤ buffer ¾å¤Ç¡¢ +\medskip +{\list{}{\leftmargin=8ex}\item[] +\par +M-x mime/decode-message-header +\endlist} +\medskip +\par +¤ò¼Â¹Ô¤·¤Þ¤¹¡£ +\medskip +\par +¤Þ¤¿¡¢decode ¤·¤¿¤¤ region ¤ò +\medskip +{\baselineskip=10pt +\begin{verbatim} + M-x mime/decode-region +\end{verbatim}} +\medskip +\par +¤Ç decode ¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£°úÍÑ¤Ê¤É¤Ç body-part ¤Ë»Ä¤Ã¤¿ +encoded-word ¤ò decode ¤¹¤ë¤Î¤ËÊØÍø¤Ç¤·¤ç¤¦¡£ +\medskip + +\subsection{encode} +\medskip +\par +tiny-mime.el ¤ò load ¤·¤Æ¡¢encode ¤·¤¿¤¤ buffer ¾å¤Ç¡¢ +\medskip +{\list{}{\leftmargin=8ex}\item[] +\par +M-x mime/encode-message-header +\endlist} +\medskip +\par +¤ò¼Â¹Ô¤·¤Þ¤¹¡£ +\medskip +\medskip + +\section{tiny-mime.el ¤ÎÊÑ¿ô} +\medskip + +\subsection{mime/no-encoding-header-fields} +\medskip +\par +tiny-mime.el ¤Ç encode ¤·¤Ê¤¤ message header ¤Î field ¤ò»ØÄꤷ¤Þ¤¹¡£ +\medskip +\par +default ¤Ç¤Ï X-Nsubject ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤¹¡£ +\medskip +\par +Î㡧 X-Nsubject ¤È Subject ¤ò encode ¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¡£ +\medskip +{\baselineskip=10pt +\begin{verbatim} +---------------------------------------------------------------------- +(setq mime/no-encoding-header-fields '("X-Nsubject" "Subject")) +---------------------------------------------------------------------- +\end{verbatim}} +\medskip +\par +¡ÎÃí°Õ¡Ï mime.el ¤ÈÊ»ÍѤ¹¤ë¾ì¹ç¡¢tiny-mime.el ¤¬ encode ¤·¤Ê¤¯¤Æ¤â¡¢ +mime.el ¤¬ encode ¤¹¤ë¤Î¤Ç¡¢mime.el ¤Î message header encoder ¤¬Æ¯¤«¤Ê +¤¤¤è¤¦¤Ë¤ËÀßÄꤷ¤Þ¤¹¡£ +\medskip + +\subsection{mime/use-X-Nsubject} +\medskip +\par +¤³¤ÎÊÑ¿ô¤ÎÃͤ¬ t ¤Î¾ì¹ç¡¢message header ¤ò encode ¤¹¤ë»þ¡¢encode ¤· +¤¿·ë²Ì¡¢Subject ¤Ë encoded-word ¤¬´Þ¤Þ¤ì¤ë¾ì¹ç¡¢Subject ¤ò decode ¤·¤¿ +¤â¤Î¤òÆþ¤ì¤¿ X-Nsubject ¤òºîÀ®¤·¤Þ¤¹¡£ +\medskip +\par +default ¤Ç¤Ï nil ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤¹¡£ +\medskip +\par +¡ÎÃí°Õ¡ÏMule ¤Ç ISO-2022-JP ¤Ë´Þ¤Þ¤ì¤ë¤â¤Î°Ê³°¤Îʸ»ú½¸¹ç¤ò»È¤¦¾ì¹ç¤Ï¡¢ +¤³¤ì¤ò»ØÄꤷ¤Ê¤¤Êý¤¬¸­ÌÀ¤Ç¤¹¡£ +\medskip + +\subsection{mail-header-separator} +\medskip +\par +´Ø¿ô mime/encode-message-header ¤Ë¤ª¤±¤ë message header ¤È body part +¤Î¶èÀÚ¤ê¤òɽ¤¹ÊÑ¿ô¤Ç¤¹¡£Î㤨¤Ð¡¢GNUS ¤Ç¤Ï "--text follows this line--" +¤¬»ØÄꤵ¤ì¤Þ¤¹¡£ +\medskip +\par +¡ÎÃí°Õ¡Ï¤³¤ÎÊÑ¿ô¤Îʸ»úÎó¤Ï¡¢version 2.6 ¤è¤êÀµµ¬É½¸½¤Ç¤Ï¤Ê¤¯¤Ê¤ê¤Þ¤·¤¿¡£ +\medskip +\medskip + +\section{mailer, news reader ¤Ø¤ÎÁȤ߹þ¤ß} +\medskip +\par +Æü¾ïŪ¤Ë¡¢Ìµ°Õ¼±¤Ë MIME header ¤òËÜÍè¤Î¸À¸ì¤Ç¸«¤¿¤¤¤È¤¤¤¦¤Î¤ÏÅöÁ³¤Î +Íßµá¤Ç¤¹¡£¤½¤³¤Ç¡¢tiny-mime.el ¤ò mailer ¤ä news reader ¤ËÁȤ߹þ¤à¤È¼« +ưŪ¤Ë MIME header ¤Î encode/decode ¤¬¤Ç¤­¤Þ¤¹¡£ +\medskip +\par +¤Þ¤¿¡¢metamail ¤ò»È¤Ã¤Æ¤ª¤é¤ì¤ëÊý¤Ç¤â¡¢ÉáÃÊ¤Ï message header ¤Î +decode ¤À¤±¤ÇÎɤ¯¤Æ¡¢³¨¤ä²»¤Ê¤É¤òºÆÀ¸¤¹¤ë»þ¤À¤± metamail ¤ò»È¤¦¤È¤¤¤¦ +¤è¤¦¤Ê»È¤¤Êý¤â¤Ç¤­¤Þ¤¹¡£ +\medskip +\par +¤³¤ÎÌÜŪ¤ò¼Â¸½¤¹¤ë¤Ë¤Ï¡¢mailer ¤ä news reader ¤ÎŬÀÚ¤Ê hook ¤Ë +mime/decode-message-header ¤òÆþ¤ì¤ì¤ÐÎɤ¤¤Ç¤·¤ç¤¦¡£¤Þ¤¿¡¢Ê¸»úÎó¤Î +decode ¤ò¤·¤¿¤¤¾ì¹ç¤Î¤¿¤á¤Ë¡¢ +\medskip +{\list{}{\leftmargin=8ex}\item[] +\par +(mime/decode-string ʸ»úÎó) +\endlist} +\medskip +\par +¤È¤¤¤¦´Ø¿ô¤âÍÑ°Õ¤·¤Æ¤¤¤Þ¤¹¡£ +\medskip +\par +GNUS ¤È mh-e ¤Ë´Ø¤·¤Æ¤Ï¡¢tm-gnus, tm-mh-e ¤È¤¤¤¦ MIME Âбþ²½¥â¥¸¥å¡¼ +¥ë¤òÍÑ°Õ¤·¤Æ¤¤¤Þ¤¹¡£ +\medskip +\par +¤³¤ì¤é¤Î¡¢³Æ MUA ¤ËÂбþ¤¹¤ë¥â¥¸¥å¡¼¥ë¤ò load ¤¹¤ë¤È tiny-mime.el ¤Ë +¤è¤ë MIME header ¤ÎÉü¸µ¤È tm-body ¤òÍøÍѤ·¤¿ MIME body ¤ÎºÆÀ¸¤¬¹Ô¤Ê¤¨ +¤Þ¤¹¡£ +\medskip +\par +¾Ü¤·¤¯¤Ï¡¢¤½¤ì¤¾¤ì¤ÎÀâÌÀ½ñ¤ò¤ªÆɤ߲¼¤µ¤¤¡£ +\medskip +\medskip + +\section{mime.el ¤È¤ÎÊ»ÍÑ} +\medskip +\par +mime.el ¤ÈÊ»ÍѤ¹¤ëÎã¤ò¼¨¤·¤Þ¤¹¡£¤³¤ÎÎã¤Î¾ì¹ç¡¢ISO-2022-JP ʸ»úÎó¤Î +encode ¤Ï tiny-mime.el ¤¬¹Ô¤Ê¤¤¡¢¤½¤ì°Ê³°¤Îʸ»ú½¸¹ç¤Ë°¤¹¤ëʸ»úÎó¤Ï +mime.el ¤¬ encode ¤·¤Þ¤¹¡£ +\medskip +\par +¤Þ¤¿¡¢tiny-mime.el ¤¬ encode ¤·¤Ê¤«¤Ã¤¿Ê¸»úÎó¤â mime.el ¤¬ encode ¤¹ +¤ë¤Î¤Ç¡¢·ë²ÌŪ¤Ë¡¢É¬¤ºÁ´¤Æ¤Î field ¤¬ encode ¤µ¤ì¤ë¤³¤È¤ËÃí°Õ¤·¤Æ²¼¤µ +¤¤¡£ +\medskip +{\baselineskip=10pt +\begin{verbatim} +---------------------------------------------------------------------- +;;; +;;; for Edit MIME mode +;;; +(autoload 'mime-mode "mime" "Edit MIME message." t) +(autoload 'mime-convert-buffer "mime" "convert to MIME." t) +(autoload 'insert-signature "signature" "Insert signature" t) +(add-hook 'mime-mode-hook + (function + (lambda () + (define-key (current-local-map) + "\C-c\C-s" (function insert-signature)) + ))) + +;; MIME header ¤Î encoder ¤ò tiny-mime ¤Î¤â¤Î¤ò»È¤¦¡£ +(setq mime-translate-hook 'mime/encode-message-header) + +;;; +;;; for GNUS +;;; +(add-hook 'news-reply-mode-hook (function mime-mode)) +(setq gnus-signature-file nil) + +;;; +;;; for mh-e +;;; +(add-hook 'mh-letter-mode-hook + (function + (lambda () + (mime/decode-message-header) + (mime-mode) + (make-local-variable 'mail-header-separator) + (setq mail-header-separator "--------")) + )) +---------------------------------------------------------------------- +\end{verbatim}} +\medskip + +\subsection{ÆÃÄê¤Î field ¤ò encode ¤·¤¿¤¯¤Ê¤¤¾ì¹ç} +\medskip +\par +ÆÃÄê¤Î field ¤ò encode ¤·¤¿¤¯¤Ê¤¤¾ì¹ç¡¢tiny-mime.el ¤ÎÊÑ¿ô +mime/no-encoding-header-fields ¤Ë¤è¤Ã¤Æ¡¢tiny-mime.el ¤Ë¤è¤ë encode ¤ò +¤ä¤á¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¤¬¡¢mime.el ¤¬ encode ¤¹¤ë¤Î¤Ç¤Ï°ÕÌ£¤¬¤¢¤ê¤Þ¤»¤ó¡£ +¤½¤³¤Ç¡¢¼¡¤Î¤è¤¦¤ËÀßÄꤹ¤ë¤³¤È¤Ç¡¢mime.el ¤Ç¤â encode ¤·¤Ê¤¤¤è¤¦¤Ë¤Ç¤­ +¤Þ¤¹¡£ +\medskip +{\baselineskip=10pt +\begin{verbatim} +---------------------------------------------------------------------- +(if (boundp 'MULE) + (progn + (defun mime-header-charset-chooser-for-mule-no-encode-ISO-2022-JP (begin end) + (let ((lclist (find-charset-region begin end))) + (cond ((null lclist) nil) ;US-ASCII requres no encoding. + ((memq lc-ltn1 lclist) + '("ISO-8859-1" . "Q")) + ((memq lc-ltn2 lclist) + '("ISO-8859-2" . "Q")) + ((memq lc-ltn3 lclist) + '("ISO-8859-3" . "Q")) + ((memq lc-ltn4 lclist) + '("ISO-8859-4" . "Q")) + ((memq lc-crl lclist) + '("ISO-8859-5" . "Q")) + ;;((memq lc-arb lclist) + ;; '("ISO-8859-6" . "Q")) + ((memq lc-grk lclist) + '("ISO-8859-7" . "Q")) + ((memq lc-hbw lclist) + '("ISO-8859-8" . "Q")) + ((memq lc-ltn5 lclist) + '("ISO-8859-9" . "Q")) + ((memq lc-jp lclist) nil) + (t ;Unknown charset. It must be Mule! + '("ISO-2022-JP-2" . "B")) + ))) + (setq mime-header-charset-chooser + 'mime-header-charset-chooser-for-mule-no-encode-ISO-2022-JP) + ) + (progn + (defun mime-header-charset-chooser-for-nemacs-no-encode-ISO-2022-JP (begin end)) + (setq mime-header-charset-chooser + 'mime-header-charset-chooser-for-nemacs-no-encode-ISO-2022-JP) + )) +---------------------------------------------------------------------- +\end{verbatim}} +\medskip +\par +Íפ¹¤ë¤Ë¡¢ISO-2022-JP ʸ»úÎó¤Î encode ¤ò mime.el ¤Ë¤µ¤»¤Ê¤¯¤¹¤ëÌõ¤Ç +¤¹¡£ +\medskip +\medskip + +\section{charset ¤ÎÄɲá¦Êѹ¹} +\medskip +\par +Mule ¤Ç¤Ï¡¢´Ø¿ô mime/set-charset-and-encoding ¤Ç¡¢charset ¤ÎÄɲá¦ÊÑ +¹¹¤¬¤Ç¤­¤Þ¤¹¡£ +\medskip +\begin{description} +\item[´Ø¿ô:]mime/set-charset-and-encoding lc cs charset encoding +\medskip +\begin{description} +\item[lc:]charset ¤ËÂбþ¤¹¤ë leading-char ¤ò»ØÄꤹ¤ë¡£ +\item[cs:]charset ¤ËÂбþ¤¹¤ë coding-system ¤ò»ØÄꤹ¤ë¡£1 octet ʸ»ú +½¸¹ç¤Ç coding-system ¤òºî¤é¤Ê¤¤¾ì¹ç¤Ï¡¢nil ¤ò»ØÄꤹ¤ë¡£ +\item[charset:]MIME ¤Î charset. +\item[encoding:]encode ¤¹¤ëºÝ¤Î encoding. +\medskip +\medskip +\end{description} +\end{description} +\par +Î㡧 KS C5601-1987 ¤ò EUC-KR ¤Î B encoding ¤¹¤ë¤è¤¦¤ËÀßÄꤹ¤ë +\medskip +{\list{}{\leftmargin=8ex}\item[] +\par +(mime/set-charset-and-encoding lc-kr *euc-kr* "EUC-KR" "B") +\endlist} +\medskip +\medskip +\par +Î㡧 koi8-r ¤ò Q encoding ¤¹¤ë¤è¤¦¤ËÀßÄꤹ¤ë¡£ +\medskip +{\list{}{\leftmargin=8ex}\item[] +\par +(mime/set-charset-and-encoding lc-prv11 nil "KOI8-R" "Q") +\endlist} +\medskip +\medskip +\par +¡ÎÃí°Õ¡Ï¸½ºß¤Î¤È¤³¤í¡¢private character ¤ÎÀßÄê¤ÏÆñ¤¢¤ê¤Ç¤¹¡£(\verb+^+\_\verb+^+; +\end{document} diff --git a/doc/tm-comp-jp.pln b/doc/tm-comp-jp.pln new file mode 100644 index 0000000..e5d1457 --- /dev/null +++ b/doc/tm-comp-jp.pln @@ -0,0 +1,62 @@ +$B2,It!w5~Bg$G$9!#(B + +In article <199408221831.DAA24174@melon.jaist.ac.jp>, + $B writes: + +$B $B8= $B7A<0$KJ,3d$7$F$/$l$k$b$N$r=q$-$^$7$?!#(B + +$BJXMx$J$N$G!"$9$3$72~NI(B($B2~0-!)(B)$B$7$F$_$^$7$?!#(B + +1. mime-mode-exit $B$r>r7oIU$-$G8F$V$h$&$K$7!"(Bmime-mode $B0J30$G$b(B + $B;H$($k$h$&$K$7$?!#(B + + $B:G6a(B mh-e 4.1 $B$N(B mh-edit-mhn $B$b;H$C$F$_$F$$$k$N$G!"(Bmime-mode $B0J30$G$b(B + $B;H$($k$h$&$K$7$?$H$$$&$N$,F05!$G$9!#6KC<$K8@$($PIaCJ$O(B MIME $B$rA4A3;H$C$F(B + $B$$$J$$?M$G$b!"<+F0J,3d$K$O;H$($k$H;W$$$^$9!#(B + +$B!t(B mh-edit-mhn $B$GJQ49$7$?8e(B mime/view-mode $B$KF~$C$F%W%l%S%e!<$7!"(B + $B$&$^$/$$$C$F$J$+$C$?$i(B mh-revert-mhn-edit $B$G$d$jD>$9!"$H$$$&(B + $Bl9g$K$bBP1~$7$?!#(B + + mh-edit-mhn $B$N=PNO$O$3$N7A<0$J$N$G!"$d$`$rF@$:$=$&$7$^$7$?!#(B + +3. mime/draft-file-name $B$,(B nil $B$N$H$-$K;H$&%U%!%$%kL>$r0J2<$N$h$&$K$7$?!#(B + + (make-temp-name (expand-file-name "tm-draft" mime/tmp-dir)) + +4. $BJ,3d$7$?%a%C%;!<%8$K$O!"$b$H$N(B Subject $B$N$&$7$m$K(B (1/3) $B$J$I$H$D$/(B + $B$h$&$K$7$?!#(B + + $B6a$$>-Mh!"(Bsuper-pipe $B$d(B gnus-uu $B$N$h$&$K!"(Bmessage/partial $B$N$H$-$O$I(B + $B$l$+$R$H$D$N5-;v$r$_$l$PB>$N$rC5$7$K9T$/5!G=$,(B tm-view.el $B$Kl9g!"(BBcc:, Dcc: Fcc: $B$J$IK\MhAw$C$?;~$K>C$($k(B + $B$O$:$N$b$N$,FO$$$F$7$^$&(B($B$H$/$K(B Bcc: $B$,8+$($k$N$OLdBj(B)$B!#(B + $B1#$9%U%#!<%k%I$r;XDj$G$-$k$h$&$K$9$Y$-!#(B + +2. $B@8@.$5$l$k(B id $B$,D9$C$?$i$7$/$F$+$C$30-$$!#(B + ($BNc$($P(B GNUS $B$N(B message-id $B@8@.%k!<%A%s$rE>MQ$7$F$O$I$&$+(B) + +$B$J$I$,$"$j$^$9!#(B + +$B $B$^$?!"(Bmessage $B$N:GBg9T?t$rJQ?t(B mime/message-max-length $B$G;XDj$G$-$^(B +$B $B$9!#$H$j$"$($:!"(Bdefault $B$G$O(B 1000 $B9T$K$7$F$"$j$^$9$,!"$3$l$K4X$9$k0lHL(B +$B $BE*$JCM$O$"$k$s$G$7$g$&$+!)(B + +$B9T?t$h$j$O%P%$%H?t$,Bg;v$J$O$:$G!"$h$/8@$o$l$k$N$O(B1$BDL$"$?$j(B50KB$B$rD6$((B +$B$J$$$h$&$K$H$$$&@)Ls$G$9$M(B($B$&$A$N%;%s%?!<$NMxMQ$NAw$G!"Cf?H$O(B base64 +$B$G0l9T(B80$B;zDj$9$k$H!"(B600 $B9T6/$K$"$?$j$^$9!#$7$+$7(B50KB +$B0J>e$N$b$N$ODL$i$J$$$h$&$K$J$C$F$$$k$H$$$&$o$1$G$O$J$/C1$K0BA4$d8zN($r(B +$B9M$($F$NCM$G$7$g$&$+$i!"(Bsplit $B$NI8=`CM$G$b$"$k(B 1000 $B$GLdBj$J$$$H;W$$$^$9!#(B +----- +$B2,It$}\\ + \\ + {\large translated by \Large Ueno Hiroshi} \\ + {\normalsize $<$jl07715@yamato.ibm.co.jp$>$} + } +\date{\verb$Id: tm-eng.tex,v 5.4 1994/10/17 03:05:02 morioka Exp $} + +\begin{document} + +\maketitle +\tableofcontents + +\chapter{Overview} + +The tm package is a set of modules to enjoy MIME on GNU Emacs. Using tm, +you can + +\begin{itemize} +\item playback or view the MIME messages using new mime/viewer-mode +\item encode and decode the multi-lingual headers +\item use the enhanced MIME functions with mh-e, GNUS, and RMAIL +\end{itemize} + +\noindent and more. + + +\section{Module List} + +The tm package includes the modules listed below. + +\begin{itemize} +\item {\bf tiny-mime} : MIME header encoder/decoder +\item {\bf tm-view} : MIME message viewer +\item {\bf tm-misc} : common part of tm-MUAs +\item {\bf tm-MUAs} : MIME function enhancer for MUAs + \begin{itemize} + \item {\bf tm-mh-e} : tm-MUA for mh-e + \item {\bf tm-gnus} : tm-MUA for GNUS + \item {\bf tm-rmail} : tm-MUA for RMAIL + \item {\bf tm-vm} : tm-MUA for vm + \end{itemize} +\item {\bf tm-setup} tm-MUA setup module +\item {\bf mime-setup} MIME setup module +\end{itemize} + + +\chapter{Considerations for Each Version of Emacs} + +\section{Emacs (original)} + +A single character set can be used if you use the original Emacs. + +\section{NEmacs, NEpoch} + +ISO-2022-JP and US-ASCII can be used if you use NEmacs. + + +\section{Mule} + +Mule can handle the multi-lingual text. With Mule, tiny-mime supports +ISO-2022-JP, ISO-2022-JP-2, US-ASCII, ISO-8859-1..9, ISO-2022-CN, +ISO-2022-KR, EUC-KR, etc. You can also add or change +encoding/decoding for character sets by mime/set-charset-and-encoding +function. + + +\chapter{Installation and Setup} + +\section{Installation} + +You can install tm by following the procedures below. + +\begin{enumerate} +\item modify bindir definition in Makefile according to your build + environment. +\item modify the method scripts in methods/ directory so that it + can work in your environment. Refer to \ref{sec:method} section + for how you can suit the method scripts to your environment. +\item make all +\item make install +\item copy all files with .el suffix into the directory pointed by Emacs + load-path variable. +\end{enumerate} + +\noindent{\bf [Notes]} +\begin{itemize} +\item Make sure mh-e version 3.x has been loaded before byte-compiling + tm-mh-e3.el. +\item Make sure GNUS 3 has been loaded before byte-compiling tm-gnus3.el. +\item Use Emacs 18 when you byte-compile tl-18.el. +\item Use the original Emacs when you byte-compile tl-orig.el. +\item Use NEmacs when you byte-compile tl-nemacs.el. +\item Use Mule when you byte-compile tl-mule.el. +\item Modules byte-compiled by Emacs 19 do not work with Emacs 18. +\end{itemize} + + +\section{Setup} + +In the tm package, two files, mime-setup.el and tm-setup.el, are provided +to ease the setup. A mime-setup.el is used for the whole MIME related +setup including MIME encoding, while tm-setup is used to set up tm-MUA +only. + + +\subsection{mime-setup} + +\begin{verbatim} +(load "mime-setup") +\end{verbatim} + +\noindent will perform various settings of MIME. As mime-setup loads +tm-setup, you do not need to load tm-setup when you use mime-setup. + +You can also set up the "automatic signature selection tool" using +mime-setup. If you want to automatically select the signature file +depending on how the message headers show, add lines like shown below +to your .emacs (Refer to the reference manual of signature.el for +more details). + +\begin{verbatim} +(setq signature-file-alist + '((("Newsgroups" . "jokes") . "~/.signature-jokes") + (("Newsgroups" . ("zxr" "nzr")) . "~/.signature-sun") + (("To" . ("ishimaru" "z-suzuki")) . "~/.signature-sun") + (("To" . "tea") . "~/.signature-jokes") + (("To" . ("sim" "oku" "takuo")) . "~/.signature-formal") + )) +\end{verbatim} + +mime-setup requires mime.el. if you set up SuperCite via mime-setup, +you need the SuperCite package also. + + +\subsection{tm-setup} + +tm-setup only sets up tm-MUAs. You do not need to explicitly load +tm-setup if you are using mime-setup for your setup. tm-setup is useful +when you do not want to use mime-setup but want to set up tm-MUAs. + +\begin{verbatim} +(load "tm-setup") +\end{verbatim} + + +\subsection{vm} + +If you want use vm, please insert following in .vm or .emacs: + +\begin{verbatim} +(load "tm-vm") +\end{verbatim} + + +\subsection{setting up without loading provided setup files} + +You may find the valuable hints in tm-setup.el if you want to set up +MIME environment without loading the tm-provided setup files. + + +\subsection{setting up MH} + +If you are using MH-6.8JP2, add the following lines to your +.mh\_profile. + +\begin{verbatim} +scan: -form scan.mime +inc: -form inc.mime +repl: -form replcomps.mime +showproc: mhl +\end{verbatim} + +\noindent Emacs will handle the most part of MH processing. You +should not specify further options in your MH profile to avoid any +possible conflict between MH and Emacs. + + + +\chapter{tm-MUA} + +``tm-MUA'' is a generic name of the modules which enhance the MIME +functions of MUA like mh-e, GNUS, and RMAIL etc. + +The current version of tm provides the following tm-MUA. + +\begin{itemize} +\item {\bf tm-mh-e} : tm-MUA for mh-e +\item {\bf tm-gnus} : tm-MUA for GNUS +\item {\bf tm-rmail} : tm-MUA for RAMIL +\end{itemize} + +\noindent You can find the detailed explanations of these modules in +the following sections. + + +\section{Summary Mode} + +If you are using tm-MUA, the following functions are added to the Summary +mode of the MUA. + +\medskip +\begin{center} + \begin{tabular}{|l|l|}\hline + key & function \\ \hline + M-t & toggles decoding of MIME headers \\ + v & enters mime/view-mode \\ \hline + \end{tabular} +\end{center} +\medskip + + +\section{mime/viewer-mode} +\label{sec:mime/viewer-mode} + +If you are using tm-MUA, mime/viewer-mode becomes active by pressing +{\bf v} key in the Summary mode. In mime/viewer-mode, you can manipulate +the MIME messages by the simple key operations. The following list shows +the functions and their key bindings which can be used in mime/viewer-mode. + +\medskip +\begin{center} + \begin{tabular}{|l|l|}\hline + key & function \\ \hline + u & goes to the upper content \\ + & returns to the Summary mode if the cursor is sitting on + the top content (*1) \\ + p & goes to the previous content \\ + n & goes to the next content \\ + SPC & scrolls up \\ + M-SPC & scrolls down \\ + DEL & scrolls down \\ + RET & goes to the next line \\ + M-RET & goes to the previous line \\ + v & playbacks a content (*2) \\ + e & extracts a file from a content (*2) \\ + C-c C-p & prints a content (*2) \\ \hline + \end{tabular} +\end{center} +\medskip + +\bigskip + +\newcounter{asteriskcount} +\noindent{\bf $B!N(BNote$B!O(B} +\vspace{-1ex} +{\list{(*\arabic{asteriskcount})}{\usecounter{asteriskcount}\leftmargin=8ex} +\item Not return to the Summary mode unless tm-view has been setup using +tm-mh-e, tm-gnus, tm-rmail etc. +\item Actual playback/extract/print will be performed by a method. +\endlist} + + +\section{Customizing tm-gnus} + +\subsection{saving articles without decoding} + +By default, The articles will be saved as they appear in the buffer +at that time. + +You can save the articles always without decoding by setting a +tm-gnus/set-mime-header-decoding-mode variable to nil then call a +function which saves the articles. + +The following example shows how you can save an article without +decoding, preserving the current MIME header decoding mode. + +\begin{verbatim} + (let ((mm mime/header-decoding-mode)) + (tm-gnus/set-mime-header-decoding-mode nil) + (article save function) + (tm-gnus/set-mime-header-decoding-mode mm) + ) +\end{verbatim} + +The following is an example that saves the articles to a folder +of mh-e. + +\begin{verbatim} +(add-hook 'gnus-Startup-hook + (function + (lambda () + (setq gnus-default-article-saver + (function + (lambda () + (interactive) + (let ((mm mime/header-decoding-mode)) + (tm-gnus/set-mime-header-decoding-mode nil) + (gnus-Subject-save-in-folder) + (tm-gnus/set-mime-header-decoding-mode mm) + ))))))) +(add-hook 'gnus-startup-hook + (function + (lambda () + (setq gnus-default-article-saver + (function + (lambda () + (interactive) + (let ((mm mime/header-decoding-mode)) + (tm-gnus/set-mime-header-decoding-mode nil) + (gnus-summary-save-in-folder) + (tm-gnus/set-mime-header-decoding-mode mm) + ))))))) +\end{verbatim} + +\subsection{replying with encoded subject to an article with encoded subject} + +When you reply to an article, you may want to encode the Subject field only +when the original article has an encoded Subject. It can be done by +defining a hook as shown below. + +\begin{verbatim} +(add-hook 'gnus-article-prepare-hook + (function + (lambda () + (if (mime/exist-encoded-word-in-subject) + (setq mime/no-encoding-header-fields '("X-Nsubject")) + (setq mime/no-encoding-header-fields '("X-Nsubject" "Subject")) + )))) +\end{verbatim} + + +\chapter{tm-view} + +tm-view is a module which is used to examine the MIME messages. +It provides a mime/viewer-mode for that purpose. + +Regarding the functions of mime/viewer-mode, refer to +\ref{sec:mime/viewer-mode} section. + +\section{Defining Conditions of Decoding} + +A mime/content-decoding-condition variable is used to define the methods +which will be called at decoding. It replaces a +mime/content-decoding-method-alist variable of tm-view version 4.x. + +A mime/content-decoding-method-alist only allowed you to define a +method used for each content-type/subtype. Now a +mime/content-decoding-condition variable allows you to write more +complicated statements to describe the more detailed conditions to determine +which method is to be use. + +A mime/content-decoding-condition variable is defined as a list with the +following syntax. + +\begin{eqnarray*} + (condition_1 \;\; condition_2 \;\; ...) +\end{eqnarray*} + +\noindent Each condition is an association list with the following +syntax. + +\begin{eqnarray*} + ((field-type_1 \; . \; value_1) \;\; + (field-type_2 \; . \; value_2) \;\; ...) +\end{eqnarray*} + +\noindent + +For example, if you want to call the external method named tm-plain +to decode every text/plain type content, you can define the condition like + +\begin{quote} + ((type . "text/plain") + (method "tm-plain" nil 'file 'type 'encoding 'mode 'name)) +\end{quote} + +\noindent As you notice, now you can define the arguments to pass to a +external method. Refer to \ref{sec:method-arguments} section for more +explanation. + +This condition definition will match all contents whose types are text/plain. +Here is an another example. + +\begin{quote} + ((type . "text/plain") + (method "tm-plain" nil 'file 'type 'encoding 'mode 'name) + (mode . "play")) +\end{quote} + +\noindent This will match the content whose type is text/plain and +the mode is play. + + +\begin{quote} + ((method "metamail" t "-m" "tm" "-x" "-d" "-z" "-e" 'file) + (mode . "play")) +\end{quote} + +\noindent This will match all contents which have a mode of play. + +The conditions defined in a mime/content-decoding-condition variable +are examined from top to bottom. The first matching condition +becomes valid and the method specified in that condition definition +will be executed. + + +\subsection{arguments of method} +\label{sec:method-arguments} + +You can specify the method field of the condition definition in two +different ways. + +\begin{eqnarray*} + (method \; . \; SYMBOL) +\end{eqnarray*} + +\noindent or + +\begin{eqnarray*} + (method \; STRING \; FLAG \; ARGUMENT_1 \; ARGUMENT_2 \; ...) +\end{eqnarray*} + +\noindent can be accepted. + +When a symbol is specified in the method field, it will be called as +an internal method. + +When a list is specified in the method field, it will be called as an +external method. The list below shows the meaning of the parameters +when the external method is specified in the method field. + +\begin{description} +\item [STRING] name of an external method +\item [FLAG] if t, both the content header and the content body are + passed to an external method. if nil, only the content body is + passed to an external method. +\item [ARGUMENT$_x$] list of arguments passed to an external method +\end{description} + +An argument passed to an external method can be in one of the following +formats. + +\begin{quote} + \begin{tabular}{lcl} + STRING&:&string itself \\ + 'SYMBOL&:&value gotten using SYMBOL as a key (see below) \\ + 'STRING&:&value gotten using STRING as a key (see below) + \end{tabular} +\end{quote} + +'SYMBOL can be one of the following. + +\begin{quote} + \begin{tabular}{lcl} + 'file&:&name of a file holding the original content \\ + 'type&:&content-type/sub-type \\ + 'encoding&:&content-transfer-encoding \\ + 'mode&:&decoding mode \\ + 'name&:&name of a file created by decode operation + \end{tabular} +\end{quote} + +\noindent 'STRING is used to search a parameter of the Content-Type +field whose name matches with it, and pass the value of that parameter +to the external method. + + +\subsection{examples} + +The default definition of a mime/content-decoding-condition variable is +shown below. + +\begin{verbatim} +(defvar mime/content-decoding-condition + '(((type . "text/plain") + (method "tm-plain" nil 'file 'type 'encoding 'mode 'name)) + ((type . "text/x-latex") + (method "tm-latex" nil 'file 'type 'encoding 'mode 'name)) + ((type . "audio/basic") + (method "tm-au" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/gif") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/jpeg") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/tiff") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/x-tiff") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/x-xbm") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/x-pic") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "video/mpeg")` + (method "tm-mpeg" nil 'file 'type 'encoding 'mode 'name)) + ((type . "application/octet-stream") + (method "tm-file" nil 'file 'type 'encoding 'mode 'name)) + ((type . "message/partial") + (method . mime/decode-message/partial-region)) + ((method "metamail" t + "-m" "tm" "-x" "-d" "-z" "-e" 'file)(mode . "play")) + )) +\end{verbatim} + +For example, if you want to use metamail to decode any contents, + +\begin{verbatim} +(setq mime/content-decoding-condition + '( + ((method "metamail" t "-m" "tm" "-x" "-d" "-z" "-e" 'file)) + )) +\end{verbatim} + +\noindent will work. + +A mime/content-decoding-condition variable provides you of very flexible +way to define the conditions of decoding. It can be simple if you only +need the a few decoding methods, while it can be very complicated if you +want to use the separate decoding method for each type/mode combination. + + +\section{Method Script} +\label{sec:method} + +The methods are written in shell script. The arguments passed from tm-view.el +to each method can be customized using mime/content-decoding-condition +variable. If you use the tm-provided setting of +mime/content-decoding-condition variable, the following arguments are +passed to the method. + +\medskip +\begin{center} + \begin{tabular}{|c|l|} \hline + argument & \multicolumn{1}{|c|}{ meaning }\\ \hline + \$1 & file name before decoded \\ + \$2 & Content-Type (type/sub-type) \\ + \$3 & encoding + \{7bit / quoted-printable / base64 / 8bit / binary / ...\}\\ + \$4 & decoding-mode \{play / extract / print\} \\ + \$5 & file name after decoded \\ \hline + \end{tabular} +\end{center} +\medskip + +Exceptionally, no method is used to restore message/partial messages +into one message. It is done by tm-view.el itself. + + +\section{Changing Appearance} + +Each content in the preview buffer is shown in the following format. + +\begin{verbatim} +[1 (text/plain)] + +body +\end{verbatim} + +\noindent tm-view shows one content in three separate portions. + +\begin{itemize} +\item content subject +\item content header +\item content body +\end{itemize} + +\noindent + + +\subsection{content subject} + +A content subject indicates the beginning of a content in the preview +buffer. By default, it will be shown as below. + +\begin{quote} + [cid title (type)] +\end{quote} + +\noindent The cid field shows the position of a content in the message. +It can be considered as the chapter number in the message. The title +field is composed of the text string from the Subject and the +Content-Description field. The type field is a copy of a +text string specified in the type/subtype field of the content. + +You can customize how the content subject appears in the preview +buffer by modifying a definition of mime/make-content-subject-function +variable. The tm-view provides a following definition as a default. + +\begin{verbatim} +(defvar mime/make-content-subject-function + (function + (lambda (cid subj ctype) + (insert + (format "[%s %s (%s)]\n" + (if (listp cid) + (mapconcat (function + (lambda (num) + (format "%s" (+ num 1)) + )) + cid ".") + "0") + subj (car ctype))) + ))) +\end{verbatim} + +\noindent The following is an example of the customization. + +\begin{verbatim} +(setq mime/make-content-subject-function + (function + (lambda (cid subj ctype) + (if (not (member (car ctype) mime/default-showing-Content-Type-list)) + (insert + (format "[%s %s (%s)]\n" + (if (listp cid) + (mapconcat (function + (lambda (num) + (format "%s" (+ num 1)) + )) + cid ".") + "0") + subj (car ctype)))) + ))) +\end{verbatim} + +\noindent This will show the content subjects only for the contents whose body +portions are to be hidden. + + +\subsection{content header} + +A content header shows the header portion of a content in the preview +buffer. The default setup will show no content headers. + +You can customize how the content header appears in the preview +buffer by modifying a definition of mime/make-content-header-filter +variable. The tm-view provides a following default definition. + + +\begin{verbatim} +(defvar mime/make-content-header-filter + (function + (lambda (cid) + (if (listp cid) + (delete-region (goto-char (point-min)) + (or (and (re-search-forward "^$" nil t) + (match-end 0)) + (point-max)) + ) + ) + ))) +\end{verbatim} + +\noindent The default setting removes all content headers +until it detects a blank line delimiting the headers and the body. +If you change a mime/make-content-header-filter variable like + +\begin{verbatim} +(setq mime/make-content-header-filter + (function + (lambda (cid) + ))) +\end{verbatim} + +\noindent you will see all headers in the content header portion. + + +\subsection{content body} + +According to the type of content, the body portion of the content +is managed by tm-view using + +\begin{enumerate} +\item Hide +\item Process +\end{enumerate} + +\noindent techniques before it is put in the preview buffer. + +'Hide' is performed to prevent showing the non-text type content body +in the preview buffer. A mime/default-showing-Content-Type-list +variable defines which type of contents will NOT be hidden. It has +the following default value. + +\begin{verbatim} +(defvar mime/default-showing-Content-Type-list + '("text/plain" "text/richtext" "text/enriched" "text/x-latex" nil)) +\end{verbatim} + +\noindent All contents are hidden except text/plain, text/richtext, +text/enriched, text/x-latex, and non-MIME contents. + +A content body which was not "hidden" is then "processed". A list +in a mime/content-filter-alist variable will be searched looking up +an entry which matches with the content-type of a content. If a matching +entry is found, the function defined in that entry will be called +to "process" a content body. + +A mime/content-filter-alist variable has nil as a default value. It +will have non-nil after loading tm-rich.el which contains the following +lines. + +\begin{verbatim} +(aput 'mime/content-filter-alist + "text/enriched" (function mime/decode-text/enriched-body)) +\end{verbatim} + +\noindent This is defining a process to be done to the text/enriched +type content body. A function mime/decode-text/enriched-body will +be called if a text/enriched body need to be "processed". + + +\section{Restrictions} + +A decode-b.c file in the tm package is the source of the BASE64 +decoder. As it was not thoroughly tested, it may not work for you. +But at least you can see what it wants to do so that you can correct +errors in the source code. (\verb+^+\_\verb+^+; + +Or you can use mmencode in the metamail package to decode the BASE64 +encoded messages. + +Use mmencode to decode the Quoted-Printable messages. The tm package +does not include the decoder for Quoted-Printable. + + +\chapter{tiny-mime} + +tiny-mime is a multi-lingual MIME style message header +encoder/decoder based on RFC 1522 for Mule, NEmacs, and NEpoch. It +is based on Mr. Enami's ISO-2022-JP Base64 MIME header decoder which +could decode only ISO-2022-JP Base64-encoded headers. The following list +shows some of the functional enhancemets I made in tiny-mime. + +\begin{itemize} +\item unfolding at decoding +\item encoding/decoding multilingual character sets, such as, + ISO-2022-JP, ISO-2022-JP-2, ISO-2022-CN, ISO-2022-KR, ISO-8859-*, + US-ASCII, EUC-KR +\item Q-encoding +\item compliance with RFC 1522 +\end{itemize} + +\noindent and more. + +tiny-mime is a MIME headers encoder/decoder in the tm package and used +by tm-view and tm-MUAs. + + +\section{mime/decode-message-header} + +{\tt mime/decode-message-header} is a command to decode the MIME headers. +You need to load tiny-mime before you can use this command. + +{\list{}{\leftmargin=8ex}\item[] +\par +M-x {\tt mime/decode-message-header} +\endlist} + +\noindent will decode the MIME headers in the current buffer. + +tm-MUAs and tm-view use this command to decode the MIME headers. +Therefore, it may not be required to explicitly execute this command if +you are using them. + + +\section{mime/decode-region} + +You can decode the MIME messages within the specified region by executing + +{\list{}{\leftmargin=8ex}\item[] +\par +M-x {\tt mime/decode-region} +\endlist} + +\noindent This is useful when you want to decode the MIME headers +which are yanked from the referenced article. + + +\chapter{Reporting Bugs} + +Please report tm bugs you find to fj.editor.emacs or send a mail to +tm ML, $<$tm@chamonix.jaist.ac.jp$>$. + +Via tm ML, You can report bugs of tm, obtain the latest release of tm +package, and discuss the future enhancements to tm. To join tm ML, +send a mail to + +\begin{center} + tm-admin@chamonix.jaist.ac.jp +\end{center} + +\noindent Since the user registration is manually done, please write +the mail body in human-recognizable language (\verb+^+\_\verb+^+). + +\end{document} diff --git a/doc/tm-eng.tex,v b/doc/tm-eng.tex,v new file mode 100644 index 0000000..50244a9 --- /dev/null +++ b/doc/tm-eng.tex,v @@ -0,0 +1,830 @@ +head 5.4; +access; +symbols; +locks; strict; +comment @% @; + + +5.4 +date 94.10.17.03.05.02; author morioka; state Exp; +branches; +next 5.2; + +5.2 +date 94.10.17.02.55.02; author morioka; state Exp; +branches; +next ; + + +desc +@@ + + +5.4 +log +@I added description for vm. +@ +text +@\documentstyle{report} + +\title{tm Reference Manual (English Edition)} +\author{{\Large Morioka Tomohiko} \\ + {\normalsize $<$morioka@@jaist.ac.jp$>$}\\ + \\ + {\large translated by \Large Ueno Hiroshi} \\ + {\normalsize $<$jl07715@@yamato.ibm.co.jp$>$} + } +\date{\verb$Id: tm-eng.tex,v 5.2 1994/10/17 02:55:02 morioka Exp morioka $} + +\begin{document} + +\maketitle +\tableofcontents + +\chapter{Overview} + +The tm package is a set of modules to enjoy MIME on GNU Emacs. Using tm, +you can + +\begin{itemize} +\item playback or view the MIME messages using new mime/viewer-mode +\item encode and decode the multi-lingual headers +\item use the enhanced MIME functions with mh-e, GNUS, and RMAIL +\end{itemize} + +\noindent and more. + + +\section{Module List} + +The tm package includes the modules listed below. + +\begin{itemize} +\item {\bf tiny-mime} : MIME header encoder/decoder +\item {\bf tm-view} : MIME message viewer +\item {\bf tm-misc} : common part of tm-MUAs +\item {\bf tm-MUAs} : MIME function enhancer for MUAs + \begin{itemize} + \item {\bf tm-mh-e} : tm-MUA for mh-e + \item {\bf tm-gnus} : tm-MUA for GNUS + \item {\bf tm-rmail} : tm-MUA for RMAIL + \item {\bf tm-vm} : tm-MUA for vm + \end{itemize} +\item {\bf tm-setup} tm-MUA setup module +\item {\bf mime-setup} MIME setup module +\end{itemize} + + +\chapter{Considerations for Each Version of Emacs} + +\section{Emacs (original)} + +A single character set can be used if you use the original Emacs. + +\section{NEmacs, NEpoch} + +ISO-2022-JP and US-ASCII can be used if you use NEmacs. + + +\section{Mule} + +Mule can handle the multi-lingual text. With Mule, tiny-mime supports +ISO-2022-JP, ISO-2022-JP-2, US-ASCII, ISO-8859-1..9, ISO-2022-CN, +ISO-2022-KR, EUC-KR, etc. You can also add or change +encoding/decoding for character sets by mime/set-charset-and-encoding +function. + + +\chapter{Installation and Setup} + +\section{Installation} + +You can install tm by following the procedures below. + +\begin{enumerate} +\item modify bindir definition in Makefile according to your build + environment. +\item modify the method scripts in methods/ directory so that it + can work in your environment. Refer to \ref{sec:method} section + for how you can suit the method scripts to your environment. +\item make all +\item make install +\item copy all files with .el suffix into the directory pointed by Emacs + load-path variable. +\end{enumerate} + +\noindent{\bf [Notes]} +\begin{itemize} +\item Make sure mh-e version 3.x has been loaded before byte-compiling + tm-mh-e3.el. +\item Make sure GNUS 3 has been loaded before byte-compiling tm-gnus3.el. +\item Use Emacs 18 when you byte-compile tl-18.el. +\item Use the original Emacs when you byte-compile tl-orig.el. +\item Use NEmacs when you byte-compile tl-nemacs.el. +\item Use Mule when you byte-compile tl-mule.el. +\item Modules byte-compiled by Emacs 19 do not work with Emacs 18. +\end{itemize} + + +\section{Setup} + +In the tm package, two files, mime-setup.el and tm-setup.el, are provided +to ease the setup. A mime-setup.el is used for the whole MIME related +setup including MIME encoding, while tm-setup is used to set up tm-MUA +only. + + +\subsection{mime-setup} + +\begin{verbatim} +(load "mime-setup") +\end{verbatim} + +\noindent will perform various settings of MIME. As mime-setup loads +tm-setup, you do not need to load tm-setup when you use mime-setup. + +You can also set up the "automatic signature selection tool" using +mime-setup. If you want to automatically select the signature file +depending on how the message headers show, add lines like shown below +to your .emacs (Refer to the reference manual of signature.el for +more details). + +\begin{verbatim} +(setq signature-file-alist + '((("Newsgroups" . "jokes") . "~/.signature-jokes") + (("Newsgroups" . ("zxr" "nzr")) . "~/.signature-sun") + (("To" . ("ishimaru" "z-suzuki")) . "~/.signature-sun") + (("To" . "tea") . "~/.signature-jokes") + (("To" . ("sim" "oku" "takuo")) . "~/.signature-formal") + )) +\end{verbatim} + +mime-setup requires mime.el. if you set up SuperCite via mime-setup, +you need the SuperCite package also. + + +\subsection{tm-setup} + +tm-setup only sets up tm-MUAs. You do not need to explicitly load +tm-setup if you are using mime-setup for your setup. tm-setup is useful +when you do not want to use mime-setup but want to set up tm-MUAs. + +\begin{verbatim} +(load "tm-setup") +\end{verbatim} + + +\subsection{vm} + +If you want use vm, please insert following in .vm or .emacs: + +\begin{verbatim} +(load "tm-vm") +\end{verbatim} + + +\subsection{setting up without loading provided setup files} + +You may find the valuable hints in tm-setup.el if you want to set up +MIME environment without loading the tm-provided setup files. + + +\subsection{setting up MH} + +If you are using MH-6.8JP2, add the following lines to your +.mh\_profile. + +\begin{verbatim} +scan: -form scan.mime +inc: -form inc.mime +repl: -form replcomps.mime +showproc: mhl +\end{verbatim} + +\noindent Emacs will handle the most part of MH processing. You +should not specify further options in your MH profile to avoid any +possible conflict between MH and Emacs. + + + +\chapter{tm-MUA} + +``tm-MUA'' is a generic name of the modules which enhance the MIME +functions of MUA like mh-e, GNUS, and RMAIL etc. + +The current version of tm provides the following tm-MUA. + +\begin{itemize} +\item {\bf tm-mh-e} : tm-MUA for mh-e +\item {\bf tm-gnus} : tm-MUA for GNUS +\item {\bf tm-rmail} : tm-MUA for RAMIL +\end{itemize} + +\noindent You can find the detailed explanations of these modules in +the following sections. + + +\section{Summary Mode} + +If you are using tm-MUA, the following functions are added to the Summary +mode of the MUA. + +\medskip +\begin{center} + \begin{tabular}{|l|l|}\hline + key & function \\ \hline + M-t & toggles decoding of MIME headers \\ + v & enters mime/view-mode \\ \hline + \end{tabular} +\end{center} +\medskip + + +\section{mime/viewer-mode} +\label{sec:mime/viewer-mode} + +If you are using tm-MUA, mime/viewer-mode becomes active by pressing +{\bf v} key in the Summary mode. In mime/viewer-mode, you can manipulate +the MIME messages by the simple key operations. The following list shows +the functions and their key bindings which can be used in mime/viewer-mode. + +\medskip +\begin{center} + \begin{tabular}{|l|l|}\hline + key & function \\ \hline + u & goes to the upper content \\ + & returns to the Summary mode if the cursor is sitting on + the top content (*1) \\ + p & goes to the previous content \\ + n & goes to the next content \\ + SPC & scrolls up \\ + M-SPC & scrolls down \\ + DEL & scrolls down \\ + RET & goes to the next line \\ + M-RET & goes to the previous line \\ + v & playbacks a content (*2) \\ + e & extracts a file from a content (*2) \\ + C-c C-p & prints a content (*2) \\ \hline + \end{tabular} +\end{center} +\medskip + +\bigskip + +\newcounter{asteriskcount} +\noindent{\bf $B!N(BNote$B!O(B} +\vspace{-1ex} +{\list{(*\arabic{asteriskcount})}{\usecounter{asteriskcount}\leftmargin=8ex} +\item Not return to the Summary mode unless tm-view has been setup using +tm-mh-e, tm-gnus, tm-rmail etc. +\item Actual playback/extract/print will be performed by a method. +\endlist} + + +\section{Customizing tm-gnus} + +\subsection{saving articles without decoding} + +By default, The articles will be saved as they appear in the buffer +at that time. + +You can save the articles always without decoding by setting a +tm-gnus/set-mime-header-decoding-mode variable to nil then call a +function which saves the articles. + +The following example shows how you can save an article without +decoding, preserving the current MIME header decoding mode. + +\begin{verbatim} + (let ((mm mime/header-decoding-mode)) + (tm-gnus/set-mime-header-decoding-mode nil) + (article save function) + (tm-gnus/set-mime-header-decoding-mode mm) + ) +\end{verbatim} + +The following is an example that saves the articles to a folder +of mh-e. + +\begin{verbatim} +(add-hook 'gnus-Startup-hook + (function + (lambda () + (setq gnus-default-article-saver + (function + (lambda () + (interactive) + (let ((mm mime/header-decoding-mode)) + (tm-gnus/set-mime-header-decoding-mode nil) + (gnus-Subject-save-in-folder) + (tm-gnus/set-mime-header-decoding-mode mm) + ))))))) +(add-hook 'gnus-startup-hook + (function + (lambda () + (setq gnus-default-article-saver + (function + (lambda () + (interactive) + (let ((mm mime/header-decoding-mode)) + (tm-gnus/set-mime-header-decoding-mode nil) + (gnus-summary-save-in-folder) + (tm-gnus/set-mime-header-decoding-mode mm) + ))))))) +\end{verbatim} + +\subsection{replying with encoded subject to an article with encoded subject} + +When you reply to an article, you may want to encode the Subject field only +when the original article has an encoded Subject. It can be done by +defining a hook as shown below. + +\begin{verbatim} +(add-hook 'gnus-article-prepare-hook + (function + (lambda () + (if (mime/exist-encoded-word-in-subject) + (setq mime/no-encoding-header-fields '("X-Nsubject")) + (setq mime/no-encoding-header-fields '("X-Nsubject" "Subject")) + )))) +\end{verbatim} + + +\chapter{tm-view} + +tm-view is a module which is used to examine the MIME messages. +It provides a mime/viewer-mode for that purpose. + +Regarding the functions of mime/viewer-mode, refer to +\ref{sec:mime/viewer-mode} section. + +\section{Defining Conditions of Decoding} + +A mime/content-decoding-condition variable is used to define the methods +which will be called at decoding. It replaces a +mime/content-decoding-method-alist variable of tm-view version 4.x. + +A mime/content-decoding-method-alist only allowed you to define a +method used for each content-type/subtype. Now a +mime/content-decoding-condition variable allows you to write more +complicated statements to describe the more detailed conditions to determine +which method is to be use. + +A mime/content-decoding-condition variable is defined as a list with the +following syntax. + +\begin{eqnarray*} + (condition_1 \;\; condition_2 \;\; ...) +\end{eqnarray*} + +\noindent Each condition is an association list with the following +syntax. + +\begin{eqnarray*} + ((field-type_1 \; . \; value_1) \;\; + (field-type_2 \; . \; value_2) \;\; ...) +\end{eqnarray*} + +\noindent + +For example, if you want to call the external method named tm-plain +to decode every text/plain type content, you can define the condition like + +\begin{quote} + ((type . "text/plain") + (method "tm-plain" nil 'file 'type 'encoding 'mode 'name)) +\end{quote} + +\noindent As you notice, now you can define the arguments to pass to a +external method. Refer to \ref{sec:method-arguments} section for more +explanation. + +This condition definition will match all contents whose types are text/plain. +Here is an another example. + +\begin{quote} + ((type . "text/plain") + (method "tm-plain" nil 'file 'type 'encoding 'mode 'name) + (mode . "play")) +\end{quote} + +\noindent This will match the content whose type is text/plain and +the mode is play. + + +\begin{quote} + ((method "metamail" t "-m" "tm" "-x" "-d" "-z" "-e" 'file) + (mode . "play")) +\end{quote} + +\noindent This will match all contents which have a mode of play. + +The conditions defined in a mime/content-decoding-condition variable +are examined from top to bottom. The first matching condition +becomes valid and the method specified in that condition definition +will be executed. + + +\subsection{arguments of method} +\label{sec:method-arguments} + +You can specify the method field of the condition definition in two +different ways. + +\begin{eqnarray*} + (method \; . \; SYMBOL) +\end{eqnarray*} + +\noindent or + +\begin{eqnarray*} + (method \; STRING \; FLAG \; ARGUMENT_1 \; ARGUMENT_2 \; ...) +\end{eqnarray*} + +\noindent can be accepted. + +When a symbol is specified in the method field, it will be called as +an internal method. + +When a list is specified in the method field, it will be called as an +external method. The list below shows the meaning of the parameters +when the external method is specified in the method field. + +\begin{description} +\item [STRING] name of an external method +\item [FLAG] if t, both the content header and the content body are + passed to an external method. if nil, only the content body is + passed to an external method. +\item [ARGUMENT$_x$] list of arguments passed to an external method +\end{description} + +An argument passed to an external method can be in one of the following +formats. + +\begin{quote} + \begin{tabular}{lcl} + STRING&:&string itself \\ + 'SYMBOL&:&value gotten using SYMBOL as a key (see below) \\ + 'STRING&:&value gotten using STRING as a key (see below) + \end{tabular} +\end{quote} + +'SYMBOL can be one of the following. + +\begin{quote} + \begin{tabular}{lcl} + 'file&:&name of a file holding the original content \\ + 'type&:&content-type/sub-type \\ + 'encoding&:&content-transfer-encoding \\ + 'mode&:&decoding mode \\ + 'name&:&name of a file created by decode operation + \end{tabular} +\end{quote} + +\noindent 'STRING is used to search a parameter of the Content-Type +field whose name matches with it, and pass the value of that parameter +to the external method. + + +\subsection{examples} + +The default definition of a mime/content-decoding-condition variable is +shown below. + +\begin{verbatim} +(defvar mime/content-decoding-condition + '(((type . "text/plain") + (method "tm-plain" nil 'file 'type 'encoding 'mode 'name)) + ((type . "text/x-latex") + (method "tm-latex" nil 'file 'type 'encoding 'mode 'name)) + ((type . "audio/basic") + (method "tm-au" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/gif") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/jpeg") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/tiff") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/x-tiff") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/x-xbm") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/x-pic") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "video/mpeg")` + (method "tm-mpeg" nil 'file 'type 'encoding 'mode 'name)) + ((type . "application/octet-stream") + (method "tm-file" nil 'file 'type 'encoding 'mode 'name)) + ((type . "message/partial") + (method . mime/decode-message/partial-region)) + ((method "metamail" t + "-m" "tm" "-x" "-d" "-z" "-e" 'file)(mode . "play")) + )) +\end{verbatim} + +For example, if you want to use metamail to decode any contents, + +\begin{verbatim} +(setq mime/content-decoding-condition + '( + ((method "metamail" t "-m" "tm" "-x" "-d" "-z" "-e" 'file)) + )) +\end{verbatim} + +\noindent will work. + +A mime/content-decoding-condition variable provides you of very flexible +way to define the conditions of decoding. It can be simple if you only +need the a few decoding methods, while it can be very complicated if you +want to use the separate decoding method for each type/mode combination. + + +\section{Method Script} +\label{sec:method} + +The methods are written in shell script. The arguments passed from tm-view.el +to each method can be customized using mime/content-decoding-condition +variable. If you use the tm-provided setting of +mime/content-decoding-condition variable, the following arguments are +passed to the method. + +\medskip +\begin{center} + \begin{tabular}{|c|l|} \hline + argument & \multicolumn{1}{|c|}{ meaning }\\ \hline + \$1 & file name before decoded \\ + \$2 & Content-Type (type/sub-type) \\ + \$3 & encoding + \{7bit / quoted-printable / base64 / 8bit / binary / ...\}\\ + \$4 & decoding-mode \{play / extract / print\} \\ + \$5 & file name after decoded \\ \hline + \end{tabular} +\end{center} +\medskip + +Exceptionally, no method is used to restore message/partial messages +into one message. It is done by tm-view.el itself. + + +\section{Changing Appearance} + +Each content in the preview buffer is shown in the following format. + +\begin{verbatim} +[1 (text/plain)] + +body +\end{verbatim} + +\noindent tm-view shows one content in three separate portions. + +\begin{itemize} +\item content subject +\item content header +\item content body +\end{itemize} + +\noindent + + +\subsection{content subject} + +A content subject indicates the beginning of a content in the preview +buffer. By default, it will be shown as below. + +\begin{quote} + [cid title (type)] +\end{quote} + +\noindent The cid field shows the position of a content in the message. +It can be considered as the chapter number in the message. The title +field is composed of the text string from the Subject and the +Content-Description field. The type field is a copy of a +text string specified in the type/subtype field of the content. + +You can customize how the content subject appears in the preview +buffer by modifying a definition of mime/make-content-subject-function +variable. The tm-view provides a following definition as a default. + +\begin{verbatim} +(defvar mime/make-content-subject-function + (function + (lambda (cid subj ctype) + (insert + (format "[%s %s (%s)]\n" + (if (listp cid) + (mapconcat (function + (lambda (num) + (format "%s" (+ num 1)) + )) + cid ".") + "0") + subj (car ctype))) + ))) +\end{verbatim} + +\noindent The following is an example of the customization. + +\begin{verbatim} +(setq mime/make-content-subject-function + (function + (lambda (cid subj ctype) + (if (not (member (car ctype) mime/default-showing-Content-Type-list)) + (insert + (format "[%s %s (%s)]\n" + (if (listp cid) + (mapconcat (function + (lambda (num) + (format "%s" (+ num 1)) + )) + cid ".") + "0") + subj (car ctype)))) + ))) +\end{verbatim} + +\noindent This will show the content subjects only for the contents whose body +portions are to be hidden. + + +\subsection{content header} + +A content header shows the header portion of a content in the preview +buffer. The default setup will show no content headers. + +You can customize how the content header appears in the preview +buffer by modifying a definition of mime/make-content-header-filter +variable. The tm-view provides a following default definition. + + +\begin{verbatim} +(defvar mime/make-content-header-filter + (function + (lambda (cid) + (if (listp cid) + (delete-region (goto-char (point-min)) + (or (and (re-search-forward "^$" nil t) + (match-end 0)) + (point-max)) + ) + ) + ))) +\end{verbatim} + +\noindent The default setting removes all content headers +until it detects a blank line delimiting the headers and the body. +If you change a mime/make-content-header-filter variable like + +\begin{verbatim} +(setq mime/make-content-header-filter + (function + (lambda (cid) + ))) +\end{verbatim} + +\noindent you will see all headers in the content header portion. + + +\subsection{content body} + +According to the type of content, the body portion of the content +is managed by tm-view using + +\begin{enumerate} +\item Hide +\item Process +\end{enumerate} + +\noindent techniques before it is put in the preview buffer. + +'Hide' is performed to prevent showing the non-text type content body +in the preview buffer. A mime/default-showing-Content-Type-list +variable defines which type of contents will NOT be hidden. It has +the following default value. + +\begin{verbatim} +(defvar mime/default-showing-Content-Type-list + '("text/plain" "text/richtext" "text/enriched" "text/x-latex" nil)) +\end{verbatim} + +\noindent All contents are hidden except text/plain, text/richtext, +text/enriched, text/x-latex, and non-MIME contents. + +A content body which was not "hidden" is then "processed". A list +in a mime/content-filter-alist variable will be searched looking up +an entry which matches with the content-type of a content. If a matching +entry is found, the function defined in that entry will be called +to "process" a content body. + +A mime/content-filter-alist variable has nil as a default value. It +will have non-nil after loading tm-rich.el which contains the following +lines. + +\begin{verbatim} +(aput 'mime/content-filter-alist + "text/enriched" (function mime/decode-text/enriched-body)) +\end{verbatim} + +\noindent This is defining a process to be done to the text/enriched +type content body. A function mime/decode-text/enriched-body will +be called if a text/enriched body need to be "processed". + + +\section{Restrictions} + +A decode-b.c file in the tm package is the source of the BASE64 +decoder. As it was not thoroughly tested, it may not work for you. +But at least you can see what it wants to do so that you can correct +errors in the source code. (\verb+^+\_\verb+^+; + +Or you can use mmencode in the metamail package to decode the BASE64 +encoded messages. + +Use mmencode to decode the Quoted-Printable messages. The tm package +does not include the decoder for Quoted-Printable. + + +\chapter{tiny-mime} + +tiny-mime is a multi-lingual MIME style message header +encoder/decoder based on RFC 1522 for Mule, NEmacs, and NEpoch. It +is based on Mr. Enami's ISO-2022-JP Base64 MIME header decoder which +could decode only ISO-2022-JP Base64-encoded headers. The following list +shows some of the functional enhancemets I made in tiny-mime. + +\begin{itemize} +\item unfolding at decoding +\item encoding/decoding multilingual character sets, such as, + ISO-2022-JP, ISO-2022-JP-2, ISO-2022-CN, ISO-2022-KR, ISO-8859-*, + US-ASCII, EUC-KR +\item Q-encoding +\item compliance with RFC 1522 +\end{itemize} + +\noindent and more. + +tiny-mime is a MIME headers encoder/decoder in the tm package and used +by tm-view and tm-MUAs. + + +\section{mime/decode-message-header} + +{\tt mime/decode-message-header} is a command to decode the MIME headers. +You need to load tiny-mime before you can use this command. + +{\list{}{\leftmargin=8ex}\item[] +\par +M-x {\tt mime/decode-message-header} +\endlist} + +\noindent will decode the MIME headers in the current buffer. + +tm-MUAs and tm-view use this command to decode the MIME headers. +Therefore, it may not be required to explicitly execute this command if +you are using them. + + +\section{mime/decode-region} + +You can decode the MIME messages within the specified region by executing + +{\list{}{\leftmargin=8ex}\item[] +\par +M-x {\tt mime/decode-region} +\endlist} + +\noindent This is useful when you want to decode the MIME headers +which are yanked from the referenced article. + + +\chapter{Reporting Bugs} + +Please report tm bugs you find to fj.editor.emacs or send a mail to +tm ML, $<$tm@@chamonix.jaist.ac.jp$>$. + +Via tm ML, You can report bugs of tm, obtain the latest release of tm +package, and discuss the future enhancements to tm. To join tm ML, +send a mail to + +\begin{center} + tm-admin@@chamonix.jaist.ac.jp +\end{center} + +\noindent Since the user registration is manually done, please write +the mail body in human-recognizable language (\verb+^+\_\verb+^+). + +\end{document} +@ + + +5.2 +log +@*** empty log message *** +@ +text +@d10 1 +a10 1 +\date{\verb$Id: tm-eng.tex,v 5.2 1994/10/11 17:17:05 morioka Exp $} +d44 1 +d147 9 +@ diff --git a/doc/tm-jp.tex b/doc/tm-jp.tex new file mode 100644 index 0000000..80da255 --- /dev/null +++ b/doc/tm-jp.tex @@ -0,0 +1,750 @@ +\documentstyle[a4j]{jreport} + +\title{tm ÀâÌÀ½ñ} +\author{¼é²¬ ÃÎɧ\\ + morioka@jaist.ac.jp} +\date{\verb$Id: tm-jp.tex,v 5.4 1994/10/17 02:58:20 morioka Exp $} + +\begin{document} + +\maketitle +\tableofcontents + +\chapter{¤Ï¤¸¤á¤Ë} + +tm ¤Ï GNU Emacs ¤Ç MIME ¤ò³Ú¤·¤à¤¿¤á¤Î package ¤Ç¤¹¡£tm ¤ò»È¤¦¤È¡¢ + +\begin{itemize} +\item mime/viewer-mode ¤ò»È¤Ã¤¿ MIME message ¤Î±ÜÍ÷¡¦ºÆÀ¸ +\item ¿¸À¸ì header ¤Î encode/decode +\item mh-e, GNUS, RMAIL ¤Ç¤Î MIME µ¡Ç½¤Î¶¯²½ +\end{itemize} + +\noindent ¤¬¹Ô¤Ê¤¨¤Þ¤¹¡£ + + +\section{Module °ìÍ÷} + +tm ¤Ï°Ê²¼¤Î module ¤«¤é¤Ê¤ê¤Þ¤¹¡£ + +\begin{itemize} +\item {\bf tiny-mime} : MIME header encoder/decoder +\item {\bf tm-view} : MIME viewer +\item {\bf tm-misc} : tm-MUA ¤Î¶¦ÄÌ module +\item {\bf tm-MUAs} : MUA ¤Î MIME µ¡Ç½¶¯²½ module + \begin{itemize} + \item {\bf tm-mh-e} : mh-e ÍѤΠtm-MUA + \item {\bf tm-gnus} : GNUS ÍѤΠtm-MUA + \item {\bf tm-rmail} : RMAIL ÍѤΠtm-MUA + \item {\bf tm-vm} : vm ÍѤΠtm-MUA + \end{itemize} +\item {\bf tm-setup} tm-MUA ¤ÎÀßÄê module +\item {\bf mime-setup} MIME ´Ø·¸¤ÎÀßÄê module +\end{itemize} + + +\chapter{Emacs version Ê̤ε¡Ç½¤ª¤è¤ÓÀ©¸Â} + +\section{Emacs (original)} + +Original ¤Î Emacs ¤Ç¤Ï¡¢ÅöÁ³¤Î¤³¤È¤Ê¤¬¤é¡¢Ã±°ìʸ»ú½¸¹ç¤·¤«»È¤¨¤Þ¤»¤ó¡£ + + +\section{NEmacs, NEpoch} + +NEmacs ¤Ç¤Ï¡¢ISO-2022-JP ¤ª¤è¤Ó US-ASCII ¤¬»È¤¨¤Þ¤¹¡£ + + +\section{Mule} + +ISO-2022-JP, ISO-2022-JP-2, US-ASCII, ISO-8859-1..9, ISO-2022-CN, +ISO-2022-KR, EUC-KR ¤Ê¤É¤Î¿¸À¸ì header ¤¬»È¤¨¤Þ¤¹¡£¤Þ¤¿¡¢´Ø¿ô +mime/set-charset-and-encoding ¤ÇÄɲá¦Êѹ¹¤¬¤Ç¤­¤Þ¤¹¡£ + + +\chapter{Install ¤ÈÀßÄê} + +\section{Install} + +Install ¤Ï¼¡¤Î¼ê½ç¤Ç¹Ô¤Ê¤¤¤Þ¤¹¡£ + +\begin{enumerate} +\item Makefile ¤Î bindir ¤ò¼«Ê¬¤Î´Ä¶­¤Ë¹ç¤ï¤»¤Æ½ñ¤­´¹¤¨¤ë¡£ +\item methods/ °Ê²¼¤Ë¤¢¤ë method script ¤ò \ref{sec:method} Àá¤ò»²¾È¤· + ¤Æ¡¢¼«Ê¬¤Î´Ä¶­¤Ë¹ç¤¦¤è¤¦¤Ë½ñ¤­´¹¤¨¤ë¡£ +\item make all ¤¹¤ë¡£ +\item make install ¤¹¤ë¡£ +\item *.el ¤ò Emacs ¤ÎÊÑ¿ô load-path ¤Ç»ØÄꤵ¤ì¤¿ directory ¤Ë copy ¤¹¤ë¡£ +\end{enumerate} + +\noindent{\bf [Ãí°Õ]} +\begin{itemize} +\item tm-mh-e3.el ¤ò byte-compile ¤¹¤ë¾ì¹ç¤Ï¡¢mh-e version 3.* ¤ò load + ¤·¤¿¾õÂ֤ǹԤʤäƲ¼¤µ¤¤¡£ +\item tm-gnus3.el ¤ò byte-compile ¤¹¤ë¾ì¹ç¤Ï¡¢GNUS 3 ¤¬ load ¤µ¤ì¤¿¾õ + Â֤ǹԤʤäƲ¼¤µ¤¤¡£ +\item tl-18.el ¤ò byte-compile ¤¹¤ë¾ì¹ç¤Ï¡¢Emacs 18 ¤Ç¹Ô¤Ê¤Ã¤Æ²¼¤µ¤¤¡£ +\item tl-orig.el ¤ò byte-compile ¤¹¤ë¾ì¹ç¤Ï¡¢original Emacs ¤Ç¹Ô¤Ê¤Ã¤Æ + ²¼¤µ¤¤¡£ +\item tl-nemacs.el ¤ò byte-compile ¤¹¤ë¾ì¹ç¤Ï¡¢NEmacs ¤Ç¹Ô¤Ê¤Ã¤Æ²¼¤µ¤¤¡£ +\item tl-mule.el ¤ò byte-compile ¤¹¤ë¾ì¹ç¤Ï¡¢Mule ¤Ç¹Ô¤Ê¤Ã¤Æ²¼¤µ¤¤¡£ +\item Emacs 19 ¤Ç byte-compile ¤·¤¿ module ¤Ï Emacs 18 ¤Ç¤ÏÆ°¤­¤Þ¤»¤ó¡£ +\end{itemize} + + +\section{ÀßÄê} + +¤³¤Î package ¤Ë¤Ï mime-setup.el ¤È tm-setup.el ¤È¤¤¤¦´Ê°×ÀßÄê file ¤¬ +Éí°¤·¤Æ¤¤¤Þ¤¹¡£mime-setup.el ¤Ç¤Ï encoding ¤â´Þ¤á¤¿ÀßÄê¤ò¹Ô¤Ê¤¤¡¢ +tm-setup ¤Ç¤Ï tm-MUA ¤Ë´Ø¤¹¤ëÀßÄê¤Î¤ß¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£ + +\subsection{mime-setup} + +\begin{verbatim} +(load "mime-setup") +\end{verbatim} + +\noindent ¤È¤¹¤ë¤È MIME ¤Ë´Ø¤¹¤ë³Æ¼ïÀßÄê¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£mime-setup ¤Ï +tm-setup ¤òÆɤó¤Ç¤¤¤ë¤Î¤Ç¡¢mime-setup ¤ò»È¤¦¾ì¹ç¡¢tm-setup ¤ò load ¤¹ +¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£ + +mime-setup ¤Ç¤Ï signature ¤Î¼«Æ°ÀÚÂؤ¨ tool ¤âÉí°¤·¤Æ¤¤¤Þ¤¹¡£ +message header ¤Î field ¤Ë¹ç¤ï¤»¤Æ signature ¤Î¼«Æ°ÀÚÂؤò¹Ô¤Ê¤¤¤¿¤¤¾ì +¹ç¤Ï .emacs ¤Ë°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤òÆþ¤ì¤Æ²¼¤µ¤¤¡£¡Ê¾Ü¤·¤¯¤Ï signature.el +¤ÎÀâÌÀ½ñ¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡Ë + +\begin{verbatim} +(setq signature-file-alist + '((("Newsgroups" . "jokes") . "~/.signature-jokes") + (("Newsgroups" . ("zxr" "nzr")) . "~/.signature-sun") + (("To" . ("ishimaru" "z-suzuki")) . "~/.signature-sun") + (("To" . "tea") . "~/.signature-jokes") + (("To" . ("sim" "oku" "takuo")) . "~/.signature-formal") + )) +\end{verbatim} + +mime-setup ¤ò»È¤¦¾ì¹ç¤Ï¡¢mime.el ¤¬É¬ÍפǤ¹¡£¤Þ¤¿¡¢SuperCite ¤ò»È¤¦¾ì +¹ç¤Ï¡¢SuperCite ¤âɬÍפǤ¹¡£ + + +\subsection{tm-setup} + +tm-setup ¤Ï tm-MUA ¤ÎÀßÄê¤Î¤ß¤ò¹Ô¤Ê¤¦ module ¤Ç¤¹¡£mime-setup ¤ò load +¤·¤Æ¤¤¤ë¾ì¹ç¡¢¤³¤ì¤òÍÛ¤Ë load ¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¤¬¡¢mime-setup ¤ò»È +¤¤¤¿¤¯¤Ê¤¤¾ì¹ç¡¢°Ê²¼¤Î¤è¤¦¤Ë¤³¤ì¤ò load ¤·¤Æ²¼¤µ¤¤¡£ + +\begin{verbatim} +(load "tm-setup") +\end{verbatim} + + +\subsection{vm} + +vm ¤ò»È¤¦¾ì¹ç¤Ï .vm ¤« .emacs ¤Ë + +\begin{verbatim} +(load "tm-vm") +\end{verbatim} + +\noindent ¤òÆþ¤ì¤Æ²¼¤µ¤¤¡£ + + +\subsection{ÀßÄê file ¤ò»È¤ï¤Ê¤¤¾ì¹ç} + +tm-setup.el ¤ò»²¹Í¤Ë¤·¤Æ²¼¤µ¤¤¡£ + + +\subsection{MH ¤ÎÀßÄê} + +¤Þ¤¿¡¢MH ¤¬ MH-6.8JP2 ¤Î¾ì¹ç¡¢.mh\_profile ¤Ë + +\begin{verbatim} +scan: -form scan.mime +inc: -form inc.mime +repl: -form replcomps.mime +showproc: mhl +\end{verbatim} + +\noindent ¤òÄɲ䷤Ƥ¯¤À¤µ¤¤¡£¤Þ¤¿¡¢¤½¤ì°Ê³°¤Î MH ¤Î½èÍý¤Ï Emacs ¤Î¦ +¤Ç¼è¤ê»ÅÀÚ¤ë¤Î¤Ç¡¢MH ¤ÎÀßÄê¤Ï¤·¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£ + + +\chapter{tm-MUA} + +``tm-MUA'' ¤È¤¤¤¦¤Î¤Ï¡¢mh-e, GNUS, RMAIL ¤Ê¤É¤Î MUA ¤Î¤¿¤á¤Î MIME µ¡Ç½ +¶¯²½ module ¤ÎÁí¾Î¤Ç¤¹¡£ + +¸½ºß¡¢tm-MUA ¤Ë¤Ï¡¢ + +\begin{itemize} +\item {\bf tm-mh-e} : mh-e ÍѤΠtm-MUA +\item {\bf tm-gnus} : GNUS ÍѤΠtm-MUA +\item {\bf tm-rmail} : RMAIL ÍѤΠtm-MUA +\item {\bf tm-vm} : VM ÍѤΠtm-MUA +\end{itemize} + +\noindent ¤¬¤¢¤ê¤Þ¤¹¡£¤³¤Î¾Ï¤Ç¤Ï¤³¤ì¤é¤Î module ¤Ë´Ø¤·¤ÆÀâÌÀ¤·¤Þ¤¹¡£ + + +\section{Summary mode} + +tm-MUA ¤ò»È¤¦¤È¡¢¸µ¤Î MUA ¤Î Summary mode ¤ËÂФ·¤Æ°Ê²¼¤Îµ¡Ç½¤¬Äɲ䵤ì +¤Þ¤¹¡£ + +\medskip +\begin{center} + \begin{tabular}{|l|l|}\hline + key & µ¡Ç½ \\ \hline + M-t & MIME header ¤Î decode ¤Ë´Ø¤¹¤ë toggle \\ + v & ËÜʸ¤ËÆþ¤ê¡¢mime/view-mode ¤Ë°Ü¤ë \\ \hline + \end{tabular} +\end{center} +\medskip + + +\section{mime/viewer-mode} +\label{sec:mime/viewer-mode} + +tm-MUA ¤ò»È¤¦¤È¡¢Summary mode ¤Ç {\bf v} ¡Êvm ¤Ç¤Ï {\bf Z}¡Ë¤ò²¡¤¹¤³¤È +¤Ë¤è¤Ã¤Æ¡¢mime/viewer-mode ¤È¤¤¤¦ MIME message ¤ò±ÜÍ÷¤¹¤ë¤¿¤á¤Î mode +¤ËÆþ¤ê¤Þ¤¹¡£mime/viewer-mode ¤Ë¤Ï°Ê²¼¤Îµ¡Ç½¤¬¤¢¤ê¤Þ¤¹¡£ + +\medskip +\begin{center} + \begin{tabular}{|l|l|}\hline + key & µ¡Ç½ \\ \hline + u & ¾å¤Î content ¤ËÌá¤ë \\ + & message ¤Î°ìÈÖ¾å¤Î content ¤Ç¤³¤ì¤ò¹Ô¤Ê¤¦¤È Summary mode + ¤ËÌá¤ë (*1) \\ + p & Á°¤Î content ¤Ë°ÜÆ°¤¹¤ë \\ + n & ¼¡¤Î content ¤Ë°ÜÆ°¤¹¤ë \\ + SPC & scroll up ¤¹¤ë \\ + M-SPC & scroll down ¤¹¤ë \\ + DEL & scroll down ¤¹¤ë \\ + RET & ¼¡¤Î¹Ô¤Ë°ÜÆ°¤¹¤ë \\ + M-RET & Á°¤Î¹Ô¤Ë°ÜÆ°¤¹¤ë \\ + v & content ¤òºÆÀ¸¤¹¤ë (*2) \\ + e & content ¤«¤é file ¤ò¼è¤ê½Ð¤¹ (*2) \\ + C-c C-p & content ¤ò°õºþ¤¹¤ë (*2) \\ \hline + \end{tabular} +\end{center} +\medskip + +\bigskip + +\newcounter{asteriskcount} +\noindent{\bf ¡ÎÃí°Õ¡Ï} +\vspace{-1ex} +{\list{(*\arabic{asteriskcount})}{\usecounter{asteriskcount}\leftmargin=8ex} +\item tm-mh-e, tm-gnus, tm-rmail ¤Ê¤É¤Ç tm-view ¤ÎÀßÄê¤ò¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ + Summary mode ¤Ë¤ÏÌá¤ê¤Þ¤»¤ó¡£ +\item ¼ÂºÝ¤ÎÆ°ºî¤ÏÂбþ¤¹¤ë method ¤Ë°Í¤ê¤Þ¤¹¡£ +\endlist} + + +\section{tm-gnus ¤Î customize} + +\subsection{article ¤ò save ¤¹¤ë»þ decoding ¤·¤Ê¤¤} + +article ¤ò save ¤¹¤ë»þ¡¢Êݸ¤µ¤ì¤ë message ¤Ï¤½¤Î»þɽ¼¨¤µ¤ì¤Æ¤¤¤ë¤è¤¦ +¤Ë¡¢¤½¤Î»þ¤Î MIME header decoding mode ¤Ë±þ¤¸¤Æ save ¤µ¤ì¤Þ¤¹¡£ + +¤·¤«¤·¡¢article ¤ò save ¤¹¤ë»þ¡¢¾ï¤Ë¡¢MIME header decoding ¤ò¹Ô¤Ê¤ï¤Ê +¤¤¡¢À¸¤Î message ¤ÇÊݸ¤·¤¿¤¤¾ì¹ç¤Ï¡¢ÊÑ¿ô +tm-gnus/set-mime-header-decoding-mode ¤ÎÃͤò nil ¤Ë¤·¤Æ¡¢MIME header +decoding ¤ò¹Ô¤Ê¤ï¤Ê¤¤ mode ¤Ë¤·¤Æ¡¢article save ´Ø¿ô¤ò¼Â¹Ô¤¹¤ë¤è¤¦¤ËÀß +Äꤷ¤Æ²¼¤µ¤¤¡£ + +Save ¤Î¼Â¹Ô¸å¡¢MIME header decoding mode ¤òÁ°¤Î¾õÂÖ¤ËÌᤷ¤¿¤¤¾ì¹ç¤Ï¡¢ +°Ê²¼¤Î¤è¤¦¤Ë¡¢°ì»þÊÑ¿ô¤Ë MIME header decoding mode ¤òÊݸ¤·¤Æ¤ª¤±¤Ð OK +¤Ç¤¹¡£ + +\begin{verbatim} + (let ((mm mime/header-decoding-mode)) + (tm-gnus/set-mime-header-decoding-mode nil) + (article save ´Ø¿ô) + (tm-gnus/set-mime-header-decoding-mode mm) + ) +\end{verbatim} + +°Ê²¼¤Ë¡¢mh-e ¤Î folder ¤Ë save ¤¹¤ë¾ì¹ç¤ÎÎã¤ò¼¨¤·¤Þ¤¹¡£ + +\begin{verbatim} +(add-hook 'gnus-Startup-hook + (function + (lambda () + (setq gnus-default-article-saver + (function + (lambda () + (interactive) + (let ((mm mime/header-decoding-mode)) + (tm-gnus/set-mime-header-decoding-mode nil) + (gnus-Subject-save-in-folder) + (tm-gnus/set-mime-header-decoding-mode mm) + ))))))) +(add-hook 'gnus-startup-hook + (function + (lambda () + (setq gnus-default-article-saver + (function + (lambda () + (interactive) + (let ((mm mime/header-decoding-mode)) + (tm-gnus/set-mime-header-decoding-mode nil) + (gnus-summary-save-in-folder) + (tm-gnus/set-mime-header-decoding-mode mm) + ))))))) +\end{verbatim} + +\subsection{reply ¤¹¤ë»þ Subject ¤Î encoding Ë¡¤ò reply ¸µ¤Ë¹ç¤ï¤»¤ë} + +Reply ¤¹¤ë»þ¡¢reply ¸µ¤Î Subject ¤Ë ASCII °Ê³°¤Îʸ»ú½¸¹ç¤ÎÆþ¤Ã¤Æ¤¤¤ë +¾ì¹ç¡¢reply ¸µ¤¬ MIME encode ¤µ¤ì¤Æ¤¤¤¿¤é encode ¤·¡¢¤½¤¦¤Ç¤Ê¤«¤Ã¤¿¤é +À¸¤ÇÆþ¤ì¤¿¤¤¾ì¹ç¤Ï¡¢¼¡¤Î¤è¤¦¤ËÀßÄꤷ¤Þ¤¹¡£ + +\begin{verbatim} +(add-hook 'gnus-article-prepare-hook + (function + (lambda () + (if (mime/exist-encoded-word-in-subject) + (setq mime/no-encoding-header-fields '("X-Nsubject")) + (setq mime/no-encoding-header-fields '("X-Nsubject" "Subject")) + )))) +\end{verbatim} + + +\chapter{tm-view} + +tm-view ¤Ï MIME message ¤ò±ÜÍ÷¤¹¤ë¤¿¤á¤Îµ¡Ç½¤òÄ󶡤¹¤ë module ¤Ç¤¹¡£ +tm-view ¤Ï mime/viewer-mode ¤È¤¤¤¦ mode ¤òÄ󶡤·¤Þ¤¹¡£ + +mime/viewer-mode ¤Îµ¡Ç½¤Ë´Ø¤·¤Æ¤Ï¡¢\ref{sec:mime/viewer-mode} Àá¤ò»²¾È +¤·¤Æ²¼¤µ¤¤¡£ + +\section{content ¤Î decode ¾ò·ï¤ÎÀßÄê} + +ÊÑ¿ô mime/content-decoding-condition ¤Ï decode »þ¤Î method ¤ò»ØÄꤹ¤ë +¤¿¤á¤ÎÊÑ¿ô¤Ç¡¢tm-view 4 ¤ÎÊÑ¿ô mime/content-decoding-method-alist ¤ËÁê +Åö¤·¤Þ¤¹¡£ + +ÊÑ¿ô mime/content-decoding-method-alist ¤Ç¤Ï¡¢Ã±¤Ë +content-type/subtype ¤ËÂФ¹¤ë method ¤ò»ØÄꤹ¤ë¤³¤È¤·¤«¤Ç¤­¤Þ¤»¤ó¤Ç¤· +¤¿¤¬¡¢ÊÑ¿ô mime/content-decoding-condition ¤Ç¤Ï decode »þ¤ÎÀ©Ìó¾ò·ï¤ò +½ñ¤¯¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ + +ÊÑ¿ô mime/content-decoding-condition ¤Ï¡¢ + +\begin{eqnarray*} + (¾ò·ï_1 \;\; ¾ò·ï_2 \;\; ...) +\end{eqnarray*} + +\noindent ¤È¤¤¤¦·Á¤ò¤·¤¿ list ¤Ç¡¢³Æ¾ò·ï¤Ï + +\begin{eqnarray*} + ((field-type_1 \; . \; value_1) \;\; + (field-type_2 \; . \; value_2) \;\; ...) +\end{eqnarray*} + +\noindent ¤È¤¤¤¦·Á¤ÎÏ¢ÁÛ list ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ + +Î㤨¤Ð¡¢text/plain ¤Î»þ¡¢tm-plain ¤òµ¯Æ°¤¹¤ë»þ¡¢ + +\begin{quote} + ((type . "text/plain") + (method "tm-plain" nil 'file 'type 'encoding 'mode 'name)) +\end{quote} + +\noindent ¤È¤¤¤¦¾ò·ï¤ò½ñ¤­¤Þ¤¹¡£¸«¤Æ¤ÎÄ̤ꡢ³°Éô method ¤Î°ú¿ô¤¬½ñ¤±¤ë +¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£¾Ü¤·¤¯¤Ï \ref{sec:method-arguments} Àá¤Ç½Ò¤Ù¤Þ¤¹¡£ + +¤³¤Î¾ò·ï¤Ï text/plain ¤Ç¤¢¤ë content ¤Ê¤éÁ´¤Æ¤Î decoding-mode ¤ÇÍ­¸ú¤Ç +¤¹¡£¤·¤«¤·¡¢ + +\begin{quote} + ((type . "text/plain") + (method "tm-plain" nil 'file 'type 'encoding 'mode 'name) + (mode . "play")) +\end{quote} + +\noindent ¤Ê¤é¡¢play mode °Ê³°¤Ç¤ÏÍ­¸ú¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ + +µÕ¤Ë¡¢ + +\begin{quote} + ((method "metamail" t "-m" "tm" "-x" "-d" "-z" "-e" 'file) + (mode . "play")) +\end{quote} + +\noindent ¤Ê¤é¡¢Á´¤Æ¤Î content-type ¤Î play mode ¤ÇÍ­¸ú¤Ë¤Ê¤ê¤Þ¤¹¡£ + +¤³¤¦¤·¤Æ³Æ¾ò·ï¤òÁ°¤«¤é¸«¤Æ¹Ô¤­¡¢ºÇ½é¤ËÍ­¸ú¤Ë¤Ê¤Ã¤¿¾ò·ï¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹¡£ + + +\subsection{method ¤Î°ú¿ô¤Î»ØÄê¤Î»ÅÊý} +\label{sec:method-arguments} + +¾ò·ï¤Î method field ¤Ï + +\begin{eqnarray*} + (method \; . \; SYMBOL) +\end{eqnarray*} + +\noindent ¤« + +\begin{eqnarray*} + (method \; ʸ»úÎó \; FLAG \; °ú¿ô_1 \; °ú¿ô_2 \; ...) +\end{eqnarray*} + +\noindent ¤È¤¤¤¦·Á¤ò¤·¤Æ¤¤¤Þ¤¹¡£ + +method field ¤ÎÃͤ¬ symbol ¤Ç¤¢¤ë¾ì¹ç¤Ï¡¢ÆâÉô method ¤È¤·¤Æµ¯Æ°¤µ¤ì¤Þ +¤¹¡£ + +method field ¤ÎÃͤ¬ list ¤Ç¤¢¤ë¾ì¹ç¡¢³°Éô method ¤È¤·¤Æµ¯Æ°¤µ¤ì¤Þ¤¹¡£ +¤³¤Î¾ì¹ç¡¢ + +\begin{quote} + \begin{tabular}{lcl} + ʸ»úÎó&:&³°Éô method ¤Î̾Á° \\ + FLAG&:& t ¤Ê¤é content header ¤â³°Éô method ¤ËÅϤ¹¡£ + nil ¤Ê¤é content body ¤Î¤ß¤òÅϤ¹¡£\\ + °ú¿ôÎó&:&³°Éô method ¤Î°ú¿ô + \end{tabular} +\end{quote} + +\noindent ¤È²ò¼á¤µ¤ì¤Þ¤¹¡£ + +¤Þ¤¿¡¢³°Éô method ¤Î°ú¿ô¤Ï¼¡¤Î¤è¤¦¤Ê·Á¼°¤Ç½ñ¤­¤Þ¤¹¡£ + +\begin{quote} + \begin{tabular}{lcl} + ʸ»úÎó&:&¤½¤Îʸ»úÎó¤òÅϤ¹ \\ + 'SYMBOL&:&SYMBOL ¤ò key ¤È¤·¤¿ÃͤòÅϤ¹\\ + 'ʸ»úÎó&:&ʸ»úÎó¤ò key ¤È¤·¤¿ÃͤòÅϤ¹ + \end{tabular} +\end{quote} + +'SYMBOL ¤Ç»ØÄê¤Ç¤­¤ë¤â¤Î¤Ë¤Ï¡¢ + +\begin{quote} + \begin{tabular}{lcl} + 'file&:&content ¤òÅϤ¹¤¿¤á¤Î file ̾ \\ + 'type&:&content-type/sub-type ̾ \\ + 'encoding&:&content-transfer-encoding \\ + 'mode&:&decoding mode \\ + 'name&:&file ¤ËÍ¾ì¹ç¤Î file ̾ + \end{tabular} +\end{quote} + +\noindent ¤Ê¤É¤¬¤¢¤ê¡¢'ʸ»úÎó ¤Ç¤Ï Content-Type field ¤Î parameter ¤Î +Ãͤ¬»ØÄê¤Ç¤­¤Þ¤¹¡£ + + +\subsection{Îã} + +½é´üÃͤϰʲ¼¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ + +\begin{verbatim} +(defvar mime/content-decoding-condition + '(((type . "text/plain") + (method "tm-plain" nil 'file 'type 'encoding 'mode 'name)) + ((type . "text/x-latex") + (method "tm-latex" nil 'file 'type 'encoding 'mode 'name)) + ((type . "audio/basic") + (method "tm-au" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/gif") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/jpeg") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/tiff") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/x-tiff") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/x-xbm") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/x-pic") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "video/mpeg")` + (method "tm-mpeg" nil 'file 'type 'encoding 'mode 'name)) + ((type . "application/octet-stream") + (method "tm-file" nil 'file 'type 'encoding 'mode 'name)) + ((type . "message/partial") + (method . mime/decode-message/partial-region)) + ((method "metamail" t + "-m" "tm" "-x" "-d" "-z" "-e" 'file)(mode . "play")) + )) +\end{verbatim} + +Î㤨¤Ð¡¢¡ÖÁ´Éô metamail »È¤¦¤ó¤ä¡×¤È¤¤¤¦¾ì¹ç¡¢ + +\begin{verbatim} +(setq mime/content-decoding-condition + '( + ((method "metamail" t "-m" "tm" "-x" "-d" "-z" "-e" 'file)) + )) +\end{verbatim} + +\noindent ¤È¤¹¤ì¤Ð OK ¤Ç¤¹¡£ + +¹©Éפ¹¤ì¤Ð¡¢¤«¤Ê¤êÊ£»¨¤Ê¾ò·ï¤¬½ñ¤±¤ë¤Ç¤·¤ç¤¦¡£ + + +\section{method script} +\label{sec:method} + +³Æ method ¤Ï shell script ¤Ç½ñ¤­¤Þ¤¹¡£tm-verw.el ¤«¤éÅϤµ¤ì¤ë°ú¿ô¤Ï¡¢ +ÊÑ¿ô mime/content-decoding-condition ¤Ç»ØÄê¤Ç¤­¤Þ¤¹¤¬¡¢É¸½àŪ¤Ê°ú¿ôÎó +¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£ + +\medskip +\begin{center} + \begin{tabular}{|c|l|} \hline + °ú¿ô & \multicolumn{1}{|c|}{ ÃÍ }\\ \hline + \$1 & decode Á°¤Î file ̾ \\ + \$2 & Content-Type (type/sub-type) \\ + \$3 & encoding + \{7bit / quoted-printable / base64 / 8bit / binary / ...\}\\ + \$4 & decoding-mode \{play / extract / print\} \\ + \$5 & file ̾ \\ \hline + \end{tabular} +\end{center} +\medskip + +¤Þ¤¿¡¢message/partial ¤À¤±¤Ï tm-view.el ¼«¿È¤ÇÉü¸µ¤·¤Þ¤¹¡£ + + +\section{ɽ¼¨} + +mime/viewer-mode ¤ËÆþ¤ë¤È¡¢³Æ content ¤Ï preview buffer ¤Ë + +\begin{verbatim} +[1 (text/plain)] + +ËÜʸ +\end{verbatim} + +\noindent ¤Î¤è¤¦¤Ë²Ã¹©¤µ¤ì¤Æɽ¼¨¤µ¤ì¤Þ¤¹¡£tm-view ¤Ç¤Ï content ¤òɽ¼¨ +¤¹¤ëºÝ¡¢ + +\begin{itemize} +\item content subject +\item content header +\item content body +\end{itemize} + +\noindent ¤È¤¤¤¦£³¤Ä¤ÎÉôʬ¤Ëʬ¤±¤Æ°·¤ï¤ì¤Þ¤¹¡£ + + +\subsection{content subject} + +content subject ¤Ï preview buffer ¤Ç content ¤ÎÀèƬ¤òɽ¤¹¤¿¤á¤ÎÉôʬ¤Ç¡¢ +ɸ½à¤Ç¤Ï¡¢ + +\begin{quote} + [cid Âê̾ (·¿)] +\end{quote} + +\noindent ¤Î¤è¤¦¤Ëɽ¼¨¤µ¤ì¤Þ¤¹¡£cid ¤Ï message ¤ÎÃæ¤Ç¤Î content ¤Î°ÌÃÖ +¤òɽ¤¹¤â¤Î¤Ç¡¢ÀáÈÖ¹æ¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤¹¡£Âê̾¤Ï¡¢Subject ¤ä +Content-Description ¤Ê¤É¤Ë½ñ¤«¤ì¤¿Ê¸»úÎ󤫤éºî¤é¤ì¤Þ¤¹¡£·¿¤Ï +Content-Type ¤Ë½ñ¤«¤ì¤¿ type/subtype ¤Î¤³¤È¤Ç¤¹¡£ + +¤³¤Î content subject ¤Îɽ¼¨¤ÏÊÑ¿ô mime/make-content-subject-function +¤Ë¤è¤Ã¤ÆÀßÄê¤Ç¤­¤Þ¤¹¡£´ûÄêÃͤϡ¢ + +\begin{verbatim} +(defvar mime/make-content-subject-function + (function + (lambda (cid subj ctype) + (insert + (format "[%s %s (%s)]\n" + (if (listp cid) + (mapconcat (function + (lambda (num) + (format "%s" (+ num 1)) + )) + cid ".") + "0") + subj (car ctype))) + ))) +\end{verbatim} + +\noindent ¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¢Î㤨¤Ð¡¢ + +\begin{verbatim} +(setq mime/make-content-subject-function + (function + (lambda (cid subj ctype) + (if (not (member (car ctype) mime/default-showing-Content-Type-list)) + (insert + (format "[%s %s (%s)]\n" + (if (listp cid) + (mapconcat (function + (lambda (num) + (format "%s" (+ num 1)) + )) + cid ".") + "0") + subj (car ctype)))) + ))) +\end{verbatim} + +\noindent ¤È¤¹¤ì¤Ð±£¤µ¤ì¤¿ content ¤À¤± content subject ¤òɽ¼¨¤¹¤ë¤è¤¦ +¤Ë¤Ç¤­¤Þ¤¹¡£ + + +\subsection{content header} + +content header ¤Ï preview buffer ¤Ç content header ¤òɽ¼¨¤¹¤ë¤¿¤á¤ÎÉô +ʬ¤Ç¤¹¡£É¸½à¤Ç¤Ï¶õ¹Ô¤Ë¤Ê¤ê¤Þ¤¹¡£ + +¤³¤Î content header ¤Îɽ¼¨¤ÏÊÑ¿ô mime/make-content-header-filter ¤Ë¤è¤Ã +¤ÆÀßÄê¤Ç¤­¤Þ¤¹¡£´ûÄêÃͤϡ¢ + +\begin{verbatim} +(defvar mime/make-content-header-filter + (function + (lambda (cid) + (if (listp cid) + (delete-region (goto-char (point-min)) + (or (and (re-search-forward "^$" nil t) + (match-end 0)) + (point-max)) + ) + ) + ))) +\end{verbatim} + +\noindent ¤È¤Ê¤Ã¤Æ¤ª¤ê¡¢content header ¤ò body ¤È¤Î¶­¤Î¶õ¹Ô¤Þ¤Çºï½ü¤¹ +¤ë¤È¤¤¤¦É÷¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£Î㤨¤Ð¡¢ + +\begin{verbatim} +(setq mime/make-content-header-filter + (function + (lambda (cid) + ))) +\end{verbatim} + +\noindent ¤È¤¹¤ì¤Ð¡¢Á´¤Æ¤Î content header field ¤òɽ¼¨¤Ç¤­¤Þ¤¹¡£ + + +\subsection{content body} + +preview buffer ¤Ë content body ¤òɽ¼¨¤¹¤ëºÝ¡¢content-type Ëè¤Ë + +\begin{enumerate} +\item ±£Êà +\item ²Ã¹© +\end{enumerate} + +\noindent ¤È¤¤¤¦½èÍý¤¬¹Ô¤Ê¤ï¤ì¤Þ¤¹¡£ + +±£ÊäÏÈó text part ¤ò±£¤¹¤¿¤á¤Î½èÍý¤Ç¡¢ÊÑ¿ô +mime/default-showing-Content-Type-list ¤ËÀßÄꤵ¤ì¤¿ content-type °Ê³° +¤Î content ¤¬±£Ê䵤ì¤Þ¤¹¡£¤³¤ÎÊÑ¿ô¤Î´ûÄêÃͤϡ¢ + +\begin{verbatim} +(defvar mime/default-showing-Content-Type-list + '("text/plain" "text/richtext" "text/enriched" "text/x-latex" nil)) +\end{verbatim} + +\noindent ¤Ç¡¢text/plain, text/richtext, text/enriched, text/x-latex, +µÚ¤Ó¡¢Èó MIME content ¤Î¤ß¤¬É½¼¨¤µ¤ì¡¢¤½¤ì°Ê³°¤Ï¡¢±£Ê䵤ì¤Þ¤¹¡£ + +±£Ê䵤ì¤Ê¤«¤Ã¤¿ content ¤ËÂФ·¤Æ¡¢²Ã¹©½èÍý¤¬¹Ô¤Ê¤ï¤ì¤Þ¤¹¡£¤½¤Î +content ¤Î content-type ¤ò key ¤Ë¤·¤ÆÊÑ¿ô mime/content-filter-alist ¤ò +°ú¤­¡¢¤½¤ÎÃÍÉô¤Ë½ñ¤«¤ì¤¿´Ø¿ô¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹¡£ + +ÊÑ¿ô mime/content-filter-alist ¤Î´ûÄêÃÍ¤Ï nil ¤Ç¤¹¤¬¡¢tm-rich.el ¤ò +load ¤¹¤ë¤È¡¢ + +\begin{verbatim} +(aput 'mime/content-filter-alist + "text/enriched" (function mime/decode-text/enriched-body)) +\end{verbatim} + +\noindent ¤Î¤è¤¦¤Ë text/enriched ¤ËÂФ¹¤ë²Ã¹©½èÍý¤¬ÀßÄꤵ¤ì¤Þ¤¹¡£ + + +\section{À©¸Â} + +Éí°¤Î BASE64 decoder ¤Ç¤¢¤ë decode-b.c ¤Ï¤¤¤¤²Ã¸º¤Êºî¤ê¤Ê¤Î¤Ç¡¢Æ°¤«¤Ê +¤«¤Ã¤¿¤é¡¢Ã»¤¤¥×¥í¥°¥é¥à¤Ê¤Î¤Ç¡¢°Õ¤òµâ¤ó¤Ç½¤Àµ¤·¤Æ²¼¤µ¤¤¡£ +(\verb+^+\_\verb+^+; + +¤Þ¤¿¡¢metamail Éí°¤Î mmencode ¤ò»È¤Ã¤Æ decode ¤·¤Æ¤âÎɤ¤¤Ç¤·¤ç¤¦¡£ + +¤Þ¤¿¡¢Quoted-Printable ¤Î decoder ¤ÏÉí°¤·¤Þ¤»¤ó¤Î¤Ç¡¢mmencode ¤ò»È¤Ã +¤Æ²¼¤µ¤¤¡£ + + +\chapter{tiny-mime} + +tiny-mime ¤Ï Mule, NEmacs, NEpoch ¾å¤ÇÆ°ºî¤¹¤ë MIME header ¤Î +encoder/decoder ¤Ç¤¹¡£tiny-mime ¤Ï¡¢ÀΡ¢¤¨¤Ê¤ß ¤Ä¤°¤È¤â ¤µ¤ó¤¬ +fj.editor.emacs ¤ËÅê¹Æ¤µ¤ì¤¿ ISO-2022-JP MIME header decoder ¤ò¸µ¤Ë¤· +¤Æ¤¤¤Þ¤¹¡£ + +¸½ºß¤Ç¤Ï¡¢Åö»þ¤Î¤â¤Î¤ËÈæ¤Ù¡¢ + +\begin{itemize} +\item decoding »þ¤Ë¤ª¤±¤ë unfolding µ¡Ç½¤ÎÄɲà +\item ISO-2022-JP ¤Ë²Ã¤¨¡¢ISO-2022-KR, ISO-8859-*, US-ASCII ¤Ê¤É¤Î¿¸À + ¸ì header ¤Î encode/decode µ¡Ç½¤ÎÄɲà +\item Q-encoding ¤ÎÄɲà +\item RFC 1522 ¤Ø¤ÎÂбþ +\end{itemize} + +\noindent ¤È¤¤¤Ã¤¿µ¡Ç½¶¯²½¤¬¹Ô¤Ê¤ï¤ì¤Æ¤¤¤Þ¤¹¡£ + +tiny-mime ¤Ï tm ¤Ë¤ª¤±¤ë MIME header encoder/decoder ¤Ç¤¢¤ê¡¢tm-view, +tm-MUA ¤¬¤³¤ì¤òÍøÍѤ·¤Æ¤¤¤Þ¤¹¡£ + + +\section{mime/decode-message-header} + +{\tt mime/decode-message-header} ¤Ï MIME header ¤ò decode ¤¹¤ë¤¿¤á¤ÎÌ¿ +Îá¤Ç¤¹¡£tiny-mime ¤¬ load ¤µ¤ì¤Æ¤¤¤ë¾õÂ֤ǡ¢decode ¤·¤¿¤¤ buffer ¤Î¾å +¤Ç¡¢ + +{\list{}{\leftmargin=8ex}\item[] +\par +M-x {\tt mime/decode-message-header} +\endlist} + +\noindent ¤ò¼Â¹Ô¤¹¤ë¤È¡¢¤½¤Î buffer ¾å¤Î MIME header ¤¬ decode ¤µ¤ì¤Þ +¤¹¡£ + +tm-MUA ¤ä tm-view ¤Ï¤³¤ÎÌ¿Îá¤ò¸Æ¤ó¤Ç¤¤¤ë¤Î¤Ç¡¢¤³¤ì¤é¤òÍøÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢ +Íۤˤ³¤ÎÌ¿Îá¤ò¼Â¹Ô¤¹¤ëɬÍפÏ̵¤¤¤Ç¤·¤ç¤¦¡£ + + +\section{mime/decode-region} + +region ¤ËÂФ·¤Æ¡¢ + +{\list{}{\leftmargin=8ex}\item[] +\par +M-x {\tt mime/decode-region} +\endlist} + +\noindent ¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ç¡¢°úÍÑ¤Ê¤É¤Ç buffer ¤Ë»Ä¤Ã¤¿ MIME header ¤ò +decode ¤Ç¤­¤Þ¤¹¡£ + + +\chapter{¥Ð¥°Êó¹ð¤Î»ÅÊý} + +tm ¤Î¥Ð¥°¤ò¸«¤Ä¤±¤¿¤é fj.editor.emacs ¤Ë post ¤¹¤ë¤«¡¢tm ML +$<$tm@chamonix.jaist.ac.jp$>$ ¤Ë mail ¤òÁ÷¤Ã¤Æ²¼¤µ¤¤¡£ + +tm ML ¤Ç¤Ï tm ¤Î¥Ð¥°¾ðÊó¤Î¸ò´¹¤äºÇ¿·ÈǤÎÇÛÉÛ¡¢tm ¤Î²þÎɤ˴ؤ¹¤ëµÄÏÀ¤ò +¹Ô¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£tm ML ¤Ë»²²Ã¤·¤¿¤¤Êý¤Ï + +\begin{center} + tm-admin@chamonix.jaist.ac.jp +\end{center} + +\noindent ¤Þ¤Ç mail ¤òÁ÷¤Ã¤Æ²¼¤µ¤¤¡£ÅÐÏ¿¤Ï¼êÆ°¤Ç¤¹¤Î¤Ç¡¢¤Ç¤­¤ì¤Ð¡¢¼«Á³ +¸À¸ì¤Ç½ñ¤¤¤Æ²¼¤µ¤¤¡£(\verb+^+\_\verb+^+) + +\end{document} diff --git a/doc/tm-jp.tex,v b/doc/tm-jp.tex,v new file mode 100644 index 0000000..fd7bd89 --- /dev/null +++ b/doc/tm-jp.tex,v @@ -0,0 +1,1195 @@ +head 5.4; +access; +symbols; +locks; strict; +comment @% @; + + +5.4 +date 94.10.17.02.58.20; author morioka; state Exp; +branches; +next 5.3; + +5.3 +date 94.10.17.02.54.15; author morioka; state Exp; +branches; +next 5.2; + +5.2 +date 94.10.11.17.17.05; author morioka; state Exp; +branches; +next 5.1; + +5.1 +date 94.09.26.14.52.00; author morioka; state Exp; +branches; +next 5.0; + +5.0 +date 94.09.26.14.46.30; author morioka; state Exp; +branches; +next 2.1; + +2.1 +date 94.09.02.09.41.08; author morioka; state Exp; +branches; +next 2.0; + +2.0 +date 94.09.02.07.42.01; author morioka; state Exp; +branches; +next 1.2; + +1.2 +date 94.09.01.02.11.05; author morioka; state Exp; +branches; +next 1.1; + +1.1 +date 94.08.31.11.18.40; author morioka; state Exp; +branches; +next ; + + +desc +@@ + + +5.4 +log +@vm ¤Ë´Ø¤¹¤ëµ­½Ò¤òÄɲä·¤¿¡£ +@ +text +@\documentstyle[a4j]{jreport} + +\title{tm ÀâÌÀ½ñ} +\author{¼é²¬ ÃÎɧ\\ + morioka@@jaist.ac.jp} +\date{\verb$Id: tm-jp.tex,v 5.3 1994/10/17 02:54:15 morioka Exp morioka $} + +\begin{document} + +\maketitle +\tableofcontents + +\chapter{¤Ï¤¸¤á¤Ë} + +tm ¤Ï GNU Emacs ¤Ç MIME ¤ò³Ú¤·¤à¤¿¤á¤Î package ¤Ç¤¹¡£tm ¤ò»È¤¦¤È¡¢ + +\begin{itemize} +\item mime/viewer-mode ¤ò»È¤Ã¤¿ MIME message ¤Î±ÜÍ÷¡¦ºÆÀ¸ +\item ¿¸À¸ì header ¤Î encode/decode +\item mh-e, GNUS, RMAIL ¤Ç¤Î MIME µ¡Ç½¤Î¶¯²½ +\end{itemize} + +\noindent ¤¬¹Ô¤Ê¤¨¤Þ¤¹¡£ + + +\section{Module °ìÍ÷} + +tm ¤Ï°Ê²¼¤Î module ¤«¤é¤Ê¤ê¤Þ¤¹¡£ + +\begin{itemize} +\item {\bf tiny-mime} : MIME header encoder/decoder +\item {\bf tm-view} : MIME viewer +\item {\bf tm-misc} : tm-MUA ¤Î¶¦ÄÌ module +\item {\bf tm-MUAs} : MUA ¤Î MIME µ¡Ç½¶¯²½ module + \begin{itemize} + \item {\bf tm-mh-e} : mh-e ÍѤΠtm-MUA + \item {\bf tm-gnus} : GNUS ÍѤΠtm-MUA + \item {\bf tm-rmail} : RMAIL ÍѤΠtm-MUA + \item {\bf tm-vm} : vm ÍѤΠtm-MUA + \end{itemize} +\item {\bf tm-setup} tm-MUA ¤ÎÀßÄê module +\item {\bf mime-setup} MIME ´Ø·¸¤ÎÀßÄê module +\end{itemize} + + +\chapter{Emacs version Ê̤ε¡Ç½¤ª¤è¤ÓÀ©¸Â} + +\section{Emacs (original)} + +Original ¤Î Emacs ¤Ç¤Ï¡¢ÅöÁ³¤Î¤³¤È¤Ê¤¬¤é¡¢Ã±°ìʸ»ú½¸¹ç¤·¤«»È¤¨¤Þ¤»¤ó¡£ + + +\section{NEmacs, NEpoch} + +NEmacs ¤Ç¤Ï¡¢ISO-2022-JP ¤ª¤è¤Ó US-ASCII ¤¬»È¤¨¤Þ¤¹¡£ + + +\section{Mule} + +ISO-2022-JP, ISO-2022-JP-2, US-ASCII, ISO-8859-1..9, ISO-2022-CN, +ISO-2022-KR, EUC-KR ¤Ê¤É¤Î¿¸À¸ì header ¤¬»È¤¨¤Þ¤¹¡£¤Þ¤¿¡¢´Ø¿ô +mime/set-charset-and-encoding ¤ÇÄɲá¦Êѹ¹¤¬¤Ç¤­¤Þ¤¹¡£ + + +\chapter{Install ¤ÈÀßÄê} + +\section{Install} + +Install ¤Ï¼¡¤Î¼ê½ç¤Ç¹Ô¤Ê¤¤¤Þ¤¹¡£ + +\begin{enumerate} +\item Makefile ¤Î bindir ¤ò¼«Ê¬¤Î´Ä¶­¤Ë¹ç¤ï¤»¤Æ½ñ¤­´¹¤¨¤ë¡£ +\item methods/ °Ê²¼¤Ë¤¢¤ë method script ¤ò \ref{sec:method} Àá¤ò»²¾È¤· + ¤Æ¡¢¼«Ê¬¤Î´Ä¶­¤Ë¹ç¤¦¤è¤¦¤Ë½ñ¤­´¹¤¨¤ë¡£ +\item make all ¤¹¤ë¡£ +\item make install ¤¹¤ë¡£ +\item *.el ¤ò Emacs ¤ÎÊÑ¿ô load-path ¤Ç»ØÄꤵ¤ì¤¿ directory ¤Ë copy ¤¹¤ë¡£ +\end{enumerate} + +\noindent{\bf [Ãí°Õ]} +\begin{itemize} +\item tm-mh-e3.el ¤ò byte-compile ¤¹¤ë¾ì¹ç¤Ï¡¢mh-e version 3.* ¤ò load + ¤·¤¿¾õÂ֤ǹԤʤäƲ¼¤µ¤¤¡£ +\item tm-gnus3.el ¤ò byte-compile ¤¹¤ë¾ì¹ç¤Ï¡¢GNUS 3 ¤¬ load ¤µ¤ì¤¿¾õ + Â֤ǹԤʤäƲ¼¤µ¤¤¡£ +\item tl-18.el ¤ò byte-compile ¤¹¤ë¾ì¹ç¤Ï¡¢Emacs 18 ¤Ç¹Ô¤Ê¤Ã¤Æ²¼¤µ¤¤¡£ +\item tl-orig.el ¤ò byte-compile ¤¹¤ë¾ì¹ç¤Ï¡¢original Emacs ¤Ç¹Ô¤Ê¤Ã¤Æ + ²¼¤µ¤¤¡£ +\item tl-nemacs.el ¤ò byte-compile ¤¹¤ë¾ì¹ç¤Ï¡¢NEmacs ¤Ç¹Ô¤Ê¤Ã¤Æ²¼¤µ¤¤¡£ +\item tl-mule.el ¤ò byte-compile ¤¹¤ë¾ì¹ç¤Ï¡¢Mule ¤Ç¹Ô¤Ê¤Ã¤Æ²¼¤µ¤¤¡£ +\item Emacs 19 ¤Ç byte-compile ¤·¤¿ module ¤Ï Emacs 18 ¤Ç¤ÏÆ°¤­¤Þ¤»¤ó¡£ +\end{itemize} + + +\section{ÀßÄê} + +¤³¤Î package ¤Ë¤Ï mime-setup.el ¤È tm-setup.el ¤È¤¤¤¦´Ê°×ÀßÄê file ¤¬ +Éí°¤·¤Æ¤¤¤Þ¤¹¡£mime-setup.el ¤Ç¤Ï encoding ¤â´Þ¤á¤¿ÀßÄê¤ò¹Ô¤Ê¤¤¡¢ +tm-setup ¤Ç¤Ï tm-MUA ¤Ë´Ø¤¹¤ëÀßÄê¤Î¤ß¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£ + +\subsection{mime-setup} + +\begin{verbatim} +(load "mime-setup") +\end{verbatim} + +\noindent ¤È¤¹¤ë¤È MIME ¤Ë´Ø¤¹¤ë³Æ¼ïÀßÄê¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£mime-setup ¤Ï +tm-setup ¤òÆɤó¤Ç¤¤¤ë¤Î¤Ç¡¢mime-setup ¤ò»È¤¦¾ì¹ç¡¢tm-setup ¤ò load ¤¹ +¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£ + +mime-setup ¤Ç¤Ï signature ¤Î¼«Æ°ÀÚÂؤ¨ tool ¤âÉí°¤·¤Æ¤¤¤Þ¤¹¡£ +message header ¤Î field ¤Ë¹ç¤ï¤»¤Æ signature ¤Î¼«Æ°ÀÚÂؤò¹Ô¤Ê¤¤¤¿¤¤¾ì +¹ç¤Ï .emacs ¤Ë°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤òÆþ¤ì¤Æ²¼¤µ¤¤¡£¡Ê¾Ü¤·¤¯¤Ï signature.el +¤ÎÀâÌÀ½ñ¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡Ë + +\begin{verbatim} +(setq signature-file-alist + '((("Newsgroups" . "jokes") . "~/.signature-jokes") + (("Newsgroups" . ("zxr" "nzr")) . "~/.signature-sun") + (("To" . ("ishimaru" "z-suzuki")) . "~/.signature-sun") + (("To" . "tea") . "~/.signature-jokes") + (("To" . ("sim" "oku" "takuo")) . "~/.signature-formal") + )) +\end{verbatim} + +mime-setup ¤ò»È¤¦¾ì¹ç¤Ï¡¢mime.el ¤¬É¬ÍפǤ¹¡£¤Þ¤¿¡¢SuperCite ¤ò»È¤¦¾ì +¹ç¤Ï¡¢SuperCite ¤âɬÍפǤ¹¡£ + + +\subsection{tm-setup} + +tm-setup ¤Ï tm-MUA ¤ÎÀßÄê¤Î¤ß¤ò¹Ô¤Ê¤¦ module ¤Ç¤¹¡£mime-setup ¤ò load +¤·¤Æ¤¤¤ë¾ì¹ç¡¢¤³¤ì¤òÍÛ¤Ë load ¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¤¬¡¢mime-setup ¤ò»È +¤¤¤¿¤¯¤Ê¤¤¾ì¹ç¡¢°Ê²¼¤Î¤è¤¦¤Ë¤³¤ì¤ò load ¤·¤Æ²¼¤µ¤¤¡£ + +\begin{verbatim} +(load "tm-setup") +\end{verbatim} + + +\subsection{vm} + +vm ¤ò»È¤¦¾ì¹ç¤Ï .vm ¤« .emacs ¤Ë + +\begin{verbatim} +(load "tm-vm") +\end{verbatim} + +\noindent ¤òÆþ¤ì¤Æ²¼¤µ¤¤¡£ + + +\subsection{ÀßÄê file ¤ò»È¤ï¤Ê¤¤¾ì¹ç} + +tm-setup.el ¤ò»²¹Í¤Ë¤·¤Æ²¼¤µ¤¤¡£ + + +\subsection{MH ¤ÎÀßÄê} + +¤Þ¤¿¡¢MH ¤¬ MH-6.8JP2 ¤Î¾ì¹ç¡¢.mh\_profile ¤Ë + +\begin{verbatim} +scan: -form scan.mime +inc: -form inc.mime +repl: -form replcomps.mime +showproc: mhl +\end{verbatim} + +\noindent ¤òÄɲ䷤Ƥ¯¤À¤µ¤¤¡£¤Þ¤¿¡¢¤½¤ì°Ê³°¤Î MH ¤Î½èÍý¤Ï Emacs ¤Î¦ +¤Ç¼è¤ê»ÅÀÚ¤ë¤Î¤Ç¡¢MH ¤ÎÀßÄê¤Ï¤·¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£ + + +\chapter{tm-MUA} + +``tm-MUA'' ¤È¤¤¤¦¤Î¤Ï¡¢mh-e, GNUS, RMAIL ¤Ê¤É¤Î MUA ¤Î¤¿¤á¤Î MIME µ¡Ç½ +¶¯²½ module ¤ÎÁí¾Î¤Ç¤¹¡£ + +¸½ºß¡¢tm-MUA ¤Ë¤Ï¡¢ + +\begin{itemize} +\item {\bf tm-mh-e} : mh-e ÍѤΠtm-MUA +\item {\bf tm-gnus} : GNUS ÍѤΠtm-MUA +\item {\bf tm-rmail} : RMAIL ÍѤΠtm-MUA +\item {\bf tm-vm} : VM ÍѤΠtm-MUA +\end{itemize} + +\noindent ¤¬¤¢¤ê¤Þ¤¹¡£¤³¤Î¾Ï¤Ç¤Ï¤³¤ì¤é¤Î module ¤Ë´Ø¤·¤ÆÀâÌÀ¤·¤Þ¤¹¡£ + + +\section{Summary mode} + +tm-MUA ¤ò»È¤¦¤È¡¢¸µ¤Î MUA ¤Î Summary mode ¤ËÂФ·¤Æ°Ê²¼¤Îµ¡Ç½¤¬Äɲ䵤ì +¤Þ¤¹¡£ + +\medskip +\begin{center} + \begin{tabular}{|l|l|}\hline + key & µ¡Ç½ \\ \hline + M-t & MIME header ¤Î decode ¤Ë´Ø¤¹¤ë toggle \\ + v & ËÜʸ¤ËÆþ¤ê¡¢mime/view-mode ¤Ë°Ü¤ë \\ \hline + \end{tabular} +\end{center} +\medskip + + +\section{mime/viewer-mode} +\label{sec:mime/viewer-mode} + +tm-MUA ¤ò»È¤¦¤È¡¢Summary mode ¤Ç {\bf v} ¡Êvm ¤Ç¤Ï {\bf Z}¡Ë¤ò²¡¤¹¤³¤È +¤Ë¤è¤Ã¤Æ¡¢mime/viewer-mode ¤È¤¤¤¦ MIME message ¤ò±ÜÍ÷¤¹¤ë¤¿¤á¤Î mode +¤ËÆþ¤ê¤Þ¤¹¡£mime/viewer-mode ¤Ë¤Ï°Ê²¼¤Îµ¡Ç½¤¬¤¢¤ê¤Þ¤¹¡£ + +\medskip +\begin{center} + \begin{tabular}{|l|l|}\hline + key & µ¡Ç½ \\ \hline + u & ¾å¤Î content ¤ËÌá¤ë \\ + & message ¤Î°ìÈÖ¾å¤Î content ¤Ç¤³¤ì¤ò¹Ô¤Ê¤¦¤È Summary mode + ¤ËÌá¤ë (*1) \\ + p & Á°¤Î content ¤Ë°ÜÆ°¤¹¤ë \\ + n & ¼¡¤Î content ¤Ë°ÜÆ°¤¹¤ë \\ + SPC & scroll up ¤¹¤ë \\ + M-SPC & scroll down ¤¹¤ë \\ + DEL & scroll down ¤¹¤ë \\ + RET & ¼¡¤Î¹Ô¤Ë°ÜÆ°¤¹¤ë \\ + M-RET & Á°¤Î¹Ô¤Ë°ÜÆ°¤¹¤ë \\ + v & content ¤òºÆÀ¸¤¹¤ë (*2) \\ + e & content ¤«¤é file ¤ò¼è¤ê½Ð¤¹ (*2) \\ + C-c C-p & content ¤ò°õºþ¤¹¤ë (*2) \\ \hline + \end{tabular} +\end{center} +\medskip + +\bigskip + +\newcounter{asteriskcount} +\noindent{\bf ¡ÎÃí°Õ¡Ï} +\vspace{-1ex} +{\list{(*\arabic{asteriskcount})}{\usecounter{asteriskcount}\leftmargin=8ex} +\item tm-mh-e, tm-gnus, tm-rmail ¤Ê¤É¤Ç tm-view ¤ÎÀßÄê¤ò¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ + Summary mode ¤Ë¤ÏÌá¤ê¤Þ¤»¤ó¡£ +\item ¼ÂºÝ¤ÎÆ°ºî¤ÏÂбþ¤¹¤ë method ¤Ë°Í¤ê¤Þ¤¹¡£ +\endlist} + + +\section{tm-gnus ¤Î customize} + +\subsection{article ¤ò save ¤¹¤ë»þ decoding ¤·¤Ê¤¤} + +article ¤ò save ¤¹¤ë»þ¡¢Êݸ¤µ¤ì¤ë message ¤Ï¤½¤Î»þɽ¼¨¤µ¤ì¤Æ¤¤¤ë¤è¤¦ +¤Ë¡¢¤½¤Î»þ¤Î MIME header decoding mode ¤Ë±þ¤¸¤Æ save ¤µ¤ì¤Þ¤¹¡£ + +¤·¤«¤·¡¢article ¤ò save ¤¹¤ë»þ¡¢¾ï¤Ë¡¢MIME header decoding ¤ò¹Ô¤Ê¤ï¤Ê +¤¤¡¢À¸¤Î message ¤ÇÊݸ¤·¤¿¤¤¾ì¹ç¤Ï¡¢ÊÑ¿ô +tm-gnus/set-mime-header-decoding-mode ¤ÎÃͤò nil ¤Ë¤·¤Æ¡¢MIME header +decoding ¤ò¹Ô¤Ê¤ï¤Ê¤¤ mode ¤Ë¤·¤Æ¡¢article save ´Ø¿ô¤ò¼Â¹Ô¤¹¤ë¤è¤¦¤ËÀß +Äꤷ¤Æ²¼¤µ¤¤¡£ + +Save ¤Î¼Â¹Ô¸å¡¢MIME header decoding mode ¤òÁ°¤Î¾õÂÖ¤ËÌᤷ¤¿¤¤¾ì¹ç¤Ï¡¢ +°Ê²¼¤Î¤è¤¦¤Ë¡¢°ì»þÊÑ¿ô¤Ë MIME header decoding mode ¤òÊݸ¤·¤Æ¤ª¤±¤Ð OK +¤Ç¤¹¡£ + +\begin{verbatim} + (let ((mm mime/header-decoding-mode)) + (tm-gnus/set-mime-header-decoding-mode nil) + (article save ´Ø¿ô) + (tm-gnus/set-mime-header-decoding-mode mm) + ) +\end{verbatim} + +°Ê²¼¤Ë¡¢mh-e ¤Î folder ¤Ë save ¤¹¤ë¾ì¹ç¤ÎÎã¤ò¼¨¤·¤Þ¤¹¡£ + +\begin{verbatim} +(add-hook 'gnus-Startup-hook + (function + (lambda () + (setq gnus-default-article-saver + (function + (lambda () + (interactive) + (let ((mm mime/header-decoding-mode)) + (tm-gnus/set-mime-header-decoding-mode nil) + (gnus-Subject-save-in-folder) + (tm-gnus/set-mime-header-decoding-mode mm) + ))))))) +(add-hook 'gnus-startup-hook + (function + (lambda () + (setq gnus-default-article-saver + (function + (lambda () + (interactive) + (let ((mm mime/header-decoding-mode)) + (tm-gnus/set-mime-header-decoding-mode nil) + (gnus-summary-save-in-folder) + (tm-gnus/set-mime-header-decoding-mode mm) + ))))))) +\end{verbatim} + +\subsection{reply ¤¹¤ë»þ Subject ¤Î encoding Ë¡¤ò reply ¸µ¤Ë¹ç¤ï¤»¤ë} + +Reply ¤¹¤ë»þ¡¢reply ¸µ¤Î Subject ¤Ë ASCII °Ê³°¤Îʸ»ú½¸¹ç¤ÎÆþ¤Ã¤Æ¤¤¤ë +¾ì¹ç¡¢reply ¸µ¤¬ MIME encode ¤µ¤ì¤Æ¤¤¤¿¤é encode ¤·¡¢¤½¤¦¤Ç¤Ê¤«¤Ã¤¿¤é +À¸¤ÇÆþ¤ì¤¿¤¤¾ì¹ç¤Ï¡¢¼¡¤Î¤è¤¦¤ËÀßÄꤷ¤Þ¤¹¡£ + +\begin{verbatim} +(add-hook 'gnus-article-prepare-hook + (function + (lambda () + (if (mime/exist-encoded-word-in-subject) + (setq mime/no-encoding-header-fields '("X-Nsubject")) + (setq mime/no-encoding-header-fields '("X-Nsubject" "Subject")) + )))) +\end{verbatim} + + +\chapter{tm-view} + +tm-view ¤Ï MIME message ¤ò±ÜÍ÷¤¹¤ë¤¿¤á¤Îµ¡Ç½¤òÄ󶡤¹¤ë module ¤Ç¤¹¡£ +tm-view ¤Ï mime/viewer-mode ¤È¤¤¤¦ mode ¤òÄ󶡤·¤Þ¤¹¡£ + +mime/viewer-mode ¤Îµ¡Ç½¤Ë´Ø¤·¤Æ¤Ï¡¢\ref{sec:mime/viewer-mode} Àá¤ò»²¾È +¤·¤Æ²¼¤µ¤¤¡£ + +\section{content ¤Î decode ¾ò·ï¤ÎÀßÄê} + +ÊÑ¿ô mime/content-decoding-condition ¤Ï decode »þ¤Î method ¤ò»ØÄꤹ¤ë +¤¿¤á¤ÎÊÑ¿ô¤Ç¡¢tm-view 4 ¤ÎÊÑ¿ô mime/content-decoding-method-alist ¤ËÁê +Åö¤·¤Þ¤¹¡£ + +ÊÑ¿ô mime/content-decoding-method-alist ¤Ç¤Ï¡¢Ã±¤Ë +content-type/subtype ¤ËÂФ¹¤ë method ¤ò»ØÄꤹ¤ë¤³¤È¤·¤«¤Ç¤­¤Þ¤»¤ó¤Ç¤· +¤¿¤¬¡¢ÊÑ¿ô mime/content-decoding-condition ¤Ç¤Ï decode »þ¤ÎÀ©Ìó¾ò·ï¤ò +½ñ¤¯¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ + +ÊÑ¿ô mime/content-decoding-condition ¤Ï¡¢ + +\begin{eqnarray*} + (¾ò·ï_1 \;\; ¾ò·ï_2 \;\; ...) +\end{eqnarray*} + +\noindent ¤È¤¤¤¦·Á¤ò¤·¤¿ list ¤Ç¡¢³Æ¾ò·ï¤Ï + +\begin{eqnarray*} + ((field-type_1 \; . \; value_1) \;\; + (field-type_2 \; . \; value_2) \;\; ...) +\end{eqnarray*} + +\noindent ¤È¤¤¤¦·Á¤ÎÏ¢ÁÛ list ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ + +Î㤨¤Ð¡¢text/plain ¤Î»þ¡¢tm-plain ¤òµ¯Æ°¤¹¤ë»þ¡¢ + +\begin{quote} + ((type . "text/plain") + (method "tm-plain" nil 'file 'type 'encoding 'mode 'name)) +\end{quote} + +\noindent ¤È¤¤¤¦¾ò·ï¤ò½ñ¤­¤Þ¤¹¡£¸«¤Æ¤ÎÄ̤ꡢ³°Éô method ¤Î°ú¿ô¤¬½ñ¤±¤ë +¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£¾Ü¤·¤¯¤Ï \ref{sec:method-arguments} Àá¤Ç½Ò¤Ù¤Þ¤¹¡£ + +¤³¤Î¾ò·ï¤Ï text/plain ¤Ç¤¢¤ë content ¤Ê¤éÁ´¤Æ¤Î decoding-mode ¤ÇÍ­¸ú¤Ç +¤¹¡£¤·¤«¤·¡¢ + +\begin{quote} + ((type . "text/plain") + (method "tm-plain" nil 'file 'type 'encoding 'mode 'name) + (mode . "play")) +\end{quote} + +\noindent ¤Ê¤é¡¢play mode °Ê³°¤Ç¤ÏÍ­¸ú¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ + +µÕ¤Ë¡¢ + +\begin{quote} + ((method "metamail" t "-m" "tm" "-x" "-d" "-z" "-e" 'file) + (mode . "play")) +\end{quote} + +\noindent ¤Ê¤é¡¢Á´¤Æ¤Î content-type ¤Î play mode ¤ÇÍ­¸ú¤Ë¤Ê¤ê¤Þ¤¹¡£ + +¤³¤¦¤·¤Æ³Æ¾ò·ï¤òÁ°¤«¤é¸«¤Æ¹Ô¤­¡¢ºÇ½é¤ËÍ­¸ú¤Ë¤Ê¤Ã¤¿¾ò·ï¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹¡£ + + +\subsection{method ¤Î°ú¿ô¤Î»ØÄê¤Î»ÅÊý} +\label{sec:method-arguments} + +¾ò·ï¤Î method field ¤Ï + +\begin{eqnarray*} + (method \; . \; SYMBOL) +\end{eqnarray*} + +\noindent ¤« + +\begin{eqnarray*} + (method \; ʸ»úÎó \; FLAG \; °ú¿ô_1 \; °ú¿ô_2 \; ...) +\end{eqnarray*} + +\noindent ¤È¤¤¤¦·Á¤ò¤·¤Æ¤¤¤Þ¤¹¡£ + +method field ¤ÎÃͤ¬ symbol ¤Ç¤¢¤ë¾ì¹ç¤Ï¡¢ÆâÉô method ¤È¤·¤Æµ¯Æ°¤µ¤ì¤Þ +¤¹¡£ + +method field ¤ÎÃͤ¬ list ¤Ç¤¢¤ë¾ì¹ç¡¢³°Éô method ¤È¤·¤Æµ¯Æ°¤µ¤ì¤Þ¤¹¡£ +¤³¤Î¾ì¹ç¡¢ + +\begin{quote} + \begin{tabular}{lcl} + ʸ»úÎó&:&³°Éô method ¤Î̾Á° \\ + FLAG&:& t ¤Ê¤é content header ¤â³°Éô method ¤ËÅϤ¹¡£ + nil ¤Ê¤é content body ¤Î¤ß¤òÅϤ¹¡£\\ + °ú¿ôÎó&:&³°Éô method ¤Î°ú¿ô + \end{tabular} +\end{quote} + +\noindent ¤È²ò¼á¤µ¤ì¤Þ¤¹¡£ + +¤Þ¤¿¡¢³°Éô method ¤Î°ú¿ô¤Ï¼¡¤Î¤è¤¦¤Ê·Á¼°¤Ç½ñ¤­¤Þ¤¹¡£ + +\begin{quote} + \begin{tabular}{lcl} + ʸ»úÎó&:&¤½¤Îʸ»úÎó¤òÅϤ¹ \\ + 'SYMBOL&:&SYMBOL ¤ò key ¤È¤·¤¿ÃͤòÅϤ¹\\ + 'ʸ»úÎó&:&ʸ»úÎó¤ò key ¤È¤·¤¿ÃͤòÅϤ¹ + \end{tabular} +\end{quote} + +'SYMBOL ¤Ç»ØÄê¤Ç¤­¤ë¤â¤Î¤Ë¤Ï¡¢ + +\begin{quote} + \begin{tabular}{lcl} + 'file&:&content ¤òÅϤ¹¤¿¤á¤Î file ̾ \\ + 'type&:&content-type/sub-type ̾ \\ + 'encoding&:&content-transfer-encoding \\ + 'mode&:&decoding mode \\ + 'name&:&file ¤ËÍ¾ì¹ç¤Î file ̾ + \end{tabular} +\end{quote} + +\noindent ¤Ê¤É¤¬¤¢¤ê¡¢'ʸ»úÎó ¤Ç¤Ï Content-Type field ¤Î parameter ¤Î +Ãͤ¬»ØÄê¤Ç¤­¤Þ¤¹¡£ + + +\subsection{Îã} + +½é´üÃͤϰʲ¼¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ + +\begin{verbatim} +(defvar mime/content-decoding-condition + '(((type . "text/plain") + (method "tm-plain" nil 'file 'type 'encoding 'mode 'name)) + ((type . "text/x-latex") + (method "tm-latex" nil 'file 'type 'encoding 'mode 'name)) + ((type . "audio/basic") + (method "tm-au" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/gif") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/jpeg") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/tiff") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/x-tiff") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/x-xbm") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/x-pic") + (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "video/mpeg")` + (method "tm-mpeg" nil 'file 'type 'encoding 'mode 'name)) + ((type . "application/octet-stream") + (method "tm-file" nil 'file 'type 'encoding 'mode 'name)) + ((type . "message/partial") + (method . mime/decode-message/partial-region)) + ((method "metamail" t + "-m" "tm" "-x" "-d" "-z" "-e" 'file)(mode . "play")) + )) +\end{verbatim} + +Î㤨¤Ð¡¢¡ÖÁ´Éô metamail »È¤¦¤ó¤ä¡×¤È¤¤¤¦¾ì¹ç¡¢ + +\begin{verbatim} +(setq mime/content-decoding-condition + '( + ((method "metamail" t "-m" "tm" "-x" "-d" "-z" "-e" 'file)) + )) +\end{verbatim} + +\noindent ¤È¤¹¤ì¤Ð OK ¤Ç¤¹¡£ + +¹©Éפ¹¤ì¤Ð¡¢¤«¤Ê¤êÊ£»¨¤Ê¾ò·ï¤¬½ñ¤±¤ë¤Ç¤·¤ç¤¦¡£ + + +\section{method script} +\label{sec:method} + +³Æ method ¤Ï shell script ¤Ç½ñ¤­¤Þ¤¹¡£tm-verw.el ¤«¤éÅϤµ¤ì¤ë°ú¿ô¤Ï¡¢ +ÊÑ¿ô mime/content-decoding-condition ¤Ç»ØÄê¤Ç¤­¤Þ¤¹¤¬¡¢É¸½àŪ¤Ê°ú¿ôÎó +¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£ + +\medskip +\begin{center} + \begin{tabular}{|c|l|} \hline + °ú¿ô & \multicolumn{1}{|c|}{ ÃÍ }\\ \hline + \$1 & decode Á°¤Î file ̾ \\ + \$2 & Content-Type (type/sub-type) \\ + \$3 & encoding + \{7bit / quoted-printable / base64 / 8bit / binary / ...\}\\ + \$4 & decoding-mode \{play / extract / print\} \\ + \$5 & file ̾ \\ \hline + \end{tabular} +\end{center} +\medskip + +¤Þ¤¿¡¢message/partial ¤À¤±¤Ï tm-view.el ¼«¿È¤ÇÉü¸µ¤·¤Þ¤¹¡£ + + +\section{ɽ¼¨} + +mime/viewer-mode ¤ËÆþ¤ë¤È¡¢³Æ content ¤Ï preview buffer ¤Ë + +\begin{verbatim} +[1 (text/plain)] + +ËÜʸ +\end{verbatim} + +\noindent ¤Î¤è¤¦¤Ë²Ã¹©¤µ¤ì¤Æɽ¼¨¤µ¤ì¤Þ¤¹¡£tm-view ¤Ç¤Ï content ¤òɽ¼¨ +¤¹¤ëºÝ¡¢ + +\begin{itemize} +\item content subject +\item content header +\item content body +\end{itemize} + +\noindent ¤È¤¤¤¦£³¤Ä¤ÎÉôʬ¤Ëʬ¤±¤Æ°·¤ï¤ì¤Þ¤¹¡£ + + +\subsection{content subject} + +content subject ¤Ï preview buffer ¤Ç content ¤ÎÀèƬ¤òɽ¤¹¤¿¤á¤ÎÉôʬ¤Ç¡¢ +ɸ½à¤Ç¤Ï¡¢ + +\begin{quote} + [cid Âê̾ (·¿)] +\end{quote} + +\noindent ¤Î¤è¤¦¤Ëɽ¼¨¤µ¤ì¤Þ¤¹¡£cid ¤Ï message ¤ÎÃæ¤Ç¤Î content ¤Î°ÌÃÖ +¤òɽ¤¹¤â¤Î¤Ç¡¢ÀáÈÖ¹æ¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤¹¡£Âê̾¤Ï¡¢Subject ¤ä +Content-Description ¤Ê¤É¤Ë½ñ¤«¤ì¤¿Ê¸»úÎ󤫤éºî¤é¤ì¤Þ¤¹¡£·¿¤Ï +Content-Type ¤Ë½ñ¤«¤ì¤¿ type/subtype ¤Î¤³¤È¤Ç¤¹¡£ + +¤³¤Î content subject ¤Îɽ¼¨¤ÏÊÑ¿ô mime/make-content-subject-function +¤Ë¤è¤Ã¤ÆÀßÄê¤Ç¤­¤Þ¤¹¡£´ûÄêÃͤϡ¢ + +\begin{verbatim} +(defvar mime/make-content-subject-function + (function + (lambda (cid subj ctype) + (insert + (format "[%s %s (%s)]\n" + (if (listp cid) + (mapconcat (function + (lambda (num) + (format "%s" (+ num 1)) + )) + cid ".") + "0") + subj (car ctype))) + ))) +\end{verbatim} + +\noindent ¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¢Î㤨¤Ð¡¢ + +\begin{verbatim} +(setq mime/make-content-subject-function + (function + (lambda (cid subj ctype) + (if (not (member (car ctype) mime/default-showing-Content-Type-list)) + (insert + (format "[%s %s (%s)]\n" + (if (listp cid) + (mapconcat (function + (lambda (num) + (format "%s" (+ num 1)) + )) + cid ".") + "0") + subj (car ctype)))) + ))) +\end{verbatim} + +\noindent ¤È¤¹¤ì¤Ð±£¤µ¤ì¤¿ content ¤À¤± content subject ¤òɽ¼¨¤¹¤ë¤è¤¦ +¤Ë¤Ç¤­¤Þ¤¹¡£ + + +\subsection{content header} + +content header ¤Ï preview buffer ¤Ç content header ¤òɽ¼¨¤¹¤ë¤¿¤á¤ÎÉô +ʬ¤Ç¤¹¡£É¸½à¤Ç¤Ï¶õ¹Ô¤Ë¤Ê¤ê¤Þ¤¹¡£ + +¤³¤Î content header ¤Îɽ¼¨¤ÏÊÑ¿ô mime/make-content-header-filter ¤Ë¤è¤Ã +¤ÆÀßÄê¤Ç¤­¤Þ¤¹¡£´ûÄêÃͤϡ¢ + +\begin{verbatim} +(defvar mime/make-content-header-filter + (function + (lambda (cid) + (if (listp cid) + (delete-region (goto-char (point-min)) + (or (and (re-search-forward "^$" nil t) + (match-end 0)) + (point-max)) + ) + ) + ))) +\end{verbatim} + +\noindent ¤È¤Ê¤Ã¤Æ¤ª¤ê¡¢content header ¤ò body ¤È¤Î¶­¤Î¶õ¹Ô¤Þ¤Çºï½ü¤¹ +¤ë¤È¤¤¤¦É÷¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£Î㤨¤Ð¡¢ + +\begin{verbatim} +(setq mime/make-content-header-filter + (function + (lambda (cid) + ))) +\end{verbatim} + +\noindent ¤È¤¹¤ì¤Ð¡¢Á´¤Æ¤Î content header field ¤òɽ¼¨¤Ç¤­¤Þ¤¹¡£ + + +\subsection{content body} + +preview buffer ¤Ë content body ¤òɽ¼¨¤¹¤ëºÝ¡¢content-type Ëè¤Ë + +\begin{enumerate} +\item ±£Êà +\item ²Ã¹© +\end{enumerate} + +\noindent ¤È¤¤¤¦½èÍý¤¬¹Ô¤Ê¤ï¤ì¤Þ¤¹¡£ + +±£ÊäÏÈó text part ¤ò±£¤¹¤¿¤á¤Î½èÍý¤Ç¡¢ÊÑ¿ô +mime/default-showing-Content-Type-list ¤ËÀßÄꤵ¤ì¤¿ content-type °Ê³° +¤Î content ¤¬±£Ê䵤ì¤Þ¤¹¡£¤³¤ÎÊÑ¿ô¤Î´ûÄêÃͤϡ¢ + +\begin{verbatim} +(defvar mime/default-showing-Content-Type-list + '("text/plain" "text/richtext" "text/enriched" "text/x-latex" nil)) +\end{verbatim} + +\noindent ¤Ç¡¢text/plain, text/richtext, text/enriched, text/x-latex, +µÚ¤Ó¡¢Èó MIME content ¤Î¤ß¤¬É½¼¨¤µ¤ì¡¢¤½¤ì°Ê³°¤Ï¡¢±£Ê䵤ì¤Þ¤¹¡£ + +±£Ê䵤ì¤Ê¤«¤Ã¤¿ content ¤ËÂФ·¤Æ¡¢²Ã¹©½èÍý¤¬¹Ô¤Ê¤ï¤ì¤Þ¤¹¡£¤½¤Î +content ¤Î content-type ¤ò key ¤Ë¤·¤ÆÊÑ¿ô mime/content-filter-alist ¤ò +°ú¤­¡¢¤½¤ÎÃÍÉô¤Ë½ñ¤«¤ì¤¿´Ø¿ô¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹¡£ + +ÊÑ¿ô mime/content-filter-alist ¤Î´ûÄêÃÍ¤Ï nil ¤Ç¤¹¤¬¡¢tm-rich.el ¤ò +load ¤¹¤ë¤È¡¢ + +\begin{verbatim} +(aput 'mime/content-filter-alist + "text/enriched" (function mime/decode-text/enriched-body)) +\end{verbatim} + +\noindent ¤Î¤è¤¦¤Ë text/enriched ¤ËÂФ¹¤ë²Ã¹©½èÍý¤¬ÀßÄꤵ¤ì¤Þ¤¹¡£ + + +\section{À©¸Â} + +Éí°¤Î BASE64 decoder ¤Ç¤¢¤ë decode-b.c ¤Ï¤¤¤¤²Ã¸º¤Êºî¤ê¤Ê¤Î¤Ç¡¢Æ°¤«¤Ê +¤«¤Ã¤¿¤é¡¢Ã»¤¤¥×¥í¥°¥é¥à¤Ê¤Î¤Ç¡¢°Õ¤òµâ¤ó¤Ç½¤Àµ¤·¤Æ²¼¤µ¤¤¡£ +(\verb+^+\_\verb+^+; + +¤Þ¤¿¡¢metamail Éí°¤Î mmencode ¤ò»È¤Ã¤Æ decode ¤·¤Æ¤âÎɤ¤¤Ç¤·¤ç¤¦¡£ + +¤Þ¤¿¡¢Quoted-Printable ¤Î decoder ¤ÏÉí°¤·¤Þ¤»¤ó¤Î¤Ç¡¢mmencode ¤ò»È¤Ã +¤Æ²¼¤µ¤¤¡£ + + +\chapter{tiny-mime} + +tiny-mime ¤Ï Mule, NEmacs, NEpoch ¾å¤ÇÆ°ºî¤¹¤ë MIME header ¤Î +encoder/decoder ¤Ç¤¹¡£tiny-mime ¤Ï¡¢ÀΡ¢¤¨¤Ê¤ß ¤Ä¤°¤È¤â ¤µ¤ó¤¬ +fj.editor.emacs ¤ËÅê¹Æ¤µ¤ì¤¿ ISO-2022-JP MIME header decoder ¤ò¸µ¤Ë¤· +¤Æ¤¤¤Þ¤¹¡£ + +¸½ºß¤Ç¤Ï¡¢Åö»þ¤Î¤â¤Î¤ËÈæ¤Ù¡¢ + +\begin{itemize} +\item decoding »þ¤Ë¤ª¤±¤ë unfolding µ¡Ç½¤ÎÄɲà +\item ISO-2022-JP ¤Ë²Ã¤¨¡¢ISO-2022-KR, ISO-8859-*, US-ASCII ¤Ê¤É¤Î¿¸À + ¸ì header ¤Î encode/decode µ¡Ç½¤ÎÄɲà +\item Q-encoding ¤ÎÄɲà +\item RFC 1522 ¤Ø¤ÎÂбþ +\end{itemize} + +\noindent ¤È¤¤¤Ã¤¿µ¡Ç½¶¯²½¤¬¹Ô¤Ê¤ï¤ì¤Æ¤¤¤Þ¤¹¡£ + +tiny-mime ¤Ï tm ¤Ë¤ª¤±¤ë MIME header encoder/decoder ¤Ç¤¢¤ê¡¢tm-view, +tm-MUA ¤¬¤³¤ì¤òÍøÍѤ·¤Æ¤¤¤Þ¤¹¡£ + + +\section{mime/decode-message-header} + +{\tt mime/decode-message-header} ¤Ï MIME header ¤ò decode ¤¹¤ë¤¿¤á¤ÎÌ¿ +Îá¤Ç¤¹¡£tiny-mime ¤¬ load ¤µ¤ì¤Æ¤¤¤ë¾õÂ֤ǡ¢decode ¤·¤¿¤¤ buffer ¤Î¾å +¤Ç¡¢ + +{\list{}{\leftmargin=8ex}\item[] +\par +M-x {\tt mime/decode-message-header} +\endlist} + +\noindent ¤ò¼Â¹Ô¤¹¤ë¤È¡¢¤½¤Î buffer ¾å¤Î MIME header ¤¬ decode ¤µ¤ì¤Þ +¤¹¡£ + +tm-MUA ¤ä tm-view ¤Ï¤³¤ÎÌ¿Îá¤ò¸Æ¤ó¤Ç¤¤¤ë¤Î¤Ç¡¢¤³¤ì¤é¤òÍøÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢ +Íۤˤ³¤ÎÌ¿Îá¤ò¼Â¹Ô¤¹¤ëɬÍפÏ̵¤¤¤Ç¤·¤ç¤¦¡£ + + +\section{mime/decode-region} + +region ¤ËÂФ·¤Æ¡¢ + +{\list{}{\leftmargin=8ex}\item[] +\par +M-x {\tt mime/decode-region} +\endlist} + +\noindent ¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ç¡¢°úÍÑ¤Ê¤É¤Ç buffer ¤Ë»Ä¤Ã¤¿ MIME header ¤ò +decode ¤Ç¤­¤Þ¤¹¡£ + + +\chapter{¥Ð¥°Êó¹ð¤Î»ÅÊý} + +tm ¤Î¥Ð¥°¤ò¸«¤Ä¤±¤¿¤é fj.editor.emacs ¤Ë post ¤¹¤ë¤«¡¢tm ML +$<$tm@@chamonix.jaist.ac.jp$>$ ¤Ë mail ¤òÁ÷¤Ã¤Æ²¼¤µ¤¤¡£ + +tm ML ¤Ç¤Ï tm ¤Î¥Ð¥°¾ðÊó¤Î¸ò´¹¤äºÇ¿·ÈǤÎÇÛÉÛ¡¢tm ¤Î²þÎɤ˴ؤ¹¤ëµÄÏÀ¤ò +¹Ô¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£tm ML ¤Ë»²²Ã¤·¤¿¤¤Êý¤Ï + +\begin{center} + tm-admin@@chamonix.jaist.ac.jp +\end{center} + +\noindent ¤Þ¤Ç mail ¤òÁ÷¤Ã¤Æ²¼¤µ¤¤¡£ÅÐÏ¿¤Ï¼êÆ°¤Ç¤¹¤Î¤Ç¡¢¤Ç¤­¤ì¤Ð¡¢¼«Á³ +¸À¸ì¤Ç½ñ¤¤¤Æ²¼¤µ¤¤¡£(\verb+^+\_\verb+^+) + +\end{document} +@ + + +5.3 +log +@tm-vm ¤Ë´Ø¤¹¤ëµ­½Ò¤òÄɲä·¤¿¡£ +@ +text +@d6 1 +a6 1 +\date{\verb$Id: tm-jp.tex,v 1.1 1994/10/17 02:38:18 morioka Exp morioka $} +d39 1 +@ + + +5.2 +log +@content ¤Îɽ¼¨¤ÎºÝ¤Î filter ÊÑ¿ô¤Ë´Ø¤¹¤ëµ­½Ò¤òÄɲä·¤¿¡£ +@ +text +@d6 1 +a6 1 +\date{\verb$Id: tm-jp.tex,v 5.1 1994/09/26 14:52:00 morioka Exp morioka $} +d140 11 +d182 1 +d207 3 +a209 4 +tm-MUA ¤ò»È¤¦¤È¡¢Summary mode ¤Ç {\bf v} ¤ò²¡¤¹¤³¤È¤Ë¤è¤Ã¤Æ¡¢ +mime/viewer-mode ¤È¤¤¤¦ MIME message ¤ò±ÜÍ÷¤¹¤ë¤¿¤á¤Î mode ¤ËÆþ¤ê¤Þ¤¹ +¡Ê⤷¡¢vm ¤Ç¤Ï°ã¤¦ key ¤Ë bind ¤·¤Æ¤¤¤ë¤½¤¦¤Ç¤¹¡Ë¡£mime/viewer-mode +¤Ë¤Ï°Ê²¼¤Îµ¡Ç½¤¬¤¢¤ê¤Þ¤¹¡£ +@ + + +5.1 +log +@mime/view-mode ¤È¤Ê¤Ã¤Æ¤¤¤ëÉôʬ¤ò mime/viewer-mode ¤Ë½¤Àµ¤·¤¿¡£ +@ +text +@d6 1 +a6 1 +\date{\verb$Id: tm-jp.tex,v 5.0 1994/09/26 14:46:30 morioka Exp morioka $} +d18 1 +a19 1 +\item mime/viewer-mode ¤ò»È¤Ã¤¿ MIME message ¤Î±ÜÍ÷¡¦ºÆÀ¸ +d51 1 +a55 13 +\begin{description} +\item[¡ÎÃí°Õ¡Ï] outline.el ¤Ï NEmacs Éí°¤Î¤â¤Î¤Ç¤Ï¤Ê¤¯¡¢outln-18.el + ¤ò»È¤¦¤³¤È¤ò¿ä¾©¤·¤Þ¤¹¡£outln-18.el ¤ò»È¤¦¾ì¹ç¤Ï¡¢¤³¤ì¤ò outline.el + ¤Ë link ¤òÄ¥¤ë¤«¡¢rename ¤·¤Æ²¼¤µ¤¤¡£ + + outln-18.el ¤ò»È¤ï¤Ê¤¤¾ì¹ç¤Ï¡¢outline.el ¤Ë + +\begin{verbatim} +(provide 'outline) +\end{verbatim} + + \noindent ¤òÆþ¤ì¤Æ²¼¤µ¤¤¡£ +\end{description} +a56 1 + +a62 15 +\begin{description} +\item[¡ÎÃí°Õ¡Ï] Emacs 18 base ¤Î Mule (Mule 1.1 ¤Ê¤É¡Ë¤Ç¤Ï¡¢Mule Éí° + ¤Î outline.el ¤ÎÂå¤ï¤ê¤Ëoutln-18.el ¤ò»È¤¦¤³¤È¤ò¿ä¾©¤·¤Þ¤¹¡£ + outln-18.el ¤ò»È¤¦¾ì¹ç¤Ï¡¢¤³¤ì¤ò outline.el ¤Ë link ¤òÄ¥¤ë¤«¡¢rename + ¤·¤Æ²¼¤µ¤¤¡£ + + outln-18.el ¤ò»È¤ï¤Ê¤¤¾ì¹ç¤Ï¡¢outline.el ¤Ë + +\begin{verbatim} +(provide 'outline) +\end{verbatim} + + \noindent ¤òÆþ¤ì¤Æ²¼¤µ¤¤¡£ +\end{description} + +a109 7 +mime-setup.el ¤Ïɸ½à¤Ç¤Ï SuperCite ¤ÎÀßÄê¤â¹Ô¤Ê¤¤¤Þ¤¹¡£¤³¤ì¤ò¤ä¤á¤ë¾ì +¹ç .emacs ¤Ë°Ê²¼¤Î¤â¤Î¤òÆþ¤ì¤Æ²¼¤µ¤¤¡£ + +\begin{verbatim} +(setq mime-setup-use-sc nil) +\end{verbatim} + +d211 3 +d502 153 +@ + + +5.0 +log +@tm-view 5.1 ¤ËÂбþ¤·¤¿ÀâÌÀʸ¤ÎÊѹ¹¤ò¹Ô¤Ê¤Ã¤¿¡£ +@ +text +@d6 1 +a6 1 +\date{\verb$Id: tm-jp.tex,v 2.1 1994/09/02 09:41:08 morioka Exp morioka $} +d19 1 +a19 1 +\item mime/view-mode ¤ò»È¤Ã¤¿ MIME message ¤Î±ÜÍ÷¡¦ºÆÀ¸ +@ + + +2.1 +log +@scroll-up, scroll-down ¤òÉÕ¤±²Ã¤¨¤¿¡£ +@ +text +@d6 1 +a6 1 +\date{\verb$Id: tm-jp.tex,v 2.0 1994/09/02 07:42:01 morioka Exp morioka $} +d227 2 +a228 2 +\section{mime/view-mode} +\label{sec:mime/view-mode} +d231 3 +a233 2 +mime/view-mode ¤È¤¤¤¦ MIME message ¤ò±ÜÍ÷¤¹¤ë¤¿¤á¤Î minor-mode ¤ËÆþ¤ê +¤Þ¤¹¡£mime/view-mode ¤Ë¤Ï°Ê²¼¤Îµ¡Ç½¤¬¤¢¤ê¤Þ¤¹¡£ +a252 3 +mime/view-mode ¤Ï minor-mode ¤Ê¤Î¤Ç¡¢¸µ¤Î MUA ¤Î Article mode ¤Î +mime/view-mode ¤È¤Ö¤Ä¤«¤Ã¤Æ¤¤¤Ê¤¤µ¡Ç½¤Ï¡¢¸µ¤Î MUA ¤Îµ¡Ç½¤¬»È¤¨¤Þ¤¹¡£ + +d339 60 +a398 2 +tm-view ¤Ï minor-mode ¤Î mime/view-mode ¤È major-mode ¤Î +mime/show-message-mode ¤òÄ󶡤·¤Þ¤¹¡£ +d400 1 +a400 3 +mime/view-mode ¤Îµ¡Ç½¤Ë´Ø¤·¤Æ¤Ï¡¢\ref{sec:mime/view-mode} Àá¤ò»²¾È¤·¤Æ +²¼¤µ¤¤¡£mime/show-message-mode ¤Ï mime/view-mode ¤ò¸Æ¤ó¤Ç¤¤¤ë¤Î¤Ç¡¢¤½ +¤ì¤¬ major-mode ¤Ç¤¢¤ë¤³¤È¤ò½ü¤±¤Ð¡¢mime/view-mode ¤ÈƱ¤¸¤Ç¤¹¡£ +d403 2 +a404 1 +\section{tm-view ¤Î customize} +d406 1 +a406 1 +\subsection{Emacs ¤ÎÀßÄê} +d408 3 +a410 1 +\subsubsection{method ¤Î»ØÄê} +d412 1 +a412 2 +.emacs ¤Ë°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤òÆþ¤ì¤Æ¡¢³Æ Content-Type ¤ËÂбþ¤¹¤ë method¤ò +»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ +d414 32 +a445 11 +\begin{verbatim} +(setq mime/content-decoding-method-alist + '(("audio/basic" . "tm-au") + ("image/gif" . "tm-image") + ("image/jpeg" . "tm-image") + ("image/x-pic" . "tm-image") + ("video/mpeg" . "tm-mpeg") + ("application/octet-stream" . "tm-file") + ("text/x-latex" . "tm-latex") + )) +\end{verbatim} +d447 1 +d449 9 +a457 1 +\subsubsection{content header ¤Îɽ¼¨} +d459 2 +a460 4 +mime/view-minor-mode ¤Ç¤Ï¡¢MIME ·Á¼°¤Î content ¤ÎÆâ¡¢¤½¤Î content ¤Î +content-type ¤¬ÊÑ¿ô +mime/default-showing-Content-Type-list ¤Ç»ØÄꤵ¤ì¤¿¤â¤Î¤Ç¤Ê¤±¤ì¤Ð±£¤· +¤Þ¤¹¡£ +a461 4 +¤³¤Î¤è¤¦¤Ë¡¢content ¤¬±£¤µ¤ì¤ë¾ì¹ç¤Ç¤â¡¢ÉáÄÌ¤Ï content header ¤È +content body ¤Î£±¹ÔÌܤÏɽ¼¨¤µ¤ì¤Þ¤¹¤¬¡¢ÊÑ¿ô mime/hide-content-header +¤ò t ¤Ë¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢content header ¤Î£±¹ÔÌܤΤߤòɽ¼¨¤¹¤ë¤è¤¦¤Ë¤Ç +¤­¤Þ¤¹¡£ +d463 1 +d465 32 +a496 1 +\subsubsection{ÆâÉô decoder ¤Î»ÈÍÑ} +d498 1 +a498 2 +°Ê²¼¤Î¤è¤¦¤ËÊÑ¿ô mime/use-internal-decoder ¤ò t ¤Ë¤¹¤ë¤È¡¢Base64 ¤Î +decode ¤òÆâÉô decoder ¤ò»È¤Ã¤Æ¹Ô¤Ê¤¤¤Þ¤¹¡£ +d501 4 +a504 1 +(setq mime/use-internal-decoder t) +d507 1 +a507 3 +¤·¤«¤·¤Ê¤¬¤é¡¢ÆâÉô decoder ¤Ï¤¹¤´¤¯ÃÙ¤¤¤Î¤Ç (\verb+^+\_\verb+^+; +decode-b ¤¬Æ°¤«¤Ê¤¤¤« mmencode ¤¬¤Ê¤¤¾ì¹ç°Ê³°¤Ï»ØÄꤷ¤Ê¤¤Êý¤¬Îɤ¤¤Ç¤·¤ç +¤¦¡£ +d509 1 +d511 2 +a512 1 +\subsection{method script} +d515 3 +a517 2 +³Æ method ¤Ï shell script ¤Ç½ñ¤­¤Þ¤¹¡£tm-body.el ¤«¤éÅϤµ¤ì¤ë°ú¿ô¤Ï°Ê +²¼¤ÎÄ̤ê¤Ç¤¹¡£ +d533 1 +a533 1 +¤Þ¤¿¡¢message/partial ¤À¤±¤Ï tm-body.el ¼«¿È¤ÇÉü¸µ¤·¤Þ¤¹¡£ +a536 2 + +message/external-body ¤Ë´Ø¤·¤Æ¤Ï¸½ºß¤Î¤È¤³¤í¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤»¤ó¡£ +@ + + +2.0 +log +@¹½À®¤òÊѤ¨¤¿¡£ +@ +text +@d6 1 +a6 1 +\date{\verb$Id: tm-jp.tex,v 1.2 1994/09/01 02:11:05 morioka Exp morioka $} +d243 2 +d255 1 +a255 4 +\noindent{\bf [Ãí°Õ]} + +(*1) tm-mh-e, tm-gnus, tm-rmail ¤Ê¤É¤Ç tm-view ¤ÎÀßÄê¤ò¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ +Summary mode ¤Ë¤ÏÌá¤ê¤Þ¤»¤ó¡£ +d257 8 +a264 1 +(*2) ¼ÂºÝ¤ÎÆ°ºî¤ÏÂбþ¤¹¤ë method ¤Ë°Í¤ê¤Þ¤¹¡£ +@ + + +1.2 +log +@̾Á°¤Î¤È¤³¤í¤Ë E-mail address ¤òÉÕ¤±²Ã¤¨¤¿¡£ +@ +text +@d6 1 +a6 1 +\date{\verb$Id: tm-jp.tex,v 1.1 1994/08/31 11:18:40 morioka Exp morioka $} +d55 15 +d76 15 +d195 6 +a200 1 +\chapter{»È¤¤Êý} +d202 7 +a208 1 +\section{tm-MUA} +a209 1 +tm-mh-e, tm-gnus, tm-rmail ¤Ê¤É¤Î tm-MUA ¤Î´ðËÜŪ¤Ê»È¤¤Êý¤òÀâÌÀ¤·¤Þ¤¹¡£ +d211 1 +a211 1 +\subsection{Summary mode} +d213 2 +a214 2 +tm-MUA ¤ò»È¤¦¤È¸µ¤Î MUA ¤Î Summary mode ¤ËÂФ·¤Æ°Ê²¼¤Îµ¡Ç½¤¬Äɲ䵤ì¤Þ +¤¹¡£ +d226 3 +a228 1 +\subsection{mime/view-mode} +d230 3 +a232 2 +mime/view-mode ¤Ï¡¢MIME message ¤ò±ÜÍ÷¤¹¤ë¤¿¤á¤Î minor-mode ¤Ç¤¹¡£¸µ¤Î +MUA ¤Î Article mode ¤ËÂФ·¤Æ°Ê²¼¤Îµ¡Ç½¤¬Äɲ䵤ì¤Þ¤¹¡£ +d250 3 +d261 72 +a332 1 +\section{tiny-mime} +d334 3 +a336 3 +mime/decode-region ¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ç¡¢°úÍÑ¤Ê¤É¤Ç buffer ¤Ë»Ä¤Ã¤¿ MIME +header ¤ò decode ¤Ç¤­¤Þ¤¹¡£¡Ê¾Ü¤·¤¯¤Ï tiny-mime ¤ÎÀâÌÀ½ñ¤ò»²¾È¤·¤Æ²¼¤µ +¤¤¡Ë +d338 3 +a341 1 +\chapter{Customize} +d343 1 +a343 1 +\section{tm-view} +d347 2 +d364 16 +d381 1 +a381 3 +decode ¤òÆâÉô decoder ¤ò»È¤Ã¤Æ¹Ô¤Ê¤¤¤Þ¤¹¡£¡Ê¤¹¤´¤¯ÃÙ¤¤¤Ç¤¹ +(\verb+^+\_\verb+^+; decode-b ¤¬Æ°¤«¤Ê¤¤¤« mmencode ¤¬¤Ê¤¤¾ì¹ç°Ê³°¤Ï»Ø +Äꤷ¤Ê¤¤Êý¤¬Îɤ¤¤Ç¤·¤ç¤¦¡Ë +d387 4 +d392 1 +a392 1 +\subsection{method script ¤ÎÀßÄê} +d415 1 +a415 1 +\subsection{À©¸Â} +d429 21 +a449 1 +\section{tm-gnus} +d451 2 +a452 1 +\subsection{article ¤ò save ¤¹¤ë»þ decoding ¤·¤Ê¤¤} +d454 3 +a456 2 +article ¤ò save ¤¹¤ë»þ¡¢Êݸ¤µ¤ì¤ë message ¤Ï¤½¤Î»þɽ¼¨¤µ¤ì¤Æ¤¤¤ë¤è¤¦ +¤Ë¡¢¤½¤Î»þ¤Î MIME header decoding mode ¤Ë±þ¤¸¤Æ save ¤µ¤ì¤Þ¤¹¡£ +d458 4 +a461 5 +¤·¤«¤·¡¢article ¤ò save ¤¹¤ë»þ¡¢¾ï¤Ë¡¢MIME header decoding ¤ò¹Ô¤Ê¤ï¤Ê +¤¤¡¢À¸¤Î message ¤ÇÊݸ¤·¤¿¤¤¾ì¹ç¤Ï¡¢ÊÑ¿ô +tm-gnus/set-mime-header-decoding-mode ¤ÎÃͤò nil ¤Ë¤·¤Æ¡¢MIME header +decoding ¤ò¹Ô¤Ê¤ï¤Ê¤¤ mode ¤Ë¤·¤Æ¡¢article save ´Ø¿ô¤ò¼Â¹Ô¤¹¤ë¤è¤¦¤ËÀß +Äꤷ¤Æ²¼¤µ¤¤¡£ +d463 2 +a464 3 +Save ¤Î¼Â¹Ô¸å¡¢MIME header decoding mode ¤òÁ°¤Î¾õÂÖ¤ËÌᤷ¤¿¤¤¾ì¹ç¤Ï¡¢ +°Ê²¼¤Î¤è¤¦¤Ë¡¢°ì»þÊÑ¿ô¤Ë MIME header decoding mode ¤òÊݸ¤·¤Æ¤ª¤±¤Ð OK +¤Ç¤¹¡£ +d466 2 +a467 7 +\begin{verbatim} + (let ((mm mime/header-decoding-mode)) + (tm-gnus/set-mime-header-decoding-mode nil) + (article save ´Ø¿ô) + (tm-gnus/set-mime-header-decoding-mode mm) + ) +\end{verbatim} +a468 1 +°Ê²¼¤Ë¡¢mh-e ¤Î folder ¤Ë save ¤¹¤ë¾ì¹ç¤ÎÎã¤ò¼¨¤·¤Þ¤¹¡£ +d470 1 +a470 26 +\begin{verbatim} +(add-hook 'gnus-Startup-hook + (function + (lambda () + (setq gnus-default-article-saver + (function + (lambda () + (interactive) + (let ((mm mime/header-decoding-mode)) + (tm-gnus/set-mime-header-decoding-mode nil) + (gnus-Subject-save-in-folder) + (tm-gnus/set-mime-header-decoding-mode mm) + ))))))) +(add-hook 'gnus-startup-hook + (function + (lambda () + (setq gnus-default-article-saver + (function + (lambda () + (interactive) + (let ((mm mime/header-decoding-mode)) + (tm-gnus/set-mime-header-decoding-mode nil) + (gnus-summary-save-in-folder) + (tm-gnus/set-mime-header-decoding-mode mm) + ))))))) +\end{verbatim} +d472 1 +a472 1 +\subsection{reply ¤¹¤ë»þ Subject ¤Î encoding Ë¡¤ò reply ¸µ¤Ë¹ç¤ï¤»¤ë} +d474 4 +a477 3 +Reply ¤¹¤ë»þ¡¢reply ¸µ¤Î Subject ¤Ë ASCII °Ê³°¤Îʸ»ú½¸¹ç¤ÎÆþ¤Ã¤Æ¤¤¤ë +¾ì¹ç¡¢reply ¸µ¤¬ MIME encode ¤µ¤ì¤Æ¤¤¤¿¤é encode ¤·¡¢¤½¤¦¤Ç¤Ê¤«¤Ã¤¿¤é +À¸¤ÇÆþ¤ì¤¿¤¤¾ì¹ç¤Ï¡¢¼¡¤Î¤è¤¦¤ËÀßÄꤷ¤Þ¤¹¡£ +d479 2 +a480 9 +\begin{verbatim} +(add-hook 'gnus-article-prepare-hook + (function + (lambda () + (if (mime/exist-encoded-word-in-subject) + (setq mime/no-encoding-header-fields '("X-Nsubject")) + (setq mime/no-encoding-header-fields '("X-Nsubject" "Subject")) + )))) +\end{verbatim} +@ + + +1.1 +log +@Initial revision +@ +text +@d4 3 +a6 2 +\author{¼é²¬ ÃÎɧ} +\date{\verb$Id$} +@ diff --git a/tm-view.el b/tm-view.el index 702b576..64b4019 100644 --- a/tm-view.el +++ b/tm-view.el @@ -10,7 +10,7 @@ ;;; (defconst mime/viewer-RCS-ID - "$Id: tm-view.el,v 5.5 1994/10/02 17:54:17 morioka Exp $") + "$Id: tm-view.el,v 5.9 1994/10/11 15:14:07 morioka Exp $") (defconst mime/viewer-version (and (string-match "[0-9][0-9.]*" mime/viewer-RCS-ID) @@ -298,10 +298,10 @@ ) (progn (narrow-to-region (point-min) - (progn - (search-forward "\n\n" nil t) - (match-beginning 0) - )) + (or (and (search-forward "\n\n" nil t) + (match-beginning 0) + ) + (point-max))) (or (message/get-field-body "Content-Description") (message/get-field-body "Subject") @@ -363,7 +363,7 @@ (switch-to-buffer obuf) (setq nb (point)) (insert str) - (setq ne (- (point) 1)) + (setq ne (point)) (save-excursion (save-restriction (narrow-to-region nb ne) @@ -377,8 +377,9 @@ (goto-char nb) (funcall mime/make-content-subject-function cid subj ctype) (setq ne (point-max)) - (setq dest (nconc dest (list (list nb ne buf beg end)))) + (setq dest (nconc dest (list (list nb (- ne 1) buf beg end)))) )) + (goto-char ne) (setq r (cdr r)) ) (set-buffer-modified-p nil) @@ -723,6 +724,9 @@ (define-key keymap "n" 'mime/next-content) (define-key keymap " " 'mime/scroll-up-content) (define-key keymap "\M- " 'mime/scroll-down-content) + (define-key keymap "\177" 'mime/scroll-down-content) + (define-key keymap "\C-m" 'mime/next-line-content) + (define-key keymap "\C-\M-m" 'mime/previous-line-content) (define-key keymap "v" 'mime/play-content) (define-key keymap "e" 'mime/extract-content) (define-key keymap "\C-c\C-p" 'mime/print-content) @@ -831,11 +835,13 @@ )) )) -(defun mime/scroll-up-content () +(defun mime/scroll-up-content (&optional h) (interactive) + (if (null h) + (setq h (- (window-height) 1)) + ) (let ((fcl mime/preview-flat-content-list) (p (point)) - (h (- (window-height) 1)) np) (setq np (or (catch 'tag (while fcl @@ -850,11 +856,13 @@ (goto-char np) ))) -(defun mime/scroll-down-content () +(defun mime/scroll-down-content (&optional h) (interactive) + (if (null h) + (setq h (- (window-height) 1)) + ) (let ((fcl mime/preview-flat-content-list) (p (point)) - (h (- (window-height) 1)) pp) (setq pp (or (let ((i (- (length fcl) 1))) (catch 'tag @@ -870,6 +878,16 @@ (goto-char pp) ))) +(defun mime/next-line-content () + (interactive) + (mime/scroll-up-content 1) + ) + +(defun mime/previous-line-content () + (interactive) + (mime/scroll-down-content 1) + ) + (defun mime/exit-view-mode () (interactive) (kill-buffer (current-buffer)) diff --git a/tm-vm.el b/tm-vm.el new file mode 100644 index 0000000..a125131 --- /dev/null +++ b/tm-vm.el @@ -0,0 +1,52 @@ +;;; +;;; tm-vm.el : tm-MUA for vm +;;; +;;; by MASUTANI Yasuhiro +;;; +;;; Plese insert (load "tm-vm") in .vm or .emacs. +;;; + +(define-key vm-mode-map "Z" 'tm-vm/view-message) + +(require 'tl-list) +(require 'tm-view) + +(setq mime/go-to-top-node-method-alist + (put-alist 'vm-mode + (function + (lambda () + (mime/exit-view-mode) + (let ((w (get-buffer-window mime/output-buffer-name))) + (if w (delete-window w))) + (vm-display vm-summary-buffer t + '(mime/exit-view-mode) + '(this-command)) + (vm-widen-page) + (goto-char (point-max)) + (widen) + (narrow-to-region (point) + (vm-vheaders-of + (car vm-message-pointer))) + (goto-char (point-min)) + (if vm-honor-page-delimiters + (vm-narrow-to-page)) + (select-window (get-buffer-window vm-summary-buffer)) + )) + mime/go-to-top-node-method-alist)) + +(defun tm-vm/view-message () + "Decode and view MIME message for VM" + (interactive) + (vm-follow-summary-cursor) + (vm-select-folder-buffer) + (vm-check-for-killed-summary) + (vm-error-if-folder-empty) + (vm-display (current-buffer) t '(tm-vm/view-message) + '(tm-vm/view-mesage reading-message)) + (vm-widen-page) + (goto-char (point-max)) + (widen) + (narrow-to-region (point) (vm-start-of (car vm-message-pointer))) + (goto-char (point-min)) + (select-window (vm-get-buffer-window (current-buffer))) + (mime/viewer-mode))