pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/devel/flim



Module Name:    pkgsrc
Committed By:   mef
Date:           Sun Sep  3 14:58:39 UTC 2023

Modified Files:
        pkgsrc/devel/flim: Makefile PLIST distinfo
        pkgsrc/devel/flim/patches: patch-ab patch-ac patch-mime-parse.el
Added Files:
        pkgsrc/devel/flim/patches: patch-ChangeLog patch-FLIM-CFG
            patch-FLIM-ELS patch-FLIM-MK patch-Makefile patch-README.en
            patch-README.ja patch-eword-decode.el patch-eword-encode.el
            patch-flim-pkg.el patch-ftp.in patch-hmac-md5.el patch-hmac-sha1.el
            patch-luna.el patch-lunit.el patch-md5.el patch-mel-g.el
            patch-mel-q-ccl.el patch-mel-q.el patch-mel-u.el patch-mel.el
            patch-mime-conf.el patch-mime-def.el patch-mime-en.texi
            patch-mime-ja.texi patch-mime-parse.el-00 patch-mime.el
            patch-mmbuffer.el patch-mmcooked.el patch-mmexternal.el
            patch-mmgeneric.el patch-qmtp.el patch-sasl-cram.el
            patch-sasl-digest.el patch-sasl-scram.el patch-sasl-xoauth2.el
            patch-sasl.el patch-sha1.el patch-smtp.el patch-std11.el

Log Message:
(devel/flim) Patches added to get github.com/wanderlust/flim version 20230808

Fix to build with emacs28, (emacs20, xemacs215 are not tested)


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 pkgsrc/devel/flim/Makefile
cvs rdiff -u -r1.11 -r1.12 pkgsrc/devel/flim/PLIST
cvs rdiff -u -r1.14 -r1.15 pkgsrc/devel/flim/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/devel/flim/patches/patch-ChangeLog \
    pkgsrc/devel/flim/patches/patch-FLIM-CFG \
    pkgsrc/devel/flim/patches/patch-FLIM-ELS \
    pkgsrc/devel/flim/patches/patch-FLIM-MK \
    pkgsrc/devel/flim/patches/patch-Makefile \
    pkgsrc/devel/flim/patches/patch-README.en \
    pkgsrc/devel/flim/patches/patch-README.ja \
    pkgsrc/devel/flim/patches/patch-eword-decode.el \
    pkgsrc/devel/flim/patches/patch-eword-encode.el \
    pkgsrc/devel/flim/patches/patch-flim-pkg.el \
    pkgsrc/devel/flim/patches/patch-ftp.in \
    pkgsrc/devel/flim/patches/patch-hmac-md5.el \
    pkgsrc/devel/flim/patches/patch-hmac-sha1.el \
    pkgsrc/devel/flim/patches/patch-luna.el \
    pkgsrc/devel/flim/patches/patch-lunit.el \
    pkgsrc/devel/flim/patches/patch-md5.el \
    pkgsrc/devel/flim/patches/patch-mel-g.el \
    pkgsrc/devel/flim/patches/patch-mel-q-ccl.el \
    pkgsrc/devel/flim/patches/patch-mel-q.el \
    pkgsrc/devel/flim/patches/patch-mel-u.el \
    pkgsrc/devel/flim/patches/patch-mel.el \
    pkgsrc/devel/flim/patches/patch-mime-conf.el \
    pkgsrc/devel/flim/patches/patch-mime-def.el \
    pkgsrc/devel/flim/patches/patch-mime-en.texi \
    pkgsrc/devel/flim/patches/patch-mime-ja.texi \
    pkgsrc/devel/flim/patches/patch-mime-parse.el-00 \
    pkgsrc/devel/flim/patches/patch-mime.el \
    pkgsrc/devel/flim/patches/patch-mmbuffer.el \
    pkgsrc/devel/flim/patches/patch-mmcooked.el \
    pkgsrc/devel/flim/patches/patch-mmexternal.el \
    pkgsrc/devel/flim/patches/patch-mmgeneric.el \
    pkgsrc/devel/flim/patches/patch-qmtp.el \
    pkgsrc/devel/flim/patches/patch-sasl-cram.el \
    pkgsrc/devel/flim/patches/patch-sasl-digest.el \
    pkgsrc/devel/flim/patches/patch-sasl-scram.el \
    pkgsrc/devel/flim/patches/patch-sasl-xoauth2.el \
    pkgsrc/devel/flim/patches/patch-sasl.el \
    pkgsrc/devel/flim/patches/patch-sha1.el \
    pkgsrc/devel/flim/patches/patch-smtp.el \
    pkgsrc/devel/flim/patches/patch-std11.el
cvs rdiff -u -r1.1 -r1.2 pkgsrc/devel/flim/patches/patch-ab \
    pkgsrc/devel/flim/patches/patch-mime-parse.el
cvs rdiff -u -r1.2 -r1.3 pkgsrc/devel/flim/patches/patch-ac

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/flim/Makefile
diff -u pkgsrc/devel/flim/Makefile:1.43 pkgsrc/devel/flim/Makefile:1.44
--- pkgsrc/devel/flim/Makefile:1.43     Tue Jun  6 12:40:37 2023
+++ pkgsrc/devel/flim/Makefile  Sun Sep  3 14:58:38 2023
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.43 2023/06/06 12:40:37 riastradh Exp $
+# $NetBSD: Makefile,v 1.44 2023/09/03 14:58:38 mef Exp $
 
 DISTNAME=      flim-1.14.9
 PKGNAME=       ${EMACS_PKGNAME_PREFIX}${DISTNAME}
-PKGREVISION=   5
+PKGREVISION=   6
 CATEGORIES=    devel
 MASTER_SITES=  http://www.kanji.zinbun.kyoto-u.ac.jp/~tomo/comp/emacsen/lisp/flim/flim-1.14/
 
@@ -33,13 +33,18 @@ MAKEFLAGS.xemacs+=  XEMACS=${EMACS_BIN} \
                        PACKAGEDIR=${EMACS_LISPPREFIX:C|/lisp$||}
 
 EMACS_MODULES=         base
-EMACS_BUILDLINK=       # defined
+EMACS_BUILDLINK=       # empty
+
+post-patch:
+       ${RM} -f ${WRKSRC}/hmac-def.el
+       ${RM} -f ${WRKSRC}/hex-utile.el
+
+pre-configure:
+       ${MKDIR} -p ${WRKDIR}/.home/.emacs.d/elpa
+       find ${WRKSRC} -name \*orig | xargs rm
 
 post-build:
-       @cd ${WRKSRC}; for i in mime-en mime-ja; do                     \
-               ${RM} -f $${i}.info*;                                   \
-               ${CP} $${i}.texi $${i}.texi.orig;                       \
-               ${LOCALBASE}/bin/qkc -Oeu $${i}.texi.orig >$${i}.texi;  \
+       cd ${WRKSRC}; for i in mime-en mime-ja; do                      \
                makeinfo --force --no-validate $${i}.texi;              \
        done
 
@@ -61,7 +66,7 @@ post-install:
 .include "../../editors/emacs/modules.mk"
 
 .if (${EMACS_FLAVOR} != "xemacs")
-BUILDLINK_API_DEPENDS.apel+=   apel>=10.7
+BUILDLINK_API_DEPENDS.apel+=   apel>=10.8
 .include "../../devel/apel/buildlink3.mk"
 .endif
 

Index: pkgsrc/devel/flim/PLIST
diff -u pkgsrc/devel/flim/PLIST:1.11 pkgsrc/devel/flim/PLIST:1.12
--- pkgsrc/devel/flim/PLIST:1.11        Fri Sep 29 12:40:26 2017
+++ pkgsrc/devel/flim/PLIST     Sun Sep  3 14:58:38 2023
@@ -1,44 +1,20 @@
-@comment $NetBSD: PLIST,v 1.11 2017/09/29 12:40:26 wiz Exp $
-${EMACS_INFOPREFIX}/mime-en.info
-${EMACS_INFOPREFIX}/mime-ja.info
-${FOR_xemacs214}${EMACS_LISPPREFIX}/flim/auto-autoloads.el
-${FOR_xemacs214}${EMACS_LISPPREFIX}/flim/auto-autoloads.elc
-${FOR_xemacs214}${EMACS_LISPPREFIX}/flim/custom-load.el
-${FOR_xemacs214}${EMACS_LISPPREFIX}/flim/custom-load.elc
-${FOR_xemacs215}${EMACS_LISPPREFIX}/flim/auto-autoloads.el
-${FOR_xemacs215}${EMACS_LISPPREFIX}/flim/auto-autoloads.elc
-${FOR_xemacs215}${EMACS_LISPPREFIX}/flim/custom-load.el
-${FOR_xemacs215}${EMACS_LISPPREFIX}/flim/custom-load.elc
+@comment $NetBSD: PLIST,v 1.12 2023/09/03 14:58:38 mef Exp $
+info/mime-en.info
+info/mime-ja.info
 ${EMACS_LISPPREFIX}/flim/eword-decode.el
 ${EMACS_LISPPREFIX}/flim/eword-decode.elc
 ${EMACS_LISPPREFIX}/flim/eword-encode.el
 ${EMACS_LISPPREFIX}/flim/eword-encode.elc
 ${EMACS_LISPPREFIX}/flim/hex-util.el
-${EMACS_LISPPREFIX}/flim/hex-util.elc
-${EMACS_LISPPREFIX}/flim/hmac-def.el
-${EMACS_LISPPREFIX}/flim/hmac-def.elc
 ${EMACS_LISPPREFIX}/flim/hmac-md5.el
-${EMACS_LISPPREFIX}/flim/hmac-md5.elc
 ${EMACS_LISPPREFIX}/flim/hmac-sha1.el
-${EMACS_LISPPREFIX}/flim/hmac-sha1.elc
 ${EMACS_LISPPREFIX}/flim/luna.el
 ${EMACS_LISPPREFIX}/flim/luna.elc
 ${EMACS_LISPPREFIX}/flim/lunit.el
 ${EMACS_LISPPREFIX}/flim/lunit.elc
-${FOR_xemacs215}${EMACS_LISPPREFIX}/flim/mailcap.el
-${FOR_xemacs215}${EMACS_LISPPREFIX}/flim/mailcap.elc
-${FOR_emacs20}${EMACS_LISPPREFIX}/flim/md4.el
-${FOR_emacs20}${EMACS_LISPPREFIX}/flim/md4.elc
-${FOR_emacs21}${EMACS_LISPPREFIX}/flim/md4.el
-${FOR_emacs21}${EMACS_LISPPREFIX}/flim/md4.elc
-${FOR_emacs20}${EMACS_LISPPREFIX}/flim/md5-el.el
-${FOR_emacs20}${EMACS_LISPPREFIX}/flim/md5-el.elc
 ${EMACS_LISPPREFIX}/flim/md5.el
-${EMACS_LISPPREFIX}/flim/md5.elc
 ${EMACS_LISPPREFIX}/flim/mel-b-ccl.el
-${EMACS_LISPPREFIX}/flim/mel-b-ccl.elc
 ${EMACS_LISPPREFIX}/flim/mel-b-el.el
-${EMACS_LISPPREFIX}/flim/mel-b-el.elc
 ${EMACS_LISPPREFIX}/flim/mel-g.el
 ${EMACS_LISPPREFIX}/flim/mel-g.elc
 ${EMACS_LISPPREFIX}/flim/mel-q-ccl.el
@@ -65,28 +41,16 @@ ${EMACS_LISPPREFIX}/flim/mmexternal.el
 ${EMACS_LISPPREFIX}/flim/mmexternal.elc
 ${EMACS_LISPPREFIX}/flim/mmgeneric.el
 ${EMACS_LISPPREFIX}/flim/mmgeneric.elc
-${FOR_emacs20}${EMACS_LISPPREFIX}/flim/ntlm.el
-${FOR_emacs20}${EMACS_LISPPREFIX}/flim/ntlm.elc
-${FOR_emacs21}${EMACS_LISPPREFIX}/flim/ntlm.el
-${FOR_emacs21}${EMACS_LISPPREFIX}/flim/ntlm.elc
 ${EMACS_LISPPREFIX}/flim/qmtp.el
 ${EMACS_LISPPREFIX}/flim/qmtp.elc
 ${EMACS_LISPPREFIX}/flim/sasl-cram.el
-${EMACS_LISPPREFIX}/flim/sasl-cram.elc
 ${EMACS_LISPPREFIX}/flim/sasl-digest.el
-${EMACS_LISPPREFIX}/flim/sasl-digest.elc
-${FOR_emacs20}${EMACS_LISPPREFIX}/flim/sasl-ntlm.el
-${FOR_emacs20}${EMACS_LISPPREFIX}/flim/sasl-ntlm.elc
-${FOR_emacs21}${EMACS_LISPPREFIX}/flim/sasl-ntlm.el
-${FOR_emacs21}${EMACS_LISPPREFIX}/flim/sasl-ntlm.elc
 ${EMACS_LISPPREFIX}/flim/sasl-scram.el
 ${EMACS_LISPPREFIX}/flim/sasl-scram.elc
 ${EMACS_LISPPREFIX}/flim/sasl.el
 ${EMACS_LISPPREFIX}/flim/sasl.elc
 ${EMACS_LISPPREFIX}/flim/sha1-el.el
-${EMACS_LISPPREFIX}/flim/sha1-el.elc
 ${EMACS_LISPPREFIX}/flim/sha1.el
-${EMACS_LISPPREFIX}/flim/sha1.elc
 ${EMACS_LISPPREFIX}/flim/smtp.el
 ${EMACS_LISPPREFIX}/flim/smtp.elc
 ${EMACS_LISPPREFIX}/flim/std11.el

Index: pkgsrc/devel/flim/distinfo
diff -u pkgsrc/devel/flim/distinfo:1.14 pkgsrc/devel/flim/distinfo:1.15
--- pkgsrc/devel/flim/distinfo:1.14     Tue Oct 26 10:14:38 2021
+++ pkgsrc/devel/flim/distinfo  Sun Sep  3 14:58:38 2023
@@ -1,8 +1,48 @@
-$NetBSD: distinfo,v 1.14 2021/10/26 10:14:38 nia Exp $
+$NetBSD: distinfo,v 1.15 2023/09/03 14:58:38 mef Exp $
 
 BLAKE2s (flim-1.14.9.tar.gz) = a21dfc084bedd6ba75f20988d5e1e5fae0d758dd5e0f977527c165ebedc77375
 SHA512 (flim-1.14.9.tar.gz) = a272a30f27cea24f537b9bf3a6dbb25113deff0ab8e1c03bd802e4d32d673d567d282297ed9e4d35217f069699a1fc25bfdde09778171a188dfa46f49e9bb7dd
 Size (flim-1.14.9.tar.gz) = 182065 bytes
-SHA1 (patch-ab) = 3818258269cb432cb95fe02e22ed03f98400e31f
-SHA1 (patch-ac) = 62c3df484e393f798f16200a0970e7d7ea37b308
-SHA1 (patch-mime-parse.el) = 40d7a44a177a5407465fec9700e7b00fe6973d5b
+SHA1 (patch-ChangeLog) = dcbda73d526164f238dbd17b5a0344ed3aa989ac
+SHA1 (patch-FLIM-CFG) = 7fd16f95b4cf5b19e1f9cec16e538d2535145bbf
+SHA1 (patch-FLIM-ELS) = a664460a3c860447a20d300b58353fc3827809b8
+SHA1 (patch-FLIM-MK) = ff218a29d5fdab817a287e4e482548ec26df4fb6
+SHA1 (patch-Makefile) = c9e6fb1fc4a6bc1ef93293edfd74aa4bf5093eaa
+SHA1 (patch-README.en) = 0594c72d60c32f3b84d6dee2cd763e5ea86eb743
+SHA1 (patch-README.ja) = 1ea7da76d00e5cbea27b68d61d6f578e003a820e
+SHA1 (patch-ab) = 59e9da5406183eeb3f12ffc7a2a11176c46bc30b
+SHA1 (patch-ac) = 5eb7c708f131d661e893927c1adc0fb3fa3aa045
+SHA1 (patch-eword-decode.el) = c5587fa80f1999c781baab9a8641f8a48b1ccc3f
+SHA1 (patch-eword-encode.el) = 1c5bc4b38ece8867191b0aa75ecd988e7104e194
+SHA1 (patch-flim-pkg.el) = 5277943f6d8fe8bd3f20c0be7c6a00ddf0488f83
+SHA1 (patch-ftp.in) = 1e51ceb9f57bb7e129d20963fc32e7e4620b7543
+SHA1 (patch-hmac-md5.el) = 2c30a6956eb7d435394a034a937a5a5fd0b894ca
+SHA1 (patch-hmac-sha1.el) = a82426d00c4e437c5b76f37c4a7adf670b435db0
+SHA1 (patch-luna.el) = 204848486896438fe3293823171d6dd57080392a
+SHA1 (patch-lunit.el) = 5072b93134716f02a71c80d08cc38f0242074395
+SHA1 (patch-md5.el) = e7468476e5af0a01c234e3ab668e5a935ab73b11
+SHA1 (patch-mel-g.el) = 863f46e4ac2382e50343748165e8629f00d7d43c
+SHA1 (patch-mel-q-ccl.el) = 7e78fd934afe76d08e0ac0b94142b3505fa57fef
+SHA1 (patch-mel-q.el) = c6e6a6385b2d569a6ad2c59e82d5ed8217f76f7b
+SHA1 (patch-mel-u.el) = 7b81fc86c134294844bd1a962451cbc26aee156a
+SHA1 (patch-mel.el) = b6ba9f8c9a98829d824f7caeccc8cbef7b8e5c93
+SHA1 (patch-mime-conf.el) = f5b416fb3a5c4a215ab1f91a6ffa3a43b4f1e864
+SHA1 (patch-mime-def.el) = d2402e3e87f56119dd6376806d80bcba146ca226
+SHA1 (patch-mime-en.texi) = 7aec003da716e020b2bcf1b7871704cf998f7fe1
+SHA1 (patch-mime-ja.texi) = 93b1b11ac75058b3dadb72103477845487ee1e39
+SHA1 (patch-mime-parse.el) = b836b35e2ee55205f0043660e6f9695a8492e8d6
+SHA1 (patch-mime-parse.el-00) = 557e8bb815cf361acc1f7c6b0d6867aa6a2dad64
+SHA1 (patch-mime.el) = b8eb7d1884a0198baa03931daf0f033e57aee622
+SHA1 (patch-mmbuffer.el) = 637507580af8ff1709e776db2d9faffb71684d17
+SHA1 (patch-mmcooked.el) = f922bcc9d8e37dc0a145d747c89e24f1ce988f94
+SHA1 (patch-mmexternal.el) = a19262529f738c413b6ae0d15c4b34a625cdcb32
+SHA1 (patch-mmgeneric.el) = 5a2a646981621ac9d9d72ecc99e0d188ad827b44
+SHA1 (patch-qmtp.el) = 98521f9e98dcfde8321bcc96a8837835d1f3fcf4
+SHA1 (patch-sasl-cram.el) = 3e539e8144cba639dbef52c0c8402e17a2814253
+SHA1 (patch-sasl-digest.el) = fbc2fe257d100fc2a2e9ceb8c154ff1d4507e687
+SHA1 (patch-sasl-scram.el) = 13db72ebd4bda2f3c996510e0747e4ca83d4e9c5
+SHA1 (patch-sasl-xoauth2.el) = e8bc389bf9c0b6f7554ac8ff00132a0c6e79c790
+SHA1 (patch-sasl.el) = ed09e6665f4fedcf9293afc79cf7ee5dca41a9a9
+SHA1 (patch-sha1.el) = f6f758a3eb612207e4a6df401d0312d7d422537a
+SHA1 (patch-smtp.el) = 1a0e8c17099e2cdcfe14a3a3e202e71d634afc99
+SHA1 (patch-std11.el) = d61eaa6580735f003e57b13897fae807d5b01631

Index: pkgsrc/devel/flim/patches/patch-ab
diff -u pkgsrc/devel/flim/patches/patch-ab:1.1 pkgsrc/devel/flim/patches/patch-ab:1.2
--- pkgsrc/devel/flim/patches/patch-ab:1.1      Sun Apr 13 04:16:18 2003
+++ pkgsrc/devel/flim/patches/patch-ab  Sun Sep  3 14:58:38 2023
@@ -1,4 +1,6 @@
-$NetBSD: patch-ab,v 1.1 2003/04/13 04:16:18 uebayasi Exp $
+$NetBSD: patch-ab,v 1.2 2023/09/03 14:58:38 mef Exp $
+
+Add direntry
 
 --- mime-en.texi.orig  Wed Oct  9 00:50:05 2002
 +++ mime-en.texi
Index: pkgsrc/devel/flim/patches/patch-mime-parse.el
diff -u pkgsrc/devel/flim/patches/patch-mime-parse.el:1.1 pkgsrc/devel/flim/patches/patch-mime-parse.el:1.2
--- pkgsrc/devel/flim/patches/patch-mime-parse.el:1.1   Tue May 11 02:05:07 2021
+++ pkgsrc/devel/flim/patches/patch-mime-parse.el       Sun Sep  3 14:58:38 2023
@@ -1,24 +1,518 @@
-$NetBSD: patch-mime-parse.el,v 1.1 2021/05/11 02:05:07 mef Exp $
+$NetBSD: patch-mime-parse.el,v 1.2 2023/09/03 14:58:38 mef Exp $
 
-sting-to-int is obsolete function since emacs-26
+ flim-1_14-wl branch at 2023-08-08
 
---- mime-parse.el.orig 2005-07-06 11:09:04.000000000 +0900
-+++ mime-parse.el      2021-05-11 10:55:39.987654397 +0900
-@@ -97,7 +97,7 @@ be the result."
-     (insert text)
-     (goto-char (point-min))
-     (while (re-search-forward "%[0-9A-Fa-f][0-9A-Fa-f]" nil t)
--      (insert (prog1 (string-to-int
-+      (insert (prog1 (string-to-number
-                     (buffer-substring (point)(- (point) 2))
-                     16)
+--- /tmp/W/devel/flim/work/flim-1.14.9/mime-parse.el   2023-09-02 12:45:03.684120507 +0900
++++ ./mime-parse.el    2023-08-31 08:29:38.610505135 +0900
+@@ -1,4 +1,4 @@
+-;;; mime-parse.el --- MIME message parser
++;;; mime-parse.el --- MIME message parser  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1994,95,96,97,98,99,2001 Free Software Foundation, Inc.
+ 
+@@ -25,9 +25,13 @@
+ 
+ ;;; Code:
+ 
+-(require 'mime-def)
++(require 'pccl)
++(require 'broken)
++
+ (require 'luna)
++(require 'mime-def)
+ (require 'std11)
++(require 'mime)
+ 
+ (autoload 'mime-entity-body-buffer "mime")
+ (autoload 'mime-entity-body-start-point "mime")
+@@ -37,6 +41,132 @@
+ ;;; @ lexical analyzer
+ ;;;
+ 
++(unless-broken ccl-usable
++(define-ccl-program mime-default-ccl-lexical-analyzer
++  ;; r0 input
++  ;; r1 flag means any character exists.
++  ;; r2 in parse flag
++  ;;    1 atom, 2 spaces 3 comment (no output) 4 encloser 5 error
++  ;; r3 comment depth
++  (eval-when-compile
++    (let* ((wrt `(if (r0 == ?\") (write "\\\"")
++                 (if (r0 == ?\\) (write "\\\\")
++                   (write r0))))
++         (atm `((branch r2
++                        ((r2 = 1)
++                         (write "(mime-token . \"")
++                         (write-read-repeat r0))
++                        (write-read-repeat r0)
++                        ((r2 = 1)
++                         (write "(mime-token . \"")
++                         (write-read-repeat r0)))))
++         (ts  `((if (r2 == 1) ((write "\")") (r2 = 0)))
++                (write "(tspecials . \"")
++                ,wrt
++                (write "\")")
++                (read r0)
++                (repeat)))
++         (sp  `((branch r2
++                        ((r2 = 2)
++                         (read r0)
++                         (repeat))
++                        ((write "\")")
++                         (r2 = 2)
++                         (read r0)
++                         (repeat))
++                        ((read r0) (repeat)))))
++         (err `((branch r2
++                        ((write "(error . \""))
++                        ((write "\")")
++                         (write "(error . \""))
++                        ((write "(error . \"")))
++                (r2 = 5)
++                (loop
++                 (write-read-repeat r0))))
++         (enc (lambda (name tag)
++                `((if (r2 == 1) ((write "\")")))
++                  (write ,(concat "(" name " . \""))
++                  (r2 = 4)
++                  (loop
++                   (read-branch
++                    r0
++                    ,@(let* ((count (1+ (max tag ?\\)))
++                             (result (make-vector count '(write-repeat r0))))
++                        (aset result ?\\ `((write "\\\\")
++                                           (read r0)
++                                           ,wrt
++                                           (repeat)))
++                        (aset result ?\" '((write "\\\"") (repeat)))
++                        (aset result tag '(break))
++                        (mapcar 'identity result)))
++                   (write-repeat r0))
++                  (write "\")")
++                  (r2 = 0)
++                  (read r0)
++                  (repeat))))
++         (qs (funcall enc "quoted-string" ?\"))
++         (dl (funcall enc "domain-literal" ?\]))
++         (cm  `((if (r2 == 1) ((write "\")")))
++                (r2 = 3)
++                (r3 = 1)
++                (loop
++                 (read-branch
++                  r0
++                  ,@(let* ((count (1+ (max ?\( ?\) ?\\)))
++                           (result (make-vector count '(repeat))))
++                      (aset result ?\( '((r3 += 1) (repeat)))
++                      (aset result ?\) '((r3 -= 1)
++                                         (if (r3 < 1) (break)
++                                           (repeat))))
++                      (aset result ?\\ `((read r0) (repeat)))
++                      (mapcar 'identity result)))
++                 (repeat))
++                (r2 = 0)
++                (read r0)
++                (repeat))))
++      `(8
++      ((r2 = 0)
++       (read r0)
++       (r1 = 1)
++       (write "((")
++       (loop
++        (branch r0
++                ,@(mapcar (lambda (elt) (eval elt))
++                          '(err err err err err err err err
++                                err sp  sp  err err err err err
++                                err err err err err err err err
++                                err err err err err err err err
++                                sp  atm qs  atm atm atm atm atm
++                                cm  ts  atm atm ts  atm atm ts 
++                                atm atm atm atm atm atm atm atm
++                                atm atm ts  ts  ts  ts  ts  ts
++                                ts  atm atm atm atm atm atm atm
++                                atm atm atm atm atm atm atm atm
++                                atm atm atm atm atm atm atm atm
++                                atm atm atm dl  ts  ts)))
++        ,@atm))
++      ((branch r1
++               (write "(nil . t)")
++               (branch r2
++                       (write ") . t)")
++                       (write "\")) . t)")
++                       (write ") . t)")
++                       (write "))")
++                       (write "\")))")
++                       (write "\")) . t)")))))))))
++
++(defcustom mime-ccl-lexical-analyzer
++  (static-unless (or (broken-p 'ccl-usable)
++                   (broken-p 'ccl-execute-eof-block))
++    'mime-default-ccl-lexical-analyzer)
++  "Specify CCL-program symbol for `mime-lexical-analyze'.
++When nil, do not use CCL.
++See docstring of `std11-ccl-lexical-analyzer' for details of CCL-program.
++If you modify `mime-lexical-analyzer', set this variable to nil
++or prepare corresponding CCL-program."
++  :group 'mime
++  :type '(choice symbol (const :tag "Do not use CCL." nil)))
++
+ (defcustom mime-lexical-analyzer
+   '(std11-analyze-quoted-string
+     std11-analyze-domain-literal
+@@ -70,22 +200,27 @@
+ 
+ (defun mime-lexical-analyze (string)
+   "Analyze STRING as lexical tokens of MIME."
+-  (let ((ret (std11-lexical-analyze string mime-lexical-analyzer))
+-        prev tail)
+-    ;; skip leading linear-white-space.
+-    (while (memq (car (car ret)) '(spaces comment))
+-      (setq ret (cdr ret)))
+-    (setq prev ret
+-          tail (cdr ret))
+-    ;; remove linear-white-space.
+-    (while tail
+-      (if (memq (car (car tail)) '(spaces comment))
+-          (progn
+-            (setcdr prev (cdr tail))
+-            (setq tail (cdr tail)))
+-        (setq prev (cdr prev)
+-              tail (cdr tail))))
+-    ret))
++  (let (ret prev tail)
++    (if (and mime-ccl-lexical-analyzer
++           (cdr (setq ret (read (ccl-execute-on-string
++                                 mime-ccl-lexical-analyzer
++                                 (make-vector 9 0) (or string ""))))))
++      (car ret)
++      (setq ret (std11-lexical-analyze string mime-lexical-analyzer))
++      ;; skip leading linear-white-space.
++      (while (memq (car (car ret)) '(spaces comment))
++      (setq ret (cdr ret)))
++      (setq prev ret
++          tail (cdr ret))
++      ;; remove linear-white-space.
++      (while tail
++      (if (memq (car (car tail)) '(spaces comment))
++          (progn
++            (setcdr prev (cdr tail))
++            (setq tail (cdr tail)))
++        (setq prev (cdr prev)
++              tail (cdr tail))))
++      ret)))
+ 
+ 
+ ;;; @ field parser
+@@ -103,11 +238,7 @@
                  (delete-region (point)(- (point) 3)))))
-@@ -147,7 +147,7 @@ property of the decoded-value."
-           (let* ((attribute (downcase
-                            (substring (car params) 0 (match-end 1))))
-                  (section (if (match-beginning 2)
--                            (string-to-int
-+                            (string-to-number
-                              (substring (car params)
-                                         (1+ (match-beginning 2))
-                                         (match-end 2)))
+     (setq text (buffer-string))
+     (when charset
+-      ;; I believe that `decode-mime-charset-string' of mcs-e20.el should
+-      ;; be independent of the value of `enable-multibyte-characters'.
+-      (erase-buffer)
+-      (set-buffer-multibyte t)
+-      (setq text (decode-mime-charset-string text charset)))
++      (setq text (mime-charset-decode-string text charset)))
+     (when language
+       (put-text-property 0 (length text) 'mime-language language text))
+     text))
+@@ -122,7 +253,7 @@
+                                  (concat mime-attribute-char-regexp "+")))
+                (goto-char (match-end 0)))
+              (not (eobp)))
+-      (insert (prog1 (format "%%%02X" (char-int (char-after)))
++      (insert (prog1 (format "%%%02X" (following-char))
+                 (delete-region (point)(1+ (point))))))
+     (buffer-string)))
+ 
+@@ -237,12 +368,216 @@
+ 
+ ;;; for compatibility with flim-1_13-rfc2231 API.
+ (defalias 'mime-parse-parameters-from-list 'mime-decode-parameters)
+-(make-obsolete 'mime-parse-parameters-from-list 'mime-decode-parameters)
++(make-obsolete 'mime-parse-parameters-from-list
++             'mime-decode-parameters "28 Feb 2001")
++
++
++;;; @ parameter value encoder
++;;;
++
++(defun mime-divide-extended-parameter (name value)
++  "Divide MIME parameter value \"NAME=VALUE\" into segments.
++Each of \" NAME*n*=SEGMENT_n\;\" will be no more than 78 characters.
++Return value is a list of string when division is performed, otherwise
++return value is just a string."
++  ;; `limit' must be more than (length "CHARSET'LANGUAGE'%XX").
++  ;;
++  ;; Since MIME spec does not limit either length of CHARSET or length
++  ;; of LANGUAGE, we choose 30 for minimum `limit' based on the longest
++  ;; name of charset that Emacs supports ("ISO-2022-CN-EXT"; 15 chars).
++  ;;
++  ;; Anyway, if `name' is too long, we will ignore 78 chars limit.
++  (let ((limit (max (- 78 4 (length name)) 30))); (length " *=;") => 4
++    (if (> limit (length value))
++      value
++      (let ((count 0)
++          result)
++      (setq limit (max (- limit 2) 30))       ; (length "*n") => 2
++      (with-temp-buffer
++        (set-buffer-multibyte nil)
++        (insert value)
++        (while (> (point-max) limit)
++          (goto-char (- limit 3))             ; (length "%XX") => 3
++          (cond
++           ((eq (following-char) ?%)
++            (forward-char 3))
++           ((progn
++              (forward-char)
++              (eq (following-char) ?%)))
++           ((progn
++              (forward-char)
++              (eq (following-char) ?%)))
++           (t
++            (forward-char)))
++          (setq result (cons (prog1 (buffer-substring (point-min)(point))
++                               (delete-region (point-min)(point)))
++                             result)
++                count (1+ count))
++          (when (zerop (% count 10))
++            (setq limit (max (1- limit) 30))))
++        (nreverse
++         (cons (buffer-substring (point-min)(point-max))
++               result)))))))
++
++(defun mime-encode-extended-parameter (name value)
++  "Encode MIME parameter value \"NAME=VALUE\" as an extended-parameter.
++If encoding is unnecessary, return nil.
++If division is performed, return value is a list of string, otherwise
++return value is just a string."
++  (let ((language (get-text-property 0 'mime-language value)))
++    (when (or language
++            (string-match "[^ -~]" value)) ; Nonmatching printable US-ASCII.
++      (with-temp-buffer
++      (let ((charset (find-mime-charset-by-charsets
++                      (find-charset-string value))))
++        (setq value (mime-charset-encode-string value charset))
++        (set-buffer-multibyte nil)
++        (insert value)
++        (goto-char (point-min))
++        (insert (symbol-name charset)
++                ?'
++                (if language (symbol-name language) "")
++                ?')
++        (while (re-search-forward mime-non-attribute-char-regexp nil t)
++          (insert (prog1 (format "%%%02X" (preceding-char))
++                    (delete-region (1- (point))(point)))))
++        (mime-divide-extended-parameter name (buffer-string)))))))
++
++(defun mime-divide-regular-parameter (name value)
++  "Divide MIME parameter value \"NAME=VALUE\" into segments.
++Each of \" NAME*n=SEGMENT_n\;\" will be no more than 78 characters.
++Return value is a list of string when division is performed, otherwise
++just a string is returned."
++  (let ((limit (max (- (eval-when-compile (- 78 (length " =\"\";")))
++                     (length name))
++                  30)))
++    (if (> limit (length value))
++      (concat "\"" value "\"")
++      (let ((count 0)
++          result)
++      (setq limit (max (- limit 2) 30))       ; (length "*n") => 2
++      (setq limit (1- limit))                 ; XXX
++      (with-temp-buffer
++        (set-buffer-multibyte nil)
++        (insert value)
++        (while (> (point-max) limit)
++          (goto-char (point-min))
++          (while (< (point) limit)
++            (when (eq (following-char) ?\\)
++              (forward-char))
++            (forward-char))
++          (setq result (cons (concat "\""
++                                     (prog1 (buffer-substring
++                                             (point-min)(point))
++                                       (delete-region
++                                        (point-min)(point)))
++                                     "\"")
++                             result)
++                count (1+ count))
++          (when (zerop (% count 10))
++            (setq limit (max (1- limit) 30))))
++        (nreverse
++         (cons (concat "\""
++                       (buffer-substring (point-min)(point-max))
++                       "\"")
++               result)))))))
++
++(defun mime-encode-regular-parameter (name value)
++  "Encode MIME parameter value \"NAME=VALUE\" as a regular-parameter.
++If division is performed, return value is a list of string, otherwise
++return value is just a string."
++  (with-temp-buffer
++    (set-buffer-multibyte nil)
++    (insert value)
++    (goto-char (point-min))
++    (while (not (eobp))
++      (when (memq (following-char) '(?\\ ?\"))
++      (insert ?\\))
++      (forward-char 1))
++    (mime-divide-regular-parameter name (buffer-string))))
++
++(defun mime-encode-parameters (params)
++  "Encode PARAMS plist with MIME Parameter-Value Extensions.
++Return value is an alist of MIME parameter values."
++  (let (name value encoded result)
++    (while params
++      (setq name (car params)
++            value (car (cdr params))
++            params (cdr (cdr params)))
++      (cond
++       ;; first two clauses are for backward compatibility,
++       ;; especially for "ftp.in" in the distribution.
++       ((not (string-match (eval-when-compile
++                           (concat "^\\(" mime-attribute-char-regexp "+\\)"
++                                   "\\(\\*[0-9]+\\)?" ; continuation
++                                   "\\(\\*\\)?$")) ; charset/language
++                         name))
++      ;; invalid parameter name.
++      ;; XXX: Should we signal an error?
++      )
++       ((> (match-end 0) (match-end 1))
++      ;; this parameter value is already encoded.
++      (setq result (cons (cons name
++                               (if (match-beginning 3)
++                                   ;; extended-parameter
++                                   value
++                                 ;; regular-parameter
++                                 (std11-wrap-as-quoted-string value)))
++                         result)))
++       ((setq encoded (mime-encode-extended-parameter name value))
++      ;; extended-parameter
++      (if (stringp encoded)
++          (setq result (cons (cons (concat name "*") encoded) result))
++        ;; with continuation
++        (let ((section 0))
++          (while encoded
++            (setq result (cons (cons (concat name
++                                             "*" (int-to-string section)
++                                             "*")
++                                     (car encoded))
++                               result)
++                  section (1+ section)
++                  encoded(cdr encoded))))))
++       (t
++      ;; regular-parameter
++      (setq encoded (mime-encode-regular-parameter name value))
++        (if (stringp encoded)
++            (setq result (cons (cons name encoded) result))
++        ;; with continuation
++          (let ((section 0))
++            (while encoded
++              (setq result (cons (cons (concat name
++                                               "*" (int-to-string section))
++                                     (car encoded))
++                               result)
++                  section (1+ section)
++                  encoded (cdr encoded))))))))
++    (nreverse result)))
++
++(provide 'mime-parse)
++(require 'eword-encode)
++
++(defun mime-encode-parameters-broken-mime (params)
++  "Encode PARAMS plist compatibly with Outlook.
++Return value is an alist of MIME parameter values."
++  (let (result)
++    (while (cadr params)
++      (setq result
++          `((,(car params)
++             . ,(eword-encode-string (cadr params)
++                                     (+ (length (car params)) 3)))
++            . ,result)
++          params (cddr params)))
++    (nreverse result)))
++
++
++;;; @ field parser
++;;;
+ 
+ (defun mime-parse-parameters (tokens)
+   "Parse TOKENS as MIME parameter values.
+ Return a property list, which is a list of the form
+-\(PARAMETER-NAME1 VALUE1 PARAMETER-NAME2 VALUE2...)."
++(PARAMETER-NAME1 VALUE1 PARAMETER-NAME2 VALUE2...)."
+   (let (params attribute)
+     (while (and tokens
+               (eq (car (car tokens)) 'tspecials)
+@@ -294,8 +629,7 @@
+ If Content-Type field is not found, return nil."
+   (let ((field-body (std11-field-body "Content-Type")))
+     (if field-body
+-      (mime-parse-Content-Type field-body)
+-      )))
++      (mime-parse-Content-Type field-body))))
+ 
+ 
+ ;;; @@ Content-Disposition
+@@ -321,8 +655,7 @@
+ If Content-Disposition field is not found, return nil."
+   (let ((field-body (std11-field-body "Content-Disposition")))
+     (if field-body
+-      (mime-parse-Content-Disposition field-body)
+-      )))
++      (mime-parse-Content-Disposition field-body))))
+ 
+ 
+ ;;; @@ Content-Transfer-Encoding
+@@ -345,8 +678,7 @@
+ If Content-Transfer-Encoding field is not found, return nil."
+   (let ((field-body (std11-field-body "Content-Transfer-Encoding")))
+     (if field-body
+-      (mime-parse-Content-Transfer-Encoding field-body)
+-      )))
++      (mime-parse-Content-Transfer-Encoding field-body))))
+ 
+ 
+ ;;; @@ Content-ID / Message-ID
+@@ -360,10 +692,13 @@
+ ;;;###autoload
+ (defun mime-uri-parse-cid (string)
+   "Parse STRING as cid URI."
+-  (mime-parse-msg-id (cons '(specials . "<")
+-                         (nconc
+-                          (cdr (cdr (std11-lexical-analyze string)))
+-                          '((specials . ">"))))))
++  (when (string-match "^cid:" string)
++    (setq string (concat "<" (substring string 4) ">"))
++    (let ((parser (cdr (assq 'Content-Id mime-field-parser-alist))))
++      (if parser
++        (funcall parser (eword-lexical-analyze string))
++      (mime-decode-field-body string 'Content-Id 'plain)))))
++
+ 
+ 
+ ;;; @ message parser
+@@ -470,12 +805,8 @@
+           body-start (point-min)))
+     (save-restriction
+       (narrow-to-region header-start header-end)
+-      (setq content-type (or (let ((str (std11-fetch-field "Content-Type")))
+-                             (if str
+-                                 (mime-parse-Content-Type str)
+-                               ))
+-                           default-ctl))
+-      )
++      (setq content-type (or (mime-read-Content-Type)
++                           default-ctl)))
+     (luna-make-entity representation-type
+                     :location (current-buffer)
+                     :content-type content-type
+@@ -485,8 +816,7 @@
+                     :header-start header-start
+                     :header-end header-end
+                     :body-start body-start
+-                    :body-end body-end)
+-    ))
++                    :body-end body-end)))
+ 
+ 
+ ;;; @ for buffer

Index: pkgsrc/devel/flim/patches/patch-ac
diff -u pkgsrc/devel/flim/patches/patch-ac:1.2 pkgsrc/devel/flim/patches/patch-ac:1.3
--- pkgsrc/devel/flim/patches/patch-ac:1.2      Thu Apr 17 04:56:34 2003
+++ pkgsrc/devel/flim/patches/patch-ac  Sun Sep  3 14:58:38 2023
@@ -1,4 +1,6 @@
-$NetBSD: patch-ac,v 1.2 2003/04/17 04:56:34 uebayasi Exp $
+$NetBSD: patch-ac,v 1.3 2023/09/03 14:58:38 mef Exp $
+
+Add @direntry
 
 --- mime-ja.texi.orig  Wed Oct  9 00:50:05 2002
 +++ mime-ja.texi

Added files:

Index: pkgsrc/devel/flim/patches/patch-ChangeLog
diff -u /dev/null pkgsrc/devel/flim/patches/patch-ChangeLog:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-ChangeLog   Sun Sep  3 14:58:38 2023
@@ -0,0 +1,1018 @@
+$NetBSD: patch-ChangeLog,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+sync to  lexical-binding
+
+--- /tmp/wip/flim/work/flim-1.14.9/./ChangeLog 2007-11-28 18:13:25.000000000 +0900
++++ ././ChangeLog      2020-09-05 16:02:47.286943577 +0900
+@@ -1,6 +1,821 @@
++2020-08-24  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mime-def.el: Change product name to 'FLIM-LB'.
++
++2020-08-19  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      Change non-ASCII text files's coding-system to UTF-8
++
++      * ChangeLog:  Likewise.
++
++      * README.ja: Likewise.
++
++      * mime-ja.texi: Likewize.  Assume LuaTex for typesetting.
++
++      * mime-en.texi: Likewise.  Assume LuaTex for typesetting, because
++      this file is partially written in Japanese.
++
++2020-08-05  Naoya Yamashita  <conao3%gmail.com@localhost>
++
++      Fix closing parens position (cosmetic change only).
++      Cf. https://github.com/wanderlust/flim/pull/11
++
++2020-08-03  Naoya Yamashita  <conao3%gmail.com@localhost>
++
++      Use ?\s instead of ?(whitespace).
++      Cf. https://github.com/wanderlust/flim/pull/10
++
++      * eword-decode.el (eword-decode-encoded-words): Likewise.
++
++      * eword-encode.el (eword-encode-rword-list, ew-encode-rword-1)
++      (tm-eword::string-to-ruled-words): Likewise.
++
++      * mel-q-ccl.el (mel-ccl-decode-quoted-printable-generic)
++      (mel-ccl-encode-quoted-printable-generic, mel-ccl-decode-q):
++      Likewise.
++
++      * mel-q.el (quoted-printable-internal-encode-region): Likewise.
++
++      * mel.el (Q-encoded-text-length): Likewise.
++
++      * mime-conf.el (mime-mailcap-look-at-schar): Likewise
++
++      * smtp.el (smtp-deduce-address-list): Likewise.
++
++      * std11.el (std11-space-char-list): Likewise.
++
++2020-06-26  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * std11.el (std11-addr-to-string): Fix typo.
++      Cf. https://github.com/wanderlust/wanderlust/issues/175
++
++2020-06-14  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      Minor refactorings.
++
++      * eword-decode.el (eword-decode-encoded-words)
++      (eword-analyze-comment, eword-decode-token): Reduce use of concat
++      function.
++
++      * sasl.el (sasl-unique-id-number-base36): Replace char-to-string
++      by list for concat function's arguments.
++
++      * smtp.el (smtp-send-data): Minor refactoring.
++
++      * std11.el (std11-header-string, std11-header-string-except)
++      (std11-fill-msg-id-list-string): Reduce use of concat function.
++      (std11-parse-group, std11-addr-to-string): Minor refactorings.
++
++2020-06-05  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * FLIM-MK: Assume Emacs 24 or later.
++
++2020-06-03  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      Use following-char and preceding-char instead of char-after and
++      char-before for the current point.
++
++      * mel-q.el (quoted-printable-internal-encode-region)
++      (quoted-printable-internal-decode-region): Likewise.
++
++      * mime-conf.el (mime-mailcap-skip-comment)
++      (mime-mailcap-look-at-type-field, mime-mailcap-look-at-schar)
++      (mime-mailcap-look-at-qchar): Likewise.
++
++      * mime-parse.el (mime-decode-parameter-encode-segment)
++      (mime-divide-extended-parameter, mime-encode-extended-parameter)
++      (mime-divide-regular-parameter, mime-encode-regular-parameter):
++      Likewise.
++
++2020-06-02  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      Strip use of function wrapping lambda.
++
++      * eword-encode.el
++      (eword-encode-Content-Disposition-field-body-broken-mime)
++      (eword-encode-Content-Type-field-body-broken-mime)
++      (eword-encode-Content-Disposition-field-body)
++      (eword-encode-Content-Type-field-body): Likewise.
++
++      * mel-q.el (q-encoding-decode-string, q-encoding-encode-string):
++      Likewise.
++
++      * std11.el (std11-full-name-string, std11-addr-to-string):
++      Likewise.
++
++2020-05-30  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * eword-decode.el (eword-decode-encoded-words): Fix cl
++      dependencies.
++
++      * eword-encode.el: Adjust dependencies.
++
++      * mel-q.el: Adjust dependencies.
++      (quoted-printable-internal-decode-region): Use string-to-list
++      instead of string-to-char-list.
++
++      * mel.el: Adjust dependencies.
++
++      * mime-parse.el: Adjust dependencies.
++
++      * std11.el: Adjust dependencies.
++
++2020-05-23  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      Use lexical binding.
++
++      * eword-decode.el: Likewise.
++
++      * eword-encode.el: Likewise.
++
++      * hmac-md5.el: Likewise.
++
++      * hmac-sha1.el: Likewise.
++
++      * luna.el: Likewise.
++
++      * lunit.el: Likewise.
++
++      * md5.el: Likewise.
++
++      * mel-g.el: Likewise.
++
++      * mel-q-ccl.el: Likewise.
++
++      * mel-q.el: Likewise.
++
++      * mel-u.el: Likewise.
++
++      * mel.el: Likewise.
++
++      * mime-conf.el: Likewise.
++
++      * mime-def.el: Likewise.
++
++      * mime-parse.el: Likewise.
++
++      * mime.el: Likewise.
++
++      * mmbuffer.el: Likewise.
++
++      * mmcooked.el: Likewise.
++
++      * mmexternal.el: Likewise.
++
++      * mmgeneric.el: Likewise.
++
++      * qmtp.el: Likewise.
++
++      * sasl-cram.el: Likewise.
++
++      * sasl-digest.el: Likewise.
++
++      * sasl-scram.el: Likewise.
++
++      * sasl-xoauth2.el: Likewise.
++
++      * sasl.el: Likewise.
++
++      * sha1.el: Likewise.
++
++      * smtp.el: Likewise.
++
++      * std11.el: Likewise.
++
++2020-05-23  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      Support additional SASL mechanism libraries.
++
++      * sasl.el (sasl-additional-mechanism-alist): New variable.
++      (sasl-mechanism-alist): Include entries for additional libraries.
++      (sasl-mechanisms): Calculate from sasl-mechanism-alist.
++
++2020-05-23  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      Rmove some files which are inluded in Emacs.
++
++      * hmac-def.el: Removed.
++
++      * hex-utils.el: Removed.
++
++      * sasl-ntlm.el: Removed.
++
++      * FLIM-ELS (flim-modules, hmac-modules): Remove removed files.
++
++2020-05-23  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      Suppress byte-compiler's warnings.
++
++      * eword-decode.el (eword-decode-header): Add obsolete date.
++
++      * eword-encode.el: Fix dependency.
++      (eword-encode-header, eword-in-subject-p)
++      (eword-encode-field-body): Add obsolete date.
++
++      * mime-def.el: Remove dependecy on static.el.
++      (eval-when-compile): Assume Emacs24 or later.
++      (mime-message-structure): Add obsolete date.
++
++      * mime-parse.el: Fix dependency.
++      (mime-parse-parameters-from-list): Add obsolete date.
++
++      * qmtp.el (qmtp-via-qmtp): Add obsolete date.
++
++      * smtp.el (smtp-via-smtp): Add obsolete date.
++
++      * std11.el (std11-parse-in-reply-to): Add obsolete date.
++
++2020-05-23  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      Drop old platforms support, dependency on cl.el.  Now supported
++      Emacsen are version 24 and later.
++
++      * FLIM-ELS: Assume Emacs version 24 or later.
++
++      * eword-encode.el: Likewise.
++
++      * md5.el: Likewise.
++
++      * mel-q-ccl.el: Likewise.
++
++      * mel-q.el: Likewise.
++
++      * mel.el: Likewise.
++
++      * sha1.el: Likewise.
++
++      * eword-decode.el: Use cl-lib instead of cl.
++
++      * md5-dl.el: Removed.
++
++      * md5-el.el: Removed.
++
++      * mel-b-ccl.el: Removed.
++
++      * mel-b-dl.el: Removed.
++
++      * mel-b-el.el: Removed.
++
++      * sha1-el.el: Removed.
++
++      * sha1-dl.el: Removed.
++
++      * md4.el: Removed.  Included in Emacs.
++
++      * ntlm.el: Removed.  Included in Emacs.
++
++      * smtpmail.el: Removed.  Included in Emacs.
++
++2020-03-03  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * sasl-xoauth2.el (sasl-xoauth2-response): Fix typo in variable name.
++
++2020-02-28  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * sasl.el (sasl-mechanism-alist, sasl-mechanisms): Add OAUTHBEARER
++      as alias for XOAUTH2.
++
++2019-05-26  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * eword-decode.el (eword-decode-token): Escape characters which
++      cause warning from byte compiler.
++
++2018-03-29  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      Fix EHLO command is sent twice after STARTTLS command when
++      built-in GnuTLS library is used.
++
++      * smtp.el (smtp-open-gnutls-starttls-stream): Abolished.
++      (smtp-open-connection): Do not use smtp-open-gnutls-starttls-stream.
++      (smtp-primitive-starttls): Use gnutls-negotiate when built-in
++      GnuTLS is used for STARTTLS connection.
++
++2018-01-18  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      XOAUTH2 authentication support is introduced (experimental).
++
++      * FLIM-ELS: Install sasl-xoauth2.el when oauth2.el is installed.
++
++      * sasl.el (sasl-mechanisms, sasl-mechanism-alist): Add entry for
++      XOAUTH2.
++
++      * sasl-xoauth2.el: New file.
++
++2016-12-06  Piotr Trojanek  <piotr.trojanek%gmail.com@localhost>
++
++      * luna.el (luna-class-find-member)
++      (luna-class-find-or-make-member): do not modify input argument.
++
++2016-11-30  Piotr Trojanek  <piotr.trojanek%gmail.com@localhost>
++
++      * luna.el (luna-define-class-function): simplify iteration with
++      dolist.
++
++2016-10-30  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * std11.el (std11-full-name-string): Refactored.
++
++2016-10-30  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * eword-decode.el (eword-decode-structured-field-body)
++      (eword-decode-and-unfold-structured-field-body)
++      (eword-decode-and-fold-structured-field-body): Decrease number of
++      times for calling concat function.
++
++      * std11.el (std11-wrap-as-quoted-pairs, std11-strip-quoted-pair)
++      (std11-comment-value-to-string): Likewise.
++
++2016-10-30  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * smtp.el (smtp-send-buffer, smtp-send-buffer-by-myself): Call
++      kill-buffer with nil.  Only Emacs 23 and later support omitting an
++      argument for kill-buffer.  Reported By Tatsuya Kinoshita
++      <tats%vega.ocn.ne.jp@localhost>.  Cf. [wl:14662]
++
++2016-08-31  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * eword-decode.el (eword-analyze-encoded-word): Fix the check for
++      non-atom special chars to permit space chars.
++
++2016-08-14  Erik Hetzner  <egh%e6h.org@localhost>
++
++      * mime-en.texi: Add dir entry
++
++      * mime-ja.texi: Likewise
++
++2016-08-13  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * eword-decode.el (eword-analyze-encoded-word): Quote decoded word
++      when it contains non-atom special chars and not quoted.
++      Cf. https://github.com/wanderlust/wanderlust/issues/126
++
++2016-03-12  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mel.el (mel-prompt-for-encoding): New function.
++      (mime-encode-region, mime-decode-region)
++      (mime-insert-encoded-file, mime-write-decoded-region): Use it.
++
++2015-12-13  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * smtp.el (smtp-send-buffer, smtp-send-buffer-by-myself): Kill
++      trace buffer after sending when smtp-debug is nil and network
++      stream is disconnected.  Suggested by Herbert J. Skuhra
++      <herbert%oslo.ath.cx@localhost>
++
++2015-07-30  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * smtp.el (smtp-primitive-auth): Fix the case that server returns
++      human readable string for AUTH command.
++
++2015-05-23  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * smtp.el (smtp-make-fqdn): Show more informative message for
++      invalid FQDN.
++      Cf. https://github.com/wanderlust/wanderlust/issues/96
++
++2015-05-02  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * eword-encode.el: Require poem.el for non-mule.
++
++2015-04-30  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mime-parse.el (mime-default-ccl-lexical-analyzer)
++      (mime-ccl-lexical-analyzer): Fix for CCL unusable environments.
++
++      * std11.el (std11-default-ccl-lexical-analyzer)
++      (std11-ccl-lexical-analyzer): Likeswise.
++
++2015-04-27  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mime-parse.el (mime-default-ccl-lexical-analyzer): Fix wrong
++      program is build on XEmacs.
++
++      Cf. https://github.com/wanderlust/flim/commit/488a4d70fb4ae57bdd30dc75c2d75579894e28a2
++
++      * std11.el (std11-default-ccl-lexical-analyzer): Likewise.
++
++2015-03-10  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mime-parse.el (mime-default-ccl-lexical-analyzer): Fix the case
++      input is terminated with space characters or non-closing comment.
++
++2014-12-21  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * std11.el (std11-ignored-token-p): Simplified.
++
++2014-12-16  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      CCL base lexical analyzers are available.  They are much faster.
++      If you modify `std11-lexical-analyzer' or `mime-lexical-analyzer',
++      you also need to modify `std11-ccl-lexical-analyzer' or
++      `mime-ccl-lexical-analyzer', respectively.
++
++      * mime-parse.el (mime-default-ccl-lexical-analyzer): New CCL program.
++      (mime-ccl-lexical-analyzer): New customizable variable.
++      (mime-lexical-analyze): Use CCL based lexical analyzer if
++      mime-ccl-lexical-analyzer is non-nil.
++
++      * std11.el (std11-default-ccl-lexical-analyzer): New CCL program.
++      (std11-ccl-lexical-analyzer): New customizable variable.
++      (std11-lexical-analyze): Use CCL based lexical analyzer if
++      std11-ccl-lexical-analyzer is non-nil.
++
++2014-11-09  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mime-en.texi (7bit): Fix typo.
++
++      * mime-ja.texi: Fix missing cross-references.
++
++2014-11-09  Erik Hetzner <egh%e6h.org@localhost>
++
++      * flim-pkg.el: New file.
++
++2014-11-09  Erik Hetzner <egh%e6h.org@localhost>
++
++      * mime-en.texi: Fix headers and missing cross-references.
++
++      * mime-ja.texi: Fix headers.
++
++      * mime-en.sgml: Removed.
++
++      * mime-ja.sgml: Removed.
++
++2014-09-15  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mime-conf.el (mime-format-mailcap-command): Minor refactoring.
++
++2014-09-13  Erik Hetzner <egh%e6h.org@localhost>
++
++      * mime-conf.el (mime-format-mailcap-command): Add quotes for
++      quoted file name to unquote.
++      Cf. https://github.com/wanderlust/flim/pull/3
++
++2014-08-31  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mime-parse.el (mime-decode-parameter-value)
++      (mime-decode-parameters): Use string-to-number instead of
++      string-to-int.
++
++2014-08-31  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * eword-encode.el (eword-encode-char-type): Defined as macro.
++
++2014-08-31  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * lunit.el (lunit-generate-template): Use `with-current-buffer'
++      rather than save-excursion+set-buffer.
++
++      * mmbuffer.el (initialize-instance, mime-write-entity)
++      (mime-entity-body, mime-write-entity-body, mime-entity-content)
++      (mime-write-entity-content, mime-entity-fetch-field): Likewise.
++
++      * mmcooked.el (write-entity-content, write-entity)
++      (write-entity-body): Likewise.
++
++      * mmgeneric.el (mime-insert-header-from-buffer): Likewise.
++
++      * qmtp.el (qmtp-send-buffer): Likewise.
++
++      * smtp.el (smtp-package-buffer-internal-size, smtp-send-buffer)
++      (smtp-send-buffer-by-myself, smtp-primitive-data)
++      (smtp-process-filter, smtp-send-command)
++      (smtp-deduce-address-list): Likewise.
++
++2014-06-20  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      Un-encoded garbage handling is available when built-in base64
++      decoder is used.
++
++      * mel.el (mel-b-builtin-garbage-strategy): New customizable
++      variable.
++      (mel-b-builtin-encoded-line-regexp): New variable.
++      (mel-b-builtin-decode-string, mel-b-builtin-decode-region): New
++      functions.
++      (mime-decode-string, mime-decode-region)
++      (mime-write-decoded-region): (mel-b-builtin) Use them.
++
++2014-05-31  Juliusz Chroboczek  <jch%pps.univ-paris-diderot.fr@localhost>
++
++      * mel.el (mime-insert-encoded-file): Avoid going through an
++      intermediary string, work inline.
++      (mime-write-decoded-region): likewise.
++
++2014-04-23  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * FLIM-ELS: Check whether secure-hash function is defined.
++      Cf. https://github.com/ikazuhiro/flim/commit/85bbe382c4812fd041207aa727acba8ece2e7a39#commitcomment-6082738
++
++      * hmac-md5.el: Likewise.
++
++      * hmac-sha1.el: Likewise.
++
++      * sha1.el (TOP, sha1-dl-module): Likewise.
++
++2014-04-15  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * FLIM-ELS: Install sha1-el.el when dynamic-link is available and
++      built-in sha1 library is not available.
++
++2014-04-05  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * std11.el (std11-narrow-to-header)
++      (std11-field-bodies): Minor refactoring.
++
++2014-03-30  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * sasl-cram.el: Require hex-util.el.
++
++      * sasl-digest.el: Require hex-util.el.
++
++      * hmac-md5.el: Do not require hex-util.el.  Define autoload for
++      decode-hex-string only when needed.
++      (md5-binary): Use built-in functionality if available.
++
++      * hmac-sha1.el: Linkewise.
++      (sha1-binary): Use built-in functionality if available.
++
++2014-03-29  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * FLIM-ELS: Do not install sha1-el.el when built-in SHA1 library
++      is available.
++
++      * sha1.el: Do not require sha1-el.el in the above case.
++      (sha1-dl-module): set to nil in the above case.
++
++2014-02-22  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mel-q-ccl.el (quoted-printable-ccl-insert-encoded-file): Call
++      insert-file-contents-literally directly.
++
++2013-07-05  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * eword-encode.el: Fix the previous change for really checking.
++
++2013-07-04  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * eword-encode.el: Check whether the mule-vesion variable is defined.
++
++2013-06-26  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mailcap.el: Removed to resolve compatibility problem when run in
++      expanded place.
++
++2013-03-23  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      Many encoder/decoder functions now always encode/decode regardless
++      buffer's multibyteness.
++      * mime-def.el (mime-charset-decode-string)
++      (mime-charset-encode-string): New functions.
++
++      * mime-parse.el (mime-decode-parameter-value)
++      (mime-encode-extended-parameter): Use them.
++
++      * eword-decode.el (eword-decode-unstructured-field-body)
++      (eword-decode-and-unfold-unstructured-field-body)
++      (eword-decode-unfolded-unstructured-field-body)
++      (eword-decode-encoded-words, eword-analyze-quoted-string)
++      (eword-analyze-comment, eword-analyze-atom): Use
++      mime-charset-decode-string instead of decode-mime-charset-string.
++
++      * eword-encode.el (tm-eword::encoded-word-length)
++      (tm-eword::encoded-word-length): Use mime-charset-encode-string
++      instead of encode-mime-charset-string.
++
++2012-08-14  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * std11.el (std11-unfold-strip-leading-tab): New variable.
++      (std11-unfold-string): Use it.  Workaround for incorrect folding.
++
++2012-08-10  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mel-q-ccl.el (q-encoding-ccl-decode-string): Remove duplicate
++      definition for Emacs 23.1.
++
++2012-07-29  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * eword-encode.el (ew-find-string-rule): Define own function for
++      Emacs23 which has APEL with detect-mime-charset-string for it.
++      (ew-find-charset-rule): Define only when needed.
++
++2012-07-29  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * eword-encode.el (ew-find-string-rule): New function.
++      (eword-encode-phrase-to-rword-list): Use it.
++
++2012-07-29  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * eword-encode.el (tm-eword::string-to-ruled-words): Define own
++      function for Emacs23 which has APEL with
++      detect-mime-charset-string for it.
++      (eword-encode-char-type, eword-encode-divide-into-charset-words)
++      (eword-encode-charset-words-to-words): Define only when needed.
++
++2012-07-29  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * eword-encode.el (tm-eword::string-to-ruled-words): New function.
++      (eword-encode-split-string, eword-encode-phrase-to-rword-list):
++      Use it.
++
++2012-04-28  MORIOKA Tomohiko  <tomo.git%chise.org@localhost>
++
++      * README.ja, README.en (Bug reports): Use "Emacs-MIME" instead of
++      "EMACS-MIME".
++
++2001-02-27  Martin Buchholz  <martin%xemacs.org@localhost>
++
++      * mime-en.sgml: Typo fix.
++
++2012-04-28  MORIOKA Tomohiko  <tomo%zinbun.kyoto-u.ac.jp@localhost>
++
++      * README.ja, README.en (Bug reports): Modify for
++      emacs-mime-{en|ja}@lists.chise.org.
++
++2012-04-20  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mime-parse.el (mime-parse-message): Use mime-read-Content-Type
++      instead of mime-parse-Content-Type.
++
++2012-04-07  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * smtp.el (smtp-open-connection): Raise error when open connection
++      function failed.
++
++2012-03-20  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      Support built-in GnuTLS for STARTTLS connection.
++      * smtp.el (smtp-use-gnutls): New cutomizable variable.
++      (smtp-open-gnutls-starttls-stream): New function.
++      (smtp-submit-package): Respect smtp-use-gnutls's value.
++      (smtp-send-buffer, smtp-send-buffer-by-myself): Do not
++      decide smtp-open-connection-function's value here.
++      (smtp-open-connection): Decide which open-connection-function is
++      called here.  Respect smtp-use-gnutls's value.
++
++2011-06-27  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mel-q.el (quoted-printable-num-to-raw-byte-char): Enclose with
++      eval-and-compile().
++
++2011-06-24  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mime-parse.el (mime-encode-parameters-broken-mime): New function.
++
++      * eword-encode.el (eword-encode-Content-Type-field-body-broken-mime)
++      (eword-encode-Content-Disposition-field-body-broken-mime): New
++      functions.  If you want to use them, modify
++      `mime-header-encode-method-alist'.
++
++2011-06-19  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      Revert the change of 2004-02-17.
++      * smtp.el (smtp-starttls-program, smtp-starttls-extra-args):
++      Abolished.
++      (smtp-send-buffer): Likewise.
++
++2011-06-09  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mime.el (mime-entity-filename): When a result is got from entity
++      header, decode it.
++
++2011-06-07  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      Merged from rfc2231-encoder branch.
++      * eword-encode.el (eword-encode-Content-Type-field-body)
++      (eword-encode-Content-Disposition-field-body): New functions.
++
++      * mime-def.el (mime-attribute-char-regexp): Update for RFC2231.
++      (mime-non-attribute-char-regexp): New constant.
++
++      * mime-parse.el (mime-divide-extended-parameter)
++      (mime-encode-extended-parameter, mime-divide-regular-parameter)
++      (mime-encode-regular-parameter, mime-encode-parameters): New
++      functions.
++
++2011-05-16  David Maus  <dmaus%ictsoc.de@localhost>
++
++      * md4.el (md4-make-step): Use new style backqoutes. Slipped
++      through 2010-11-14.
++
++2010-11-14  HAMANO Kiyoto  <khiker.mail%gmail.com@localhost>
++
++      * sha1-el.el (sha1-F0, sha1-F1, sha1-F2, sha1-F3, sha1-S1)
++      (sha1-S5, sha1-S30, sha1-OP, sha1-add-to-H): Use new style
++      backquotes.
++
++      * md5-el.el: Dto.
++
++      * md4.el (md4-make-step): Dto.
++
++      * hmac-def.el (define-hmac-function): Dto.
++
++      * hex-util.el (hex-char-to-num, hex-char-to-char): Dto.
++
++      * eword-encode.el (make-ew-rword, ew-rword-text)
++      (ew-rword-charset, ew-rword-encoding, ew-rword-type): Dto.
++
++2010-11-13  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mime-parse.el (mime-uri-parse-cid): Respect
++      mime-field-parser-alist's value.
++
++2010-08-05  Tetsurou Okazaki  <okazaki%be.to@localhost>
++
++      * smtp.el (smtp-submit-package): Handle the case that
++      `smtp-find-connection' returns nil in unwind forms.
++
++2010-06-21  Katsumi Yamaoka  <yamaoka%jpl.org@localhost>
++
++      * FLIM-CFG: Add emu subdirectory to load-path when LISPDIR is
++      specified.  Suggested by Kazuhiro NISHIYAMA <zn%mbf.nifty.com@localhost>.
++
++2010-03-10  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mel-q-ccl.el (quoted-printable-ccl-decode-string)
++      (q-encoding-ccl-decode-string): Use ccl-execute-on-string() when
++      encoder for CCL coding system is broken.
++      (quoted-printable-ccl-decode-region)
++      (quoted-printable-ccl-write-decoded-region): Use
++      quoted-printable-ccl-decode-string in the above environment.
++      (TOP): Check facility for them.  Another check for decoder for ccl
++      coding system is added.
++
++      * mel-q.el (quoted-printable-num-to-raw-byte-char): New inline
++      function.
++      (quoted-printable-internal-decode-region)
++      (q-encoding-decode-string): Use it.
++
++2010-02-20  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mel-q-ccl.el (quoted-printable-ccl-encode-string)
++      (quoted-printable-ccl-insert-encoded-file)
++      (q-encoding-ccl-encode-string): Change branches to facility based.
++      (TOP): Check facility for them.
++
++2010-02-18  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mel-q-ccl.el (quoted-printable-ccl-encode-string)
++      (quoted-printable-ccl-insert-encoded-file)
++      (q-encoding-ccl-encode-string): Make new vector instead of use of
++      the one that is hard-coded in the program.
++
++2010-02-14  Tetsurou Okazaki  <okazaki%be.to@localhost>
++
++      * smtp.el (smtp-primitive-mailfrom): Fixed two spaces may be used
++      as a separator before "BODY=8BITMIME".
++
++2010-02-09  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mel-q-ccl.el (quoted-printable-ccl-encode-string)
++      (quoted-printable-ccl-insert-encoded-file)
++      (q-encoding-ccl-encode-string): Use ccl-execute-on-string() on
++      Emacs 23.1.
++      (quoted-printable-ccl-encode-region): Use
++      quoted-printable-ccl-encode-string() on Emacs 23.1.
++
++2010-01-25  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mel-q-ccl.el (mel-ccl-encode-quoted-printable-generic): Output
++      invalid character as is.
++
++2010-01-24  Kazuhiro Ito  <kzhr%d1.dion.ne.jp@localhost>
++
++      * mel.el (8bit-write-decoded-region): Use no-conversion coding
++      system for writing.
++
++      * mel-q.el (quoted-printable-quote-char)
++      (quoted-printable-internal-encode-region): Support Emacs 23
++      raw-byte characters in multibyte string.
++
++      * mel-q-ccl.el (mel-ccl-decode-q)
++      (mel-ccl-encode-q-generic)
++      (mel-ccl-encode-quoted-printable-generic): Ditto.
++      (quoted-printable-ccl-write-decoded-region): Use LF eol coding
++      system explicitly.
++
++2008-11-25  Katsumi Yamaoka  <yamaoka%jpl.org@localhost>
++
++      * eword-decode.el (eword-decode-string, eword-decode-region):
++      Mention language info in doc string.
++
++2008-11-25  Katsumi Yamaoka  <yamaoka%jpl.org@localhost>
++
++      * eword-decode.el (eword-decode-string, eword-decode-region)
++      (eword-analyze-encoded-word): Express the language portion of an
++      encoded word as a symbol.
++
++      * tests/test-rfc2231.el (test-rfc2231-encoded-word-1)
++      (test-rfc2231-encoded-word-2, test-rfc2231-encoded-word-3): Use
++      eword-decode-string instead of eword-decode-encoded-word.
++
++2008-09-20  Yoichi NAKAYAMA  <yoichi%geiin.org@localhost>
++
++      * mel-q-ccl.el (mel-ccl-256-to-16-table): Accept (illegal) lower
++      case representation for decoding.
++
++
+ 2007-11-28  MORIOKA Tomohiko  <tomo%kanji.zinbun.kyoto-u.ac.jp@localhost>
+ 
+-      * FLIM: Version 1.14.9 (Goj-D�) released.-A
++      * FLIM: Version 1.14.9 (Gojō) released.
+ 
+ 2006-12-20  MORIOKA Tomohiko  <tomo%kanji.zinbun.kyoto-u.ac.jp@localhost>
+ 
+@@ -86,7 +901,7 @@
+ 
+ 2005-12-25  MORIOKA Tomohiko  <tomo%kanji.zinbun.kyoto-u.ac.jp@localhost>
+ 
+-      * FLIM: Version 1.14.8 (Shij-D�) released.-A
++      * FLIM: Version 1.14.8 (Shijō) released.
+ 
+ 2005-12-25  MORIOKA Tomohiko  <tomo%kanji.zinbun.kyoto-u.ac.jp@localhost>
+ 
+@@ -111,7 +926,7 @@
+ 
+ 2004-10-01  MORIOKA Tomohiko  <tomo%mousai.as.wakwak.ne.jp@localhost>
+ 
+-      * FLIM: Version 1.14.7 (Sanj-D�) released.-A
++      * FLIM: Version 1.14.7 (Sanjō) released.
+ 
+ 2004-10-01  MORIOKA Tomohiko  <tomo%kanji.zinbun.kyoto-u.ac.jp@localhost>
+ 
+@@ -399,7 +1214,7 @@
+ 
+ 2002-06-03  MORIOKA Tomohiko  <tomo%kanji.zinbun.kyoto-u.ac.jp@localhost>
+ 
+-      * FLIM: Version 1.14.4 (Kashiharajing-D�-mae) released.-A
++      * FLIM: Version 1.14.4 (Kashiharajingū-mae) released.
+ 
+ 2002-01-16  Hiroya Murata     <lapis-lazuli%pop06.odn.ne.jp@localhost>
+ 
+@@ -450,7 +1265,7 @@
+ 
+ 2001-06-01  MORIOKA Tomohiko  <tomo%kanji.zinbun.kyoto-u.ac.jp@localhost>
+ 
+-      * FLIM: Version 1.14.3 (Unebigory-D�mae) released.-A
++      * FLIM: Version 1.14.3 (Unebigoryōmae) released.
+ 
+ 2001-06-01  Katsumi Yamaoka   <yamaoka%jpl.org@localhost>
+ 
+@@ -1512,7 +2327,7 @@
+ 
+ 2000-07-12  MORIOKA Tomohiko  <tomo%kanji.zinbun.kyoto-u.ac.jp@localhost>
+ 
+-      * FLIM-Chao: Version 1.14.1 (Rokujiz-D�) released.-A
++      * FLIM-Chao: Version 1.14.1 (Rokujizō) released.
+ 
+ 2000-07-10  MORIOKA Tomohiko  <tomo%kanji.zinbun.kyoto-u.ac.jp@localhost>
+ 
+@@ -2130,7 +2945,7 @@
+ 
+ 1999-05-31  MORIOKA Tomohiko  <tomo%m17n.org@localhost>
+ 
+-      * FLIM: Version 1.12.7 (Y-D�zaki) released.-A
++      * FLIM: Version 1.12.7 (Yūzaki) released.
+ 
+ 1999-05-31  MORIOKA Tomohiko  <tomo%m17n.org@localhost>
+ 
+@@ -2305,7 +3120,7 @@
+ 
+ 1999-05-11  MORIOKA Tomohiko  <tomo%m17n.org@localhost>
+ 
+-      * FLIM: Version 1.12.6 (Family-K-D�enmae) released.-A
++      * FLIM: Version 1.12.6 (Family-Kōenmae) released.
+ 
+ 1999-04-27  Shuhei KOBAYASHI  <shuhei%aqua.ocn.ne.jp@localhost>
+ 
+@@ -2422,7 +3237,7 @@
+ 
+ 1999-01-23  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+-      * FLIM: Version 1.12.3 (Kintetsu-K-D�riyama) released.-A
++      * FLIM: Version 1.12.3 (Kintetsu-Kōriyama) released.
+ 
+ 1999-01-23  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+@@ -2465,7 +3280,7 @@
+ 
+ 1999-01-21  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+-      * FLIM: Version 1.12.2 (Kuj-D�) released.-A
++      * FLIM: Version 1.12.2 (Kujō) released.
+ 
+ 1999-01-16  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+@@ -2651,7 +3466,7 @@
+ 
+ 1998-12-02  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+-      * FLIM: Version 1.12.1 (Nishinoky-D�) released.-A
++      * FLIM: Version 1.12.1 (Nishinokyō) released.
+ 
+ 1998-11-30  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+@@ -2869,7 +3684,7 @@
+ 
+ 1998-10-26  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+-      * FLIM: Version 1.11.2 (Heij-D�) was released.-A
++      * FLIM: Version 1.11.2 (Heijō) was released.
+ 
+       * NEWS (Abolish variable `mime-temp-directory'): New subsection.
+ 
+@@ -3149,7 +3964,7 @@
+ 
+ 1998-10-12  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+-      * FLIM: Version 1.10.4 (Shin-H-D�sono) was released.-A
++      * FLIM: Version 1.10.4 (Shin-Hōsono) was released.
+ 
+ 1998-10-12  Katsumi Yamaoka   <yamaoka%jpl.org@localhost>
+ 
+@@ -3334,7 +4149,7 @@
+ 
+ 1998-09-29  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+-      * FLIM: Version 1.10.0 (K-D�do) was released.-A
++      * FLIM: Version 1.10.0 (Kōdo) was released.
+ 
+       * README.en (What's FLIM): Add mel-ccl.el.
+ 
+@@ -3621,7 +4436,7 @@
+ 
+ 1998-08-31  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+-      * FLIM: Version 1.9.1 (Tonosh-D�) was released.-A
++      * FLIM: Version 1.9.1 (Tonoshō) was released.
+ 
+       * mime-en.sgml (mm-backend): Translate a little.
+ 
+@@ -3764,7 +4579,7 @@
+ 
+ 1998-07-07  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+-      * FLIM-Chao: Version 1.8.0 (Shij-D�) was released.-A
++      * FLIM-Chao: Version 1.8.0 (Shijō) was released.
+ 
+ 1998-07-07  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+@@ -3876,7 +4691,7 @@
+ 
+ 1998-07-01  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+-      * FLIM: Version 1.8.0 (-D�kubo) was released.-A
++      * FLIM: Version 1.8.0 (Ōkubo) was released.
+ 
+       * README.en: Delete `How to use'.
+ 
+@@ -4001,7 +4816,7 @@
+ 
+ 1998-06-28  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+-      * FLIM-Chao: Version 1.7.0 (Goj-D�) was released.-A
++      * FLIM-Chao: Version 1.7.0 (Gojō) was released.
+ 
+ 1998-06-26  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+@@ -4260,7 +5075,7 @@
+ 
+ 1998-06-19  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+-      * FLIM: Version 1.4.1 (Momoyama-Gory-D�mae) was released.-A
++      * FLIM: Version 1.4.1 (Momoyama-Goryōmae) was released.
+ 
+ 1998-06-18  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+@@ -4380,7 +5195,7 @@
+ 
+ 1998-05-06  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+-      * FLIM: Version 1.2.0 (J-D�j�) was released.-A
++      * FLIM: Version 1.2.0 (Jūjō) was released.
+ 
+       * README.en (What's FLIM): Delete description about
+       std11-parse.el; add description about mailcap.el.
+@@ -4431,7 +5246,7 @@
+ 
+ 1998-05-05  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+-      * FLIM: Version 1.1.0 (T-D�ji) was released.-A
++      * FLIM: Version 1.1.0 (Tōji) was released.
+ 
+ 1998-05-04  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+@@ -4467,7 +5282,7 @@
+ 
+ 1998-04-17  MORIOKA Tomohiko  <morioka%jaist.ac.jp@localhost>
+ 
+-      * FLIM: Version 1.0.1 (Ky-D�to) was released.-A
++      * FLIM: Version 1.0.1 (Kyōto) was released.
+ 
+       * mime-def.el (mime-spadework-module-version-string): New
+       constant.
Index: pkgsrc/devel/flim/patches/patch-FLIM-CFG
diff -u /dev/null pkgsrc/devel/flim/patches/patch-FLIM-CFG:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-FLIM-CFG    Sun Sep  3 14:58:38 2023
@@ -0,0 +1,23 @@
+$NetBSD: patch-FLIM-CFG,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/FLIM-CFG        2006-12-21 02:40:42.000000000 +0900
++++ ./FLIM-CFG 2023-08-31 08:29:38.576546360 +0900
+@@ -13,11 +13,16 @@
+     (progn
+       (add-to-list 'default-load-path LISPDIR)
+       (add-to-list 'load-path LISPDIR)
++      (add-to-list 'load-path (expand-file-name "emu" LISPDIR))
+       (add-to-list 'load-path (expand-file-name "apel" LISPDIR))))
+ 
+ (if (boundp 'VERSION_SPECIFIC_LISPDIR)
+     (add-to-list 'load-path VERSION_SPECIFIC_LISPDIR))
+ 
++(if (boundp 'PACKAGE_LISPDIR)
++    (let ((default-directory PACKAGE_LISPDIR))
++      (normal-top-level-add-subdirs-to-load-path)))
++
+ (require 'install)
+ 
+ (add-latest-path "custom")
Index: pkgsrc/devel/flim/patches/patch-FLIM-ELS
diff -u /dev/null pkgsrc/devel/flim/patches/patch-FLIM-ELS:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-FLIM-ELS    Sun Sep  3 14:58:38 2023
@@ -0,0 +1,50 @@
+$NetBSD: patch-FLIM-ELS,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/FLIM-ELS        2003-11-13 09:31:39.000000000 +0900
++++ ./FLIM-ELS 2023-08-31 08:29:38.577768707 +0900
+@@ -11,37 +11,20 @@
+                    mime mime-parse mmgeneric
+                    mmbuffer mmcooked mmexternal
+                    mime-conf
+-                   sasl sasl-cram sasl-digest
+-                   md4 ntlm sasl-ntlm sasl-scram
++                   sasl sasl-scram
+                    smtp qmtp))
+ 
+ (setq flim-version-specific-modules nil)
+ 
+-(setq hmac-modules '(hex-util
+-                   hmac-def md5 sha1
+-                   hmac-md5 hmac-sha1))
+-
+-(if (and (fboundp 'base64-encode-string)
+-       (subrp (symbol-function 'base64-encode-string)))
+-    nil
+-  (if (fboundp 'dynamic-link)
+-      (setq flim-modules (cons 'mel-b-dl flim-modules))))
+-(setq flim-modules (cons 'mel-b-el flim-modules))
++(setq hmac-modules '(md5 sha1 hmac-sha1))
+ 
+ (require 'pccl)
+ (unless-broken ccl-usable
+-  (setq flim-modules (cons 'mel-b-ccl (cons 'mel-q-ccl flim-modules))))
++  (setq flim-modules (cons 'mel-q-ccl flim-modules)))
+ 
+-(if (and (fboundp 'md5)
+-       (subrp (symbol-function 'md5)))
+-    nil
+-  (if (fboundp 'dynamic-link)
+-      (setq hmac-modules (cons 'md5-dl hmac-modules))
+-    (setq hmac-modules (cons 'md5-el hmac-modules))))
+-
+-(if (fboundp 'dynamic-link)
+-    (setq hmac-modules (cons 'sha1-dl hmac-modules))
+-  (setq hmac-modules (cons 'sha1-el hmac-modules)))
++(require 'path-util)
++(when (module-installed-p 'oauth2)
++  (setq flim-modules (append flim-modules '(sasl-xoauth2))))
+ 
+ (setq flim-modules (nconc hmac-modules flim-modules))
+ 
Index: pkgsrc/devel/flim/patches/patch-FLIM-MK
diff -u /dev/null pkgsrc/devel/flim/patches/patch-FLIM-MK:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-FLIM-MK     Sun Sep  3 14:58:38 2023
@@ -0,0 +1,70 @@
+$NetBSD: patch-FLIM-MK,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/FLIM-MK 2006-12-12 17:21:00.000000000 +0900
++++ ./FLIM-MK  2023-08-31 08:29:38.579192058 +0900
+@@ -21,6 +21,16 @@
+              (princ (format "VERSION_SPECIFIC_LISPDIR=%s\n"
+                             VERSION_SPECIFIC_LISPDIR)))))
+     (setq command-line-args-left (cdr command-line-args-left))
++    (and (setq package-lisp-dir (car command-line-args-left))
++       (or (string-equal "NONE" package-lisp-dir)
++           (progn
++             (defvar PACKAGE_LISPDIR
++               (if (boundp (intern package-lisp-dir))
++                   (symbol-value (intern package-lisp-dir))
++                 package-lisp-dir))
++             (princ (format "PACKAGE_LISPDIR=%s\n"
++                            PACKAGE_LISPDIR)))))
++    (setq command-line-args-left (cdr command-line-args-left))
+     (load-file "FLIM-CFG")
+     (load-file "FLIM-ELS")
+     (princ (format "PREFIX=%s
+@@ -54,46 +64,4 @@
+       (setq files (cdr files)))
+     (lunit suite)))
+ 
+-(defun config-flim-package ()
+-  (let (package-dir)
+-    (and (setq package-dir (car command-line-args-left))
+-       (or (string= "NONE" package-dir)
+-           (defvar PACKAGEDIR package-dir)))
+-    (setq command-line-args-left (cdr command-line-args-left))
+-    (load-file "FLIM-CFG")
+-    (load-file "FLIM-ELS")
+-    (setq flim-modules (append flim-modules
+-                             '(auto-autoloads custom-load)))
+-    (princ (format "PACKAGEDIR=%s\n" PACKAGEDIR))))
+-
+-(defun compile-flim-package ()
+-  (config-flim-package)
+-
+-  (if (fboundp 'batch-update-directory-autoloads)
+-      ;; XEmacs 21.5.19 and newer.
+-      (progn
+-      (add-to-list 'command-line-args-left ".")
+-      (add-to-list 'command-line-args-left "flim")
+-      (batch-update-directory-autoloads))
+-    (setq autoload-package-name "flim")
+-    (add-to-list 'command-line-args-left ".")
+-    (batch-update-directory))
+-
+-  (add-to-list 'command-line-args-left ".")
+-  (Custom-make-dependencies)
+-
+-  (compile-elisp-modules flim-version-specific-modules ".")
+-  (compile-elisp-modules flim-modules "."))
+-
+-(defun install-flim-package ()
+-  (config-flim-package)
+-  (install-elisp-modules (append flim-version-specific-modules
+-                               flim-modules)
+-                       "./"
+-                       (expand-file-name FLIM_PREFIX
+-                                         (expand-file-name "lisp"
+-                                                           PACKAGEDIR)))
+-  (delete-file "./auto-autoloads.el")
+-  (delete-file "./custom-load.el"))
+-
+ ;;; FLIM-MK ends here
Index: pkgsrc/devel/flim/patches/patch-Makefile
diff -u /dev/null pkgsrc/devel/flim/patches/patch-Makefile:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-Makefile    Sun Sep  3 14:58:38 2023
@@ -0,0 +1,63 @@
+$NetBSD: patch-Makefile,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/Makefile        2007-11-28 18:13:25.000000000 +0900
++++ ./Makefile 2023-08-31 08:29:38.580447751 +0900
+@@ -18,6 +18,7 @@
+ LISPDIR = NONE
+ PACKAGEDIR = NONE
+ VERSION_SPECIFIC_LISPDIR = NONE
++#ACKAGE_LISPDIR = package-user-dir
+ 
+ GOMI  = *.elc \
+         *.cp *.cps *.ky *.kys *.fn *.fns *.vr *.vrs \
+@@ -29,45 +30,21 @@
+ ARC_DIR = $(ARC_DIR_PREFIX)/flim/flim-$(API)
+ SEMI_ARC_DIR = $(ARC_DIR_PREFIX)/semi/semi-1.14-for-flim-$(API)
+ 
+-CVS_HOST = cvs.m17n.org
+-
+ elc:
+       $(EMACS) $(FLAGS) -f compile-flim $(PREFIX) $(LISPDIR) \
+-              $(VERSION_SPECIFIC_LISPDIR)
++              $(VERSION_SPECIFIC_LISPDIR) $(PACKAGE_LISPDIR)
+ 
+ check:
+       $(EMACS) $(FLAGS) -f check-flim $(PREFIX) $(LISPDIR) \
+-              $(VERSION_SPECIFIC_LISPDIR)
++              $(VERSION_SPECIFIC_LISPDIR) $(PACKAGE_LISPDIR)
+ 
+ install:      elc
+       $(EMACS) $(FLAGS) -f install-flim $(PREFIX) $(LISPDIR) \
+-              $(VERSION_SPECIFIC_LISPDIR)
+-
+-
+-package:
+-      $(XEMACS) $(FLAGS) -f compile-flim-package $(PACKAGEDIR)
+-
+-install-package:      package
+-      $(XEMACS) $(FLAGS) -f install-flim-package $(PACKAGEDIR)
++              $(VERSION_SPECIFIC_LISPDIR) $(PACKAGE_LISPDIR)
+ 
+ clean:
+       -$(RM) $(GOMI)
+ 
+-
+-tar:
+-      cvs commit
+-      sh -c 'cvs tag -R $(PACKAGE)-`echo $(VERSION) | tr . _`; \
+-      cd /tmp; \
+-      cvs -d :pserver:anonymous@$(CVS_HOST):/cvs/root \
+-              export -d $(PACKAGE)-$(VERSION) \
+-              -r $(PACKAGE)-`echo $(VERSION) | tr . _` \
+-              flim'
+-      cd /tmp; $(RM) $(PACKAGE)-$(VERSION)/ftp.in ; \
+-              $(TAR) cvzf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
+-      cd /tmp; $(RM) -r $(PACKAGE)-$(VERSION)
+-      sed "s/VERSION/$(VERSION)/" < ftp.in | sed "s/API/$(API)/" \
+-              | sed "s/PACKAGE/$(PACKAGE)/" > ftp
+-
+ release:
+       -$(RM) $(ARC_DIR)/$(PACKAGE)-$(VERSION).tar.gz
+       mv /tmp/$(PACKAGE)-$(VERSION).tar.gz $(ARC_DIR)
Index: pkgsrc/devel/flim/patches/patch-README.en
diff -u /dev/null pkgsrc/devel/flim/patches/patch-README.en:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-README.en   Sun Sep  3 14:58:38 2023
@@ -0,0 +1,38 @@
+$NetBSD: patch-README.en,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/README.en       2006-12-21 02:44:48.000000000 +0900
++++ ./README.en        2023-08-31 08:29:38.582561272 +0900
+@@ -33,8 +33,6 @@
+       eword-decode.el --- encoded-word decoder
+       eword-encode.el --- encoded-word encoder
+ 
+-    mailcap.el        --- mailcap parser and utility
+-
+   This library should work on:
+ 
+       Emacs 20.4 and up
+@@ -136,14 +134,15 @@
+ ===========
+ 
+   If you write bug-reports and/or suggestions for improvement, please
+-  send them to the EMACS-MIME Mailing List:
++  send them to the Emacs-MIME Mailing Lists:
+ 
+-      emacs-mime-en%m17n.org@localhost        (English)
+-      emacs-mime-ja%m17n.org@localhost        (Japanese)
++      emacs-mime-en%lists.chise.org@localhost (English)
++      emacs-mime-ja%lists.chise.org@localhost (Japanese)
+ 
+-  Via the EMACS-MIME ML, you can report FLIM bugs, obtain the latest
++  Via the Emacs-MIME ML, you can report FLIM bugs, obtain the latest
+   release of FLIM, and discuss future enhancements to FLIM.  To join
+-  the EMACS-MIME ML, send an empty e-mail to
++  the Emacs-MIME ML, please see the descriptions of the following
++  pages:
+ 
+-      emacs-mime-en-ctl%m17n.org@localhost    (English)
+-      emacs-mime-ja-ctl%m17n.org@localhost    (Japanese)
++      http://lists.chise.org/mailman/listinfo/emacs-mime-en (English)
++      http://lists.chise.org/mailman/listinfo/emacs-mime-ja (Japanese)
Index: pkgsrc/devel/flim/patches/patch-README.ja
diff -u /dev/null pkgsrc/devel/flim/patches/patch-README.ja:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-README.ja   Sun Sep  3 14:58:38 2023
@@ -0,0 +1,244 @@
+$NetBSD: patch-README.ja,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/README.ja       2006-12-21 03:06:14.000000000 +0900
++++ ./README.ja        2023-08-31 08:29:38.583869221 +0900
+@@ -1,159 +1,156 @@
+-[FLIM $B$N(B README ($BF|K\8lHG(B)]
++[FLIM の README (日本語版)]
+ 
+-FLIM $B$H$O!)(B
++FLIM とは?
+ ===========
+ 
+-  FLIM $B$O(B Internet message $B$K4X$9$kMM!9$JI=8=7A<0$dId9f2=$K4X$9$k4pAC(B
+-  $BE*$J5!G=$rDs6!$9$k$?$a$NHFMQItIJ$G$9!#(BFLIM $B$O0J2<$N%b%8%e!<%k$+$i9=(B
+-  $B@.$5$l$F$$$^$9(B:
++  FLIM は Internet message に関する様々な表現形式や符号化に関する基礎
++  的な機能を提供するための汎用部品です。FLIM は以下のモジュールから構
++  成されています:
+ 
+-    std11.el  --- STD 11 (RFC 822) $B7A<0$K4p$E$/2r@O=hM}Ey(B
++    std11.el  --- STD 11 (RFC 822) 形式に基づく解析処理等
+ 
+-    mime.el   --- MIME-entity $B$K4X$9$k=t5!G=$NDs6!(B
++    mime.el   --- MIME-entity に関する諸機能の提供
+ 
+-      mime-def.el --- MIME $B7A<0$K4X$9$kDj5A(B
++      mime-def.el --- MIME 形式に関する定義
+ 
+-      mime-parse.el --- MIME $B2r@O4o(B
++      mime-parse.el --- MIME 解析器
+ 
+-      mel.el --- MIME $BId9f4o(B/$BI|9f4o(B
+-      mel-b-dl.el --- base64 (B-encoding) $BId9f4o(B/$BI|9f4o(B
+-                      (dynamic loading $B5!G=IU$-(B Emacs 20 $BMQ(B)
++      mel.el --- MIME 符号器/復号器
++      mel-b-dl.el --- base64 (B-encoding) 符号器/復号器
++                      (dynamic loading 機能付き Emacs 20 用)
+       mel-b-ccl.el --- base64 (B-encoding) encoder/decoder (using CCL)
+-      mel-b-el.el --- base64 (B-encoding) $BId9f4o(B/$BI|9f4o(B
+-                      ($BB>$N(B emacsen $BMQ(B)
++      mel-b-el.el --- base64 (B-encoding) 符号器/復号器
++                      (他の emacsen 用)
+       mel-q-ccl.el --- quoted-printable and Q-encoding
+                        encoder/decoder (using CCL)
+-      mel-q.el    --- quoted-printable $B$H(B Q-encoding
+-                      $BId9f4o(B/$BI|9f4o(B
+-      mel-u.el    --- uuencode $B$N$?$a$NHs8x<0(B backend
+-      mel-g.el    --- gzip64 $B$N$?$a$NHs8x<0(B backend
++      mel-q.el    --- quoted-printable と Q-encoding
++                      符号器/復号器
++      mel-u.el    --- uuencode のための非公式 backend
++      mel-g.el    --- gzip64 のための非公式 backend
+ 
+-      eword-decode.el --- encoded-word $BI|9f4o(B
+-      eword-encode.el --- encoded-word $BId9f4o(B
++      eword-decode.el --- encoded-word 復号器
++      eword-encode.el --- encoded-word 符号器
+ 
+-    mailcap.el        --- mailcap $B$N2r@O=hM}Ey(B
++  以下の環境で動作します:
+ 
+-  $B0J2<$N4D6-$GF0:n$7$^$9!'(B
++      Emacs 20.4 以降
++      XEmacs 21.1 以降
+ 
+-      Emacs 20.4 $B0J9_(B
+-      XEmacs 21.1 $B0J9_(B
+ 
+-
+-$BF3F~(B (Installation)
++導入 (Installation)
+ ===================
+ 
+-(0) $BF3F~(B (install) $B$9$kA0$K!"(BAPEL (10.7 $B0J9_(B) $B$rF3F~$7$F$/$@$5$$!#(BAPEL
+-    $B$O0J2<$N$H$3$m$G<hF@$G$-$^$9(B:
++(0) 導入 (install) する前に、APEL (10.7 以降) を導入してください。APEL
++    は以下のところで取得できます:
+ 
+       ftp://ftp.m17n.org/pub/mule/apel/
+ 
+-(1-a) $BE83+$7$?>l=j$X$NF3F~(B
++(1-a) 展開した場所への導入
+ 
+-  $BE83+$7$?>l=j$H$O0[$J$k>l=j$KF3F~$7$?$/$J$$$J$i!"(B
++  展開した場所とは異なる場所に導入したくないなら、
+ 
+       % make
+ 
+-  $B$@$1$r<B9T$7$F$/$@$5$$!#(B
++  だけを実行してください。
+ 
+-  emacs $B$N%3%^%s%IL>$r;XDj$9$k$3$H$,$G$-$^$9!#Nc$($P!"(B
++  emacs のコマンド名を指定することができます。例えば、
+ 
+       % make EMACS=xemacs
+ 
+-  `EMACS=...' $B$,>JN,$5$l$k$H!"(BEmacs=emacs $B$,;H$o$l$^$9!#(B
++  `EMACS=...' が省略されると、Emacs=emacs が使われます。
+ 
+ (b) make install
+ 
+-  $BE83+$7$?>l=j$H$O0[$J$k>l=j$KF3F~$7$?$$$J$i!"(B
++  展開した場所とは異なる場所に導入したいなら、
+ 
+       % make install
+ 
+-  $B$r<B9T$7$F$/$@$5$$!#(B
++  を実行してください。
+ 
+-  emacs $B$N%3%^%s%IL>$r;XDj$9$k$3$H$,$G$-$^$9!#Nc$($P!"(B
++  emacs のコマンド名を指定することができます。例えば、
+ 
+       % make install EMACS=xemacs
+ 
+-  `EMACS=...' $B$,>JN,$5$l$k$H!"(BEmacs=emacs $B$,;H$o$l$^$9!#(B
++  `EMACS=...' が省略されると、Emacs=emacs が使われます。
+ 
+-  Emacs Lisp $B%W%m%0%i%`$N$?$a$N%G%#%l%/%H%j!<LZ$N@\F,<-(B (prefix) $B$r;X(B
+-  $BDj$9$k$3$H$,$G$-$^$9!#Nc$($P!"(B
++  Emacs Lisp プログラムのためのディレクトリー木の接頭辞 (prefix) を指
++  定することができます。例えば、
+ 
+       % make install PREFIX=~/
+ 
+-  `PREFIX=...' $B$,>JN,$5$l$k$H!";XDj$5$l$?(B emacs $B%3%^%s%I$N%G%#%l%/%H%j!<(B
+-  $BLZ$N@\F,<-$,;HMQ$5$l$^$9(B ($B$*$=$i$/(B /usr/local $B$G$9(B)$B!#(B
++  `PREFIX=...' が省略されると、指定された emacs コマンドのディレクトリー
++  木の接頭辞が使用されます (おそらく /usr/local です)。
+ 
+-  $BNc$($P!"(BPREFIX=/usr/local $B$H(B Emacs 20.7 $B$,;XDj$5$l$l$P!"0J2<$N%G%#%l(B
+-  $B%/%H%j!<LZ$,:n@.$5$l$^$9!#(B
++  例えば、PREFIX=/usr/local と Emacs 20.7 が指定されれば、以下のディレ
++  クトリー木が作成されます。
+ 
+       /usr/local/share/emacs/site-lisp/flim/  --- FLIM
+       /usr/local/share/emacs/20.7/site-lisp/flim/     --- FLIM
+ 
+-  Emacs Lisp $B%W%m%0%i%`$N$?$a$N(B lisp $B%G%#%l%/%H%j!<$r;XDj$9$k$3$H$,$G(B
+-  $B$-$^$9!#Nc$($P!"(B:
++  Emacs Lisp プログラムのための lisp ディレクトリーを指定することがで
++  きます。例えば、:
+ 
+     % make install LISPDIR=~/share/emacs/elisp
+ 
+-  `LISPDIR=...' $B$,>JN,$5$l$k$H!";XDj$5$l$?(B emacs $B$N%3%^%s%I$N(B
+-  site-lisp $B%G%#%l%/%H%j!<$,;H$o$l$^$9(B ($B$*$=$i$/(B
+-  /usr/local/share/emacs/site-lisp $B$+(B /usr/local/lib/xemacs/site-lisp)
+-  $B$G$9!#(B
+-
+-  emu $B%b%8%e!<%k(B (APEL $B%Q%C%1!<%8$KF~$C$F$$$^$9(B) $B$,I8=`$G$J$$%G%#%l%/(B
+-  $B%H%j!<$KF3F~$5$l$F$$$k>l9g$O!"$=$l$i$N$"$k>l=j$r;XDj$9$kI,MW(B
+-  $B$,$"$j$^$9!#Nc$($P!'(B
++  `LISPDIR=...' が省略されると、指定された emacs のコマンドの
++  site-lisp ディレクトリーが使われます (おそらく
++  /usr/local/share/emacs/site-lisp か /usr/local/lib/xemacs/site-lisp)
++  です。
++
++  emu モジュール (APEL パッケージに入っています) が標準でないディレク
++  トリーに導入されている場合は、それらのある場所を指定する必要
++  があります。例えば:
+ 
+     % make install VERSION_SPECIFIC_LISPDIR=~/elisp
+ 
+-  $B$I$N%U%!%$%k$,(B emu $B%b%8%e!<%k$+(B APEL $B%b%8%e!<%k$N0lIt$J$N$+!"$=$l$i(B
+-  $B$,$I$3$KF3F~$5$l$k$+$rCN$j$?$$$H$-$O!"<!$N$h$&$J%3%^%s%I$rF~(B
+-  $BNO$9$k$3$H$,$G$-$^$9!#(B
++  どのファイルが emu モジュールか APEL モジュールの一部なのか、それら
++  がどこに導入されるかを知りたいときは、次のようなコマンドを入
++  力することができます。
+ 
+     % make what-where LISPDIR=~/elisp VERSION_SPECIFIC_LISPDIR=~/elisp
+ 
+-  $B$^$?!"(BFLIM-CFG $B%U%!%$%k$rJT=8$9$k$3$H$GB>$NA*Br2DG=$J@_Dj$r;XDj$9$k(B
+-  $B$3$H$,$G$-$^$9!#$=$N>\:Y$K4X$7$F$O(B FLIM-CFG $B%U%!%$%k$NCm<a(B (comment) 
+-  $B$rFI$s$G$/$@$5$$!#(B
++  また、FLIM-CFG ファイルを編集することで他の選択可能な設定を指定する
++  ことができます。その詳細に関しては FLIM-CFG ファイルの注釈 (comment) 
++  を読んでください。
+ 
+-(1-c) XEmacs $B$N%Q%C%1!<%8$H$7$FF3F~$9$k(B
++(1-c) XEmacs のパッケージとして導入する
+ 
+-  XEmacs $B$N%Q%C%1!<%8!&%G%#%l%/%H%j!<$KF3F~$9$k>l9g$O!"(B
++  XEmacs のパッケージ・ディレクトリーに導入する場合は、
+ 
+       % make install-package
+ 
+-  $B$r<B9T$7$F$/$@$5$$!#(B
++  を実行してください。
+ 
+-  XEmacs $B$N%3%^%s%IL>$r;XDj$9$k$3$H$,$G$-$^$9!#Nc!'(B
++  XEmacs のコマンド名を指定することができます。例:
+ 
+       % make install-package XEMACS=xemacs-21
+ 
+-  `XEMACS=...' $B$,>JN,$5$l$k$H!"(BXEMACS=xemacs $B$,;HMQ$5$l$^$9!#(B
++  `XEMACS=...' が省略されると、XEMACS=xemacs が使用されます。
+ 
+-  $B%Q%C%1!<%8!&%G%#%l%/%H%j!<$r;XDj$9$k$3$H$,$G$-$^$9!#Nc!'(B
++  パッケージ・ディレクトリーを指定することができます。例:
+ 
+       % make install PACKAGEDIR=~/.xemacs
+ 
+-  `PACKAGEDIR=...' $B$,>JN,$5$l$k$H!"B8:_$9$k%Q%C%1!<%8!&%G%#%l%/%H%j!<(B
+-  $B$N:G=i$N$b$N$,;H$o$l$^$9!#(B
++  `PACKAGEDIR=...' が省略されると、存在するパッケージ・ディレクトリー
++  の最初のものが使われます。
+ 
+-  $B!NCm0U!O(BXEmacs $B$N%Q%C%1!<%8!&%7%9%F%`$O(B XEmacs 21.0 $B$+$=$l0J9_$,I,MW(B
+-        $B$G$9!#(B
++  [注意]XEmacs のパッケージ・システムは XEmacs 21.0 かそれ以降が必要
++        です。
+ 
+ 
+-$B%P%0Js9p(B
++バグ報告
+ ========
+ 
+-  $B%P%0Js9p$d2~A1$NDs0F$r=q$$$?$H$-$O!"@'Hs(B EMACS-MIME $B%a!<%j%s%0%j%9%H(B
+-  $B$KAw$C$F$/$@$5$$(B:
+-
+-      emacs-mime-en%m17n.org@localhost        ($B1Q8l(B)
+-      emacs-mime-ja%m17n.org@localhost        ($BF|K\8l(B)
++  バグ報告や改善の提案を書いたときは、是非 Emacs-MIME メーリングリスト
++  に送ってください:
+ 
+-  EMACS-MIME ML $B$rDL$7$F!"(BFLIM $B$N%P%0$rJs9p$7$?$j!"(BFLIM $B$N:G?7$N%j%j!<(B
+-  $B%9$r<hF@$7$?$j!"(BFLIM $B$N>-Mh$N3HD%$N5DO@$r$7$?$j$9$k$3$H$,$G$-$^$9!#(B
+-  EMACS-MIME ML $B$K;22C$9$k$K$O!"6u$NEE;R%a!<%k$r(B
++      emacs-mime-ja%lists.chise.org@localhost (日本語)
++      emacs-mime-en%lists.chise.org@localhost (英語)
+ 
+-      emacs-mime-en-ctl%m17n.org@localhost    ($B1Q8l(B)
+-      emacs-mime-ja-ctl%m17n.org@localhost    ($BF|K\8l(B)
++  Emacs-MIME ML を通して、FLIM のバグを報告したり、FLIM の最新のリリー
++  スを取得したり、FLIM の将来の拡張の議論をしたりすることができます。
++  Emacs-MIME ML に参加したい方は、以下の頁の記述を見て購読手続きを行っ
++  てください:
+ 
+-  $B$KAw$C$F$/$@$5$$!#(B
++      http://lists.chise.org/mailman/listinfo/emacs-mime-ja (日本語)
++      http://lists.chise.org/mailman/listinfo/emacs-mime-en (英語)
Index: pkgsrc/devel/flim/patches/patch-eword-decode.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-eword-decode.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-eword-decode.el     Sun Sep  3 14:58:38 2023
@@ -0,0 +1,645 @@
+$NetBSD: patch-eword-decode.el,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/eword-decode.el 2005-12-25 19:45:52.000000000 +0900
++++ ./eword-decode.el  2023-08-31 08:29:38.587163972 +0900
+@@ -1,4 +1,4 @@
+-;;; eword-decode.el --- RFC 2047 based encoded-word decoder for GNU Emacs
++;;; eword-decode.el --- RFC 2047 based encoded-word decoder for GNU Emacs  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004,
+ ;;   2005 Free Software Foundation, Inc.
+@@ -36,8 +36,7 @@
+ (require 'mime-def)
+ (require 'mel)
+ (require 'std11)
+-
+-(eval-when-compile (require 'cl))     ; list*, pop
++(require 'cl-lib)
+ 
+ 
+ ;;; @ Variables
+@@ -70,8 +69,7 @@
+             "\\("
+             eword-encoded-text-regexp ; 4
+             "\\)"
+-            (regexp-quote "?="))))
+-  )
++            (regexp-quote "?=")))))
+ 
+ 
+ ;;; @ for string
+@@ -87,7 +85,10 @@
+ 
+ If MUST-UNFOLD is non-nil, it unfolds and eliminates line-breaks even
+ if there are in decoded encoded-words (generated by bad manner MUA
+-such as a version of Net$cape)."
++such as a version of Net$cape).
++
++The language informations specified in the encoded words, if any, are
++put to the decoded text as the `mime-language' text property."
+   (setq string (std11-unfold-string string))
+   (let ((regexp (concat "[\n\t ]*\\(" eword-encoded-word-regexp "\\)"))
+       (next 0)
+@@ -98,7 +99,11 @@
+       (while match
+       (setq next (match-end 0))
+       (push (list (match-string 2 string) ;; charset
+-                  (match-string 3 string) ;; language
++                  (when (match-beginning 3) ;; language
++                    (intern
++                     (downcase
++                      (substring string
++                                 (1+ (match-beginning 3)) (match-end 3)))))
+                   (match-string 4 string) ;; encoding
+                   (match-string 5 string) ;; encoded-text
+                   (match-string 1 string)) ;; encoded-word
+@@ -112,23 +117,19 @@
+           next (+ start (length words)))))
+   string)
+ 
+-(defun eword-decode-structured-field-body (string
+-                                         &optional start-column max-column
+-                                         start)
++(defun eword-decode-structured-field-body
++    (string &optional _start-column _max-column start)
+   (let ((tokens (eword-lexical-analyze string start 'must-unfold))
+-      (result "")
++      result
+       token)
+     (while tokens
+       (setq token (car tokens))
+-      (setq result (concat result (eword-decode-token token)))
++      (setq result (cons (eword-decode-token token) result))
+       (setq tokens (cdr tokens)))
+-    result))
++    (apply 'concat (nreverse result))))
+ 
+-(defun eword-decode-and-unfold-structured-field-body (string
+-                                                    &optional
+-                                                    start-column
+-                                                    max-column
+-                                                    start)
++(defun eword-decode-and-unfold-structured-field-body
++    (string &optional _start-column _max-column start)
+   "Decode and unfold STRING as structured field body.
+ It decodes non us-ascii characters in FULL-NAME encoded as
+ encoded-words or invalid \"raw\" string.  \"Raw\" non us-ascii
+@@ -137,17 +138,17 @@
+ If an encoded-word is broken or your emacs implementation can not
+ decode the charset included in it, it is not decoded."
+   (let ((tokens (eword-lexical-analyze string start 'must-unfold))
+-      (result ""))
++      result)
+     (while tokens
+       (let* ((token (car tokens))
+            (type (car token)))
+       (setq tokens (cdr tokens))
+       (setq result
+-            (if (eq type 'spaces)
+-                (concat result " ")
+-              (concat result (eword-decode-token token))
+-              ))))
+-    result))
++            (cons (if (eq type 'spaces)
++                      " "
++                    (eword-decode-token token))
++                  result))))
++    (apply 'concat (nreverse result))))
+ 
+ (defun eword-decode-and-fold-structured-field-body (string
+                                                   start-column
+@@ -160,7 +161,7 @@
+       (setq max-column fill-column))
+     (let ((c start-column)
+         (tokens (eword-lexical-analyze string start 'must-unfold))
+-        (result "")
++        result
+         token)
+       (while (and (setq token (car tokens))
+                 (setq tokens (cdr tokens)))
+@@ -171,38 +172,34 @@
+                    (next-len (string-width next-str))
+                    (next-c (+ c next-len 1)))
+               (if (< next-c max-column)
+-                  (setq result (concat result " " next-str)
++                  (setq result (cons next-str (cons " " result))
+                         c next-c)
+-                (setq result (concat result "\n " next-str)
++                (setq result (cons next-str (cons "\n " result))
+                       c (1+ next-len)))
+-              (setq tokens (cdr tokens))
+-              )
++              (setq tokens (cdr tokens)))
+           (let* ((str (eword-decode-token token)))
+-            (setq result (concat result str)
+-                  c (+ c (string-width str)))
+-            ))))
+-      (if token
+-        (concat result (eword-decode-token token))
+-      result))))
++            (setq result (cons str result)
++                  c (+ c (string-width str)))))))
++      (apply 'concat (nreverse
++                    (cons (when token (eword-decode-token token))
++                          result))))))
+ 
+-(defun eword-decode-unstructured-field-body (string &optional start-column
+-                                                  max-column)
++(defun eword-decode-unstructured-field-body
++    (string &optional _start-column _max-column)
+   (eword-decode-string
+-   (decode-mime-charset-string string default-mime-charset)))
++   (mime-charset-decode-string string default-mime-charset)))
+ 
+-(defun eword-decode-and-unfold-unstructured-field-body (string
+-                                                      &optional start-column
+-                                                      max-column)
++(defun eword-decode-and-unfold-unstructured-field-body
++    (string &optional _start-column _max-column)
+   (eword-decode-string
+-   (decode-mime-charset-string (std11-unfold-string string)
++   (mime-charset-decode-string (std11-unfold-string string)
+                              default-mime-charset)
+    'must-unfold))
+ 
+-(defun eword-decode-unfolded-unstructured-field-body (string
+-                                                    &optional start-column
+-                                                    max-column)
++(defun eword-decode-unfolded-unstructured-field-body
++    (string &optional _start-column _max-column)
+   (eword-decode-string
+-   (decode-mime-charset-string string default-mime-charset)
++   (mime-charset-decode-string string default-mime-charset)
+    'must-unfold))
+ 
+ 
+@@ -216,7 +213,10 @@
+ 
+ If MUST-UNFOLD is non-nil, it unfolds and eliminates line-breaks even
+ if there are in decoded encoded-words (generated by bad manner MUA
+-such as a version of Net$cape)."
++such as a version of Net$cape).
++
++The language informations specified in the encoded words, if any, are
++put to the decoded text as the `mime-language' text property."
+   (interactive "*r")
+   (save-excursion
+     (save-restriction
+@@ -232,7 +232,11 @@
+         (while match
+           (goto-char (setq end (match-end 0)))
+           (push (list (match-string 2) ;; charset
+-                      (match-string 3) ;; language
++                      (when (match-beginning 3) ;; language
++                        (intern
++                         (downcase
++                          (buffer-substring (1+ (match-beginning 3))
++                                            (match-end 3)))))
+                       (match-string 4) ;; encoding
+                       (match-string 5) ;; encoded-text
+                       (match-string 1)) ;; encoded-word
+@@ -253,11 +257,8 @@
+           (save-restriction
+             (narrow-to-region (goto-char beg) end)
+             (while (re-search-forward "\n\\([ \t]\\)" nil t)
+-              (replace-match (match-string 1))
+-              )
+-          (goto-char (point-max))
+-          ))
+-      )))
++              (replace-match (match-string 1)))
++          (goto-char (point-max)))))))
+ 
+ 
+ ;;; @ for message header
+@@ -286,16 +287,13 @@
+                 (setcdr cell (put-alist field function (cdr cell)))
+               (setq mime-field-decoder-alist
+                     (cons (cons mode (list (cons field function)))
+-                          mime-field-decoder-alist))
+-              ))
+-          (apply (function mime-set-field-decoder) field specs)
+-          )
++                          mime-field-decoder-alist))))
++          (apply (function mime-set-field-decoder) field specs))
+       (mime-set-field-decoder field
+                               'plain function
+                               'wide function
+                               'summary function
+-                              'nov function)
+-      ))))
++                              'nov function)))))
+ 
+ ;;;###autoload
+ (defmacro mime-find-field-presentation-method (name)
+@@ -303,20 +301,17 @@
+ NAME must be `plain', `wide', `summary' or `nov'."
+   (cond ((eq name nil)
+        `(or (assq 'summary mime-field-decoder-cache)
+-            '(summary))
+-       )
++            '(summary)))
+       ((and (consp name)
+             (car name)
+             (consp (cdr name))
+             (symbolp (car (cdr name)))
+             (null (cdr (cdr name))))
+        `(or (assq ,name mime-field-decoder-cache)
+-            (cons ,name nil))
+-       )
++            (cons ,name nil)))
+       (t
+        `(or (assq (or ,name 'summary) mime-field-decoder-cache)
+-            (cons (or ,name 'summary) nil))
+-       )))
++            (cons (or ,name 'summary) nil)))))
+ 
+ (defun mime-find-field-decoder-internal (field &optional mode)
+   "Return function to decode field-body of FIELD in MODE.
+@@ -326,8 +321,7 @@
+              (funcall mime-update-field-decoder-cache
+                       field (car mode))
+            (setcdr mode
+-                   (cdr (assq (car mode) mime-field-decoder-cache)))
+-           ))))
++                   (cdr (assq (car mode) mime-field-decoder-cache)))))))
+ 
+ ;;;###autoload
+ (defun mime-find-field-decoder (field &optional mode)
+@@ -342,21 +336,18 @@
+           (cdr p)
+         (cdr (funcall mime-update-field-decoder-cache
+                       field (or mode 'summary)))))
+-    (inline (mime-find-field-decoder-internal field mode))
+-    ))
++    (inline (mime-find-field-decoder-internal field mode))))
+ 
+ ;;;###autoload
+ (defun mime-update-field-decoder-cache (field mode &optional function)
+   "Update field decoder cache `mime-field-decoder-cache'."
+   (cond ((eq function 'identity)
+-       (setq function nil)
+-       )
++       (setq function nil))
+       ((null function)
+        (let ((decoder-alist
+               (cdr (assq (or mode 'summary) mime-field-decoder-alist))))
+          (setq function (cdr (or (assq field decoder-alist)
+-                                 (assq t decoder-alist)))))
+-       ))
++                                 (assq t decoder-alist)))))))
+   (let ((cell (assq mode mime-field-decoder-cache))
+         ret)
+     (if cell
+@@ -407,8 +398,7 @@
+      'plain   #'eword-decode-structured-field-body
+      'wide    #'eword-decode-and-fold-structured-field-body
+      'summary #'eword-decode-and-unfold-structured-field-body
+-     'nov     #'eword-decode-and-unfold-structured-field-body)
+-    ))
++     'nov     #'eword-decode-and-unfold-structured-field-body)))
+ 
+ ;; unstructured fields (default)
+ (mime-set-field-decoder
+@@ -442,8 +432,7 @@
+       ;; Don't decode
+       (if (eq mode 'summary)
+         (std11-unfold-string field-body)
+-      field-body)
+-      )))
++      field-body))))
+ 
+ ;;;###autoload
+ (defun mime-decode-header-in-region (start end
+@@ -480,11 +469,8 @@
+                 (let ((body (buffer-substring p end))
+                       (default-mime-charset default-charset))
+                   (delete-region p end)
+-                  (insert (funcall field-decoder body (1+ len)))
+-                  ))
+-              ))
+-        (eword-decode-region (point-min) (point-max) t)
+-        )))))
++                  (insert (funcall field-decoder body (1+ len)))))))
++        (eword-decode-region (point-min) (point-max) t))))))
+ 
+ ;;;###autoload
+ (defun mime-decode-header-in-buffer (&optional code-conversion separator)
+@@ -503,12 +489,12 @@
+         (concat "^\\(" (regexp-quote (or separator "")) "\\)?$")
+         nil t)
+        (match-beginning 0)
+-       (point-max)
+-       ))
++       (point-max)))
+    code-conversion))
+ 
+ (defalias 'eword-decode-header 'mime-decode-header-in-buffer)
+-(make-obsolete 'eword-decode-header 'mime-decode-header-in-buffer)
++(make-obsolete 'eword-decode-header
++             'mime-decode-header-in-buffer "28 Oct 1998")
+ 
+ 
+ ;;; @ encoded-words decoder
+@@ -554,39 +540,38 @@
+                 nil)))
+         (if (and eword-decode-allow-incomplete-encoded-text
+                  rest
+-                 (caaar rest)
+-                 (string-equal (downcase charset) (downcase (caaar rest)))
+-                 (equal language (cdaar rest)))
++                 (cl-caaar rest)
++                 (string-equal (downcase charset) (downcase (cl-caaar rest)))
++                 (equal language (cl-cdaar rest)))
+             ;; Concatenate text of which the charset is the same.
+             (setcdr (car rest) (concat (cdar rest) text))
+           (push (cons (cons charset language) text) rest))
+       ;; Don't decode encoded-word.
+       (push (cons (cons nil language) (nth 4 word)) rest)))
+     (while rest
+-      (setq word (or (and (setq charset (caaar rest))
++      (setq word (or (and (setq charset (cl-caaar rest))
+                         (condition-case err
+-                            (decode-mime-charset-string (cdar rest) charset)
++                            (mime-charset-decode-string (cdar rest) charset)
+                           (error
+                            (message "%s" (error-message-string err))
+                            nil)))
+-                   (concat (when (cdr rest) " ")
+-                           (cdar rest)
+-                           (when (and words
+-                                      (not (eq (string-to-char words) ? )))
+-                             " "))))
++                   (concat
++                    (when (cdr rest) " ")
++                    (cdar rest)
++                    (when (and words
++                               (not (eq (string-to-char (car words)) ?\s)))
++                      " "))))
+       (when must-unfold
+       (setq word (mapconcat (lambda (chr)
+-                              (cond ((eq chr ?\n) "")
+-                                    ((eq chr ?\r) "")
++                              (cond ((memq chr '(?\n ?\r)) nil)
+                                     ((eq chr ?\t) " ")
+-                                    (t (char-to-string chr))))
+-                            (std11-unfold-string word)
+-                            "")))
+-      (when (setq language (cdaar rest))
++                                    (t (list chr))))
++                            (std11-unfold-string word) nil)))
++      (when (setq language (cl-cdaar rest))
+       (put-text-property 0 (length word) 'mime-language language word))
+-      (setq words (concat word words)
+-          rest (cdr rest)))
+-    words))
++      (when (> (length word) 0) (setq words (cons word words)))
++      (setq rest (cdr rest)))
++    (apply 'concat words)))
+ 
+ ;;; @ lexical analyze
+ ;;;
+@@ -618,11 +603,11 @@
+ returns nil, next function is used.  Otherwise the return value will
+ be the result.")
+ 
+-(defun eword-analyze-quoted-string (string start &optional must-unfold)
++(defun eword-analyze-quoted-string (string start &optional _must-unfold)
+   (let ((p (std11-check-enclosure string ?\" ?\" nil start))
+       ret)
+     (when p
+-      (setq ret (decode-mime-charset-string
++      (setq ret (mime-charset-decode-string
+                (std11-strip-quoted-pair
+                 (substring string (1+ start) (1- p)))
+                default-mime-charset))
+@@ -631,7 +616,7 @@
+       (cons (cons 'quoted-string ret)
+           p))))
+ 
+-(defun eword-analyze-domain-literal (string start &optional must-unfold)
++(defun eword-analyze-domain-literal (string start &optional _must-unfold)
+   (std11-analyze-domain-literal string start))
+ 
+ (defun eword-analyze-comment (string from &optional must-unfold)
+@@ -649,17 +634,16 @@
+         (cond ((eq chr ?\\)
+                (setq i (1+ i))
+                (if (>= i len)
+-                   (throw 'tag nil)
+-                 )
+-               (setq last-str (concat last-str
+-                                      (substring string from (1- i))
+-                                      (char-to-string (aref string i)))
++                   (throw 'tag nil))
++               (setq last-str (cons (list (aref string i))
++                                    (cons (substring string from (1- i))
++                                          last-str))
+                      i (1+ i)
+-                     from i)
+-               )
++                     from i))
+               ((eq chr ?\))
+-               (setq ret (concat last-str
+-                                 (substring string from i)))
++               (setq ret
++                     (apply 'concat
++                            (substring string from i) (nreverse last-str)))
+                (throw 'tag (cons
+                             (cons 'comment
+                                   (nreverse
+@@ -667,42 +651,36 @@
+                                        dest
+                                      (cons
+                                       (eword-decode-string
+-                                       (decode-mime-charset-string
++                                       (mime-charset-decode-string
+                                         ret default-mime-charset)
+                                        must-unfold)
+-                                      dest)
+-                                     )))
+-                            (1+ i)))
+-               )
++                                      dest))))
++                            (1+ i))))
+               ((eq chr ?\()
+                (if (setq ret (eword-analyze-comment string i must-unfold))
+                    (setq last-str
+-                         (concat last-str
+-                                 (substring string from i))
++                         (apply 'concat (substring string from i)
++                                (nreverse last-str))
+                          dest
+                          (if (string= last-str "")
+                              (cons (car ret) dest)
+-                           (list* (car ret)
++                           (cl-list* (car ret)
+                                   (eword-decode-string
+-                                   (decode-mime-charset-string
++                                   (mime-charset-decode-string
+                                     last-str default-mime-charset)
+                                    must-unfold)
+-                                  dest)
+-                           )
++                                  dest))
+                          i (cdr ret)
+                          from i
+-                         last-str "")
+-                 (throw 'tag nil)
+-                 ))
++                         last-str nil)
++                 (throw 'tag nil)))
+               (t
+-               (setq i (1+ i))
+-               ))
+-        )))))
++               (setq i (1+ i)))))))))
+ 
+-(defun eword-analyze-spaces (string start &optional must-unfold)
++(defun eword-analyze-spaces (string start &optional _must-unfold)
+   (std11-analyze-spaces string start))
+ 
+-(defun eword-analyze-special (string start &optional must-unfold)
++(defun eword-analyze-special (string start &optional _must-unfold)
+   (std11-analyze-special string start))
+ 
+ (defun eword-analyze-encoded-word (string start &optional must-unfold)
+@@ -713,7 +691,11 @@
+     (while match
+       (setq next (match-end 0))
+       (push (list (match-string 2 string) ;; charset
+-                (match-string 3 string) ;; language
++                (when (match-beginning 3) ;; language
++                  (intern
++                   (downcase
++                    (substring string
++                               (1+ (match-beginning 3)) (match-end 3)))))
+                 (match-string 4 string) ;; encoding
+                 (match-string 5 string) ;; encoded-text
+                 (match-string 1 string)) ;; encoded-word
+@@ -721,20 +703,29 @@
+       (setq match (and (string-match regexp string next)
+                      (= next (match-beginning 0)))))
+     (when words
+-      (cons (cons 'atom (eword-decode-encoded-words (nreverse words)
+-                                                  must-unfold))
+-          next))))
++      (setq words (eword-decode-encoded-words (nreverse words) must-unfold))
++      (cons
++       (cons 'atom
++           (if (and (string-match (eval-when-compile
++                                    (concat "[" std11-special-char-list "]"))
++                                  words)
++                    (null (eq (cdr (std11-analyze-quoted-string words 0))
++                              (length words))))
++               ;; Docoded words contains non-atom special chars and are
++               ;; not quoted.
++               (std11-wrap-as-quoted-string words)
++             words))
++       next))))
+ 
+-(defun eword-analyze-atom (string start &optional must-unfold)
++(defun eword-analyze-atom (string start &optional _must-unfold)
+   (if (and (string-match std11-atom-regexp string start)
+          (= (match-beginning 0) start))
+       (let ((end (match-end 0)))
+-      (cons (cons 'atom (decode-mime-charset-string
++      (cons (cons 'atom (mime-charset-decode-string
+                          (substring string start end)
+                          default-mime-charset))
+             ;;(substring string end)
+-            end)
+-      )))
++            end))))
+ 
+ (defun eword-lexical-analyze-internal (string start must-unfold)
+   (let ((len (length string))
+@@ -745,17 +736,13 @@
+                 func r)
+             (while (and (setq func (car rest))
+                         (null
+-                         (setq r (funcall func string start must-unfold)))
+-                        )
++                         (setq r (funcall func string start must-unfold))))
+               (setq rest (cdr rest)))
+             (or r
+-                (cons (cons 'error (substring string start)) (1+ len)))
+-            ))
++                (cons (cons 'error (substring string start)) (1+ len)))))
+       (setq dest (cons (car ret) dest)
+-          start (cdr ret))
+-      )
+-    (nreverse dest)
+-    ))
++          start (cdr ret)))
++    (nreverse dest)))
+ 
+ (defun eword-lexical-analyze (string &optional start must-unfold)
+   "Return lexical analyzed list corresponding STRING.
+@@ -763,18 +750,17 @@
+ characters encoded as encoded-words or invalid \"raw\" format.
+ \"Raw\" non us-ascii characters are regarded as variable
+ `default-mime-charset'."
+-  (let ((key (substring string (or start 0)))
++  (let ((key (substring-no-properties string start))
+       ret cell)
+-    (set-text-properties 0 (length key) nil key)
+     (if (setq ret (assoc key eword-lexical-analyze-cache))
+       (cdr ret)
+-      (setq ret (eword-lexical-analyze-internal key 0 must-unfold))
+-      (setq eword-lexical-analyze-cache
++      (setq ret (eword-lexical-analyze-internal key 0 must-unfold)
++          eword-lexical-analyze-cache
+           (cons (cons key ret)
+                 eword-lexical-analyze-cache))
+-      (if (cdr (setq cell (nthcdr eword-lexical-analyze-cache-max
+-                                eword-lexical-analyze-cache)))
+-        (setcdr cell nil))
++      (when (cdr (setq cell (nthcdr eword-lexical-analyze-cache-max
++                                  eword-lexical-analyze-cache)))
++      (setcdr cell nil))
+       ret)))
+ 
+ (defun eword-decode-token (token)
+@@ -783,18 +769,15 @@
+     (cond ((eq type 'quoted-string)
+          (std11-wrap-as-quoted-string value))
+         ((eq type 'comment)
+-         (let ((dest ""))
++         (let (dest)
+            (while value
+-             (setq dest (concat dest
+-                                (if (stringp (car value))
+-                                    (std11-wrap-as-quoted-pairs
+-                                     (car value) '(?( ?)))
+-                                  (eword-decode-token (car value))
+-                                  ))
+-                   value (cdr value))
+-             )
+-           (concat "(" dest ")")
+-           ))
++             (setq dest (cons (if (stringp (car value))
++                                  (std11-wrap-as-quoted-pairs
++                                   (car value) '(?\( ?\)))
++                                (eword-decode-token (car value)))
++                              dest)
++                   value (cdr value)))
++           (apply 'concat "(" (nreverse (cons ")" dest)))))
+         (t value))))
+ 
+ (defun eword-extract-address-components (string &optional start)
+@@ -809,10 +792,8 @@
+                          (std11-unfold-string string) start
+                          'must-unfold))))
+          (phrase  (std11-full-name-string structure))
+-         (address (std11-address-string structure))
+-         )
+-    (list phrase address)
+-    ))
++         (address (std11-address-string structure)))
++    (list phrase address)))
+ 
+ 
+ ;;; @ end
Index: pkgsrc/devel/flim/patches/patch-eword-encode.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-eword-encode.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-eword-encode.el     Sun Sep  3 14:58:38 2023
@@ -0,0 +1,687 @@
+$NetBSD: patch-eword-encode.el,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/eword-encode.el 2007-09-06 16:48:50.000000000 +0900
++++ ./eword-encode.el  2023-08-31 08:29:38.589006246 +0900
+@@ -1,4 +1,4 @@
+-;;; eword-encode.el --- RFC 2047 based encoded-word encoder for GNU Emacs
++;;; eword-encode.el --- RFC 2047 based encoded-word encoder for GNU Emacs  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1995,1996,1997,1998,1999,2000,2002,2003,2004 Free
+ ;;   Software Foundation, Inc.
+@@ -30,7 +30,6 @@
+ (require 'std11)
+ (require 'eword-decode)
+ 
+-
+ ;;; @ variables
+ ;;;
+ 
+@@ -59,8 +58,7 @@
+     (tis-620          . "B")
+     (iso-2022-jp-2    . "B")
+     (iso-2022-int-1   . "B")
+-    (utf-8            . "B")
+-    ))
++    (utf-8            . "B")))
+ 
+ (defvar mime-header-default-charset-encoding "Q")
+ 
+@@ -74,6 +72,8 @@
+       Dcc))
+     (eword-encode-in-reply-to . (In-Reply-To))
+     (eword-encode-structured-field-body . (Mime-Version User-Agent))
++    (eword-encode-Content-Disposition-field-body . (Content-Disposition))
++    (eword-encode-Content-Type-field-body . (Content-Type))
+     (eword-encode-unstructured-field-body)))
+ 
+ ;;; @ encoded-text encoder
+@@ -88,126 +88,64 @@
+   (let ((text (encoded-text-encode-string string encoding mode)))
+     (if text
+       (concat "=?" (upcase (symbol-name charset)) "?"
+-              encoding "?" text "?=")
+-      )))
++              encoding "?" text "?="))))
+ 
+ 
+ ;;; @ charset word
+ ;;;
+ 
+-(defsubst eword-encode-char-type (character)
+-  (if (memq character '(?  ?\t ?\n))
+-      nil
+-    (char-charset character)
+-    ))
+-
+-(defun eword-encode-divide-into-charset-words (string)
+-  (let ((len (length string))
+-      dest)
+-    (while (> len 0)
+-      (let* ((chr (aref string 0))
+-             ;; (chr (sref string 0))
+-           (charset (eword-encode-char-type chr))
+-             (i 1)
+-           ;; (i (char-length chr))
+-           )
+-      (while (and (< i len)
+-                  (setq chr (aref string i))
+-                    ;; (setq chr (sref string i))
+-                  (eq charset (eword-encode-char-type chr)))
+-        (setq i (1+ i))
+-          ;; (setq i (char-next-index chr i))
+-        )
+-      (setq dest (cons (cons charset (substring string 0 i)) dest)
+-            string (substring string i)
+-            len (- len i))))
+-    (nreverse dest)))
+-
+ 
+ ;;; @ word
+ ;;;
+ 
+-(defun eword-encode-charset-words-to-words (charset-words)
+-  (let (dest)
+-    (while charset-words
+-      (let* ((charset-word (car charset-words))
+-           (charset (car charset-word))
+-           )
+-      (if charset
+-          (let ((charsets (list charset))
+-                (str (cdr charset-word))
+-                )
+-            (catch 'tag
+-              (while (setq charset-words (cdr charset-words))
+-                (setq charset-word (car charset-words)
+-                      charset (car charset-word))
+-                (if (null charset)
+-                    (throw 'tag nil)
+-                  )
+-                (or (memq charset charsets)
+-                    (setq charsets (cons charset charsets))
+-                    )
+-                (setq str (concat str (cdr charset-word)))
+-                ))
+-            (setq dest (cons (cons charsets str) dest))
+-            )
+-        (setq dest (cons charset-word dest)
+-              charset-words (cdr charset-words)
+-              ))))
+-    (nreverse dest)
+-    ))
+-
+ 
+ ;;; @ rule
+ ;;;
+ 
+ (defmacro make-ew-rword (text charset encoding type)
+-  (` (list (, text)(, charset)(, encoding)(, type))))
++  `(list ,text ,charset ,encoding ,type))
+ (defmacro ew-rword-text (rword)
+-  (` (car (, rword))))
++  `(car ,rword))
+ (defmacro ew-rword-charset (rword)
+-  (` (car (cdr (, rword)))))
++  `(car (cdr ,rword)))
+ (defmacro ew-rword-encoding (rword)
+-  (` (car (cdr (cdr (, rword))))))
++  `(car (cdr (cdr ,rword))))
+ (defmacro ew-rword-type (rword)
+-  (` (car (cdr (cdr (cdr (, rword)))))))
++  `(car (cdr (cdr (cdr ,rword)))))
++
++(defun ew-find-string-rule (string)
++  (let ((charset (detect-mime-charset-string string)))
++    (list charset
++        (cdr (or (assq charset mime-header-charset-encoding-alist)
++                 (cons nil mime-header-default-charset-encoding))))))
+ 
+-(defun ew-find-charset-rule (charsets)
+-  (if charsets
+-      (let* ((charset (find-mime-charset-by-charsets charsets))
+-           (encoding
+-            (cdr (or (assq charset mime-header-charset-encoding-alist)
+-                     (cons charset mime-header-default-charset-encoding)))))
+-      (list charset encoding))))
+-
+-;; [tomo:2002-11-05] The following code is a quick-fix for emacsen
+-;; which is not depended on the Mule model.  We should redesign
+-;; `eword-encode-split-string' to avoid to depend on the Mule model.
+-(if (featurep 'utf-2000)
+-;; for CHISE Architecture
+-(defun tm-eword::words-to-ruled-words (wl &optional mode)
+-  (let (mcs)
+-    (mapcar (function
+-           (lambda (word)
+-             (setq mcs (detect-mime-charset-string (cdr word)))
+-             (make-ew-rword
+-              (cdr word)
+-              mcs
+-              (cdr (or (assq mcs mime-header-charset-encoding-alist)
+-                       (cons mcs mime-header-default-charset-encoding)))
+-              mode)
+-             ))
+-          wl)))
+-
+-;; for legacy Mule
+-(defun tm-eword::words-to-ruled-words (wl &optional mode)
+-  (mapcar (function
+-         (lambda (word)
+-           (let ((ret (ew-find-charset-rule (car word))))
+-             (make-ew-rword (cdr word) (car ret)(nth 1 ret) mode)
+-             )))
+-        wl))
+-)
++(defun tm-eword::string-to-ruled-words (string &optional mode)
++  (let ((len (length string))
++      (beg 0)
++      (i 1)
++      spacep dest mcs)
++    (when (> len 0)
++      (mapcar
++       (lambda (elt)
++       (if (cdr elt)
++           (make-ew-rword (car elt) nil nil mode)
++         (setq mcs (detect-mime-charset-string (car elt)))
++         (make-ew-rword
++          (car elt)
++          mcs
++          (cdr (or (assq mcs mime-header-charset-encoding-alist)
++                   (cons nil mime-header-default-charset-encoding)))
++          mode)))
++       (progn
++       (setq spacep (memq (aref string 0) '(?\s ?\t ?\n)))
++       (while (< i len)
++         (unless (eq spacep (memq (aref string i) '(?\s ?\t ?\n)))
++           (setq dest (cons (cons (substring string beg i) spacep) dest))
++           (setq beg i)
++           (setq spacep (null spacep)))
++         (setq i (1+ i)))
++       (nreverse
++        (cons (cons (substring string beg len) spacep) dest)))))))
+ 
+ (defun ew-space-process (seq)
+   (let (prev a ac b c cc)
+@@ -227,30 +165,19 @@
+                      (setq prev (cons
+                                  (cons (concat (car a)(car b)(car c))
+                                        (cdr a))
+-                                 (cdr prev)
+-                                 ))
+-                     (setq seq (cdr seq))
+-                     )
++                                 (cdr prev)))
++                     (setq seq (cdr seq)))
+                     (t
+                      (setq prev (cons
+                                  (cons (concat (car a)(car b))
+                                        (cdr a))
+-                                 (cdr prev)
+-                                 ))
+-                     ))
+-            (setq prev (cons b prev))
+-            ))
+-      (setq prev (cons b prev))
+-      ))
+-    (reverse prev)
+-    ))
++                                 (cdr prev)))))
++            (setq prev (cons b prev))))
++      (setq prev (cons b prev))))
++    (reverse prev)))
+ 
+ (defun eword-encode-split-string (str &optional mode)
+-  (ew-space-process
+-   (tm-eword::words-to-ruled-words
+-    (eword-encode-charset-words-to-words
+-     (eword-encode-divide-into-charset-words str))
+-    mode)))
++  (ew-space-process (tm-eword::string-to-ruled-words str mode)))
+ 
+ 
+ ;;; @ length
+@@ -263,16 +190,13 @@
+       ret)
+     (setq ret
+         (cond ((string-equal encoding "B")
+-               (setq string (encode-mime-charset-string string charset))
+-               (base64-encoded-length string)
+-               )
++               (setq string (mime-charset-encode-string string charset))
++               (base64-encoded-length string))
+               ((string-equal encoding "Q")
+-               (setq string (encode-mime-charset-string string charset))
+-               (Q-encoded-text-length string (ew-rword-type rword))
+-               )))
++               (setq string (mime-charset-encode-string string charset))
++               (Q-encoded-text-length string (ew-rword-type rword)))))
+     (if ret
+-      (cons (+ 7 (length (symbol-name charset)) ret) string)
+-      )))
++      (cons (+ 7 (length (symbol-name charset)) ret) string))))
+ 
+ 
+ ;;; @ encode-string
+@@ -286,35 +210,27 @@
+       (if (null ret)
+         (cond ((and (setq string (car rword))
+                     (or (<= (setq len (+ (length string) column)) 76)
+-                        (<= column 1))
+-                    )
+-               (setq rwl (cdr rwl))
+-               )
+-              ((memq (aref string 0) '(?  ?\t))
++                        (<= column 1)))
++               (setq rwl (cdr rwl)))
++              ((memq (aref string 0) '(?\s ?\t))
+                (setq string (concat "\n" string)
+                      len (length string)
+-                     rwl (cdr rwl))
+-               )
++                     rwl (cdr rwl)))
+               (must-output
+                (setq string "\n "
+-                     len 1)
+-               )
++                     len 1))
+               (t
+-               (throw 'can-not-output nil)
+-               ))
++               (throw 'can-not-output nil)))
+       (cond ((and (setq len (car ret))
+-                  (<= (+ column len) 76)
+-                  )
++                  (<= (+ column len) 76))
+              (setq string
+                    (eword-encode-text
+                     (ew-rword-charset rword)
+                     (ew-rword-encoding rword)
+                     (cdr ret)
+-                    (ew-rword-type rword)
+-                    ))
++                    (ew-rword-type rword)))
+              (setq len (+ (length string) column))
+-             (setq rwl (cdr rwl))
+-             )
++             (setq rwl (cdr rwl)))
+             (t
+              (setq string (car rword))
+              (let* ((p 0) np
+@@ -325,12 +241,10 @@
+                              ;;(setq np (char-next-index (sref string p) p))
+                              (setq nstr (substring string 0 np))
+                              (setq ret (tm-eword::encoded-word-length
+-                                        (cons nstr (cdr rword))
+-                                        ))
++                                        (cons nstr (cdr rword))))
+                              (setq nstr (cdr ret))
+                              (setq len (+ (car ret) column))
+-                             (<= len 76)
+-                             ))
++                             (<= len 76)))
+                  (setq str nstr
+                        p np))
+                (if (string-equal str "")
+@@ -346,12 +260,8 @@
+                         (ew-rword-encoding rword)
+                         str
+                         (ew-rword-type rword)))
+-                 (setq len (+ (length string) column))
+-                 )
+-               )))
+-      )
+-      (list string len rwl)
+-      )))
++                 (setq len (+ (length string) column)))))))
++      (list string len rwl))))
+ 
+ (defun eword-encode-rword-list (column rwl)
+   (let (ret dest str ew-f pew-f folded-points)
+@@ -360,23 +270,20 @@
+       (if (and pew-f ew-f)
+         (setq rwl (cons '(" ") rwl)
+               pew-f nil)
+-      (setq pew-f ew-f)
+-      )
++      (setq pew-f ew-f))
+       (if (null (setq ret (ew-encode-rword-1 column rwl)))
+         (let ((i (1- (length dest)))
+               c s r-dest r-column)
+           (catch 'success
+             (while (catch 'found
+                      (while (>= i 0)
+-                       (cond ((memq (setq c (aref dest i)) '(?  ?\t))
++                       (cond ((memq (setq c (aref dest i)) '(?\s ?\t))
+                               (if (memq i folded-points)
+                                   (throw 'found nil)
+                                 (setq folded-points (cons i folded-points))
+-                                (throw 'found i))
+-                              )
++                                (throw 'found i)))
+                              ((eq c ?\n)
+-                              (throw 'found nil)
+-                              ))
++                              (throw 'found nil)))
+                        (setq i (1- i))))
+               (setq s (substring dest i)
+                     r-column (length s)
+@@ -384,17 +291,13 @@
+               (when (setq ret (ew-encode-rword-1 r-column rwl))
+                 (setq dest r-dest
+                       column r-column)
+-                (throw 'success t)
+-                ))
+-            (setq ret (ew-encode-rword-1 column rwl 'must-output))
+-            )))
++                (throw 'success t)))
++            (setq ret (ew-encode-rword-1 column rwl 'must-output)))))
+       (setq str (car ret))
+       (setq dest (concat dest str))
+       (setq column (nth 1 ret)
+-          rwl (nth 2 ret))
+-      )
+-    (list dest column)
+-    ))
++          rwl (nth 2 ret)))
++    (list dest column)))
+ 
+ 
+ ;;; @ converter
+@@ -410,65 +313,44 @@
+            (setq dest
+                  (append dest
+                          (list
+-                          (let ((ret (ew-find-charset-rule
+-                                      (find-charset-string str))))
++                          (let ((ret (ew-find-string-rule str)))
+                             (make-ew-rword
+-                             str (car ret)(nth 1 ret) 'phrase)
+-                            )
+-                          )))
+-           )
++                             str (car ret)(nth 1 ret) 'phrase))))))
+           ((eq type 'comment)
+            (setq dest
+                  (append dest
+                          '(("(" nil nil special))
+-                         (tm-eword::words-to-ruled-words
+-                          (eword-encode-charset-words-to-words
+-                           (eword-encode-divide-into-charset-words
+-                            (cdr token)))
+-                          'comment)
+-                         '((")" nil nil special))
+-                         ))
+-           )
++                         (tm-eword::string-to-ruled-words
++                          (cdr token) 'comment)
++                         '((")" nil nil special)))))
+           (t
+            (setq dest
+                  (append dest
+-                         (tm-eword::words-to-ruled-words
+-                          (eword-encode-charset-words-to-words
+-                           (eword-encode-divide-into-charset-words
+-                            (cdr token))
+-                           ) 'phrase)))
+-           ))
+-      (setq phrase (cdr phrase))
+-      )
+-    (ew-space-process dest)
+-    ))
++                         (tm-eword::string-to-ruled-words
++                          (cdr token) 'phrase)))))
++      (setq phrase (cdr phrase)))
++    (ew-space-process dest)))
+ 
+ (defun eword-encode-addr-seq-to-rword-list (seq)
+   (let (dest pname)
+     (while seq
+       (let* ((token (car seq))
+-           (name (car token))
+-           )
++           (name (car token)))
+       (cond ((eq name 'spaces)
+-             (setq dest (nconc dest (list (list (cdr token) nil nil))))
+-             )
++             (setq dest (nconc dest (list (list (cdr token) nil nil)))))
+             ((eq name 'comment)
+              (setq dest
+                    (nconc
+                     dest
+                     (list (list "(" nil nil))
+                     (eword-encode-split-string (cdr token) 'comment)
+-                    (list (list ")" nil nil))
+-                    ))
+-             )
++                    (list (list ")" nil nil)))))
+             ((eq name 'quoted-string)
+              (setq dest
+                    (nconc
+                     dest
+                     (list
+-                     (list (concat "\"" (cdr token) "\"") nil nil)
+-                     )))
+-             )
++                     (list (concat "\"" (cdr token) "\"") nil nil)))))
+             (t
+              (setq dest
+                    (if (or (eq pname 'spaces)
+@@ -479,11 +361,9 @@
+                             (list
+                              (list (concat (car (car (last dest)))
+                                            (cdr token))
+-                                   nil nil)))))
+-             ))
++                                   nil nil)))))))
+       (setq seq (cdr seq)
+-            pname name))
+-      )
++            pname name)))
+     dest))
+ 
+ (defun eword-encode-phrase-route-addr-to-rword-list (phrase-route-addr)
+@@ -496,36 +376,31 @@
+         ;;   )
+       (setq dest (eword-encode-phrase-to-rword-list phrase))
+       (if dest
+-          (setq dest (append dest '((" " nil nil))))
+-        )
++          (setq dest (append dest '((" " nil nil)))))
+       (append
+        dest
+        (eword-encode-addr-seq-to-rword-list
+         (append '((specials . "<"))
+                 route
+-                '((specials . ">"))))
+-       ))))
++                '((specials . ">"))))))))
+ 
+ (defun eword-encode-addr-spec-to-rword-list (addr-spec)
+   (if (eq (car addr-spec) 'addr-spec)
+-      (eword-encode-addr-seq-to-rword-list (cdr addr-spec))
+-    ))
++      (eword-encode-addr-seq-to-rword-list (cdr addr-spec))))
+ 
+ (defun eword-encode-mailbox-to-rword-list (mbox)
+   (let ((addr (nth 1 mbox))
+       (comment (nth 2 mbox))
+       dest)
+     (setq dest (or (eword-encode-phrase-route-addr-to-rword-list addr)
+-                 (eword-encode-addr-spec-to-rword-list addr)
+-                 ))
++                 (eword-encode-addr-spec-to-rword-list addr)))
+     (if comment
+       (setq dest
+             (append dest
+                     '((" " nil nil)
+                       ("(" nil nil))
+                     (eword-encode-split-string comment 'comment)
+-                    (list '(")" nil nil))
+-                    )))
++                    (list '(")" nil nil)))))
+     dest))
+ 
+ (defsubst eword-encode-mailboxes-to-rword-list (mboxes)
+@@ -577,8 +452,7 @@
+                   (let ((elt (car in-reply-to)))
+                     (if (eq (car elt) 'phrase)
+                         (eword-encode-phrase-to-rword-list (cdr elt))
+-                      (eword-encode-msg-id-to-rword-list elt)
+-                      ))))
++                      (eword-encode-msg-id-to-rword-list elt)))))
+       (setq in-reply-to (cdr in-reply-to)))
+     dest))
+ 
+@@ -586,6 +460,9 @@
+ ;;; @ application interfaces
+ ;;;
+ 
++(provide 'eword-encode)
++(require 'mime-parse)
++
+ (defvar eword-encode-default-start-column 10
+   "Default start column if it is omitted.")
+ 
+@@ -604,8 +481,7 @@
+   (car (eword-encode-rword-list
+       (or column eword-encode-default-start-column)
+       (eword-encode-addresses-to-rword-list
+-       (std11-parse-addresses-string string))
+-      )))
++       (std11-parse-addresses-string string)))))
+ 
+ (defun eword-encode-in-reply-to (string &optional column)
+   "Encode header field STRING as In-Reply-To field, and return the result.
+@@ -620,8 +496,7 @@
+ Optional argument COLUMN is start-position of the field."
+   (car (eword-encode-rword-list
+       (or column eword-encode-default-start-column)
+-      (eword-encode-addr-seq-to-rword-list (std11-lexical-analyze string))
+-      )))
++      (eword-encode-addr-seq-to-rword-list (std11-lexical-analyze string)))))
+ 
+ (defun eword-encode-unstructured-field-body (string &optional column)
+   "Encode header field STRING as unstructured field, and return the result.
+@@ -630,6 +505,81 @@
+       (or column eword-encode-default-start-column)
+       (eword-encode-split-string string 'text))))
+ 
++(defun eword-encode-Content-Type-field-body (field-body &optional _column)
++  "Encode FIELD-BODY with MIME Parameter-Value Extensions, if necessary.
++Optional second arg COLUMN is ignored."
++  (let ((tokens (mime-lexical-analyze field-body))
++      primary-type)
++    (unless (eq (car (car tokens)) 'mime-token)
++      (error "Invalid Content-Type value: %s" field-body))
++    (setq primary-type (downcase (cdr (car tokens)))
++        tokens (cdr tokens))
++    (unless (and (eq (car (car tokens)) 'tspecials)
++               (string= (cdr (car tokens)) "/")
++               (setq tokens (cdr tokens))
++               (eq (car (car tokens)) 'mime-token))
++      (error "Invalid Content-Type value: %s" field-body))
++    (concat " " primary-type "/" (downcase (cdr (car tokens)))
++            (mapconcat
++             (lambda (param)
++               (concat ";\n " (car param) "=" (cdr param)))
++             (mime-encode-parameters
++            (mime-parse-parameters (cdr tokens)))
++             ""))))
++
++(defun eword-encode-Content-Disposition-field-body
++    (field-body &optional _column)
++  "Encode FIELD-BODY with MIME Parameter-Value Extensions, if necessary.
++Optional second arg COLUMN is ignored."
++  (let ((tokens (mime-lexical-analyze field-body)))
++    (unless (eq (car (car tokens)) 'mime-token)
++      (error "Invalid Content-Disposition value: %s" field-body))
++    (concat " " (cdr (car tokens))
++            (mapconcat
++             (lambda (param)
++               (concat ";\n " (car param) "=" (cdr param)))
++             (mime-encode-parameters
++            (mime-parse-parameters (cdr tokens)))
++             ""))))
++
++(defun eword-encode-Content-Type-field-body-broken-mime
++  (field-body &optional _column)
++  "Encode FIELD-BODY compatibly with Outlook, if necessary.
++Optional second arg COLUMN is ignored."
++  (let ((tokens (mime-lexical-analyze field-body))
++      primary-type)
++    (unless (eq (car (car tokens)) 'mime-token)
++      (error "Invalid Content-Type value: %s" field-body))
++    (setq primary-type (downcase (cdr (car tokens)))
++        tokens (cdr tokens))
++    (unless (and (eq (car (car tokens)) 'tspecials)
++               (string= (cdr (car tokens)) "/")
++               (setq tokens (cdr tokens))
++               (eq (car (car tokens)) 'mime-token))
++      (error "Invalid Content-Type value: %s" field-body))
++    (concat " " primary-type "/" (downcase (cdr (car tokens)))
++            (mapconcat
++             (lambda (param)
++               (concat ";\n " (car param) "=\"" (cdr param) "\""))
++             (mime-encode-parameters-broken-mime
++            (mime-parse-parameters (cdr tokens)))
++             ""))))
++
++(defun eword-encode-Content-Disposition-field-body-broken-mime
++  (field-body &optional _column)
++  "Encode FIELD-BODY compatibly with Outlook, if necessary.
++Optional second arg COLUMN is ignored."
++  (let ((tokens (mime-lexical-analyze field-body)))
++    (unless (eq (car (car tokens)) 'mime-token)
++      (error "Invalid Content-Disposition value: %s" field-body))
++    (concat " " (cdr (car tokens))
++            (mapconcat
++             (lambda (param)
++               (concat ";\n " (car param) "=\"" (cdr param) "\""))
++             (mime-encode-parameters-broken-mime
++            (mime-parse-parameters (cdr tokens)))
++             ""))))
++
+ ;;;###autoload
+ (defun mime-encode-field-body (field-body field-name)
+   "Encode FIELD-BODY as FIELD-NAME, and return the result.
+@@ -655,13 +605,13 @@
+       (setq method-alist (cdr method-alist)))
+       ret)))
+ (defalias 'eword-encode-field-body 'mime-encode-field-body)
+-(make-obsolete 'eword-encode-field-body 'mime-encode-field-body)
++(make-obsolete 'eword-encode-field-body 'mime-encode-field-body "19 Dec 2000")
+ 
+ (defun eword-in-subject-p ()
+   (let ((str (std11-field-body "Subject")))
+     (if (and str (string-match eword-encoded-word-regexp str))
+       str)))
+-(make-obsolete 'eword-in-subject-p "Don't use it.")
++(make-obsolete 'eword-in-subject-p "Don't use it." "19 Dec 2000")
+ 
+ (defsubst eword-find-field-encoding-method (field-name)
+   (setq field-name (downcase field-name))
+@@ -672,11 +622,9 @@
+              (str (car pair)))
+         (if (and (stringp str)
+                  (string= field-name (downcase str)))
+-            (throw 'found (cdr pair))
+-          ))
++            (throw 'found (cdr pair))))
+       (setq alist (cdr alist)))
+-      (cdr (assq t mime-field-encoding-method-alist))
+-      )))
++      (cdr (assq t mime-field-encoding-method-alist)))))
+ 
+ ;;;###autoload
+ (defun mime-encode-header-in-buffer (&optional code-conversion)
+@@ -715,7 +663,8 @@
+                                  default-cs)))
+                         (encode-coding-region bbeg end cs)))))))))))
+ (defalias 'eword-encode-header 'mime-encode-header-in-buffer)
+-(make-obsolete 'eword-encode-header 'mime-encode-header-in-buffer)
++(make-obsolete 'eword-encode-header
++             'mime-encode-header-in-buffer "19 Dec 2000")
+ 
+ 
+ ;;; @ end
Index: pkgsrc/devel/flim/patches/patch-flim-pkg.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-flim-pkg.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-flim-pkg.el Sun Sep  3 14:58:38 2023
@@ -0,0 +1,10 @@
+$NetBSD: patch-flim-pkg.el,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+sync to  lexical-binding
+
+--- /tmp/wip/flim/work/flim-1.14.9/./flim-pkg.el       1970-01-01 09:00:00.000000000 +0900
++++ ././flim-pkg.el    2018-07-29 22:48:22.274683207 +0900
+@@ -0,0 +1,3 @@
++(define-package "flim" "1.14.9"
++  "A library to provide basic features about message representation or encoding."
++  '((apel "10.8")))
Index: pkgsrc/devel/flim/patches/patch-ftp.in
diff -u /dev/null pkgsrc/devel/flim/patches/patch-ftp.in:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-ftp.in      Sun Sep  3 14:58:38 2023
@@ -0,0 +1,22 @@
+$NetBSD: patch-ftp.in,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+sync to  lexical-binding
+
+--- /tmp/wip/flim/work/flim-1.14.9/./ftp.in    1970-01-01 09:00:00.000000000 +0900
++++ ././ftp.in 2018-07-29 22:48:22.274798660 +0900
+@@ -0,0 +1,15 @@
++--<<alternative>>-{
++
++  It is available from
++
++    http://www.kanji.zinbun.kyoto-u.ac.jp/~tomo/lemi/dist/flim/flim-API/
++
++--[[message/external-body; access-type=URL;
++      URL*0="http://";;
++      URL*1="www.kanji.zinbun.kyoto-u.ac.jp/~tomo/";
++      URL*2="lemi/dist/";
++      URL*3="flim/flim-API/";
++      URL*4="PACKAGE-VERSION.tar.gz"]]
++Content-Type: application/octet-stream
++Content-Disposition: attachment; filename="PACKAGE-VERSION.tar.gz"
++--}-<<alternative>>
Index: pkgsrc/devel/flim/patches/patch-hmac-md5.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-hmac-md5.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-hmac-md5.el Sun Sep  3 14:58:38 2023
@@ -0,0 +1,42 @@
+$NetBSD: patch-hmac-md5.el,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+sync to  lexical-binding
+
+--- /tmp/wip/flim/work/flim-1.14.9/./hmac-md5.el       2005-07-06 11:09:04.000000000 +0900
++++ ././hmac-md5.el    2020-09-05 16:02:39.899197296 +0900
+@@ -1,4 +1,4 @@
+-;;; hmac-md5.el --- Compute HMAC-MD5.
++;;; hmac-md5.el --- Compute HMAC-MD5.  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1999, 2001  Free Software Foundation, Inc.
+ 
+@@ -64,26 +64,13 @@
+ ;;; Code:
+ 
+ (eval-when-compile (require 'hmac-def))
+-(require 'hex-util)                   ; (decode-hex-string STRING)
+ (require 'md5)                                ; expects (md5 STRING)
+ 
+ ;; To share *.elc files between Emacs w/ and w/o DL patch,
+ ;; this check must be done at load-time.
+-(cond
+- ((fboundp 'md5-binary)
+-  ;; do nothing.
+-  )
+- ((condition-case nil
+-       ;; `md5' of v21 takes 4th arg CODING (and 5th arg NOERROR).
+-       (md5 "" nil nil 'binary)               ; => "d41d8cd98f00b204e9800998ecf8427e"
+-     (wrong-number-of-arguments nil))
+-  (defun md5-binary (string)
+-    "Return the MD5 of STRING in binary form."
+-   (decode-hex-string (md5 string nil nil 'binary))))
+- (t
+-  (defun md5-binary (string)
+-    "Return the MD5 of STRING in binary form."
+-   (decode-hex-string (md5 string)))))
++(defun md5-binary (string)
++  "Return the MD5 of STRING in binary form."
++  (secure-hash 'md5 string nil nil t))
+ 
+ (define-hmac-function hmac-md5 md5-binary 64 16) ; => (hmac-md5 TEXT KEY)
+ (define-hmac-function hmac-md5-96 md5-binary 64 16 96)
Index: pkgsrc/devel/flim/patches/patch-hmac-sha1.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-hmac-sha1.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-hmac-sha1.el        Sun Sep  3 14:58:38 2023
@@ -0,0 +1,35 @@
+$NetBSD: patch-hmac-sha1.el,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/hmac-sha1.el    2005-07-06 11:09:04.000000000 +0900
++++ ./hmac-sha1.el     2023-08-31 08:29:38.591676336 +0900
+@@ -1,4 +1,4 @@
+-;;; hmac-sha1.el --- Compute HMAC-SHA1.
++;;; hmac-sha1.el --- Compute HMAC-SHA1.  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1999, 2001  Free Software Foundation, Inc.
+ 
+@@ -64,19 +64,10 @@
+ ;;; Code:
+ 
+ (eval-when-compile (require 'hmac-def))
+-(require 'hex-util)                   ; (decode-hex-string STRING)
+-(require 'sha1)                               ; expects (sha1 STRING)
+ 
+-;; To share *.elc files between Emacs w/ and w/o DL patch,
+-;; this check must be done at load-time.
+-(cond
+- ((fboundp 'sha1-binary)
+-  ;; do nothing.
+-  )
+- (t
+-  (defun sha1-binary (string)
+-    "Return the SHA1 of STRING in binary form."
+-    (decode-hex-string (sha1 string)))))
++(defun sha1-binary (string)
++  "Return the SHA1 of STRING in binary form."
++  (secure-hash 'sha1 string nil nil t))
+ 
+ (define-hmac-function hmac-sha1 sha1-binary 64 20) ; => (hmac-sha1 TEXT KEY)
+ (define-hmac-function hmac-sha1-96 sha1-binary 64 20 96)
Index: pkgsrc/devel/flim/patches/patch-luna.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-luna.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-luna.el     Sun Sep  3 14:58:38 2023
@@ -0,0 +1,145 @@
+$NetBSD: patch-luna.el,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/luna.el 2005-07-06 11:09:04.000000000 +0900
++++ ./luna.el  2023-08-31 08:29:38.593059572 +0900
+@@ -1,4 +1,4 @@
+-;;; luna.el --- tiny OOP system kernel
++;;; luna.el --- tiny OOP system kernel  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1999,2000,2002 Free Software Foundation, Inc.
+ 
+@@ -24,9 +24,6 @@
+ 
+ ;;; Code:
+ 
+-(eval-when-compile (require 'cl))
+-
+-
+ ;;; @ class
+ ;;;
+ 
+@@ -68,13 +65,11 @@
+ 
+ (defun luna-define-class-function (class &optional parents slots)
+   (let ((oa (make-vector 31 0))
+-      (rest parents)
+-      parent name
++      name
+       (i 2)
+       b j)
+-    (while rest
+-      (setq parent (pop rest)
+-          b (- i 2))
++    (dolist (parent parents)
++      (setq b (- i 2))
+       (mapatoms (lambda (sym)
+                 (when (setq j (get sym 'luna-slot-index))
+                   (setq name (symbol-name sym))
+@@ -82,9 +77,8 @@
+                     (put (intern name oa) 'luna-slot-index (+ j b))
+                     (setq i (1+ i)))))
+               (luna-class-obarray (luna-find-class parent))))
+-    (setq rest slots)
+-    (while rest
+-      (setq name (symbol-name (pop rest)))
++    (dolist (slot slots)
++      (setq name (symbol-name slot))
+       (unless (intern-soft name oa)
+       (put (intern name oa) 'luna-slot-index i)
+       (setq i (1+ i))))
+@@ -95,9 +89,11 @@
+ ;; MEMBER-NAME.
+ 
+ (defun luna-class-find-member (class member-name)
+-  (or (stringp member-name)
+-      (setq member-name (symbol-name member-name)))
+-  (intern-soft member-name (luna-class-obarray class)))
++  (intern-soft
++   (if (stringp member-name)
++       member-name
++     (symbol-name member-name))
++   (luna-class-obarray class)))
+ 
+ 
+ ;; Return a member (slot or method) of CLASS that has name
+@@ -105,9 +101,11 @@
+ ;; CLASS.
+ 
+ (defsubst luna-class-find-or-make-member (class member-name)
+-  (or (stringp member-name)
+-      (setq member-name (symbol-name member-name)))
+-  (intern member-name (luna-class-obarray class)))
++  (intern
++   (if (stringp member-name)
++       member-name
++     (symbol-name member-name))
++   (luna-class-obarray class)))
+ 
+ 
+ ;; Return the index number of SLOT-NAME in CLASS.
+@@ -220,6 +218,9 @@
+ ;;; @ instance (entity)
+ ;;;
+ 
++(defvar luna-next-methods nil)
++(defvar luna-current-method-arguments nil)
++
+ (defmacro luna-class-name (entity)
+   "Return class-name of the ENTITY."
+   `(aref ,entity 0))
+@@ -230,8 +231,8 @@
+ (defmacro luna-get-obarray (entity)
+   `(aref ,entity 1))
+ 
+-(defmacro luna-set-obarray (entity obarray)
+-  `(aset ,entity 1 ,obarray))
++(defmacro luna-set-obarray (entity array)
++  `(aset ,entity 1 ,array))
+ 
+ (defmacro luna-slot-index (entity slot-name)
+   `(luna-class-slot-index (luna-find-class (luna-class-name ,entity))
+@@ -249,12 +250,13 @@
+   `(luna-class-find-functions (luna-find-class (luna-class-name ,entity))
+                             ,service))
+ 
+-(defsubst luna-send (entity message &rest luna-current-method-arguments)
++(defsubst luna-send (entity message &rest arguments)
+   "Send MESSAGE to ENTITY, and return the result.
+ ENTITY is an instance of a luna class, and MESSAGE is a method name of
+ the luna class.
+-LUNA-CURRENT-METHOD-ARGUMENTS is arguments of the MESSAGE."
+-  (let ((luna-next-methods (luna-find-functions entity message))
++ARGUMENTS is arguments of the MESSAGE."
++  (let ((luna-current-method-arguments arguments)
++      (luna-next-methods (luna-find-functions entity message))
+       luna-current-method
+       luna-previous-return-value)
+     (while (and luna-next-methods
+@@ -269,10 +271,6 @@
+                   t))))
+     luna-previous-return-value))
+ 
+-(eval-when-compile
+-  (defvar luna-next-methods nil)
+-  (defvar luna-current-method-arguments nil))
+-
+ (defun luna-call-next-method ()
+   "Call the next method in the current method function.
+ A method function that has :around qualifier should call this function
+@@ -307,10 +305,11 @@
+ ;;;
+ 
+ ;; Find a method of ENTITY that handles MESSAGE, and call it with
+-;; arguments LUNA-CURRENT-METHOD-ARGUMENTS.
++;; arguments ARGUMENTS.
+ 
+-(defun luna-apply-generic (entity message &rest luna-current-method-arguments)
+-  (let* ((class (luna-class-name entity))
++(defun luna-apply-generic (entity message &rest arguments)
++  (let* ((luna-current-method-arguments arguments)
++       (class (luna-class-name entity))
+        (cache (get message 'luna-method-cache))
+        (sym (intern-soft (symbol-name class) cache))
+        luna-next-methods)
Index: pkgsrc/devel/flim/patches/patch-lunit.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-lunit.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-lunit.el    Sun Sep  3 14:58:38 2023
@@ -0,0 +1,78 @@
+$NetBSD: patch-lunit.el,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/lunit.el        2005-07-06 11:09:04.000000000 +0900
++++ ./lunit.el 2023-08-31 08:29:38.593841638 +0900
+@@ -1,4 +1,4 @@
+-;;; lunit.el --- simple testing framework for luna
++;;; lunit.el --- simple testing framework for luna  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 2000 Daiki Ueno.
+ 
+@@ -52,8 +52,6 @@
+ 
+ (require 'luna)
+ 
+-(eval-when-compile (require 'cl))
+-
+ ;;; @ test
+ ;;;
+ 
+@@ -175,14 +173,14 @@
+ NAME is name of the method to be tested."
+   (luna-make-entity class :name name))
+ 
+-(luna-define-method lunit-test-number-of-tests ((case lunit-test-case))
++(luna-define-method lunit-test-number-of-tests ((_case lunit-test-case))
+   1)
+ 
+ (luna-define-method lunit-test-run ((case lunit-test-case) result)
+   (lunit-test-result-run result case))
+ 
+-(luna-define-method lunit-test-case-setup ((case lunit-test-case)))
+-(luna-define-method lunit-test-case-teardown ((case lunit-test-case)))
++(luna-define-method lunit-test-case-setup ((_case lunit-test-case)))
++(luna-define-method lunit-test-case-teardown ((_case lunit-test-case)))
+ 
+ (luna-define-method lunit-test-case-run ((case lunit-test-case))
+   (lunit-test-case-setup case)
+@@ -242,21 +240,22 @@
+ 
+ (luna-define-class lunit-test-printer (lunit-test-listener))
+ 
+-(luna-define-method lunit-test-listener-error ((printer lunit-test-printer)
+-                                             case error)
++(luna-define-method lunit-test-listener-error ((_printer lunit-test-printer)
++                                             _case error)
+   (princ (format " error: %S" error)))
+ 
+-(luna-define-method lunit-test-listener-failure ((printer lunit-test-printer)
+-                                               case failure)
++(luna-define-method lunit-test-listener-failure ((_printer lunit-test-printer)
++                                               _case failure)
+   (princ (format " failure: %S" failure)))
+ 
+-(luna-define-method lunit-test-listener-start ((printer lunit-test-printer)
++(luna-define-method lunit-test-listener-start ((_printer lunit-test-printer)
+                                              case)
+   (princ (format "Running `%S#%S'..."
+                (luna-class-name case)
+                (lunit-test-name-internal case))))
+ 
+-(luna-define-method lunit-test-listener-end ((printer lunit-test-printer) case)
++(luna-define-method
++  lunit-test-listener-end ((_printer lunit-test-printer) _case)
+   (princ "\n"))
+ 
+ (defun lunit-make-test-suite-from-class (class)
+@@ -301,8 +300,7 @@
+ 
+ (defun lunit-generate-template (file)
+   (interactive "fGenerate lunit template for: ")
+-  (save-excursion
+-    (set-buffer (find-file-noselect file))
++  (with-current-buffer (find-file-noselect file)
+     (let ((index-alist 
+          (lunit-create-index-function)))
+       (with-output-to-temp-buffer "*Lunit template*"
Index: pkgsrc/devel/flim/patches/patch-md5.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-md5.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-md5.el      Sun Sep  3 14:58:38 2023
@@ -0,0 +1,44 @@
+$NetBSD: patch-md5.el,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/md5.el  2005-07-06 11:09:04.000000000 +0900
++++ ./md5.el   2023-08-31 08:29:38.594519992 +0900
+@@ -1,4 +1,4 @@
+-;;; md5.el --- MD5 Message Digest Algorithm.
++;;; md5.el --- MD5 Message Digest Algorithm.  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1999, 2001  Free Software Foundation, Inc.
+ 
+@@ -49,30 +49,7 @@
+ 
+ ;;; Code:
+ 
+-(defvar md5-dl-module
+-  (cond
+-   ((and (fboundp 'md5)
+-       (subrp (symbol-function 'md5)))
+-    nil)
+-   ((fboundp 'dynamic-link)
+-    ;; Should we take care of `dynamic-link-path'?
+-    (let ((path (expand-file-name "md5.so" exec-directory)))
+-      (if (file-exists-p path)
+-        path
+-      nil)))
+-   (t
+-    nil)))
+-
+-(cond
+- ((and (fboundp 'md5)
+-       (subrp (symbol-function 'md5)))
+-  ;; do nothing.
+-  )
+- ((and (stringp md5-dl-module)
+-       (file-exists-p md5-dl-module))
+-  (require 'md5-dl))
+- (t
+-  (require 'md5-el)))
++(defvar md5-dl-module nil)
+ 
+ (provide 'md5)
+ 
Index: pkgsrc/devel/flim/patches/patch-mel-g.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-mel-g.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-mel-g.el    Sun Sep  3 14:58:38 2023
@@ -0,0 +1,12 @@
+$NetBSD: patch-mel-g.el,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/mel-g.el        2005-07-06 11:09:04.000000000 +0900
++++ ./mel-g.el 2023-08-31 08:29:38.595813291 +0900
+@@ -1,4 +1,4 @@
+-;;; mel-g.el --- Gzip64 encoder/decoder.
++;;; mel-g.el --- Gzip64 encoder/decoder.  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1995,96,97,98,99,2001  Free Software Foundation, Inc.
+ 
Index: pkgsrc/devel/flim/patches/patch-mel-q-ccl.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-mel-q-ccl.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-mel-q-ccl.el        Sun Sep  3 14:58:38 2023
@@ -0,0 +1,386 @@
+$NetBSD: patch-mel-q-ccl.el,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/mel-q-ccl.el    2006-06-13 00:10:02.000000000 +0900
++++ ./mel-q-ccl.el     2023-08-31 08:29:38.597755481 +0900
+@@ -1,4 +1,4 @@
+-;;; mel-q-ccl.el --- Quoted-Printable encoder/decoder using CCL.
++;;; mel-q-ccl.el --- Quoted-Printable encoder/decoder using CCL.  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1998,1999 Tanaka Akira
+ 
+@@ -67,7 +67,7 @@
+       0   1   2   3   4   5   6   7   8   9 nil nil nil nil nil nil
+     nil  10  11  12  13  14  15 nil nil nil nil nil nil nil nil nil
+     nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
+-    nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
++    nil  10  11  12  13  14  15 nil nil nil nil nil nil nil nil nil
+     nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
+     nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
+     nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
+@@ -79,12 +79,12 @@
+     nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil))
+ 
+ (defconst mel-ccl-16-to-256-table
+-  (mapcar 'char-int "0123456789ABCDEF"))
++  (string-to-list "0123456789ABCDEF"))
+ 
+ (defconst mel-ccl-high-table
+   (vconcat
+    (mapcar
+-    (lambda (v) (nth (lsh v -4) mel-ccl-16-to-256-table))
++    (lambda (v) (nth (ash v -4) mel-ccl-16-to-256-table))
+     mel-ccl-256-table)))
+ 
+ (defconst mel-ccl-low-table
+@@ -95,23 +95,21 @@
+ 
+ (defconst mel-ccl-u-raw
+   (mapcar
+-   'char-int
++   'identity
+    "0123456789\
+ ABCDEFGHIJKLMNOPQRSTUVWXYZ\
+ abcdefghijklmnopqrstuvwxyz\
+ !@#$%&'()*+,-./:;<>@[\\]^`{|}~"))
+ 
+ (defconst mel-ccl-c-raw
+-  (mapcar
+-   'char-int
++  (string-to-list
+    "0123456789\
+ ABCDEFGHIJKLMNOPQRSTUVWXYZ\
+ abcdefghijklmnopqrstuvwxyz\
+ !@#$%&'*+,-./:;<>@[]^`{|}~"))
+ 
+ (defconst mel-ccl-p-raw
+-  (mapcar
+-   'char-int
++  (string-to-list
+    "0123456789\
+ ABCDEFGHIJKLMNOPQRSTUVWXYZ\
+ abcdefghijklmnopqrstuvwxyz\
+@@ -133,9 +131,7 @@
+    enc enc enc enc enc enc enc enc enc enc enc enc enc enc enc enc
+    enc enc enc enc enc enc enc enc enc enc enc enc enc enc enc enc
+    enc enc enc enc enc enc enc enc enc enc enc enc enc enc enc enc
+-   enc enc enc enc enc enc enc enc enc enc enc enc enc enc enc enc])
+-
+-)
++   enc enc enc enc enc enc enc enc enc enc enc enc enc enc enc enc]))
+ 
+ 
+ ;;; @ CCL programs
+@@ -146,14 +142,15 @@
+ (define-ccl-program mel-ccl-decode-q
+   `(1
+     ((loop
+-      (read-branch
+-       r0
++      (read r0)
++      (branch
++       (r0 & 255)
+        ,@(mapcar
+           (lambda (r0)
+             (cond
+-             ((= r0 (char-int ?_))
+-              `(write-repeat ? ))
+-             ((= r0 (char-int ?=))
++             ((= r0 ?_)
++              `(write-repeat ?\s))
++             ((= r0 ?=)
+               `((loop
+                  (read-branch
+                   r1
+@@ -172,7 +169,7 @@
+                            `((write r0 ,(vconcat
+                                          (mapcar
+                                           (lambda (r0)
+-                                            (logior (lsh r0 4) v))
++                                            (logior (ash r0 4) v))
+                                           mel-ccl-16-table)))
+                              (break))
+                          '(repeat)))
+@@ -188,7 +185,9 @@
+   `(3
+     (loop
+      (loop
+-      (read-branch
++      (read r0)
++      (r0 &= 255)
++      (branch
+        r0
+        ,@(mapcar
+           (lambda (r0)
+@@ -214,9 +213,7 @@
+           (if (or (= r1 32) (member r1 raw))
+               '((r0 += 1) (repeat))
+             '((r0 += 3) (repeat))))
+-        mel-ccl-256-table))))))
+-
+-)
++        mel-ccl-256-table)))))))
+ 
+ (define-ccl-program mel-ccl-encode-uq
+   (mel-ccl-encode-q-generic mel-ccl-u-raw))
+@@ -243,9 +240,7 @@
+     (unless p
+       (setq p (cons branch (length eof-block-branches))
+           eof-block-branches (cons p eof-block-branches)))
+-    `(,eof-block-reg = ,(cdr p))))
+-
+-)
++    `(,eof-block-reg = ,(cdr p)))))
+ 
+ (eval-when-compile
+ 
+@@ -265,9 +260,7 @@
+     `(,(mel-ccl-set-eof-block crlf-eof)
+       (read-if (,reg == ?\n)
+       ,succ
+-      ,crlf-fail))))
+-
+-)
++      ,crlf-fail)))))
+ 
+ (eval-when-compile
+ 
+@@ -281,12 +274,10 @@
+       (after-wsp 'r5)
+       (column 'r6)
+       (type 'r3)
+-      (current 'r0)
+       (type-raw 0)
+       (type-enc 1)
+       (type-wsp 2)
+-      (type-brk 3)
+-      )
++      (type-brk 3))
+     `(4
+       ((,column = 0)
+        (,after-wsp = 0)
+@@ -295,13 +286,14 @@
+        (loop  ; invariant: column <= 75
+       (loop
+        (loop
++        (r0 &= 255)
+         (branch
+          r0
+          ,@(mapcar
+             (lambda (r0)
+               (let ((tmp (aref mel-ccl-qp-table r0)))
+                 (cond
+-                 ((eq r0 (char-int ?F))
++                 ((eq r0 ?F)
+                   `(if (,column == 0)
+                        (,(mel-ccl-set-eof-block '((write "F") (end)))
+                         (read-if (r0 == ?r)
+@@ -310,7 +302,7 @@
+                              (,(mel-ccl-set-eof-block '((write "Fro") (end)))
+                               (read-if (r0 == ?m)
+                                 (,(mel-ccl-set-eof-block '((write "From") (end)))
+-                                 (read-if (r0 == ? )
++                                 (read-if (r0 == ?\s)
+                                    ((,column = 7)
+                                     (,after-wsp = 1)
+                                     ,(mel-ccl-set-eof-block '((write "From=20") (end)))
+@@ -326,7 +318,7 @@
+                            (write-repeat "F"))))
+                      ((,type = ,type-raw) (break)) ; RAW
+                      ))
+-                 ((eq r0 (char-int ?.))
++                 ((eq r0 ?.)
+                   `(if (,column == 0)
+                        ,(mel-ccl-try-to-read-crlf
+                           input-crlf 'r0
+@@ -359,8 +351,7 @@
+                  ((eq tmp 'cr) `((,type = ,(if input-crlf type-brk type-enc))
+                                  (break)))
+                  ((eq tmp 'lf) `((,type = ,(if input-crlf type-enc type-brk))
+-                                 (break)))
+-                 )))
++                                 (break))))))
+             mel-ccl-256-table)))
+        ;; r0:type{raw,enc,wsp,brk}
+        (branch
+@@ -580,8 +571,7 @@
+                (,column = 0)
+                ,@(if output-crlf '((write ?\r)) '())
+                ,(mel-ccl-set-eof-block `(end))
+-               (write-read-repeat r0)))
+-           )))))
++               (write-read-repeat r0))))))))
+       (branch
+        ,eof-block-reg
+        ,@(reverse (mapcar 'car eof-block-branches))))))
+@@ -591,13 +581,13 @@
+     ((read r0)
+      (loop
+       (branch
+-       r0
++       (r0 & 255)
+        ,@(mapcar
+           (lambda (r0)
+             (let ((tmp (aref mel-ccl-qp-table r0)))
+               (cond
+                ((eq tmp 'raw) `(write-read-repeat r0))
+-               ((eq tmp 'wsp) (if (eq r0 (char-int ? ))
++               ((eq tmp 'wsp) (if (eq r0 ?\s)
+                                   `(r1 = 1)
+                                 `(r1 = 0)))
+                ((eq tmp 'cr)
+@@ -634,12 +624,12 @@
+                       '((write ?\r)
+                         (write-read-repeat r0))
+                     '(write-read-repeat r0))))
+-               ((eq r0 (char-int ?=))
++               ((eq r0 ?=)
+                 ;; r0='='
+                 `((read r0)
+                   ;; '=' r0
+                   (r1 = (r0 == ?\t))
+-                  (if ((r0 == ? ) | r1)
++                  (if ((r0 == ?\s) | r1)
+                       ;; '=' r0:[\t ]
+                       ;; Skip transport-padding.
+                       ;; It should check CR LF after
+@@ -647,7 +637,7 @@
+                       (loop
+                        (read-if (r0 == ?\t)
+                                 (repeat)
+-                                (if (r0 == ? )
++                                (if (r0 == ?\s)
+                                     (repeat)
+                                   (break)))))
+                   ;; '=' [\t ]* r0:[^\t ]
+@@ -656,7 +646,7 @@
+                    ,@(mapcar
+                       (lambda (r0)
+                         (cond
+-                         ((eq r0 (char-int ?\r))
++                         ((eq r0 ?\r)
+                           (if input-crlf
+                               ;; '=' [\t ]* r0='\r'
+                               `((read r0)
+@@ -677,7 +667,7 @@
+                             `((write ?=)
+                               (read r0)
+                               (repeat))))
+-                         ((eq r0 (char-int ?\n))
++                         ((eq r0 ?\n)
+                           (if input-crlf
+                               ;; '=' [\t ]* r0='\n'
+                               ;; invalid input (bare LF found) -> 
+@@ -713,7 +703,7 @@
+                               ,(vconcat
+                                 (mapcar
+                                  (lambda (r0)
+-                                   (logior (lsh r0 4) tmp))
++                                   (logior (ash r0 4) tmp))
+                                  mel-ccl-16-table)))
+                           ;; '=' [\t ]* r1:r0:[0-9A-F] r2:[^0-9A-F]
+                           ;; invalid input
+@@ -729,9 +719,8 @@
+                (t
+                 ;; r0:[^\t\r -~]
+                 ;; invalid character found.
+-                ;; -> ignore.
+-                `((read r0)
+-                  (repeat))))))
++                ;; -> output as is.
++                `((write-read-repeat r0))))))
+           mel-ccl-256-table))
+       ;; r1[0]:[\t ]
+       (loop
+@@ -756,7 +745,7 @@
+                               (break))))))
+                    `((read r0)
+                      (if (r0 == ?\ )
+-                         (,reg |= ,(lsh 1 bit))
++                         (,reg |= ,(ash 1 bit))
+                        (if (r0 != ?\t)
+                            ((r6 = ,(+ (* regnum 28) bit))
+                             (break)))))))
+@@ -800,17 +789,14 @@
+              'append
+              (mapcar
+               (lambda (bit)
+-                `((if (,reg & ,(lsh 1 bit))
++                `((if (,reg & ,(ash 1 bit))
+                       (write ?\ )
+                     (write ?\t))
+                   (if (r6 == ,(+ (* regnum 28) bit 1))
+                       (repeat))))
+               mel-ccl-28-table))))
+         '(0 1 2 3 4)))
+-      (repeat)
+-      ))))
+-
+-)
++      (repeat))))))
+ 
+ (define-ccl-program mel-ccl-encode-quoted-printable-crlf-crlf
+   (mel-ccl-encode-quoted-printable-generic t t))
+@@ -902,7 +888,7 @@
+      (decode-coding-string
+       (with-temp-buffer
+       (set-buffer-multibyte nil)
+-      (insert-file-contents-as-binary filename)
++      (insert-file-contents-literally filename)
+       (buffer-string))
+       'mel-ccl-quoted-printable-lf-lf-rev)))
+ 
+@@ -914,8 +900,7 @@
+    'quoted-printable-ccl-encode-region)
+   (mel-define-method-function
+    (mime-insert-encoded-file filename (nil "quoted-printable"))
+-   'quoted-printable-ccl-insert-encoded-file)
+-  )
++   'quoted-printable-ccl-insert-encoded-file))
+ 
+ (defun quoted-printable-ccl-decode-string (string)
+   "Decode quoted-printable encoded STRING."
+@@ -932,7 +917,11 @@
+ (defun quoted-printable-ccl-write-decoded-region (start end filename)
+   "Decode quoted-printable encoded current region and write out to FILENAME."
+   (interactive "*r\nFWrite decoded region to file: ")
+-  (let ((coding-system-for-write 'mel-ccl-quoted-printable-lf-lf-rev)
++  (defvar jam-zcat-filename-list)
++  (let ((coding-system-for-write
++       (if (coding-system-p 'mel-ccl-quoted-printable-lf-lf-rev-unix)
++           'mel-ccl-quoted-printable-lf-lf-rev-unix
++         'mel-ccl-quoted-printable-lf-lf-rev))
+       jka-compr-compression-info-list jam-zcat-filename-list)
+     (write-region start end filename)))
+ 
+@@ -967,19 +956,16 @@
+    string
+    'mel-ccl-uq-rev))
+ 
+-(unless (featurep 'xemacs)
+-  (defun q-encoding-ccl-encoded-length (string &optional mode)
+-    (let ((status [nil nil nil nil nil nil nil nil nil]))
+-      (fillarray status nil)          ; XXX: Is this necessary?
+-      (ccl-execute-on-string
+-       (cond
+-      ((eq mode 'text) 'mel-ccl-count-uq)
+-      ((eq mode 'comment) 'mel-ccl-count-cq)
+-      (t 'mel-ccl-count-pq))
+-       status
+-       string)
+-      (aref status 0)))
+-  )
++(defun q-encoding-ccl-encoded-length (string &optional mode)
++  (let ((status (make-vector 9 nil)))
++    (ccl-execute-on-string
++     (cond
++      ((eq mode 'text) 'mel-ccl-count-uq)
++      ((eq mode 'comment) 'mel-ccl-count-cq)
++      (t 'mel-ccl-count-pq))
++     status
++     string)
++    (aref status 0)))
+ 
+ (mel-define-method-function (encoded-text-encode-string string (nil "Q"))
+                           'q-encoding-ccl-encode-string)
Index: pkgsrc/devel/flim/patches/patch-mel-q.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-mel-q.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-mel-q.el    Sun Sep  3 14:58:38 2023
@@ -0,0 +1,178 @@
+$NetBSD: patch-mel-q.el,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/mel-q.el        2005-07-06 11:09:04.000000000 +0900
++++ ./mel-q.el 2023-08-31 08:29:38.599294148 +0900
+@@ -1,4 +1,4 @@
+-;;; mel-q.el --- Quoted-Printable encoder/decoder.
++;;; mel-q.el --- Quoted-Printable encoder/decoder.  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1995,96,97,98,99,2000,2001 Free Software Foundation, Inc.
+ 
+@@ -26,12 +26,7 @@
+ ;;; Code:
+ 
+ (require 'mime-def)
+-(require 'path-util)
+-(eval-when-compile
+-  ;; XXX: should provide char-list instead of string-to-char-list.
+-  ;; XXx: and also the macro `as-binary-process' should be provided
+-  ;; XXx: by the module "pces" which will be loaded by way of "poem".
+-  (require 'poem))
++(require 'pces)
+ 
+ 
+ ;;; @ Quoted-Printable encoder
+@@ -40,7 +35,8 @@
+ (defsubst quoted-printable-quote-char (character)
+   (concat
+    "="
+-   (char-to-string (aref quoted-printable-hex-chars (ash character -4)))
++   (char-to-string (aref quoted-printable-hex-chars
++                       (ash (logand character 255) -4)))
+    (char-to-string (aref quoted-printable-hex-chars (logand character 15)))))
+ 
+ (defun quoted-printable-internal-encode-region (start end)
+@@ -58,9 +54,9 @@
+           (forward-char)
+           (setq col 0))
+          (t
+-          (setq chr (char-after (point)))
++          (setq chr (logand (following-char) 255))
+           (cond
+-           ((and (memq chr '(?  ?\t)) ; encode WSP char before CRLF.
++           ((and (memq chr '(?\s ?\t))        ; encode WSP char before CRLF.
+                  (eq (char-after (1+ (point))) ?\n))
+             (forward-char)
+             (insert "=\n")
+@@ -71,7 +67,7 @@
+                  (eq (char-after (1+  (point))) ?r)
+                  (eq (char-after (+ 2 (point))) ?o)
+                  (eq (char-after (+ 3 (point))) ?m)
+-                 (eq (char-after (+ 4 (point))) ? ))
++                 (eq (char-after (+ 4 (point))) ?\s))
+             (delete-region (point)(1+ (point)))
+             (insert "=46")            ; moved to ?r.
+             (forward-char 4)          ; skip "rom ".
+@@ -112,9 +108,11 @@
+       (replace-match "")))))
+ 
+ 
++(declare-function exec-installed-p "path-util"
++                (file &optional paths suffixes))
++
+ (defvar quoted-printable-internal-encoding-limit
+-  (if (and (featurep 'xemacs)(featurep 'mule))
+-      0
++  (progn
+     (require 'path-util)
+     (if (exec-installed-p "mmencode")
+       1000
+@@ -173,8 +171,20 @@
+ (defsubst quoted-printable-hex-char-to-num (chr)
+   (cond ((<= ?a chr) (+ (- chr ?a) 10))
+       ((<= ?A chr) (+ (- chr ?A) 10))
+-      ((<= ?0 chr) (- chr ?0))
+-      ))
++      ((<= ?0 chr) (- chr ?0))))
++
++(eval-and-compile
++  (if (eval-when-compile
++      (> (string-to-char (string-as-multibyte "\200")) 128))
++      (defsubst quoted-printable-num-to-raw-byte-char (chr)
++      (if (and chr
++               (> chr 127))
++          (logior chr
++                  (eval-when-compile
++                    (- (string-to-char (string-as-multibyte "\200")) 128)))
++        chr))
++    (defsubst quoted-printable-num-to-raw-byte-char (chr)
++      chr)))
+ 
+ (defun quoted-printable-internal-decode-region (start end)
+   (save-excursion
+@@ -186,20 +196,21 @@
+        ((eolp)
+         ;; unfold soft line break.
+         (delete-region (1- (point))(1+ (point))))
+-       ((and (memq (char-after (point))
++       ((and (memq (following-char)
+                    (eval-when-compile
+                      ;; XXX: should provide char-list instead.
+-                     (string-to-char-list quoted-printable-hex-chars)))
++                     (string-to-list quoted-printable-hex-chars)))
+              (memq (char-after (1+ (point)))
+                    (eval-when-compile
+                      ;; XXX: should provide char-list instead.
+-                     (string-to-char-list quoted-printable-hex-chars))))
++                     (string-to-list quoted-printable-hex-chars))))
+         ;; encoded char.
+         (insert
+          (prog1
+-             (logior
+-              (ash (quoted-printable-hex-char-to-num (char-after (point))) 4)
+-              (quoted-printable-hex-char-to-num (char-after (1+ (point)))))
++             (quoted-printable-num-to-raw-byte-char
++              (logior
++               (ash (quoted-printable-hex-char-to-num (following-char)) 4)
++               (quoted-printable-hex-char-to-num (char-after (1+ (point))))))
+            (delete-region (1- (point))(+ 2 (point))))))
+        (t
+         ;; invalid encoding.
+@@ -295,33 +306,33 @@
+ `phrase'."
+   (let ((specials (cdr (or (assq mode q-encoding-special-chars-alist)
+                          (assq 'phrase q-encoding-special-chars-alist)))))
+-    (mapconcat (function
+-              (lambda (chr)
+-                (cond ((eq chr ? ) "_")
+-                      ((or (< chr 32) (< 126 chr)
+-                           (memq chr specials))
+-                       (quoted-printable-quote-char chr))
+-                      (t
+-                       (char-to-string chr)))))
++    (mapconcat (lambda (chr)
++               (cond ((eq chr ?\s) "_")
++                     ((or (< chr 32) (< 126 chr)
++                          (memq chr specials))
++                      (quoted-printable-quote-char chr))
++                     (t
++                      (char-to-string chr))))
+              string "")))
+ 
+ (defun q-encoding-decode-string (string)
+   "Decode STRING which is encoded in Q-encoding and return the result."
+   (let (q h l)
+-    (mapconcat (function
+-              (lambda (chr)
+-                (cond ((eq chr ?_) " ")
+-                      ((eq chr ?=)
+-                       (setq q t)
+-                       "")
+-                      (q (setq h (quoted-printable-hex-char-to-num chr))
+-                         (setq q nil)
+-                         "")
+-                      (h (setq l (quoted-printable-hex-char-to-num chr))
+-                         (prog1
+-                             (char-to-string (logior (ash h 4) l))
+-                           (setq h nil)))
+-                      (t (char-to-string chr)))))
++    (mapconcat (lambda (chr)
++               (cond ((eq chr ?_) " ")
++                     ((eq chr ?=)
++                      (setq q t)
++                      "")
++                     (q (setq h (quoted-printable-hex-char-to-num chr))
++                        (setq q nil)
++                        "")
++                     (h (setq l (quoted-printable-hex-char-to-num chr))
++                        (prog1
++                            (char-to-string
++                             (quoted-printable-num-to-raw-byte-char
++                              (logior (ash h 4) l)))
++                          (setq h nil)))
++                     (t (char-to-string chr))))
+              string "")))
+ 
+ (mel-define-method-function (encoded-text-encode-string string (nil "Q"))
Index: pkgsrc/devel/flim/patches/patch-mel-u.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-mel-u.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-mel-u.el    Sun Sep  3 14:58:38 2023
@@ -0,0 +1,12 @@
+$NetBSD: patch-mel-u.el,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/mel-u.el        2005-07-06 11:09:04.000000000 +0900
++++ ./mel-u.el 2023-08-31 08:29:38.600545058 +0900
+@@ -1,4 +1,4 @@
+-;;; mel-u.el --- uuencode encoder/decoder.
++;;; mel-u.el --- uuencode encoder/decoder.  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc.
+ 
Index: pkgsrc/devel/flim/patches/patch-mel.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-mel.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-mel.el      Sun Sep  3 14:58:38 2023
@@ -0,0 +1,327 @@
+$NetBSD: patch-mel.el,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/mel.el  2007-06-18 19:58:54.000000000 +0900
++++ ./mel.el   2023-08-31 08:29:38.601973143 +0900
+@@ -1,4 +1,4 @@
+-;;; mel.el --- A MIME encoding/decoding library.
++;;; mel.el --- A MIME encoding/decoding library.  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1995,1996,1997,1998,1999,2000 Free Software Foundation, Inc.
+ 
+@@ -27,6 +27,7 @@
+ 
+ (require 'mime-def)
+ (require 'alist)
++(require 'pces)
+ 
+ (defcustom mime-encoding-list
+   '("7bit" "8bit" "binary" "base64" "quoted-printable")
+@@ -42,8 +43,7 @@
+       (let (dest)
+       (mapatoms (lambda (sym)
+                   (or (eq sym nil)
+-                      (setq dest (cons (symbol-name sym) dest)))
+-                  )
++                      (setq dest (cons (symbol-name sym) dest))))
+                 (symbol-value (intern (format "%s-obarray" service))))
+       (let ((rest mel-encoding-module-alist)
+             pair)
+@@ -52,8 +52,7 @@
+             (or (member key dest)
+                 (<= (length key) 1)
+                 (setq dest (cons key dest))))
+-          (setq rest (cdr rest)))
+-        )
++          (setq rest (cdr rest))))
+       dest)
+     mime-encoding-list))
+ 
+@@ -73,6 +72,9 @@
+   (mel-find-function-from-obarray
+    (symbol-value (intern (format "%s-obarray" service))) encoding))
+ 
++(defun mel-prompt-for-encoding (&optional service)
++  (completing-read "Encoding: (default base64) "
++                 (mime-encoding-alist service) nil t nil nil "base64"))
+ 
+ ;;; @ setting for modules
+ ;;;
+@@ -86,7 +88,7 @@
+ 
+ (defun 8bit-write-decoded-region (start end filename)
+   "Decode and write current region encoded by \"8bit\" into FILENAME."
+-  (let ((coding-system-for-write 'raw-text)
++  (let ((coding-system-for-write 'no-conversion)
+       format-alist)
+     (write-region start end filename)))
+ 
+@@ -95,8 +97,8 @@
+                           'identity)
+ (mel-define-method-function (mime-decode-string string (nil "8bit"))
+                           'identity)
+-(mel-define-method mime-encode-region (start end (nil "8bit")))
+-(mel-define-method mime-decode-region (start end (nil "8bit")))
++(mel-define-method mime-encode-region (_start _end (nil "8bit")))
++(mel-define-method mime-decode-region (_start _end (nil "8bit")))
+ (mel-define-method-function (mime-insert-encoded-file filename (nil "8bit"))
+                           '8bit-insert-encoded-file)
+ (mel-define-method-function (mime-write-decoded-region
+@@ -112,6 +114,7 @@
+ 
+ (defun binary-write-decoded-region (start end filename)
+   "Decode and write current region encoded by \"binary\" into FILENAME."
++  (defvar jam-zcat-filename-list)
+   (let ((coding-system-for-write 'binary)
+       jka-compr-compression-info-list jam-zcat-filename-list)
+     (write-region start end filename)))
+@@ -142,86 +145,134 @@
+                           'identity)
+ (mel-define-method-function (mime-decode-string string (nil "binary"))
+                           'identity)
+-(mel-define-method mime-encode-region (start end (nil "binary")))
+-(mel-define-method mime-decode-region (start end (nil "binary")))
++(mel-define-method mime-encode-region (_start _end (nil "binary")))
++(mel-define-method mime-decode-region (_start _end (nil "binary")))
+ (mel-define-method-function (mime-insert-encoded-file filename (nil "binary"))
+                           'binary-insert-encoded-file)
+ (mel-define-method-function (mime-write-decoded-region
+                            start end filename (nil "binary"))
+                           'binary-write-decoded-region)
+ 
+-(defvar mel-b-builtin
+-   (and (fboundp 'base64-encode-string)
+-        (subrp (symbol-function 'base64-encode-string))))
+-
+-(when mel-b-builtin
+-  (mel-define-backend "base64")
+-  (mel-define-method-function (mime-encode-string string (nil "base64"))
++(defvar mel-b-builtin t)
++
++(defcustom mel-b-builtin-garbage-strategy 'asis
++"When non-nil, base64 decoder functions handle non-encoded
++garbage.  When value is asis decoders keep garbage and when value
++is discard decoders delete garbage."
++  :group 'mime
++  :type '(choice (const :tag "Keep as is" asis)
++               (const :tag "Discard" discard)
++               (const :tag "Not handled" nil)))
++
++(defvar mel-b-builtin-encoded-line-regexp "^[A-Za-z0-9+/]+=*[\t ]*\r?\n?")
++
++(mel-define-backend "base64")
++(mel-define-method-function (mime-encode-string string (nil "base64"))
+                             'base64-encode-string)
+-  (mel-define-method-function (mime-decode-string string (nil "base64"))
+-                            'base64-decode-string)
+-  (mel-define-method-function (mime-encode-region start end (nil "base64"))
+-                            'base64-encode-region)
+-  (mel-define-method-function (mime-decode-region start end (nil "base64"))
+-                            'base64-decode-region)  
+-  (mel-define-method mime-insert-encoded-file (filename (nil "base64"))
+-    "Encode contents of file FILENAME to base64, and insert the result.
+-It calls external base64 encoder specified by
+-`base64-external-encoder'.  So you must install the program (maybe
+-mmencode included in metamail or XEmacs package)."
+-    (interactive "*fInsert encoded file: ")
+-    (insert (base64-encode-string
+-           (with-temp-buffer
+-             (set-buffer-multibyte nil)
+-             (binary-insert-encoded-file filename)
+-             (buffer-string))))
+-    (or (bolp) (insert ?\n)))
+-  (mel-define-method mime-write-decoded-region (start end filename
+-                                                    (nil "base64"))
+-    "Decode the region from START to END and write out to FILENAME."
+-    (interactive "*r\nFWrite decoded region to file: ")
+-    (let ((str (buffer-substring start end)))
+-      (with-temp-buffer
+-      (insert str)
+-      (base64-decode-region (point-min) (point-max))
+-      (write-region-as-binary (point-min) (point-max) filename))))
+-    
+-  ;; (mel-define-method-function (encoded-text-encode-string string (nil "B"))
+-  ;;                             'base64-encode-string)
+-  (mel-define-method encoded-text-decode-string (string (nil "B"))
+-    (if (string-match (eval-when-compile
+-                      (concat "\\`" B-encoded-text-regexp "\\'"))
+-                    string)
++(defun mel-b-builtin-decode-string (string)
++  "Decode base64 encoded STRING with garbage handling.
++Garbage handling strategy is decided by `mel-b-builtin-garbage-strategy'.
++Return decoded string."
++  (if (null mel-b-builtin-garbage-strategy)
++      (base64-decode-string string)
++    (condition-case error
+       (base64-decode-string string)
+-      (error "Invalid encoded-text %s" string)))
+-  )
++      (error
++       (if (string-match mel-b-builtin-encoded-line-regexp string)
++         (let ((start (match-beginning 0))
++               end)
++           (message "Base64 encoded string has garbage")
++           (while (and (< (setq end (match-end 0)) (length string))
++                       (eq end
++                           (and (string-match
++                                 mel-b-builtin-encoded-line-regexp
++                                 string end)
++                                (match-beginning 0)))))
++           (if (eq mel-b-builtin-garbage-strategy 'discard)
++               (base64-decode-string (substring string start end))
++             (concat (substring string 0 start)
++                     (base64-decode-string (substring string start end))
++                     (substring string end))))
++       (signal (car error) (cdr error)))))))
++(mel-define-method-function (mime-decode-string string (nil "base64"))
++                          'mel-b-builtin-decode-string)
++(mel-define-method-function (mime-encode-region start end (nil "base64"))
++                          'base64-encode-region)
++(defun mel-b-builtin-decode-region (start end)
++  "Decode base64 encoded region between START and END with garbage handling.
++Garbage handling strategy is decided by `mel-b-builtin-garbage-strategy'."
++  (if (null mel-b-builtin-garbage-strategy)
++      (base64-decode-region start end)
++    (condition-case error
++      (base64-decode-region start end)
++      (error
++       (save-excursion
++       (let ((start (min start end))
++             (end (max start end))
++             base64-start)
++         (goto-char start)
++         (if (re-search-forward mel-b-builtin-encoded-line-regexp end t)
++             (progn
++               (message "Base64 encoded region contains garbage")
++               (setq base64-start (match-beginning 0))
++               (while (eq (point)
++                          (and (re-search-forward
++                                mel-b-builtin-encoded-line-regexp end t)
++                               (match-beginning 0))))
++               (when (eq mel-b-builtin-garbage-strategy 'discard)
++                 (delete-region (match-end 0) end))
++               (base64-decode-region base64-start (point))
++               (when (eq mel-b-builtin-garbage-strategy 'discard)
++                 (delete-region start base64-start)))
++           (signal (car error) (cdr error)))))))))
++(mel-define-method-function (mime-decode-region start end (nil "base64"))
++                          'mel-b-builtin-decode-region)  
++(mel-define-method mime-insert-encoded-file (filename (nil "base64"))
++  "Encode contents of file FILENAME to base64, and insert the result."
++  (interactive "*fInsert encoded file: ")
++  ;; No need to make buffer unibyte if binary-insert-encoded-file only
++  ;; inserts single-byte characters.
++  (save-restriction
++    (narrow-to-region (point) (point))
++    (binary-insert-encoded-file filename)
++    (base64-encode-region (point-min) (point-max))
++    (goto-char (point-max)))
++  (or (bolp) (insert ?\n)))
++(mel-define-method mime-write-decoded-region (start end filename
++                                                  (nil "base64"))
++  "Decode the region from START to END and write out to FILENAME."
++  (interactive "*r\nFWrite decoded region to file: ")
++  (let ((buffer (current-buffer)))
++    (with-temp-buffer
++      (insert-buffer-substring buffer start end)
++      (mel-b-builtin-decode-region (point-min) (point-max))
++      (write-region-as-binary (point-min) (point-max) filename))))
++
++;; (mel-define-method-function (encoded-text-encode-string string (nil "B"))
++;;                             'base64-encode-string)
++(mel-define-method encoded-text-decode-string (string (nil "B"))
++  (if (string-match (eval-when-compile
++                    (concat "\\`" B-encoded-text-regexp "\\'"))
++                  string)
++      (base64-decode-string string)
++    (error "Invalid encoded-text %s" string)))
++
+ 
+-(mel-use-module 'mel-b-el '("base64" "B"))
+ (mel-use-module 'mel-q '("quoted-printable" "Q"))
+ (mel-use-module 'mel-g '("x-gzip64"))
+ (mel-use-module 'mel-u '("x-uue" "x-uuencode"))
+ 
+-(defvar mel-b-ccl-module
+-  (and (featurep 'mule)
+-       (progn
+-       (require 'path-util)
+-       (module-installed-p 'mel-b-ccl))))
++(declare-function module-installed-p "path-util"
++                (module &optional paths))
+ 
+ (defvar mel-q-ccl-module
+-  (and (featurep 'mule)
+-       (progn
+-       (require 'path-util)
+-       (module-installed-p 'mel-q-ccl))))
+-
+-(when mel-b-ccl-module
+-  (mel-use-module 'mel-b-ccl '("base64" "B")))
++  (progn
++    (require 'path-util)
++    (module-installed-p 'mel-q-ccl)))
+ 
+ (when mel-q-ccl-module
+   (mel-use-module 'mel-q-ccl '("quoted-printable" "Q")))
+ 
+-(when base64-dl-module
+-  (mel-use-module 'mel-b-dl '("base64" "B")))
+-
+ 
+ ;;; @ region
+ ;;;
+@@ -232,9 +283,7 @@
+ ENCODING must be string."
+   (interactive
+    (list (region-beginning)(region-end)
+-       (completing-read "Encoding: "
+-                        (mime-encoding-alist)
+-                        nil t "base64")))
++       (mel-prompt-for-encoding)))
+   (funcall (mel-find-function 'mime-encode-region encoding) start end))
+ 
+ 
+@@ -244,9 +293,7 @@
+ ENCODING must be string."
+   (interactive
+    (list (region-beginning)(region-end)
+-       (completing-read "Encoding: "
+-                        (mime-encoding-alist 'mime-decode-region)
+-                        nil t "base64")))
++       (mel-prompt-for-encoding 'mime-decode-region)))
+   (funcall (mel-find-function 'mime-decode-region encoding)
+          start end))
+ 
+@@ -299,7 +346,7 @@
+     (while (< i len)
+       (setq chr (aref string i))
+       (if (or (Q-encoding-printable-char-p chr mode)
+-            (eq chr ? ))
++            (eq chr ?\s))
+         (setq l (+ l 1))
+       (setq l (+ l 3)))
+       (setq i (+ i 1)))
+@@ -314,9 +361,7 @@
+   "Insert file FILENAME encoded by ENCODING format."
+   (interactive
+    (list (read-file-name "Insert encoded file: ")
+-       (completing-read "Encoding: "
+-                        (mime-encoding-alist)
+-                        nil t "base64")))
++       (mel-prompt-for-encoding)))
+   (funcall (mel-find-function 'mime-insert-encoded-file encoding)
+          filename))
+ 
+@@ -328,9 +373,7 @@
+   (interactive
+    (list (region-beginning)(region-end)
+        (read-file-name "Write decoded region to file: ")
+-       (completing-read "Encoding: "
+-                        (mime-encoding-alist 'mime-write-decoded-region)
+-                        nil t "base64")))
++       (mel-prompt-for-encoding 'mime-write-decoded-region)))
+   (funcall (mel-find-function 'mime-write-decoded-region encoding)
+          start end filename))
+ 
Index: pkgsrc/devel/flim/patches/patch-mime-conf.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-mime-conf.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-mime-conf.el        Sun Sep  3 14:58:38 2023
@@ -0,0 +1,261 @@
+$NetBSD: patch-mime-conf.el,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/mime-conf.el    2005-07-06 11:09:04.000000000 +0900
++++ ./mime-conf.el     2023-08-31 08:29:38.602782237 +0900
+@@ -1,4 +1,4 @@
+-;;; mime-conf.el --- mailcap parser and MIME playback configuration
++;;; mime-conf.el --- mailcap parser and MIME playback configuration  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1997,1998,1999,2000,2004 Free Software Foundation, Inc.
+ 
+@@ -34,7 +34,7 @@
+ ;;;
+ 
+ (defsubst mime-mailcap-skip-comment ()
+-  (let ((chr (char-after (point))))
++  (let ((chr (following-char)))
+     (when (and chr
+              (or (= chr ?\n)
+                  (= chr ?#)))
+@@ -50,8 +50,7 @@
+       (let ((beg (match-beginning 0))
+           (end (match-end 0)))
+       (goto-char end)
+-      (buffer-substring beg end)
+-      )))
++      (buffer-substring beg end))))
+ 
+ 
+ ;;; @ typefield
+@@ -60,17 +59,15 @@
+ (defsubst mime-mailcap-look-at-type-field ()
+   (let ((type (mime-mailcap-look-at-token)))
+     (if type
+-      (if (eq (char-after (point)) ?/)
++      (if (eq (following-char) ?/)
+           (progn
+             (forward-char)
+             (let ((subtype (mime-mailcap-look-at-token)))
+               (if subtype
+                   (cons (cons 'type (intern type))
+                         (unless (string= subtype "*")
+-                          (list (cons 'subtype (intern subtype)))
+-                          )))))
+-        (list (cons 'type (intern type)))
+-        ))))
++                          (list (cons 'subtype (intern subtype))))))))
++        (list (cons 'type (intern type)))))))
+ 
+ 
+ ;;; @ field separator
+@@ -87,29 +84,27 @@
+ ;;;
+ 
+ (defsubst mime-mailcap-look-at-schar ()
+-  (let ((chr (char-after (point))))
++  (let ((chr (following-char)))
+     (if (and chr
+-           (>= chr ? )
++           (>= chr ?\s)
+            (/= chr ?\;)
+-           (/= chr ?\\)
+-           )
++           (/= chr ?\\))
+       (prog1
+           chr
+         (forward-char)))))
+ 
+ (defsubst mime-mailcap-look-at-qchar ()
+-  (when (eq (char-after (point)) ?\\)
++  (when (eq (following-char) ?\\)
+     (prog2
+       (forward-char)
+-      (char-after (point))
++      (following-char)
+       (forward-char))))
+ 
+ (defsubst mime-mailcap-look-at-mtext ()
+   (let ((beg (point)))
+     (while (or (mime-mailcap-look-at-qchar)
+              (mime-mailcap-look-at-schar)))
+-    (buffer-substring beg (point))
+-    ))
++    (buffer-substring beg (point))))
+ 
+ 
+ ;;; @ field
+@@ -123,10 +118,8 @@
+                          (goto-char (match-end 0))
+                          (mime-mailcap-look-at-mtext))))
+             (if value
+-                (cons (intern token) value)
+-              ))
+-        (list (intern token))
+-        ))))
++                (cons (intern token) value)))
++        (list (intern token))))))
+ 
+ 
+ ;;; @ mailcap entry
+@@ -139,10 +132,8 @@
+             fields field)
+         (when view
+           (while (and (mime-mailcap-skip-field-separator)
+-                      (setq field (mime-mailcap-look-at-field))
+-                      )
+-            (setq fields (cons field fields))
+-            )
++                      (setq field (mime-mailcap-look-at-field)))
++            (setq fields (cons field fields)))
+           (nconc type
+                  (list (cons 'view view))
+                  fields))))))
+@@ -164,15 +155,12 @@
+     (let (entries entry)
+       (while (progn
+              (while (mime-mailcap-skip-comment))
+-             (setq entry (mime-mailcap-look-at-entry))
+-             )
++             (setq entry (mime-mailcap-look-at-entry)))
+       (setq entries (cons entry entries))
+-      (forward-line)
+-      )
++      (forward-line))
+       (cond ((functionp order) (sort entries order))
+           ((null order) (nreverse entries))
+-          (t entries)
+-          ))))
++          (t entries)))))
+ 
+ 
+ ;;;###autoload
+@@ -189,8 +177,7 @@
+       (setq filename mime-mailcap-file))
+   (with-temp-buffer
+     (insert-file-contents filename)
+-    (mime-parse-mailcap-buffer (current-buffer) order)
+-    ))
++    (mime-parse-mailcap-buffer (current-buffer) order)))
+ 
+ 
+ ;;;###autoload
+@@ -203,9 +190,9 @@
+ SITUATION is an association-list about information of entity.  Its key
+ may be:
+ 
+-      'type           primary media-type
+-      'subtype        media-subtype
+-      'filename       filename
++      \\='type                primary media-type
++      \\='subtype     media-subtype
++      \\='filename    filename
+       STRING          parameter of Content-Type field"
+   (let ((i 0)
+       (len (length mtext))
+@@ -213,58 +200,52 @@
+       dest)
+     (while (< i len)
+       (let ((chr (aref mtext i)))
+-      (cond ((eq chr ?%)
+-             (setq i (1+ i)
+-                   chr (aref mtext i))
+-             (cond ((eq chr ?s)
+-                    (let ((file (cdr (assq 'filename situation))))
+-                      (if (null file)
+-                          (error "'filename is not specified in situation.")
+-                        (setq dest (concat dest
+-                                           (substring mtext p (1- i))
+-                                           (shell-quote-argument file))
+-                              i (1+ i)
+-                              p i)
+-                        )))
+-                   ((eq chr ?t)
+-                    (let ((type (or (mime-type/subtype-string
+-                                     (cdr (assq 'type situation))
+-                                     (cdr (assq 'subtype situation)))
+-                                    "text/plain")))
+-                      (setq dest (concat dest
+-                                         (substring mtext p (1- i))
+-                                         type)
+-                            i (1+ i)
+-                            p i)
+-                      ))
+-                   ((eq chr ?\{)
+-                    (setq i (1+ i))
+-                    (if (not (string-match "}" mtext i))
+-                        (error "parse error!!!")
+-                      (let* ((me (match-end 0))
+-                             (attribute (substring mtext i (1- me)))
+-                             (parameter (cdr (assoc attribute situation))))
+-                        (if (null parameter)
+-                            (error "\"%s\" is not specified in situation."
+-                                   attribute)
+-                          (setq dest (concat dest
+-                                             (substring mtext p (- i 2))
+-                                             parameter)
+-                                i me
+-                                p i)
+-                          )
+-                        )))
+-                   (t (error "Invalid sequence `%%%c'." chr))
+-                   ))
+-            ((eq chr ?\\)
+-             (setq dest (concat dest (substring mtext p i))
+-                   p (1+ i)
+-                   i (+ i 2))
+-             )
+-            (t (setq i (1+ i)))
+-            )))
+-    (concat dest (substring mtext p))
+-    ))
++      (cond
++       ((eq chr ?%)
++        (setq i (1+ i)
++              chr (aref mtext i))
++        (cond
++         ((eq chr ?s)
++          (let ((file (cdr (assq 'filename situation))))
++            (if file
++                (setq file (shell-quote-argument file))
++              (error "'filename is not specified in situation."))
++            (setq dest (concat dest
++                               (substring mtext p (1- i))
++                               ;; if the situation (wrongly) quotes
++                               ;; the argument, fix it.
++                               (if (eq ?' (aref mtext (- i 2)))
++                                   (concat "'" file "'")
++                                 file))
++                  i (1+ i)
++                  p i)))
++         ((eq chr ?t)
++          (let ((type (or (mime-type/subtype-string
++                           (cdr (assq 'type situation))
++                           (cdr (assq 'subtype situation)))
++                          "text/plain")))
++            (setq dest (concat dest (substring mtext p (1- i)) type)
++                  i (1+ i)
++                  p i)))
++         ((eq chr ?\{)
++          (setq i (1+ i))
++          (unless (string-match "}" mtext i)
++            (error "parse error!!!"))
++          (let* ((me (match-end 0))
++                 (attribute (substring mtext i (1- me)))
++                 (parameter (cdr (assoc attribute situation))))
++            (unless parameter
++              (error "\"%s\" is not specified in situation." attribute))
++            (setq dest (concat dest (substring mtext p (- i 2)) parameter)
++                  i me
++                  p i)))
++         (t (error "Invalid sequence `%%%c'." chr))))
++       ((eq chr ?\\)
++        (setq dest (concat dest (substring mtext p i))
++              p (1+ i)
++              i (+ i 2)))
++       (t (setq i (1+ i))))))
++    (concat dest (substring mtext p))))
+ 
+ 
+ ;;; @ end
Index: pkgsrc/devel/flim/patches/patch-mime-def.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-mime-def.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-mime-def.el Sun Sep  3 14:58:38 2023
@@ -0,0 +1,158 @@
+$NetBSD: patch-mime-def.el,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/mime-def.el     2007-09-06 17:04:09.000000000 +0900
++++ ./mime-def.el      2023-08-31 08:29:38.604422981 +0900
+@@ -1,4 +1,4 @@
+-;;; mime-def.el --- definition module about MIME -*- coding: iso-8859-4; -*-
++;;; mime-def.el --- definition module about MIME -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1995,96,97,98,99,2000,2001,2002,2003,2004,2005,2006
+ ;;   Free Software Foundation, Inc.
+@@ -33,7 +33,7 @@
+ (eval-when-compile (require 'luna))   ; luna-arglist-to-arguments
+ 
+ (eval-and-compile
+-  (defconst mime-library-product ["FLIM" (1 14 9) "Goj�"]
++  (defconst mime-library-product ["FLIM-LB" (1 14 9) "Gojō"]
+     "Product name, version number and code name of MIME-library package."))
+ 
+ (defmacro mime-product-name (product)
+@@ -96,8 +96,7 @@
+   '(("X-Nsubject" . iso-2022-jp-2)
+     ("Newsgroups" . nil)
+     ("Message-ID" . nil)
+-    (t            . mime)
+-    )
++    (t            . mime))
+   "*Alist to specify field encoding method.
+ Its key is field-name, value is encoding method.
+ 
+@@ -130,9 +129,6 @@
+ (defsubst regexp-or (&rest args)
+   (concat "\\(" (mapconcat (function identity) args "\\|") "\\)"))
+ 
+-(or (fboundp 'char-int)
+-    (defalias 'char-int 'identity))
+-
+ 
+ ;;; @ MIME constants
+ ;;;
+@@ -142,8 +138,14 @@
+ (defconst mime-token-regexp
+   (concat "[^" mime-tspecial-char-list "\000-\040]+"))
+ (defconst mime-attribute-char-regexp
+-  (concat "[^" mime-tspecial-char-list "\000-\040"
++  (concat "[^" mime-tspecial-char-list
++        "*'%"                         ; introduced in RFC 2231.
++        "\000-\040"
++        "]"))
++(defconst mime-non-attribute-char-regexp
++  (concat "[" mime-tspecial-char-list
+         "*'%"                         ; introduced in RFC 2231.
++        "\000-\040\177-\377"          ; non-printable, non-US-ASCII.
+         "]"))
+ 
+ (defconst mime-charset-regexp
+@@ -151,7 +153,8 @@
+         "*'%"                         ; should not include "%"?
+         "]+"))
+ 
+-;; More precisely, length of "[A-Za-z]+" is limited to at most 8.
++;; More precisely, length of each "[A-Za-z]+" is limited to at most 8.
++;; See RFC 3066 "Tags for the Identification of Languages".
+ ;; (defconst mime-language-regexp "[A-Za-z]+\\(-[A-Za-z]+\\)*")
+ (defconst mime-language-regexp "[-A-Za-z]+")
+ 
+@@ -275,7 +278,8 @@
+ 
+ (make-variable-buffer-local 'mime-message-structure)
+ 
+-(make-obsolete-variable 'mime-message-structure "should not use it.")
++(make-obsolete-variable 'mime-message-structure
++                      "should not use it." "26 May 1999")
+ 
+ 
+ ;;; @ for mel-backend
+@@ -294,9 +298,7 @@
+          `((defun ,name ,args
+              ,@rest
+              (funcall (mel-find-function ',name ,(car (last args)))
+-                      ,@(luna-arglist-to-arguments (butlast args)))
+-             )))
+-     ))
++                      ,@(luna-arglist-to-arguments (butlast args))))))))
+ 
+ (put 'mel-define-service 'lisp-indent-function 'defun)
+ 
+@@ -310,10 +312,8 @@
+         (while (and rest
+                     (progn
+                       (require (car rest))
+-                      (null (setq f (intern-soft encoding ob-array)))
+-                      ))
+-          (setq rest (cdr rest))
+-          )
++                      (null (setq f (intern-soft encoding ob-array)))))
++          (setq rest (cdr rest)))
+         f))))
+ 
+ (defsubst mel-copy-method (service src-backend dst-backend)
+@@ -323,8 +323,7 @@
+     (when f
+       (setq sym (intern dst-backend oa))
+       (or (fboundp sym)
+-        (fset sym (symbol-function f))
+-        ))))
++        (fset sym (symbol-function f))))))
+        
+ (defsubst mel-copy-backend (src-backend dst-backend)
+   (let ((services mel-service-list))
+@@ -338,8 +337,7 @@
+ Each parent must be backend name (string)."
+   (cons 'progn
+       (mapcar (lambda (parent)
+-                `(mel-copy-backend ,parent ,type)
+-                )
++                `(mel-copy-backend ,parent ,type))
+               parents)))
+ 
+ (defmacro mel-define-method (name args &rest body)
+@@ -380,19 +378,25 @@
+        (class (nth 1 specializer)))
+     `(progn
+        (define-function ,function
+-       (intern ,class ,(intern (format "%s-obarray" name))))
+-       )))
++       (intern ,class ,(intern (format "%s-obarray" name)))))))
+ 
+-(defvar base64-dl-module
+-  (if (and (fboundp 'base64-encode-string)
+-         (subrp (symbol-function 'base64-encode-string)))
+-      nil
+-    (if (fboundp 'dynamic-link)
+-      (let ((path (expand-file-name "base64.so" exec-directory)))
+-        (and (file-exists-p path)
+-             path)
+-        ))))
++(defvar base64-dl-module nil)
+ 
++(defsubst mime-charset-decode-string (string charset &optional lbt)
++  "Decode the STRING as MIME CHARSET.
++Buffer's multibyteness is ignored."
++  (let ((cs (mime-charset-to-coding-system charset lbt)))
++    (if cs
++      (decode-coding-string string cs)
++      string)))
++
++(defsubst mime-charset-encode-string (string charset &optional lbt)
++  "Encode the STRING as MIME CHARSET.
++Buffer's multibyteness is ignored."
++  (let ((cs (mime-charset-to-coding-system charset lbt)))
++    (if cs
++      (encode-coding-string string cs)
++      string)))
+ 
+ ;;; @ end
+ ;;;
Index: pkgsrc/devel/flim/patches/patch-mime-en.texi
diff -u /dev/null pkgsrc/devel/flim/patches/patch-mime-en.texi:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-mime-en.texi        Sun Sep  3 14:58:38 2023
@@ -0,0 +1,387 @@
+$NetBSD: patch-mime-en.texi,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/mime-en.texi    2023-09-02 12:45:03.629296047 +0900
++++ ./mime-en.texi     2023-08-31 08:29:38.606447201 +0900
+@@ -1,26 +1,30 @@
+-\input texinfo.tex
++\input texinfo-ja @c -*-texinfo -*- coding: utf-8 -*-
+ @c Generated automatically from mime-en.sgml by sinfo 3.7.
+ @setfilename mime-en.info
+-@settitle{FLIM 1.14 Reference Manual about MIME Features}
++@settitle FLIM-LB 1.14 Reference Manual about MIME Features
++@documentencoding utf-8
++@documentlanguage en
++@dircategory GNU Emacs Lisp
++@direntry
++* FLIM-LB (en): (mime-en).         Internet message library.
++@end direntry
+ @titlepage
+-@title FLIM 1.14 Reference Manual about MIME Features
++@title FLIM-LB 1.14 Reference Manual about MIME Features
+ @author MORIOKA Tomohiko <morioka@@jaist.ac.jp>
+-@subtitle 1999-01-27
++@author Kazuhiro Ito
++@subtitle 2020-09-17
+ @end titlepage
+ @node Top, Introduction, (dir), (dir)
+-@top FLIM 1.14 Reference Manual about MIME Features
++@top FLIM-LB 1.14 Reference Manual about MIME Features
+ 
+ @ifinfo
+-@direntry
+-* FLIM: (mime-en).     FLIM, a fundamental library to process Internet Messages for GNU Emacsen.
+-@end direntry
+ 
+-This file documents MIME features of FLIM, a fundamental library to
++This file documents MIME features of FLIM-LB, a fundamental library to
+ process Internet Messages for GNU Emacsen.
+ @end ifinfo
+ 
+ @menu
+-* Introduction::                What is FLIM?
++* Introduction::                What is FLIM-LB?
+ * How to use::                  How to use MIME features
+ * Entity::                      Message and Entity
+ * Content-Type::                Information of Content-Type field
+@@ -35,10 +39,11 @@
+ @end menu
+ 
+ @node Introduction, How to use, Top, Top
+-@chapter What is FLIM?
++@chapter What is FLIM-LB?
+ 
+ FLIM is a library to provide basic features about message
+-representation or encoding.
++representation or encoding.  FLIM-LB is a variant of FLIM, which
++features supports to latest Emacs.
+ 
+ 
+ @node How to use, Entity, Introduction, Top
+@@ -462,7 +467,7 @@
+ representations for their purposes.@refill
+ 
+ Each entity has @strong{representation-type}.  It must be specified when
+-an entity is created. (cf. @ref{Entity Creation}) @refill
++an entity is created. (cf. @ref{Entity creation}) @refill
+ 
+ Functions about entity are implemented by request processing to the
+ entity.  Each entity knows its representation-type.  Each entity calls
+@@ -1053,7 +1058,7 @@
+ @menu
+ * Glossary::                    
+ * Bug report::                  How to report bugs
+-* CVS::                         CVS based development
++* GitHub::                      GitHub based development
+ * History::                     History of FLIM
+ @end menu
+ 
+@@ -1104,7 +1109,7 @@
+ Base64 (@ref{Base64}) for 7bit data.@refill
+ 
+ However if there are too long lines, it can not translate by 7bit MTA
+-even if it is 7bit data.  RFC 821 (@ref{RFC 821}) and RFC 2045 (@ref{RFC 2045}) require lines in 7bit data must be less than 998 bytes.  So if a
++even if it is 7bit data.  RFC 822 (@ref{RFC 822}) and RFC 2045 (@ref{RFC 2045}) require lines in 7bit data must be less than 998 bytes.  So if a
+ ``7bit data'' has a line more than 999 bytes, it is regarded as binary
+ (@ref{binary}).  For example, Postscript file should be encoded by
+ Quoted-Printable.
+@@ -1124,7 +1129,7 @@
+ 128 .. 159, and space represented by 32, and graphic characters between
+ 33 .. 236 and 160 .. 255 are called @strong{8bit (textual) string}.@refill
+ 
+-For example, iso-8859-1 (@ref{iso-8859-1}) or euc-kr (@ref{euc-kr}) are
++For example, iso-8859-1 or euc-kr are
+ coded-character-set represented by 8bit textual string.@refill
+ 
+ Traditional Internet MTA (@ref{MTA}) can translate only 7bit
+@@ -1149,7 +1154,7 @@
+ 
+ @strong{ASCII} is a 94-character set contains primary latin characters
+ (A-Z, a-z), numbers and some characters.  It is a standard of the United
+-States of America.  It is a variant of ISO 646 (@ref{ISO 646}).
++States of America.  It is a variant of ISO 646.
+ 
+ 
+ @noindent
+@@ -1215,7 +1220,7 @@
+ @cindex media-type
+ 
+ @strong{media-type} specifies the nature of the data in the body of MIME
+-(@ref{MIME}) entity (@ref{entity}).  It consists of @strong{type} and
++(@ref{MIME}) entity (@ref{Entity}).  It consists of @strong{type} and
+ @strong{subtype}.  It is defined in RFC 2046 (@ref{RFC 2046}).@refill
+ 
+ Currently there are following standard primary-types:
+@@ -1232,15 +1237,15 @@
+ @item
+ @strong{application}
+ @item
+-@strong{multipart} (@ref{multipart})
++@strong{multipart}
+ @item
+ @strong{message}
+ @end itemize
+ 
+ 
+ And there are various subtypes, for example, application/octet-stream,
+-audio/basic, image/jpeg, multipart/mixed (@ref{multipart/mixed}),
+-text/plain (@ref{text/plain}), video/mpeg...  @refill
++audio/basic, image/jpeg, multipart/mixed,
++text/plain, video/mpeg...  @refill
+ 
+ You can refer registered media types at MEDIA TYPES
+ (ftp://ftp.isi.edu/in-notes/iana/assignments/media-types).@refill
+@@ -1302,9 +1307,9 @@
+ 
+ It is defined in RFC 2045 (@ref{RFC 2045}).@refill
+ 
+-iso-2022-jp (@ref{iso-2022-jp}) or euc-kr (@ref{euc-kr}) are kinds of
++iso-2022-jp or euc-kr are kinds of
+ it.  (In this document, MIME charsets are written by small letters to
+-distinguish graphic character set (@ref{graphic character set}).  For
++distinguish graphic character set.  For
+ example, ISO 8859-1 is a graphic character set, and iso-8859-1 is a MIME
+ charset)
+ 
+@@ -1461,7 +1466,7 @@
+ @subsection plain text
+ 
+ A textual data represented by only coded character set (@ref{coded character set}).  It does not have information about font or
+-typesetting.  (cf. @ref{text/plain})
++typesetting.
+ 
+ 
+ 
+@@ -1474,8 +1479,8 @@
+ written by English or other languages.@refill
+ 
+ It is a 7bit coded character set (@ref{coded character set}) based on
+-ISO 2022 (@ref{ISO 2022}), it contains only ASCII (@ref{ASCII}) and code
+-extension (@ref{code extension}) is not allowed.@refill
++ISO 2022, it contains only ASCII (@ref{ASCII}) and code
++extension is not allowed.@refill
+ 
+ It is standard coded character set of Internet mail.  If MIME charset is
+ not specified, @strong{us-ascii} is used as default.@refill
+@@ -1484,132 +1489,123 @@
+ interpreted as us-ascii.
+ 
+ 
+-@node Bug report, CVS, Glossary, Appendix
++@node Bug report, GitHub, Glossary, Appendix
+ @section How to report bugs
+ @cindex good bug report
+ 
+-If you write bug-reports and/or suggestions for improvement, please
+-send them to the EMACS-MIME Mailing List:
++Topics related to FLIM-LB are discussed in following mailing lists.
++The latest version is also announced there.
+ 
+-@itemize @bullet
+-@item
+- English <emacs-mime-en@@m17n.org>
+-@item
+- Japanese <emacs-mime-ja@@m17n.org>
+-@end itemize
++@display
++Wanderlust Mailing List @t{<wl@@ml.gentei.org>}
++@end display
++
++In this list Japanese is mainly used for discussion. We also have a list
++for discussion in English:
++
++@display
++Wanderlust List in English @t{<wl-en@@ml.gentei.org>}
++@end display
++(Messages posted to this list are also forwarded to the former one.)
++
++A guide can be obtained automatically by sending mail to
++@t{wl-ctl@@ml.gentei.org} (or to @t{wl-en-ctl@@ml.gentei.org} for
++the English one) with the body
++
++@example
++# guide
++@end example
+ 
++Please send bug reports or patches to one of those lists.  You have to
++subscribe the mailing list to post a message.
+ 
+ Notice that, we do not welcome bug reports about too old version.  Bugs
+ in old version might be fixed.  So please try latest version at
+ first.@refill
+ 
+ You should write @strong{good bug report}.  If you write only ``FLIM
+-does not work'', we can not find such situations.  At least, you should
+-write name, type, variants and version of OS, emacs, APEL, FLIM, SEMI
+-and MUA, and setting.  In addition, if error occurs, to send backtrace
+-is very important. (cf. @ref{(emacs)Bugs}) @refill
++does not work'', we can not find such situations.  At least, you
++should write name, type, variants and version of OS, emacs, APEL,
++FLIM, SEMI and MUA, and setting.  In addition, if error occurs, to
++send backtrace is very important. (cf. @ref{Bugs,Reporting Bugs
++,Reporting Bugs, emacs, GNU Emacs Manual}) @refill
+ 
+ Bug may not appear only your environment, but also in a lot of
+ environment (otherwise it might not bug).  Therefor if you send mail
+ to author directly, we must write a lot of mails.  So please send mail
+ to address for EMACS-MIME Mailing List instead of author.
+ 
+-Via the EMACS-MIME ML, you can report FLIM bugs, obtain the latest
+-release of FLIM, and discuss future enhancements to FLIM.  To join the
+-EMACS-MIME ML, send an empty e-mail to:
+-
+-@itemize @bullet
+-@item
+- English  <emacs-mime-en-ctl@@m17n.org>
+-@item
+- Japanese <emacs-mime-ja-ctl@@m17n.org>
+-@end itemize
+-
+-
+ 
+-@node CVS, History, Bug report, Appendix
+-@section CVS based development
++@node GitHub, History, Bug report, Appendix
++@section GitHub based development
+ 
+-Files in FLIM are managed under CVS. Therefore you can obtain the
+-newest FLIM by the following method.
++FLIM-LB's repository is published in GitHub.
+ 
+ @example
+-(0) cvs login
+-
+-    % cvs -d :pserver:anonymous@@cvs.m17n.org:/cvs/root login
+-
+-    CVS password: [CR] # NULL string
+-
+-(1) checkout
+-
+-    % cvs -d :pserver:anonymous@@cvs.m17n.org:/cvs/root checkout
+-      checkout [-r TAG] flim
++@uref{https://github.com/wanderlust/flim}
+ @end example
+ 
++If you send a pull request, please embed unindented @file{ChangeLog}
++entries in commit message like Emacs's.  See @cite{Commit messages}
++section of Emacs's CONTRIBUTE file
++@footnote{@uref{https://git.savannah.gnu.org/cgit/emacs.git/plain/CONTRIBUTE}}.
+ 
+-If you would like to join CVS based development, please send mail to
+-
+-@itemize @bullet
+-@item
+- <cvs@@cvs.m17n.org>
+-@end itemize
+-
+-@noindent
+-with your account name and your public key for ssh.
+-cvsroot is :ext:cvs@@cvs.m17n.org:/cvs/root.
++If you send a bug report, please attach Backtrace with it.
++@footnote{@uref{http://www.jpl.org/elips/BUGS-ja.html} describes how to
++in Japanese.}
+ 
+ 
+-@node History,  , CVS, Appendix
++@node History,  , GitHub, Appendix
+ @section History of FLIM
+ 
+-FLIM $B$N(B code $B$N:G8E$NItJ,$O(B $B1]JB(B $B;LCR(B $B;a$,=q$$$?(B @file{mime.el} $B$K5/8;$7(B
+-$B$^$9!#$3$N>.$5$J(B program $B$O(B Nemacs $B$GF0:n$9$k(B iso-2022-jp $B$N(B B-encoding 
+-$B@lMQ$N(B encoded-word $B$NI|9f2=%W%m%0%i%`$G$7$?!#(B@refill
+-
+-$B$=$N8e!"<i2,(B $BCNI'(B $B$O(B @file{mime.el} $B$r85$K(B@file{tiny-mime.el} $B$H$$$&%W%m(B
+-$B%0%i%`$r=q$-$^$9!#$3$l$O!"(BNemacs $B$H(B Mule $B$GF0:n$9$k(B encoded-word $B$NId9f(B
+-$B2=!&I|9f2=%W%m%0%i%`$G$7$?!#(B@file{tiny-mime.el} $B$O(B B-encoding $B$@$1$G$J$/(B 
+-Q-encoding $B$b(Bsupport $B$7!"$^$?!"(BMULE $B$G07$&$3$H$,$G$-$k$5$^$6$^$J(B MIME
+-charset (@ref{MIME charset}) $B$rF1;~$K;H$&$3$H$,$G$-$^$7$?!#$3$N;~!"(B
+-Nemacs $B$H(B Mule $B$NAPJ}$r(B support $B$9$k$?$a$KMQ$$$i$l$?%F%/%K%C%/$O8e$K(B emu
+-package $B$K$^$H$a$i$l$^$9!#(B@refill
+-
+-$B$3$N:"!"<i2,(B $BCNI'(B $B$O(B @file{tiny-mime.el} $B$r$5$^$6$^$J(B MUA $B$G;H$&$?$a$N@_(B
+-$BDj=8$bG[I[$7$F$$$^$7$?$,!"$=$l$i$O8e$K(B@file{tiny-mime.el} $B$H$H$b$K#1$D$N(B 
+-package $B$K$^$H$a$i$l!"(Btm $B$H$$$&L>A0$GG[I[$5$l$^$9!#(B@refill
+-
+-$B<i2,(B $BCNI'(B $B$O$d$,$F!"(BMIME message $B$r1\Mw$9$k$?$a$N%W%m%0%i%`$G$"$k(B
+-@file{tm-body.el} $B$r=q$-$^$9!#$3$l$O!"$9$0$K(B@file{tm-view.el} $B$H$$$&L>A0(B
+-$B$KJQ$o$j$^$7$?$,!"$d$,$F!"$3$l$,(B@file{tiny-mime.el} $B$KBe$o$C$F!"(Btm $B$NCf(B
+-$B3K$H$J$j$^$9!#(B@refill
+-
+-@file{tm-view.el} $B$OEvA3!"(BContent-Transfer-Encoding $B$r07$&I,MW$,$"$j$^$9!#(B
+-$B$3$NL\E*$N$?$a$K!"(BMEL $B$,@0Hw$5$l$O$8$a$^$7$?!#(BBase64 $B$K4X$7$F$O(B 
+-@file{tiny-mime.el} $B$N(B code $B$,0\$5$l!"$^$?!"?7$?$K(BQuoted-Printable $B$N(B 
+-code $B$,DI2C$5$l$^$7$?!#$3$l$i$,(B@file{mel-b.el} $B$H(B @file{mel-q.el} $B$K$J$j(B
+-$B$^$7$?!#(B@refill
+-
+-$B$^$?!"8e$K!"<i2,(B $BCNI'(B $B$K$h$C$F(B uuencode $BMQ$N(B @file{mel-u.el} $B$,DI2C$5$l!"(B
+-$B$=$N8e$K!">.NS(B $B=$J?(B $B;a$K$h$C$F(B x-gzip64 $BMQ$N(B@file{mel-g.el} $B$,DI2C$5$l$^(B
+-$B$7$?!#(B@refill
+-
+-tm $B$G$O8e$K!"<i2,(B $BCNI'(B $B$K$h$C$F(B @file{tiny-mime.el} $B$N:F<BAu$,9T$o$l!"$3(B
+-$B$N2aDx$G!"(BSTD 11 $B$N(B parser $B$,=q$+$l$^$7$?!#$3$l$O!"8=:_$N(B 
+-@file{std11.el} $B$KEv$?$j$^$9!#$^$?!"$3$N2aDx$G(B @file{tiny-mime.el} $B$OI|(B
+-$B9f2=$r9T$&(B @file{tm-ew-d.el} $B$HId9f2=$r9T$&(B @file{tm-ew-e.el} $B$KJ,$1$i$l(B
+-$B$^$7$?!#$3$NN><T$,8=:_$N(B @file{eword-decode.el} $B$H(B 
+-@file{eword-encode.el} $B$N@hAD$KEv$?$j$^$9!#(B@refill
+-
+-$B8e$K!"<i2,(B $BCNI'(B $B$i$K$h$C$F(B tm $B$NA4LL=q$-49$(:n6H$,9T$o$l!"$3$N2aDx$G!"(Btm 
+-$B$O(B APEL, MEL, SEMI, EMH, RMAIL-MIME, Gnus-MIME $B$J$I$KJ,$1$i$l$^$7$?!#$3(B
+-$B$N$&$A$N(B MEL $B$,(B FLIM $B$ND>@\$N@hAD$KEv$?$j$^$9!#(B@refill
+-
+-$B8e$K!"(BAPEL $B$+$i(B @file{std11.el} $B$,0\$5$l!"$^$?!"(B@file{mailcap.el},
+-@file{eword-decode.el} $B$*$h$S(B @file{eword-encode.el} $B$,(B SEMI $B$+$i0\$5$l!"(B
+-package $B$NL>A0$,(B FLIM $B$H$J$j$^$9!#(B@refill
++FLIM の code の最古の部分は 榎並 嗣智 氏が書いた @file{mime.el} に起源し
++ます。この小さな program は Nemacs で動作する iso-2022-jp の B-encoding 
++専用の encoded-word の復号化プログラムでした。@refill
++
++その後、守岡 知彦 は @file{mime.el} を元に@file{tiny-mime.el} というプロ
++グラムを書きます。これは、Nemacs と Mule で動作する encoded-word の符号
++化・復号化プログラムでした。@file{tiny-mime.el} は B-encoding だけでなく 
++Q-encoding もsupport し、また、MULE で扱うことができるさまざまな MIME
++charset (@ref{MIME charset}) を同時に使うことができました。この時、
++Nemacs と Mule の双方を support するために用いられたテクニックは後に emu
++package にまとめられます。@refill
++
++この頃、守岡 知彦 は @file{tiny-mime.el} をさまざまな MUA で使うための設
++定集も配布していましたが、それらは後に@file{tiny-mime.el} とともに1つの 
++package にまとめられ、tm という名前で配布されます。@refill
++
++守岡 知彦 はやがて、MIME message を閲覧するためのプログラムである
++@file{tm-body.el} を書きます。これは、すぐに@file{tm-view.el} という名前
++に変わりましたが、やがて、これが@file{tiny-mime.el} に代わって、tm の中
++核となります。@refill
++
++@file{tm-view.el} は当然、Content-Transfer-Encoding を扱う必要があります。
++この目的のために、MEL が整備されはじめました。Base64 に関しては 
++@file{tiny-mime.el} の code が移され、また、新たにQuoted-Printable の 
++code が追加されました。これらが@file{mel-b.el} と @file{mel-q.el} になり
++ました。@refill
++
++また、後に、守岡 知彦 によって uuencode 用の @file{mel-u.el} が追加され、
++その後に、小林 修平 氏によって x-gzip64 用の@file{mel-g.el} が追加されま
++した。@refill
++
++tm では後に、守岡 知彦 によって @file{tiny-mime.el} の再実装が行われ、こ
++の過程で、STD 11 の parser が書かれました。これは、現在の 
++@file{std11.el} に当たります。また、この過程で @file{tiny-mime.el} は復
++号化を行う @file{tm-ew-d.el} と符号化を行う @file{tm-ew-e.el} に分けられ
++ました。この両者が現在の @file{eword-decode.el} と 
++@file{eword-encode.el} の先祖に当たります。@refill
++
++後に、守岡 知彦 らによって tm の全面書き換え作業が行われ、この過程で、tm 
++は APEL, MEL, SEMI, EMH, RMAIL-MIME, Gnus-MIME などに分けられました。こ
++のうちの MEL が FLIM の直接の先祖に当たります。@refill
++
++後に、APEL から @file{std11.el} が移され、また、@file{mailcap.el},
++@file{eword-decode.el} および @file{eword-encode.el} が SEMI から移され、
++package の名前が FLIM となります。@refill
+ 
+-$B$3$ND>A0$+$iEDCf(B $BE/(B $B;a$,$h$j(B RFC $B$KCi<B$J<BAu$r=q$-;O$a!"$3$l$O!"8=:_!"(B
+-FLIM $B$N;^$G$"$k(B ``FLIM-FLAM'' $B$H$J$C$F$$$^$9!#(B
++この直前から田中 哲 氏がより RFC に忠実な実装を書き始め、これは、現在、
++FLIM の枝である ``FLIM-FLAM'' となっています。
+ 
+ 
+ @node Concept Index, Function Index, Appendix, Top
Index: pkgsrc/devel/flim/patches/patch-mime-ja.texi
diff -u /dev/null pkgsrc/devel/flim/patches/patch-mime-ja.texi:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-mime-ja.texi        Sun Sep  3 14:58:38 2023
@@ -0,0 +1,2072 @@
+$NetBSD: patch-mime-ja.texi,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/mime-ja.texi    2023-09-02 12:45:03.657092847 +0900
++++ ./mime-ja.texi     2023-08-31 08:29:38.608621034 +0900
+@@ -1,510 +1,516 @@
+-\input texinfo.tex
++\input texinfo-ja @c -*-texinfo -*- coding: utf-8 -*-
+ @c Generated automatically from mime-ja.sgml by sinfo 3.7.
+ @setfilename mime-ja.info
+-@settitle{FLIM 1.14 MIME $B5!G=@bL@=q(B}
++@documentlanguage ja
++@documentencoding utf-8
++@settitle FLIM-LB 1.14 MIME 機能説明書
++@dircategory GNU Emacs Lisp
++@direntry
++* FLIM-LB (ja): (mime-ja).         Internet message library.
++@end direntry
+ @titlepage
+-@title FLIM 1.14 MIME $B5!G=@bL@=q(B
+-@author $B<i2,(B $BCNI'(B <morioka@@jaist.ac.jp>
+-@subtitle 1999-01-27
++@title FLIM-LB 1.14 MIME 機能説明書
++@author 守岡 知彦 <morioka@@jaist.ac.jp>
++@author 伊藤 和博
++@subtitle 2020-09-17
+ @end titlepage
+ @node Top, Introduction, (dir), (dir)
+-@top FLIM 1.14 MIME $B5!G=@bL@=q(B
++@top FLIM-LB 1.14 MIME 機能説明書
+ 
+ @ifinfo
+-@direntry
+-* FLIM-ja: (mime-ja).     FLIM, a fundamental library to process Internet Messages for GNU Emacsen.
+-@end direntry
+ 
+-This file documents MIME features of FLIM, a fundamental library to
++This file documents MIME features of FLIM-LB, a fundamental library to
+ process Internet Messages for GNU Emacsen.@refill
+ 
+-GNU Emacsen $BMQ$N(B Internet Message $B=hM}$N$?$a$N4pAC(B library $B$G$"$k(B FLIM 
+-$B$N(B MIME $B5!G=$K4X$7$F@bL@$7$^$9!#(B
++GNU Emacsen 用の Internet Message 処理のための基礎 library である FLIM-LB
++の MIME 機能に関して説明します。
+ @end ifinfo
+ 
+ @menu
+-* Introduction::                FLIM $B$C$F2?!)(B
+-* How to use::                  FLIM $B$N(B MIME $B5!G=$N;H$$J}(B
+-* Entity::                      Message $B$H(B Entity
+-* Content-Type::                Content-Type $BMs$N>pJs(B
+-* Content-Disposition::         Content-Disposition $BMs$N>pJs(B
+-* Content-Transfer-Encoding::   $BId9f2=K!(B
+-* encoded-word::                Header $B$N(B network $BI=8=(B
+-* custom::                      $B0lHL@_Dj(B
+-* Appendix::                    $BIUO?(B
+-* Concept Index::               $B35G0:w0z(B
+-* Function Index::              $B4X?t:w0z(B
+-* Variable Index::              $BJQ?t:w0z(B
++* Introduction::                FLIM-LB って何?
++* How to use::                  FLIM の MIME 機能の使い方
++* Entity::                      Message と Entity
++* Content-Type::                Content-Type 欄の情報
++* Content-Disposition::         Content-Disposition 欄の情報
++* Content-Transfer-Encoding::   符号化法
++* encoded-word::                Header の network 表現
++* custom::                      一般設定
++* Appendix::                    付録
++* Concept Index::               概念索引
++* Function Index::              関数索引
++* Variable Index::              変数索引
+ @end menu
+ 
+ @node Introduction, How to use, Top, Top
+-@chapter FLIM $B$C$F2?!)(B
++@chapter FLIM-LB って何?
+ 
+-FLIM $B$O(B Internet Message $B$NI=8=$dId9f2=$K4X$9$k4pACE*$J5!G=$rDs6!$9$k(B
+-$B$?$a$N(B library $B$G$9!#(B
++FLIM は Internet Message の表現や符号化に関する基礎的な機能を提供する
++ための library です。
++FLIM-LB は FLIM のバリアントの一つで、
++最新バージョンの Emacs への対応などを特徴とします。
+ 
+ 
+ @node How to use, Entity, Introduction, Top
+-@chapter FLIM $B$N(B MIME $B5!G=$N;H$$J}(B
++@chapter FLIM の MIME 機能の使い方
+ 
+-FLIM $B$NDs6!$9$k(B MIME $B5!G=$r;H$&$?$a$K$O(B
++FLIM の提供する MIME 機能を使うためには
+ 
+ @lisp
+ (require 'mime)
+ @end lisp
+ 
+ @noindent
+-$B$rI>2A$7$F$/$@$5$$!#(B
++を評価してください。
+ 
+ 
+ @node Entity, Content-Type, How to use, Top
+-@chapter Message $B$H(B Entity
++@chapter Message と Entity
+ @cindex mime-entity
+ @cindex entity
+ 
+-RFC 2045 (@ref{RFC 2045}) $B$K$h$l$P!"!V(BEntity $B$H$$$&8l$O!"(Bmessage, $B$b$7$/(B
+-$B$O!"(Bmultipart entity $B$N(B body $BCf$N#1$D$NItJ,$N!"(BMIME $B$GDj5A$5$l$?(B header
+-field $B$HFbMF$r;X$9!W$H$J$C$F$$$^$9!#$3$3$G$O!"(BMIME $B$GDj5A$5$l$?(B header
+-field $B0J30$NA4$F$N(B header $B$H(B body $B$r;X$98l$H$7$F(B @strong{entity}$B$rMQ$$$k(B
+-$B$3$H$K$7$^$9!#(B@refill
++RFC 2045 (@ref{RFC 2045}) によれば、「Entity という語は、message, もしく
++は、multipart entity の body 中の1つの部分の、MIME で定義された header
++field と内容を指す」となっています。ここでは、MIME で定義された header
++field 以外の全ての header と body を指す語として @strong{entity}を用いる
++ことにします。@refill
+ 
+-RFC 2045 $B$NDj5A$O!"(BMIME message $B$,(B entity $B$r@a$H$9$kLZ9=B$$G$"$k$3$H$r<((B
+-$B$7$F$$$^$9!#$D$^$j!"(BMIME $B$O(B message $B$rLZ9=B$$K3HD%$7$?Lu$G$9!#(B@refill
++RFC 2045 の定義は、MIME message が entity を節とする木構造であることを示
++しています。つまり、MIME は message を木構造に拡張した訳です。@refill
+ 
+-FLIM $B$O(B entity $B$N>pJs$rI=8=$9$k$?$a$K(B@strong{mime-entity} $B9=(B
+-$BB$BN$rMQ$$$^$9!#0J2<$G$OC1$K(B mime-entity $B$H8F$V$3$H$K$7$^$9!#(B
++FLIM は entity の情報を表現するために@strong{mime-entity} 構
++造体を用います。以下では単に mime-entity と呼ぶことにします。
+ 
+ 
+ @menu
+-* Entity creation::             Entity $B$N@8@.(B
+-* Entity hierarchy::            Entity $B3,AX(B
+-* Entity Search::               Entity $B$N8!:w(B
+-* Entity Attributes::           Entity $B$NB0@-(B
+-* Entity-header::               Entity header $B$N>pJs(B
+-* entity formatting::           Entity $B$NJ8;zI=8=(B
+-* Entity-content::              Entity $B$NFbMF(B
+-* Entity-network-representation::  Entity $B$N%M%C%H%o!<%/I=8=(B
+-* Entity buffer::               Entity $B$N(B buffer $B$K$h$kI=8=(B
+-* mm-backend::                  Entity $B$NI=8=$H<B8=(B
++* Entity creation::             Entity の生成
++* Entity hierarchy::            Entity 階層
++* Entity Search::               Entity の検索
++* Entity Attributes::           Entity の属性
++* Entity-header::               Entity header の情報
++* entity formatting::           Entity の文字表現
++* Entity-content::              Entity の内容
++* Entity-network-representation::  Entity のネットワーク表現
++* Entity buffer::               Entity の buffer による表現
++* mm-backend::                  Entity の表現と実現
+ @end menu
+ 
+ @node Entity creation, Entity hierarchy, Entity, Entity
+-@section Entity $B$N@8@.(B
++@section Entity の生成
+ 
+ @defun mime-open-entity type location
+ 
+-Entity $B$r3+$$$F!"$=$l$rJV$7$^$9!#(B@refill
++Entity を開いて、それを返します。@refill
+ 
+-@var{type} $B$O(B representation-type $B$G$9!#(B(cf. @ref{mm-backend}) @refill
++@var{type} は representation-type です。(cf. @ref{mm-backend}) @refill
+ 
+-@var{location} $B$O(B entity $B$N0LCV$G$9!#;XDjJ}K!$O(B
+-representation-type $B$K0M$C$FJQ$o$j$^$9!#(B
++@var{location} は entity の位置です。指定方法は
++representation-type に依って変わります。
+ @end defun
+ 
+ 
+ @defun mime-parse-buffer &optional  buffer type
+ 
+-@var{buffer} $B$r(B message $B$H$7$F9=J82r@O$7!"$=$N7k2L$N(B mime-entity $B$r(B 
+-@var{buffer} $B$N(B@code{mime-message-structure} $B$K3JG<$9$k!#(B@refill
++@var{buffer} を message として構文解析し、その結果の mime-entity を 
++@var{buffer} の@code{mime-message-structure} に格納する。@refill
+ 
+-@var{buffer} $B$,>JN,$5$l$?>l9g!"8=:_$N(B buffer $B$r9=J82r@O$9$k!#(B@refill
++@var{buffer} が省略された場合、現在の buffer を構文解析する。@refill
+ 
+-@var{type} $B$,;XDj$5$l$?>l9g!"$=$NCM$r@8@.$5$l$k(B mime-entity $B$NI=>]7?$H$7(B
+-$B$FMQ$$$k!#>JN,$5$l$?>l9g$O(B @var{buffer} $B$H$J$k!#(B(cf. @ref{mm-backend})
++@var{type} が指定された場合、その値を生成される mime-entity の表象型とし
++て用いる。省略された場合は @var{buffer} となる。(cf. @ref{mm-backend})
+ @end defun
+ 
+ 
+ 
+ @node Entity hierarchy, Entity Search, Entity creation, Entity
+-@section Entity $B3,AX(B
++@section Entity 階層
+ @cindex node-id
+ @cindex entity-number
+ @cindex message
+ @cindex root-entity
+ 
+-MIME message $B$O(B entity $B$rC10L$H$9$kLZ9=B$$K$J$C$F$$$^$9!#(B@refill
++MIME message は entity を単位とする木構造になっています。@refill
+ 
+-$B$3$NLZ$K$*$$$F:,$H$J$k@a$O(B message $BA4BN$rI=$9(B entity $B$G$9!#$3$3$G$O!"$3(B
+-$B$l$r(B @strong{root-entity} $B$b$7$/$O(B@strong{message} $B$H8F$S$^$9!#(B@refill
++この木において根となる節は message 全体を表す entity です。ここでは、こ
++れを @strong{root-entity} もしくは@strong{message} と呼びます。@refill
+ 
+-root-entity $B0J30$N(B entity $B$O?F$r;}$A$^$9!#$^$?!"(Bentity $B$O;R6!$r;}$D$+$b(B
+-$BCN$l$^$;$s!#$3$N?F;R4X78$r9M$($k$3$H$G(B entity $B$NAjBP4X78$r07$&$3$H$,$G$-(B
+-$B$^$9!#(B@refill
++root-entity 以外の entity は親を持ちます。また、entity は子供を持つかも
++知れません。この親子関係を考えることで entity の相対関係を扱うことができ
++ます。@refill
+ 
+-$B0lJ}!"(Bentity $B$N(B message $B$K$*$1$k0LCV$r9M$($k$3$H$b$G$-$^$9!#(B@refill
++一方、entity の message における位置を考えることもできます。@refill
+ 
+-entity $B$O$3$NLZ$K$*$1$k@a$H$J$j$^$9$,!"$3$NLZ$K$O?<$5$HF1$8?<$5$NCf$N(B
+-$B=gHV$K=>$C$FHV9f$,IU$1$k$3$H$,$G$-$^$9!#B($A!"(B
++entity はこの木における節となりますが、この木には深さと同じ深さの中の
++順番に従って番号が付けることができます。即ち、
+ @example
+ 
+-                              $B(#(!(!(!($(B
+-                              $B("(B  nil $B("(B
+-                              $B(&(!(((!(%(B
+-              $B(#(!(!(!(!(!(!(!(!(!(+(!(!(!(!(!(!(!(!(!($(B
+-            $B(#(*($(B              $B(#(*($(B              $B(#(*($(B
+-            $B("#0("(B              $B("#1("(B              $B("#2("(B
+-            $B(&(((%(B              $B(&(((%(B              $B(&(((%(B
+-              $B("(B        $B(#(!(!(!(!(+(!(!(!(!($(B        $B("(B
+-          $B(#(!(*(!($(#(!(*(!($(#(!(*(!($(#(!(*(!($(#(!(*(!($(B
+-          $B("(B $B#0(B.$B#0("("(B $B#1(B.$B#0("("(B $B#1(B.$B#1("("(B $B#1(B.$B#2("("(B $B#2(B.$B#0("(B
+-          $B(&(!(!(!(%(&(!(!(!(%(&(!(!(!(%(&(!(!(!(%(&(!(!(!(%(B
++                              ┌───┐
++                              │  nil │
++                              └─┬─┘
++              ┌─────────┼─────────┐
++            ┌┴┐              ┌┴┐              ┌┴┐
++            │0│              │1│              │2│
++            └┬┘              └┬┘              └┬┘
++              │        ┌────┼────┐        │
++          ┌─┴─┐┌─┴─┐┌─┴─┐┌─┴─┐┌─┴─┐
++          │ 0.0││ 1.0││ 1.1││ 1.2││ 2.0│
++          └───┘└───┘└───┘└───┘└───┘
+ @end example
+ 
+ @noindent
+-$B$N$h$&$K?<$5(B n $B$N@a$K$OD9$5(B n $B$N@0?tNs$N@aHV9f$,?6$l$^$9!#$3$l(B
+-$B$r(B @strong{entity-number} $B$H8F$S$^$9!#(Bentity-number $B$O(B S $B<0$H(B
+-$B$7$F$O(B @code{(1 2 3)} $B$N$h$&$J@0?t$N%j%9%H$H$7$FI=8=$5$l$^$9!#(B
+-
+-mime-entity $B$G$O!"$3$l$HF1MM$N(B @strong{node-id} $B$rMQ$$$^$9!#(Bnode-id $B$O$A$g(B
+-$B$&$I(B entity-number $B$r5U$K$7$?%j%9%H$G!"(Bentity-number 1.2.3 $B$KBP1~$9$k(B 
+-node-id $B$O(B @code{(3 2 1)} $B$G$9!#(B@refill
+-
+-$BA0=R$N$h$&$K!"(BMIME message $B$O(B entity $B$rC10L$H$7$?LZ9=B$$K$J$C$F$$$k$N$G!"(B
+-$B$3$N:,$G$"$k(B message $BA4BN$b(B mime-entity $B$GI=8=$9$k$3$H$,$G$-!"(Bbuffer
+-local $BJQ?t(B @code{mime-message-structure} $B$K3JG<$9$k$3$H$K$7$^$9!#(B@refill
++のように深さ n の節には長さ n の整数列の節番号が振れます。これ
++を @strong{entity-number} と呼びます。entity-number は S 式と
++しては @code{(1 2 3)} のような整数のリストとして表現されます。
++
++mime-entity では、これと同様の @strong{node-id} を用います。node-id はちょ
++うど entity-number を逆にしたリストで、entity-number 1.2.3 に対応する 
++node-id は @code{(3 2 1)} です。@refill
++
++前述のように、MIME message は entity を単位とした木構造になっているので、
++この根である message 全体も mime-entity で表現することができ、buffer
++local 変数 @code{mime-message-structure} に格納することにします。@refill
+ 
+-@code{mime-message-structure} $B$r5/E@$K(B entity-number $B$d(B node-id 
+-$B$G<($5$l$k(B entity $B$r<h$j=P$9$3$H$,$G$-$^$9!#(B
++@code{mime-message-structure} を起点に entity-number や node-id 
++で示される entity を取り出すことができます。
+ 
+ @defvar mime-message-structure
+ 
+-$B8=:_$N(B buffer $B$K$*$1$k(B message $BA4BN$N(B mime-entity $B9=B$BN$r3JG<$9$k(Bbuffer
+-local $BJQ?t!#(B
++現在の buffer における message 全体の mime-entity 構造体を格納するbuffer
++local 変数。
+ @end defvar
+ 
+ 
+ @defun mime-entity-children entity
+ 
+-@var{entity} $B$K4^$^$l$k(B entity $B$N(B list $B$rJV$9!#(B
++@var{entity} に含まれる entity の list を返す。
+ @end defun
+ 
+ 
+ @defun mime-entity-parent entity  &optional  message
+ 
+-@var{entity} $B$N?F$N(B entity $B$rJV$9!#(B@refill
++@var{entity} の親の entity を返す。@refill
+ 
+-@var{message} $B$,;XDj$5$l$?>l9g!"$3$l$r:,$H8+Jo$9!#(B
++@var{message} が指定された場合、これを根と見倣す。
+ @end defun
+ 
+ 
+ @defun mime-root-entity-p entity
+ 
+-@var{entity} $B$,:,!JB($A!"(Bmessage $BA4BN!K$G$"$k>l9g$K!"Hs(B-@code{nil} $B$rJV(B
+-$B$9!#(B
++@var{entity} が根(即ち、message 全体)である場合に、非-@code{nil} を返
++す。
+ @end defun
+ 
+ 
+ @defun mime-entity-node-id entity
+ 
+-@var{entity} $B$N(B node-id $B$rJV$9!#(B
++@var{entity} の node-id を返す。
+ @end defun
+ 
+ 
+ @defun mime-entity-number entity
+ 
+-@var{entity} $B$N(B entity-number $B$rJV$9!#(B
++@var{entity} の entity-number を返す。
+ @end defun
+ 
+ 
+ 
+ @node Entity Search, Entity Attributes, Entity hierarchy, Entity
+-@section Entity $B$N8!:w(B
++@section Entity の検索
+ 
+ @defun mime-find-entity-from-number entity-number  &optional  message
+ 
+-@var{message} $B$+$i!"(B@var{enity-number} $B$N(B entity $B$rJV$7$^$9!#(B@refill
++@var{message} から、@var{enity-number} の entity を返します。@refill
+ 
+-@var{message} $B$,;XDj$5$l$F$$$J$$>l9g$O!"(B
+-@code{mime-message-structrue} $B$,;H$o$l$^$9!#(B
++@var{message} が指定されていない場合は、
++@code{mime-message-structrue} が使われます。
+ @end defun
+ 
+ 
+ @defun mime-find-entity-from-node-id entity-node-id  &optional  message
+ 
+-@var{message} $B$+$i!"(B@var{entity-node-id} $B$N(B entity $B$rJV$7$^$9!#(B@refill
++@var{message} から、@var{entity-node-id} の entity を返します。@refill
+ 
+-@var{message} $B$,;XDj$5$l$F$$$J$$>l9g$O!"(B
+-@code{mime-message-structure} $B$,;H$o$l$^$9!#(B
++@var{message} が指定されていない場合は、
++@code{mime-message-structure} が使われます。
+ @end defun
+ 
+ 
+ @defun mime-find-entity-from-content-id cid  &optional  message
+ 
+-@var{message} $B$+$i!"(B@var{cid} $B$N(B entity $B$rJV$7$^$9!#(B@refill
++@var{message} から、@var{cid} の entity を返します。@refill
+ 
+-@var{message} $B$,;XDj$5$l$F$$$J$$>l9g$O!"(B
+-@code{mime-message-structure} $B$,;H$o$l$^$9!#(B
++@var{message} が指定されていない場合は、
++@code{mime-message-structure} が使われます。
+ @end defun
+ 
+ 
+ 
+ @node Entity Attributes, Entity-header, Entity Search, Entity
+-@section Entity $B$NB0@-(B
++@section Entity の属性
+ 
+ @defun mime-entity-content-type entity
+ 
+-@var{entity} $B$N(B content-type $B$rJV$9!#(B(cf. @ref{mime-content-type})
++@var{entity} の content-type を返す。(cf. @ref{mime-content-type})
+ @end defun
+ 
+ 
+ @defun mime-entity-content-disposition entity
+ 
+-@var{entity} $B$N(B content-disposition $B$rJV$9!#(B
++@var{entity} の content-disposition を返す。
+ (cf. @ref{mime-content-disposition})
+ @end defun
+ 
+ 
+ @defun mime-entity-filename entity
+ 
+-@var{entity} $B$N(B file $BL>$rJV$9!#(B
++@var{entity} の file 名を返す。
+ @end defun
+ 
+ 
+ @defun mime-entity-encoding entity  &optional  default-encoding
+ 
+-@var{entity} $B$N(B content-transfer-encoding $B$rJV$9!#(B
++@var{entity} の content-transfer-encoding を返す。
+ (cf. @ref{Content-Transfer-Encoding}) @refill
+ 
+-$B$b$7!"(B@var{entity} $B$K(B Content-Transfer-Encoding $BMs$,B8:_$7$J$$>l9g$O!"(B
+-@var{default-encoding} $B$rJV$9!#$3$l$,;XDj$5$l$J$$>l9g$O!"(B@code{"7bit"} 
+-$B$rMQ$$$k!#(B
++もし、@var{entity} に Content-Transfer-Encoding 欄が存在しない場合は、
++@var{default-encoding} を返す。これが指定されない場合は、@code{"7bit"} 
++を用いる。
+ @end defun
+ 
+ 
+ @defun mime-entity-cooked-p entity
+ 
+-@var{entity} $B$NFbMF$,4{$K%3!<%IJQ49$5$l$F$$$k>l9g$O(B nil $B$GL5$$CM(B
+-$B$rJV$9!#(B
++@var{entity} の内容が既にコード変換されている場合は nil で無い値
++を返す。
+ @end defun
+ 
+ 
+ 
+ @node Entity-header, entity formatting, Entity Attributes, Entity
+-@section Entity header $B$N>pJs(B
++@section Entity header の情報
+ 
+ @defun mime-fetch-field field-name  &optional  entity
+ 
+-@var{entity} $B$N(B header $BCf$N(B @var{field-name} $BMs$N(B body $B$rJV$9!#(B@refill
++@var{entity} の header 中の @var{field-name} 欄の body を返す。@refill
+ 
+-$B7k2L$NJ8;zNs$O(B network $BI=8=$N$^$^$G$"$k!#(B@refill
++結果の文字列は network 表現のままである。@refill
+ 
+-@var{entity} $B$,>JN,$5$l$?>l9g$O!"(B@code{mime-message-structure} $B$NCM$rMQ(B
+-$B$$$k!#(B@refill
++@var{entity} が省略された場合は、@code{mime-message-structure} の値を用
++いる。@refill
+ 
+-@var{field-name} $BMs$,B8:_$7$J$$>l9g$O(B @code{nil} $B$rJV$9!#(B
++@var{field-name} 欄が存在しない場合は @code{nil} を返す。
+ @end defun
+ 
+ 
+ @defun mime-read-field field-name  &optional  entity
+ 
+-@var{entity} $B$N(B header $BCf$N(B @var{field-name} $BMs$r9=J82r@O$7$?7k2L$rJV$9!#(B
++@var{entity} の header 中の @var{field-name} 欄を構文解析した結果を返す。
+ @refill
+ 
+-$B7k2L$N7A<0$OMsKh$K0[$J$k!#Hs9=B$2=Ms$N>l9g$OJ8;zNs$rJV$7!"9=B$2=Ms$N>l9g(B
+-$B$O$=$N7A<0$K=>$C$?(B list $B$rJV$9!#(B@refill
++結果の形式は欄毎に異なる。非構造化欄の場合は文字列を返し、構造化欄の場合
++はその形式に従った list を返す。@refill
+ 
+-$B7k2LCf$NJ8;zNs$O(B Emacs $B$NFbItI=8=$KJQ49$5$l$k!#(B@refill
++結果中の文字列は Emacs の内部表現に変換される。@refill
+ 
+-@var{entity} $B$,>JN,$5$l$?>l9g$O!"(B@code{mime-message-structure} $B$NCM$rMQ(B
+-$B$$$k!#(B@refill
++@var{entity} が省略された場合は、@code{mime-message-structure} の値を用
++いる。@refill
+ 
+-@var{field-name} $BMs$,B8:_$7$J$$>l9g$O(B nil $B$rJV$9!#(B
++@var{field-name} 欄が存在しない場合は nil を返す。
+ @end defun
+ 
+ 
+ 
+ @node entity formatting, Entity-content, Entity-header, Entity
+-@section Entity $B$NJ8;zI=8=(B
++@section Entity の文字表現
+ 
+ @defun mime-insert-header entity  &optional  invisible-fields visible-fields
+ 
+-$B8=:_0LCV$K(B @var{entity} $B$NI|9f$7$?(B header $B$rA^F~$9$k!#(B@refill
++現在位置に @var{entity} の復号した header を挿入する。@refill
+ 
+-@var{invisible-fields} $B$H(B @var{visible-fields} $B$O@55,I=8=$N(Blist $B$G!"$=$l(B
+-$B$>$l!"I=<($7$?$/$J$$(B field $BL>$HI=<($7$?$$MsL>$rI=8=$7$?$b$N$G$"$k!#(B
++@var{invisible-fields} と @var{visible-fields} は正規表現のlist で、それ
++ぞれ、表示したくない field 名と表示したい欄名を表現したものである。
+ @refill
+ 
+-@var{invisible-fields} $B$NMWAG$N$I$l$+$K(B match $B$7!"$+$D!"(B
+-@var{visible-fields} $B$NMWAG$N$I$l$K$b(B match $B$7$J$$Ms$OI=<($5$l$J$$!#(B
++@var{invisible-fields} の要素のどれかに match し、かつ、
++@var{visible-fields} の要素のどれにも match しない欄は表示されない。
+ @refill
+ 
+-encoded-word (@ref{encoded-word}) $B$OI|9f$5$l$k!#!X@8$NHs(B us-ascii $BJ8;z!Y(B
+-$B$O(B @code{default-mime-charset} $B$H$7$F2r<a$5$l$k!#(B
++encoded-word (@ref{encoded-word}) は復号される。『生の非 us-ascii 文字』
++は @code{default-mime-charset} として解釈される。
+ @end defun
+ 
+ 
+ @defun mime-insert-text-content entity
+ 
+-point $B$NA0$K(B @var{entity} $B$r(B text entity $B$H$7$FA^F~$7$^$9!#(B@refill
++point の前に @var{entity} を text entity として挿入します。@refill
+ 
+-@var{entity} $B$NFbMF$O(B @ref{MIME charset} $B$H$7$FI|9f2=$5$l(B
+-$B$^$9!#(B@var{entity} $B$N(B Content-Type field $B$K(B charset paramter $B$,L5(B
+-$B$$$H!"(B@code{default-mime-charset} $B$,=i4|CM$H$7$F;H$o$l$^$9!#(B
++@var{entity} の内容は @ref{MIME charset} として復号化され
++ます。@var{entity} の Content-Type field に charset paramter が無
++いと、@code{default-mime-charset} が初期値として使われます。
+ @end defun
+ 
+ 
+ @defvar default-mime-charset
+ 
+-$BE,@Z$J(B MIME charset (@ref{MIME charset}) $B$,8+$D$+$i$J$+$C$?>l9g$KMQ$$$i(B
+-$B$l$k(BMIME charset.@refill
++適切な MIME charset (@ref{MIME charset}) が見つからなかった場合に用いら
++れるMIME charset.@refill
+ 
+-$BK\Mh$O(B APEL $B$NJQ?t$G$"$k!#(B
++本来は APEL の変数である。
+ @end defvar
+ 
+ 
+ 
+ @node Entity-content, Entity-network-representation, entity formatting, Entity
+-@section Entity $B$NFbMF(B
++@section Entity の内容
+ 
+ @defun mime-entity-content entity
+ 
+-@var{entity} $B$NFbMF$N(B byte $BNs$rJV$9!#(B
++@var{entity} の内容の byte 列を返す。
+ @end defun
+ 
+ 
+ @defun mime-insert-entity-content entity
+ 
+-point $B$N0LCV$K(B @var{entity} $B$NFbMF$rA^F~$7$^$9!#(B
++point の位置に @var{entity} の内容を挿入します。
+ @end defun
+ 
+ 
+ @defun mime-write-entity-content entity filename
+ 
+-@var{entity} $B$NFbMF$r(B @var{filename} $B$K=q$-9~$_$^$9!#(B
++@var{entity} の内容を @var{filename} に書き込みます。
+ @end defun
+ 
+ 
+ 
+ @node Entity-network-representation, Entity buffer, Entity-content, Entity
+-@section Entity $B$N%M%C%H%o!<%/I=8=(B
++@section Entity のネットワーク表現
+ 
+ @defun mime-insert-entity entity
+ 
+-@var{entity} $B$N(B header $B$H(B body $B$r(B point $B$N$H$3$m$KA^F~$7$^$9!#(B
++@var{entity} の header と body を point のところに挿入します。
+ @end defun
+ 
+ 
+ @defun mime-write-entity entity filename
+ 
+-@var{entity} $B$NI=8=$r(B @var{filename} $B$K=q$-9~$_$^$9!#(B
++@var{entity} の表現を @var{filename} に書き込みます。
+ @end defun
+ 
+ 
+ @defun mime-write-entity-body entity filename
+ 
+-@var{entity} $B$N(B body $B$r(B @var{filename} $B$K=q$-9~$_$^$9!#(B
++@var{entity} の body を @var{filename} に書き込みます。
+ @end defun
+ 
+ 
+ 
+ @node Entity buffer, mm-backend, Entity-network-representation, Entity
+-@section Entity $B$N(B buffer $B$K$h$kI=8=(B
++@section Entity の buffer による表現
+ 
+ @defun mime-entity-buffer entity
+ 
+-@var{entity} $B$,B8:_$9$k(B buffer $B$rJV$9!#(B
++@var{entity} が存在する buffer を返す。
+ @end defun
+ 
+ 
+ @defun mime-entity-point-min entity
+ 
+-@var{entity} $B$,B8:_$9$k(B buffer $B$K$*$1$k!"(B@var{entity} $B$,@j$a$kNN0h$N@hF,(B
+-$B0LCV$rJV$9!#(B
++@var{entity} が存在する buffer における、@var{entity} が占める領域の先頭
++位置を返す。
+ @end defun
+ 
+ 
+ @defun mime-entity-point-max entity
+ 
+-@var{entity} $B$,B8:_$9$k(B buffer $B$K$*$1$k!"(B@var{entity} $B$,@j$a$kNN0h$NKvHx(B
+-$B0LCV$rJV$9!#(B
++@var{entity} が存在する buffer における、@var{entity} が占める領域の末尾
++位置を返す。
+ @end defun
+ 
+ 
+ @defun mime-entity-header-start entity
+ 
+-@var{entity} $B$,B8:_$9$k(B buffer $B$K$*$1$k!"(Bheader $B$,@j$a$kNN0h$N@hF,0LCV$r(B
+-$BJV$9!#(B
++@var{entity} が存在する buffer における、header が占める領域の先頭位置を
++返す。
+ @end defun
+ 
+ 
+ @defun mime-entity-header-end entity
+ 
+-@var{entity} $B$,B8:_$9$k(B buffer $B$K$*$1$k!"(Bheader $B$,@j$a$kNN0h$NKvHx0LCV$r(B
+-$BJV$9!#(B
++@var{entity} が存在する buffer における、header が占める領域の末尾位置を
++返す。
+ @end defun
+ 
+ 
+ @defun mime-entity-body-start entity
+ 
+-@var{entity} $B$,B8:_$9$k(B buffer $B$K$*$1$k!"(Bbody $B$,@j$a$kNN0h$N@hF,0LCV$rJV(B
+-$B$9!#(B
++@var{entity} が存在する buffer における、body が占める領域の先頭位置を返
++す。
+ @end defun
+ 
+ 
+ @defun mime-entity-body-end entity
+ 
+-@var{entity} $B$,B8:_$9$k(B buffer $B$K$*$1$k!"(Bbody $B$,@j$a$kNN0h$NKvHx0LCV$rJV(B
+-$B$9!#(B
++@var{entity} が存在する buffer における、body が占める領域の末尾位置を返
++す。
+ @end defun
+ 
+ 
+ 
+ @node mm-backend,  , Entity buffer, Entity
+-@section Entity $B$NI=8=$H<B8=(B
++@section Entity の表現と実現
+ @cindex mm-backend
+-@cindex entity $B=hM}(B method
++@cindex entity 処理 method
+ @cindex representation-type
+ 
+-Entity $B$OCj>]2=$5$l$?%G!<%?I=8=$G!"<B:]$N%G!<%?I=8=$H$7$F$OMQES$K1~$8$F(B
+-$B$5$^$6$^$J$b$N$,MxMQ$G$-$k$h$&$K@_7W$5$l$F$$$^$9!#(B@refill
++Entity は抽象化されたデータ表現で、実際のデータ表現としては用途に応じて
++さまざまなものが利用できるように設計されています。@refill
+ 
+-$B$3$3$G!"(Bentity $B$,$I$&$$$&<oN`$NI=8=$r9T$C$F$$$k$+$r<($9$N$,(B
+-@strong{representation-type} $B$G!"(Bentity $B$r@8@.$9$k;~$K$O$3$l$r;XDj$7$^$9!#(B
+-(cf. @ref{Entity Creation}) @refill
+-
+-$BA0@a$^$G$K=R$Y$FMh$?(B entity $B$KBP$9$k=hM}$O!"(Bentity $B$KBP$7$F$=$N=hM}$r0M(B
+-$BMj$9$k$3$H$K$h$C$F<B8=$5$l$F$$$^$9!#(BEntity $B$O<+J,$N(B representation-type 
+-$B$rCN$C$F$*$j!"$=$N(B representation-type $B$K1~$8$F<B:]$N=hM}$r9T$&4X?t$r8F(B
+-$B$S=P$7$^$9!#$3$N$h$&$J4X?t$r(B @strong{entity $B=hM}(Bmethod} $B$H8F$S$^$9!#$^$?!"(B
+-representation-type $BKh$K$3$N$h$&$J4X?t$r$^$H$a$?$b$N$r(B 
+-@strong{mm-backend} $B$H8F$S$^$9!#(B@refill
+-
+-mm-backend $B$O(B representation-type $B$NL>A0$N@hF,$K(B @code{mm} $B$H$$$&(B
+-$B@\F,<-$rIU$1$?4X?tL>$+$i$J$k(B module $B$G!"$=$N(B module $BL>$OF1MM$K(B
+-representation-type $B$NL>A0$N@hF,$K(B @code{mm} $B$rIU$1$?$b$N$K$J$C$F(B
+-$B$$$^$9!#$3$N(B module $B$O(B representation-type $B$N(B entity $B$,:G=i$K@8@.$5$l$k(B
+-$B;~$K<+F0E*$K(B require $B$5$l$^$9!#(B
++ここで、entity がどういう種類の表現を行っているかを示すのが
++@strong{representation-type} で、entity を生成する時にはこれを指定します。
++(cf. @ref{Entity creation}) @refill
++
++前節までに述べて来た entity に対する処理は、entity に対してその処理を依
++頼することによって実現されています。Entity は自分の representation-type 
++を知っており、その representation-type に応じて実際の処理を行う関数を呼
++び出します。このような関数を @strong{entity 処理method} と呼びます。また、
++representation-type 毎にこのような関数をまとめたものを 
++@strong{mm-backend} と呼びます。@refill
++
++mm-backend は representation-type の名前の先頭に @code{mm} という
++接頭辞を付けた関数名からなる module で、その module 名は同様に
++representation-type の名前の先頭に @code{mm} を付けたものになって
++います。この module は representation-type の entity が最初に生成される
++時に自動的に require されます。
+ 
+ 
+ @menu
+-* Request for entity::          Entity $B$X$NJX$j(B
+-* mm-backend module::           mm-backend $B$N:n$jJ}(B
++* Request for entity::          Entity への便り
++* mm-backend module::           mm-backend の作り方
+ @end menu
+ 
+ @node Request for entity, mm-backend module, mm-backend, mm-backend
+-@subsection Entity $B$X$NJX$j(B
++@subsection Entity への便り
+ 
+ @defun mime-entity-send entity message  &rest  args
+ 
+-@var{entity} $B$K(B @var{message} $B$rAw$k!#(B@refill
++@var{entity} に @var{message} を送る。@refill
+ 
+-@var{args} $B$O(B @var{message} $B$N0z?t$G$"$k!#(B
++@var{args} は @var{message} の引数である。
+ @end defun
+ 
+ 
+ 
+ @node mm-backend module,  , Request for entity, mm-backend
+-@subsection mm-backend $B$N:n$jJ}(B
++@subsection mm-backend の作り方
+ 
+ @defmac mm-define-backend type &optional  parents
+ 
+-@var{type} $B$r(B mm-backend $B$H$7$FDj5A$7$^$9!#(B@refill
++@var{type} を mm-backend として定義します。@refill
+ 
+-@var{PARENTS} $B$,;XDj$5$l$F$$$k>l9g$O!"(B@var{type} $B$O(B prents
+-$B$r7Q>5$7$^$9!#$=$l$>$l$N(B parent $B$O(B representation-type $B$G$"$kI,MW$,$"(B
+-$B$j$^$9!#(B
++@var{PARENTS} が指定されている場合は、@var{type} は prents
++を継承します。それぞれの parent は representation-type である必要があ
++ります。
+ 
+-$BNc(B:@refill
++例:@refill
+ 
+ @lisp
+ (mm-define-backend chao (generic))
+@@ -514,15 +520,15 @@
+ 
+ @defmac mm-define-method name args  &rest  body
+ 
+-@var{name} $B$r(B (nth 1 (car @var{args})) backend $B$N(B method $B4X(B
+-$B?t$H$7$FDj5A$7$^$9!#(B@refill
++@var{name} を (nth 1 (car @var{args})) backend の method 関
++数として定義します。@refill
+ 
+-@var{args} $B$O(B lambda $B$N0z?t%j%9%H$N$h$&$J$b$N$G$9$,!"(B(car
+-@var{args}) $B$O;XDj$5$l$?(B parameter $B$G$"$kI,MW$,$"$j$^$9!#(B(car
+-(car @var{args})) $B$OJQ?t$NL>A0$G!"(B(nth 1 (car @var{args}))
+-$B$O(B backend $B$NL>A0(B (representation-type) $B$G$9!#(B@refill
++@var{args} は lambda の引数リストのようなものですが、(car
++@var{args}) は指定された parameter である必要があります。(car
++(car @var{args})) は変数の名前で、(nth 1 (car @var{args}))
++は backend の名前 (representation-type) です。@refill
+ 
+-$BNc(B:@refill
++例:@refill
+ 
+ @lisp
+ (mm-define-method entity-cooked-p ((entity chao)) nil)
+@@ -532,49 +538,49 @@
+ 
+ 
+ @node Content-Type, Content-Disposition, Entity, Top
+-@chapter Content-Type $BMs$N>pJs(B
++@chapter Content-Type 欄の情報
+ @cindex mime-content-type
+-@cindex Content-Type $BMs(B
++@cindex Content-Type 欄
+ 
+-@strong{Content-Type $BMs(B} $B$O(B media-type (@ref{media-type}) $B$d(B MIME
+-charset $B$H$$$C$?(B entity (@ref{entity}) $B$NFbMF$N<oN`$dI=8=7A<0$J$I$r5-=R(B
+-$B$9$k$?$a$N$b$N$G!"(BRFC 2045 (@ref{RFC 2045}) $B$GDj5A$5$l$F$$$^$9!#(B
++@strong{Content-Type 欄} は media-type (@ref{media-type}) や MIME
++charset といった entity (@ref{Entity}) の内容の種類や表現形式などを記述
++するためのもので、RFC 2045 (@ref{RFC 2045}) で定義されています。
+ 
+ @noindent
+ @strong{[Memo]}
+ @quotation
+ 
+-$BNr;KE*$K$O(B RFC 1049 $B$G(B Content-Type $BMs$,Ds0F$5$l$F$$$k!#C"$7!"(BMIME $B$N(B
+-media-type $B$N$h$&$J(B type $B$H(B subtype $B$N6hJL$O$J$/!"(BMIME charset $B$N$h$&$J(B
+-$BJ8;zId9f$N<oN`$rI=8=$9$k$3$H$b$G$-$J$$!#(B
++歴史的には RFC 1049 で Content-Type 欄が提案されている。但し、MIME の
++media-type のような type と subtype の区別はなく、MIME charset のような
++文字符号の種類を表現することもできない。
+ @end quotation
+ 
+ 
+-FLIM $B$O(B Content-Type $BMs$r9=J82r@O$9$k4X?t$H(B Content-Type $BMs$N2r@O7k2L$r(B
+-$B3JG<$9$k9=B$BN(B @strong{mime-content-type} $B$rDs6!$7$^$9!#(B
++FLIM は Content-Type 欄を構文解析する関数と Content-Type 欄の解析結果を
++格納する構造体 @strong{mime-content-type} を提供します。
+ 
+ 
+ @menu
+-* Content-Type field::          Content-Type $BMs$N7A<0(B
+-* mime-content-type::           mime-content-type $B9=B$BN(B
+-* Content-Type parser::         Content-Type $BMs$N2r@O4o(B
+-* Content-Type utility::        Content-Type $B$K4X$9$kM-MQ$J4X?t(B
++* Content-Type field::          Content-Type 欄の形式
++* mime-content-type::           mime-content-type 構造体
++* Content-Type parser::         Content-Type 欄の解析器
++* Content-Type utility::        Content-Type に関する有用な関数
+ @end menu
+ 
+ @node Content-Type field, mime-content-type, Content-Type, Content-Type
+-@section Content-Type $BMs$N7A<0(B
++@section Content-Type 欄の形式
+ @cindex parameter
+ @cindex subtype
+ @cindex type
+ 
+-Content-Type $BMs$N7A<0$O0J2<$N$h$&$KDj5A$5$l$F$$$^$9!'(B
++Content-Type 欄の形式は以下のように定義されています:
+ 
+ @quotation
+ ``Content-Type'' ``:'' @strong{type} ``/''
+ @strong{subtype} *( ``;'' @strong{parameter} )
+ @end quotation
+ 
+-$BNc$($P!"(B
++例えば、
+ 
+ @quotation
+ @example
+@@ -583,7 +589,7 @@
+ @end quotation
+ 
+ @noindent
+-$B$d(B
++や
+ 
+ @quotation
+ @example
+@@ -592,17 +598,17 @@
+ @end quotation
+ 
+ @noindent
+-$B$J$I$N$h$&$KMQ$$$i$l$^$9!#(B
++などのように用いられます。
+ 
+-$B$3$3$G!"(B`type' $B$H(B `subtype' $B$O(B entity $B$N7A<0$r<($9$b$N$G!"N><T$rAm>N$7(B
+-$B$F!"(B`media-type' $B$H8F$V$3$H$K$7$^$9!#>e5-$NNc$K$*$1$k(B `image/jpeg' $B$d(B
+-`text/plain' $B$O(B media-type $B$N#1$D$G$9!#(B
++ここで、`type' と `subtype' は entity の形式を示すもので、両者を総称し
++て、`media-type' と呼ぶことにします。上記の例における `image/jpeg' や
++`text/plain' は media-type の1つです。
+ 
+ @noindent
+ @strong{[Memo]}
+ @quotation
+ 
+-Content-Type $BMs$N$J$$(B entity $B$O(B
++Content-Type 欄のない entity は
+ 
+ @quotation
+ @example
+@@ -611,32 +617,32 @@
+ @end quotation
+ 
+ @noindent
+-$B$H$7$F2r<a$5$l$k!#(B(cf. @ref{us-ascii})
++として解釈される。(cf. @ref{us-ascii})
+ @end quotation
+ 
+ 
+ 
+ @node mime-content-type, Content-Type parser, Content-Type field, Content-Type
+-@section mime-content-type $B9=B$BN(B
++@section mime-content-type 構造体
+ 
+ @deffn{Structure} mime-content-type
+ 
+-Content-Type $BMs$N>pJs$r3JG<$9$k$?$a$N9=B$BN!#(B@refill
++Content-Type 欄の情報を格納するための構造体。@refill
+ 
+-$B$3$N9=B$BN$r;2>H$9$k$K$O(B @code{mime-content-type-$BMWAGL>(B} $B$H$$$&L>A0$N;2(B
+-$B>H4X?t$rMQ$$$k!#(B@refill
++この構造体を参照するには @code{mime-content-type-要素名} という名前の参
++照関数を用いる。@refill
+ 
+-$B$3$N9=B$BN$NMWAG$O0J2<$NDL$j$G$"$k!'(B
++この構造体の要素は以下の通りである:
+ 
+ @table @var
+ @item primary-type
+-media-type $B$N<g7?(B (symbol).
++media-type の主型 (symbol).
+ 
+ @item subtype
+-media-type $B$NI{7?(B (symbol).
++media-type の副型 (symbol).
+ 
+ @item parameters
+-Content-Type $BMs$N(B parameter ($BO"A[(B list).
++Content-Type 欄の parameter (連想 list).
+ 
+ @end table
+ @end deffn
+@@ -645,54 +651,54 @@
+ @defun make-mime-content-type type subtype
+          &optional  parameters
+ 
+-content-type $B$N@8@.;R!#(B
++content-type の生成子。
+ @end defun
+ 
+ 
+ @defun mime-content-type-parameter content-type parameter
+ 
+-@var{content-type} $B$N(B @var{parameter} $B$NCM$rJV$9!#(B
++@var{content-type} の @var{parameter} の値を返す。
+ @end defun
+ 
+ 
+ 
+ @node Content-Type parser, Content-Type utility, mime-content-type, Content-Type
+-@section Content-Type $BMs$N2r@O4o(B
++@section Content-Type 欄の解析器
+ 
+ @defun mime-parse-Content-Type string
+ 
+-@var{string} $B$r(B content-type $B$H$7$F2r@O$7$?7k2L$rJV$9!#(B
++@var{string} を content-type として解析した結果を返す。
+ @end defun
+ 
+ 
+ @defun mime-read-Content-Type
+ 
+-$B8=:_$N(B buffer $B$N(B Content-Type $BMs$rFI$_<h$j!"2r@O$7$?7k2L$rJV$9!#(B@refill
++現在の buffer の Content-Type 欄を読み取り、解析した結果を返す。@refill
+ 
+-Content-Type $BMs$,B8:_$7$J$$>l9g$O(B nil $B$rJV$9!#(B
++Content-Type 欄が存在しない場合は nil を返す。
+ @end defun
+ 
+ 
+ 
+ @node Content-Type utility,  , Content-Type parser, Content-Type
+-@section Content-Type $B$K4X$9$kM-MQ$J4X?t(B
++@section Content-Type に関する有用な関数
+ 
+ @defun mime-type/subtype-string type  &optional  subtype
+ 
+-@var{type} $B$H(B @var{subtype} $B$+$i(B type/subtype $B7A<0$NJ8;zNs$rJV$9!#(B
++@var{type} と @var{subtype} から type/subtype 形式の文字列を返す。
+ @end defun
+ 
+ 
+ 
+ @node Content-Disposition, Content-Transfer-Encoding, Content-Type, Top
+-@chapter Content-Disposition $BMs$N>pJs(B
++@chapter Content-Disposition 欄の情報
+ @cindex mime-content-disposition
+ @cindex RFC 2183
+ @cindex Standards Track
+-@cindex Content-Disposition $BMs(B
++@cindex Content-Disposition 欄
+ 
+-@strong{Content-Disposition $BMs(B} $B$O(B entity $B$NI=<($d(B file $BL>$J$I(B
+-$B$NB0@-$K$J$I$K4X$9$k>pJs$r5-=R$9$k$?$a$N$b$N$G$9!#(B
++@strong{Content-Disposition 欄} は entity の表示や file 名など
++の属性になどに関する情報を記述するためのものです。
+ 
+ 
+ @noindent
+@@ -703,34 +709,34 @@
+ August 1997, Standards Track.
+ @end quotation
+ 
+-FLIM $B$O(B Content-Disposition $BMs$r9=J82r@O$9$k4X?t$H(B Content-Disposition 
+-$BMs$N2r@O7k2L$r3JG<$9$k9=B$BN(B 
+-@strong{mime-content-disposition} $B$rDs6!$7$^$9!#(B
++FLIM は Content-Disposition 欄を構文解析する関数と Content-Disposition 
++欄の解析結果を格納する構造体 
++@strong{mime-content-disposition} を提供します。
+ 
+ 
+ @menu
+-* mime-content-disposition::    mime-content-disposition $B9=B$BN(B
+-* Content-Disposition parser::  Content-Disposition $BMs$N2r@O4o(B
++* mime-content-disposition::    mime-content-disposition 構造体
++* Content-Disposition parser::  Content-Disposition 欄の解析器
+ @end menu
+ 
+ @node mime-content-disposition, Content-Disposition parser, Content-Disposition, Content-Disposition
+-@section mime-content-disposition $B9=B$BN(B
++@section mime-content-disposition 構造体
+ 
+ @deffn{Structure} mime-content-disposition
+ 
+-Content-Disposition $BMs$N2r@O7k2L$r<}$a$k$?$a$N9=B$BN!#(B@refill
++Content-Disposition 欄の解析結果を収めるための構造体。@refill
+ 
+-$B$3$N9=B$BN$r;2>H$9$k$K$O(B @code{mime-content-disposition-$BMWAGL>(B} $B$H$$$&L>(B
+-$BA0$N;2>H4X?t$rMQ$$$k!#(B@refill
++この構造体を参照するには @code{mime-content-disposition-要素名} という名
++前の参照関数を用いる。@refill
+ 
+-$B$3$N9=B$BN$NMWAG$O0J2<$NDL$j$G$"$k!'(B
++この構造体の要素は以下の通りである:
+ 
+ @table @var
+ @item disposition-type
+ disposition-type (symbol).
+ 
+ @item parameters
+-Content-Disposition $BMs$N(B parameter ($BO"A[(B list).
++Content-Disposition 欄の parameter (連想 list).
+ 
+ @end table
+ @end deffn
+@@ -738,117 +744,117 @@
+ 
+ @defun mime-content-disposition-parameter content-disposition parameter
+ 
+-@var{content-disposition} $B$N(B @var{parameter} $B$NCM$rJV$9!#(B
++@var{content-disposition} の @var{parameter} の値を返す。
+ @end defun
+ 
+ 
+ @defun mime-content-disposition-filename content-disposition
+ 
+-@var{content-disposition} $B$N(B filename $B$NCM$rJV$9!#(B
++@var{content-disposition} の filename の値を返す。
+ @end defun
+ 
+ 
+ 
+ @node Content-Disposition parser,  , mime-content-disposition, Content-Disposition
+-@section Content-Disposition $BMs$N2r@O4o(B
++@section Content-Disposition 欄の解析器
+ 
+ @defun mime-parse-Content-Disposition string
+ 
+-@var{string} $B$r(B content-disposition $B$H$7$F2r@O$7$?7k2L$rJV$9!#(B
++@var{string} を content-disposition として解析した結果を返す。
+ @end defun
+ 
+ 
+ @defun mime-read-Content-Disposition
+ 
+-$B8=:_$N(B buffer $B$N(B Content-Disposition $BMs$rFI$_<h$j!"2r@O$7$?7k2L$rJV$9!#(B
++現在の buffer の Content-Disposition 欄を読み取り、解析した結果を返す。
+ @refill
+ 
+-Content-Disposition $BMs$,B8:_$7$J$$>l9g$O(B nil $B$rJV$9!#(B
++Content-Disposition 欄が存在しない場合は nil を返す。
+ @end defun
+ 
+ 
+ 
+ @node Content-Transfer-Encoding, encoded-word, Content-Disposition, Top
+-@chapter $BId9f2=K!(B
+-@cindex Content-Transfer-Encoding $BMs(B
++@chapter 符号化法
++@cindex Content-Transfer-Encoding 欄
+ 
+-@strong{Content-Transfer-Encoding $BMs(B} $B$O(B entity $B$NId9f2=K!$r5-=R$9$k$?$a(B
+-$B$N$b$N$G$9!#(B@refill
++@strong{Content-Transfer-Encoding 欄} は entity の符号化法を記述するため
++のものです。@refill
+ 
+-FLIM $B$G$O(B Content-Transfer-Encoding $BMs$r9=J82r@O$9$k4X?t$rDs6!$7$^$9!#$3(B
+-$B$l$i$N4X?t$O(B Content-Transfer-Encoding $BMs$N>pJs$OJ8;zNs$GI=8=$7$^$9!#(B
++FLIM では Content-Transfer-Encoding 欄を構文解析する関数を提供します。こ
++れらの関数は Content-Transfer-Encoding 欄の情報は文字列で表現します。
+ @refill
+ 
+-$B$^$?!"(BContent-Transfer-Encoding $B$K4p$E$$$FId9f2=!&I|9f2=$r9T$&4X?t$bDs(B
+-$B6!$5$l$^$9!#(B
++また、Content-Transfer-Encoding に基づいて符号化・復号化を行う関数も提
++供されます。
+ 
+ 
+ @menu
+-* Content-Transfer-Encoding parser::  Content-Transfer-Encoding $BMs$N2r@O4o(B
+-* encoder/decoder::             $BId9f2=!&I|9f2=(B
++* Content-Transfer-Encoding parser::  Content-Transfer-Encoding 欄の解析器
++* encoder/decoder::             符号化・復号化
+ * Encoding information::        Other utilities
+ * mel-backend::                 How to write encoder/decoder module
+ * generic function for mel-backend::  How to add encoding/decoding service
+ @end menu
+ 
+ @node Content-Transfer-Encoding parser, encoder/decoder, Content-Transfer-Encoding, Content-Transfer-Encoding
+-@section Content-Transfer-Encoding $BMs$N2r@O4o(B
++@section Content-Transfer-Encoding 欄の解析器
+ 
+ @defun mime-parse-Content-Transfer-Encoding string
+ 
+-@var{string} $B$r(B content-transfer-encoding $B$H$7$F2r@O$7$?7k2L$rJV$9!#(B
++@var{string} を content-transfer-encoding として解析した結果を返す。
+ @end defun
+ 
+ 
+ @defun mime-read-Content-Transfer-Encoding &optional default-encoding
+ 
+-$B8=:_$N(B buffer $B$N(B Content-Transfer-Encoding $BMs$rFI$_<h$j!"2r@O$7$?7k2L$r(B
+-$BJV$9!#(B@refill
++現在の buffer の Content-Transfer-Encoding 欄を読み取り、解析した結果を
++返す。@refill
+ 
+-Content-Transfer-Encoding $BMs$,B8:_$7$J$$>l9g$O(B@var{default-encoding} $B$r(B
+-$BJV$9!#(B
++Content-Transfer-Encoding 欄が存在しない場合は@var{default-encoding} を
++返す。
+ @end defun
+ 
+ 
+ 
+ @node encoder/decoder, Encoding information, Content-Transfer-Encoding parser, Content-Transfer-Encoding
+-@section $BId9f2=!&I|9f2=(B
++@section 符号化・復号化
+ 
+ @defun mime-encode-region start end encoding
+ 
+-$B8=:_$N(B buffer $B$N(B @var{start} $B$+$i(B @var{end} $B$^$G$N(B region $B$r(B
+-@var{encoding} $B$r;H$C$FId9f2=$7$^$9!#(B
++現在の buffer の @var{start} から @var{end} までの region を
++@var{encoding} を使って符号化します。
+ @end defun
+ 
+ 
+ @defun mime-decode-region start end encoding
+ 
+-$B8=:_$N(B buffer $B$N(B @var{start} $B$+$i(B @var{end} $B$^$G$N(B region $B$r(B
+-@var{encoding} $B$r;H$C$FI|9f2=$7$^$9!#(B
++現在の buffer の @var{start} から @var{end} までの region を
++@var{encoding} を使って復号化します。
+ @end defun
+ 
+ 
+ 
+ @defun mime-decode-string string encoding
+ 
+-@var{string} $B$r(B @var{encoding} $B$H$7$FI|9f$7$?7k2L$rJV$9!#(B
++@var{string} を @var{encoding} として復号した結果を返す。
+ @end defun
+ 
+ 
+ 
+ @defun mime-insert-encoded-file filename encoding
+ 
+-@var{ENCODING} format $B$GId9f2=$5$l$?(B file @var{FILENAME} $B$r(B
+-$BA^F~$9$k!#(B
++@var{ENCODING} format で符号化された file @var{FILENAME} を
++挿入する。
+ @end defun
+ 
+ 
+ @defun mime-write-decoded-region start end filename encoding
+ 
+-@var{encoding} $B$GId9f2=$5$l$?8=:_$N(B region $B$rI|9f2=$7$F(B
+-@var{filename}$B$K=q$-9~$_$^$9!#(B
++@var{encoding} で符号化された現在の region を復号化して
++@var{filename}に書き込みます。
+ 
+-<var>start<var> $B$H(B @var{end} $B$O(B buffer $B$N0LCV$G$9!#(B
++<var>start<var> と @var{end} は buffer の位置です。
+ @end defun
+ 
+ 
+@@ -858,19 +864,19 @@
+ 
+ @defun mime-encoding-list &optional  SERVICE
+ 
+-Content-Transfer-Encoding $B$N(B list $B$rJV$7$^$9!#(B@refill
++Content-Transfer-Encoding の list を返します。@refill
+ 
+-@var{service} $B$,;XDj$5$l$F$$$k$H!"$=$l$KBP$9$k(B
+-Content-Transfer-Encoding $B$rJV$7$^$9!#(B
++@var{service} が指定されていると、それに対する
++Content-Transfer-Encoding を返します。
+ @end defun
+ 
+ 
+ @defun mime-encoding-alist &optional  SERVICE
+ 
+-$BJd40$N$?$a$N(B Content-Transfer-Encoding $B$NI=$rJV$7$^$9!#(B@refill
++補完のための Content-Transfer-Encoding の表を返します。@refill
+ 
+-@var{service} $B$,;XDj$5$l$F$$$k>l9g$O$=$l$KBP$9$k(B
+-Content-Transfer-Encoding $B$N(B list $B$rJV$7$^$9!#(B
++@var{service} が指定されている場合はそれに対する
++Content-Transfer-Encoding の list を返します。
+ @end defun
+ 
+ 
+@@ -880,15 +886,15 @@
+ 
+ @defmac mel-define-method name args  &rest  body
+ 
+-@var{name} $B$r(B (nth 1 (car (last @var{args}))) backend $B$N(B
+-method $B4X?t$H$7$FDj5A$7$^$9!#(B
++@var{name} を (nth 1 (car (last @var{args}))) backend の
++method 関数として定義します。
+ 
+-@var{args} $B$O(B lambda $B$N0z?t(B list $B$H;w$F$$$^$9$,!"(B(car (last
+-@var{args})) $B$O;XDj$5$l$?(B parameter $B$G$"$kI,MW$,$"$j$^$9!#(B(car
+-(car (last @var{args}))) $B$OJQ?t$NL>A0$G!"(B(nth 1 (car (last
+-@var{args}))) $B$O(B backend $B$NL>A0(B (encoding) $B$G$9!#(B@refill
++@var{args} は lambda の引数 list と似ていますが、(car (last
++@var{args})) は指定された parameter である必要があります。(car
++(car (last @var{args}))) は変数の名前で、(nth 1 (car (last
++@var{args}))) は backend の名前 (encoding) です。@refill
+ 
+-$BNc(B:@refill
++例:@refill
+ 
+ @lisp
+ (mel-define-method mime-write-decoded-region (start end filename
+@@ -909,16 +915,16 @@
+ 
+ @defmac mel-define-method-function spec function
+ 
+-@var{spec} $B$N4X?tDj5A$r(B @var{function} $B$K@_Dj$7$^$9!#(B@refill
++@var{spec} の関数定義を @var{function} に設定します。@refill
+ 
+-@var{spec} $B$N:G=i$NMWAG$O(B service $B$G$9!#(B@refill
++@var{spec} の最初の要素は service です。@refill
+ 
+-@var{args} $B$N;D$j$O(B lambda $B$N0z?t(B list $B;w$F$$$^$9$,!"(B(car (last
+-@var{args})) $B$O;XDj$5$l$?(B parameter $B$G$"$kI,MW$,$"$j$^$9!#(B(car
+-(car (last @var{args}))) $B$OJQ?t$NL>A0$G!"(B(nth 1 (car (last
+-@var{args}))) $B$O(B backend $B$NL>A0(B (encoding) $B$G$9!#(B@refill
++@var{args} の残りは lambda の引数 list 似ていますが、(car (last
++@var{args})) は指定された parameter である必要があります。(car
++(car (last @var{args}))) は変数の名前で、(nth 1 (car (last
++@var{args}))) は backend の名前 (encoding) です。@refill
+ 
+-$BNc(B:@refill
++例:@refill
+ 
+ @lisp
+ (mel-define-method-function (mime-encode-string string (nil "base64"))
+@@ -929,17 +935,17 @@
+ 
+ 
+ @node generic function for mel-backend,  , mel-backend, Content-Transfer-Encoding
+-@section $BId9f2=(B/$BI|9f2=(B service $B$rDI2C$9$kJ}K!(B
++@section 符号化/復号化 service を追加する方法
+ 
+ @defmac mel-define-service name &optional  args doc-string
+ 
+-@var{name} $B$r(B Content-Transfer-Encoding $B$N(B service $B$H$7$FDj5A$7$^(B
+-$B$9!#(B@refill
++@var{name} を Content-Transfer-Encoding の service として定義しま
++す。@refill
+ 
+-@var{args} $B$,;XDj$5$l$F$$$k$H!"(B@var{name} $B$O(B service $B$N(B
+-generic function $B$H$7$FDj5A$5$l$^$9!#(B@refill
++@var{args} が指定されていると、@var{name} は service の
++generic function として定義されます。@refill
+ 
+-$BNc(B:@refill
++例:@refill
+ 
+ @lisp
+ (mel-define-service encoded-text-encode-string (string encoding)
+@@ -951,13 +957,13 @@
+ 
+ 
+ @node encoded-word, custom, Content-Transfer-Encoding, Top
+-@chapter Header $B$N(B network $BI=8=(B
++@chapter Header の network 表現
+ @cindex RFC 2047
+ @cindex Standards Track
+ @cindex RFC 2047
+ 
+-encoded-word $B$O(B header $B$GHs(B ASCII (@ref{ASCII}) $BJ8;z$rI=8=$9$k$?$a$N7A<0(B
+-$B$G!"(B@strong{RFC 2047} $B$GDj5A$5$l$F$$$^$9!#(B@refill
++encoded-word は header で非 ASCII (@ref{ASCII}) 文字を表現するための形式
++で、@strong{RFC 2047} で定義されています。@refill
+ 
+ 
+ @noindent
+@@ -968,86 +974,86 @@
+ Track (obsolete RFC 1521,1522,1590).
+ @end quotation
+ 
+-$B$^$?!"9T57$N0-$$$3$H$@$H8@$($^$9$,!"(Bencoded-word $B$rMQ$$$:$KHs(B ASCII
+-(@ref{ASCII}) $BJ8;z$r(B header $B$KF~$l$?5-;v$bB8:_$7$^$9!#(B@refill
++また、行儀の悪いことだと言えますが、encoded-word を用いずに非 ASCII
++(@ref{ASCII}) 文字を header に入れた記事も存在します。@refill
+ 
+-FLIM $B$O$3$l$i$rId9f2=!&I|9f2=$9$k5!G=$rDs6!$7$^$9!#(B
++FLIM はこれらを符号化・復号化する機能を提供します。
+ 
+ 
+ @menu
+-* Header encoder/decoder::      Header $B$NId9f2=!&I|9f2=(B
++* Header encoder/decoder::      Header の符号化・復号化
+ @end menu
+ 
+ @node Header encoder/decoder,  , encoded-word, encoded-word
+-@section Header $B$NId9f2=!&I|9f2=(B
++@section Header の符号化・復号化
+ 
+ @defun eword-decode-header &optional  code-conversion separator
+ 
+-Header $BCf$N(B encoded-word $B$rI|9f$9$k!#(B@refill
++Header 中の encoded-word を復号する。@refill
+ 
+-$B$b$7(B @var{code-conversion} $B$,(B @code{nil} $B$J$i!"(Bencoded-word $B$@$1$,I|9f$5(B
+-$B$l$k!#$b$7!"(B@var{code-conversion} $B$,(B MIME charset (@ref{MIME charset}) 
+-$B$J$i!"Hs(B ASCII bit patterns $B$O$=$N(B MIME charset $B$H$7$FI|9f$5$l$k!#$3$l0J(B
+-$B30$N>l9g!"Hs(B ASCII bit patterns $B$O(B@code{default-mime-charset}. $B$H$7$FI|(B
+-$B9f$5$l$k!#(B(cf. @ref{entity formatting}) @refill
++もし @var{code-conversion} が @code{nil} なら、encoded-word だけが復号さ
++れる。もし、@var{code-conversion} が MIME charset (@ref{MIME charset}) 
++なら、非 ASCII bit patterns はその MIME charset として復号される。これ以
++外の場合、非 ASCII bit patterns は@code{default-mime-charset}. として復
++号される。(cf. @ref{entity formatting}) @refill
+ 
+-$B$b$7(B @var{separator} $B$,(B @code{nil} $B$G$J$1$l$P!"$=$NCM$,(Bheader separator 
+-$B$H$7$FMQ$$$i$l$k!#(B
++もし @var{separator} が @code{nil} でなければ、その値がheader separator 
++として用いられる。
+ @end defun
+ 
+ 
+ @defun eword-encode-header &optional  code-conversion
+ 
+-Header $B$r(B network $BI=8=$KId9f2=$9$k!#(B@refill
++Header を network 表現に符号化する。@refill
+ 
+-$B3F(B field $B$O(B @code{mime-field-encoding-method-alist} $B$G;XDj$5$l$?J}<0$G(B
+-$BId9f2=$5$l$k!#(B
++各 field は @code{mime-field-encoding-method-alist} で指定された方式で
++符号化される。
+ @end defun
+ 
+ 
+ @defvar mime-field-encoding-method-alist
+ 
+-Field $B$rId9f2=$9$kJ}K!$r;XDj$9$kO"A[(B list$B!#3F(B element $B$O(B (FIELD
+-. METHOD) $B$NMM$K$J$C$F$$$k!#(B@refill
++Field を符号化する方法を指定する連想 list。各 element は (FIELD
++. METHOD) の様になっている。@refill
+ 
+-METHOD $B$,(B @code{mime} $B$G$"$l$P!"(BFIELD $B$O(B MIME format $B$KId9f2=$5(B
+-$B$l$k(B (encoded-word)$B!#(B
++METHOD が @code{mime} であれば、FIELD は MIME format に符号化さ
++れる (encoded-word)。
+ 
+-METHOD $B$,(B @code{nil} $B$G$"$l$P!"(BFIELD $B$OId9f2=$5$l$J$$!#(B
++METHOD が @code{nil} であれば、FIELD は符号化されない。
+ 
+-METHOD $B$,(B MIME charset $B$G$"$l$P!"(BFIELD $B$O%M%C%H%o!<%/%3!<%I$KJQ49$7$J(B
+-$B$1$l$P$J$i$J$$$H$-$K(B charset $B$KId9f2=$5$l$k!#(B@refill
++METHOD が MIME charset であれば、FIELD はネットワークコードに変換しな
++ければならないときに charset に符号化される。@refill
+ 
+-$B$=$&$G$J$1$l$P!"(BFIELD $B$O%M%C%H%o!<%/%3!<%I$KJQ49$7$J$1$l$P$J$i$J$$$H$-(B
+-$B$K(B $BJQ?t(B @code{default-mime-charset} $B$GId9f2=$5$l$k(B
++そうでなければ、FIELD はネットワークコードに変換しなければならないとき
++に 変数 @code{default-mime-charset} で符号化される
+ @end defvar
+ 
+ 
+ 
+ @node custom, Appendix, encoded-word, Top
+-@chapter $B0lHL@_Dj(B
++@chapter 一般設定
+ 
+ @deffn{group} mime
+ 
+-MIME $B4XO"5!G=$K4X$9$k(B group.@refill
++MIME 関連機能に関する group.@refill
+ 
+-@code{mail} $B$H(B @code{news} $B$KB0$9$k!#(B
++@code{mail} と @code{news} に属する。
+ @end deffn
+ 
+ 
+ @node Appendix, Concept Index, custom, Top
+-@chapter $BIUO?(B
++@chapter 付録
+ 
+ 
+ @menu
+-* Glossary::                    $BMQ8l(B
+-* Bug report::                  bug $BJs9p$N;EJ}(B
+-* CVS::                         CVS $B$K$h$k3+H/(B
+-* History::                     $BNr;K(B
++* Glossary::                    用語
++* Bug report::                  bug 報告の仕方
++* GitHub::                      GitHub による開発
++* History::                     歴史
+ @end menu
+ 
+ @node Glossary, Bug report, Appendix, Appendix
+-@section $BMQ8l(B
++@section 用語
+ 
+ 
+ @menu
+@@ -1056,7 +1062,7 @@
+ * ASCII::                       
+ * Base64::                      
+ * binary::                      
+-* Coded character set::         Coded character set$B!JId9f2=J8;z=89g!K(B, Character code$B!JJ8;zId9f!K(B
++* Coded character set::         Coded character set(符号化文字集合), Character code(文字符号)
+ * media-type::                  
+ * message::                     
+ * MIME::                        
+@@ -1077,64 +1083,64 @@
+ @node 7bit, 8bit, Glossary, Glossary
+ @subsection 7bit
+ 
+-$B$3$3$G$O(B 0 $B$+$i(B 127 $B$N@0?t$r;X$9!#(B@refill
++ここでは 0 から 127 の整数を指す。@refill
+ 
+-0 $B$+$i(B 127 $B$N@0?t$NNs$GI=8=$G$-$k$h$&$J(B data $B$r(B ``7bit $B$N(B data'' $B$H8F$V!#(B
++0 から 127 の整数の列で表現できるような data を ``7bit の data'' と呼ぶ。
+ @refill
+ 
+-$B$^$?!"(B0 $B$+$i(B 31 $B$*$h$S(B 127 $B$GI=8=$5$l$k@)8fJ8;z$H(B 32 $B$GI=8=$5$l$k6uGr$H(B 
+-33 $B$+$i(B 126 $B$GI=8=$5$l$k?^7AJ8;z$+$i$J$kJ8;zNs$N$3$H$r(B ``7bit $B$NJ8;zNs(B'' 
+-$B$H8F$V!J$3$l$O(B ISO 2022 (@ref{ISO 2022}) $B$N!V(B7 $BC10L7O!W$HF1MM!K!#(B
+-
+-$BEAE}E*$J(B Internet $B$N(B MTA (@ref{MTA}) $B$O(B 7bit $B$N(B data $B$rE>Aw$G$-$k$N$G!"(B
+-7bit $B$N(B data $B$O(B Quoted-Printable (@ref{Quoted-Printable}) $B$d(B Base64
+-(@ref{Base64}) $B$H$$$C$?JQ49$r9T$o$J$/$F$b$=$N$^$^E>Aw$G$-$k!#(B@refill
+-
+-$B$7$+$7!"(B7bit $B$G$"$l$P$I$s$J(B data $B$G$bNI$$$H$O$$$($J$$!#$J$<$J$i!"#19T$N(B
+-$BD9$5$,$"$^$j$KD9$$$H!"(BMTA $B$O$=$N(B message $B$rE>Aw$9$k$3$H$,$G$-$J$$$+$i$G(B
+-$B$"$k!#$A$J$_$K!"(BRFC 821 (@ref{RFC 821}) $B$O#19T$O2~9TJ8;z$r=|$$$F(B 998
+-byte $B0JFb$G$"$k$3$H$r5a$a$F$$$k!#$h$C$F!"$3$l0J>e$N9T$,4^$^$l$k2DG=@-$N(B
+-$B$"$k(B data, $BNc$($P!"(BPostscript $B$N(B data $B$J$I$O(B Quoted-Printable $BEy$G(B 
+-encode$B$9$kI,MQ$,$"$k!#(B
++また、0 から 31 および 127 で表現される制御文字と 32 で表現される空白と 
++33 から 126 で表現される図形文字からなる文字列のことを ``7bit の文字列'' 
++と呼ぶ(これは ISO 2022 の「7 単位系」と同様)。
++
++伝統的な Internet の MTA (@ref{MTA}) は 7bit の data を転送できるので、
++7bit の data は Quoted-Printable (@ref{Quoted-Printable}) や Base64
++(@ref{Base64}) といった変換を行わなくてもそのまま転送できる。@refill
++
++しかし、7bit であればどんな data でも良いとはいえない。なぜなら、1行の
++長さがあまりに長いと、MTA はその message を転送することができないからで
++ある。ちなみに、RFC 822 (@ref{RFC 822}) は1行は改行文字を除いて 998
++byte 以内であることを求めている。よって、これ以上の行が含まれる可能性の
++ある data, 例えば、Postscript の data などは Quoted-Printable 等で 
++encodeする必用がある。
+ 
+ 
+ @node 8bit, ASCII, 7bit, Glossary
+ @subsection 8bit
+ @cindex binary
+ 
+-$B$3$3$G$O(B 0 $B$+$i(B 255 $B$N@0?t$r;X$9!#(B@refill
++ここでは 0 から 255 の整数を指す。@refill
+ 
+-0 $B$+$i(B 255 $B$N@0?t$NNs$GI=8=$G$-$k$h$&$J(B data $B$r(B ``8bit $B$N(B data'' $B$H8F$V!#(B
++0 から 255 の整数の列で表現できるような data を ``8bit の data'' と呼ぶ。
+ @refill
+ 
+-$B$^$?!"(B0 $B$+$i(B 31, 127 $B$*$h$S(B 128 $B$+$i(B 159 $B$GI=8=$5$l$k@)8fJ8;z$H(B 32 $B$GI=(B
+-$B8=$5$l$k6uGr$H(B 33 $B$+$i(B 126 $B$H(B 160 $B$+$i(B 255 $B$GI=8=$5$l$k?^7AJ8;z$+$i$J$k(B
+-$BJ8;zNs$N$3$H$r(B ``8bit $B$NJ8;zNs(B'' $B$H8F$V!J$3$l$O(B ISO 2022 (@ref{ISO 2022}) $B$N!V(B8 $BC10L7O!W$HF1MM!K!#(B@refill
+-
+-iso-8859-1 (@ref{iso-8859-1}) $B$d(B euc-kr (@ref{euc-kr}) $B$H$$$C$?Id9f2=J8(B
+-$B;z=89g$O(B 8bit $B$NJ8;zNs$G$"$k!#(B@refill
+-
+-$BEAE}E*$J(B Internet $B$N(B MTA (@ref{MTA}) $B$O(B 7bit (@ref{7bit}) $B$N(B data $B$7$+E>(B
+-$BAw$G$-$J$$$N$G!"$=$&$7$?(B MTA $B$r7PM3$9$k>l9g!"(BQuoted-Printable
+-(@ref{Quoted-Printable}) $B$d(B Base64 (@ref{Base64}) $B$H$$$C$?JQ49$r9T$o$J$/(B
+-$B$F$O$J$i$J$$!#(B@refill
+-
+-$B$7$+$7!":G6a$G$O(B 8bit $B$NJ8;zNs$r$=$N$^$^DL$9$3$H$,$G$-$k(B MTA $B$bEP>l$7$F(B
+-$B$-$?$N$G!"$=$N$^$^Aw$k$3$H$,$G$-$k>l9g$bA}$($F$-$?!#(B@refill
+-
+-$B$7$+$7!"(B8bit $B$G$"$l$P$I$s$J(B data $B$G$bNI$$$H$O$$$($J$$!#$J$<$J$i!"#19T$N(B
+-$BD9$5$,$"$^$j$KD9$$$H!"(BMTA $B$O$=$N(B message $B$rE>Aw$9$k$3$H$,$G$-$J$$$+$i$G(B
+-$B$"$k!#$A$J$_$K!"(BRFC 821 (@ref{RFC 821}) $B$O#19T$O2~9TJ8;z$r=|$$$F(B 998
+-byte $B0JFb$G$"$k$3$H$r5a$a$F$$$k!#$h$C$F!"$3$l0J>e$N9T$,4^$^$l$k2DG=@-$N(B
+-$B$"$k(B data, $BNc$($P!"(BPostscript $B$N(B data $B$J$I$O(B Quoted-Printable $BEy$G(B 
+-encode$B$9$kI,MQ$,$"$k!#(B@refill
+-
+-$B$^$?!"$3$&$7$?M}M3$+$i!"#19T$,(B 999 byte $B0J>e$N9T$,B8:_$9$k2DG=@-$N$"$k(B
+-data $B$O(B @strong{binary} (@ref{binary}) $B$H8F$V$3$H$K$9$k!#(B@refill
+-
+-$B$A$J$_$K!"(B7bit $B$GI=8=$G$-$k(B data $B$O(B 8bit $B$G$bI=8=$G$-$k!#$h$C$F!"(B
+-``8bit'' $B$H8@$C$?>l9g!"#19T$,(B 998 byte $B0J2<$NG$0U$N(B data $B$r;X$9$3$H$,(B
+-$B$"$k!#(B
++また、0 から 31, 127 および 128 から 159 で表現される制御文字と 32 で表
++現される空白と 33 から 126 と 160 から 255 で表現される図形文字からなる
++文字列のことを ``8bit の文字列'' と呼ぶ(これは ISO 2022 の「8 単位系」と同様)。@refill
++
++iso-8859-1 や euc-kr といった符号化文
++字集合は 8bit の文字列である。@refill
++
++伝統的な Internet の MTA (@ref{MTA}) は 7bit (@ref{7bit}) の data しか転
++送できないので、そうした MTA を経由する場合、Quoted-Printable
++(@ref{Quoted-Printable}) や Base64 (@ref{Base64}) といった変換を行わなく
++てはならない。@refill
++
++しかし、最近では 8bit の文字列をそのまま通すことができる MTA も登場して
++きたので、そのまま送ることができる場合も増えてきた。@refill
++
++しかし、8bit であればどんな data でも良いとはいえない。なぜなら、1行の
++長さがあまりに長いと、MTA はその message を転送することができないからで
++ある。ちなみに、RFC 822 (@ref{RFC 822}) は1行は改行文字を除いて 998
++byte 以内であることを求めている。よって、これ以上の行が含まれる可能性の
++ある data, 例えば、Postscript の data などは Quoted-Printable 等で 
++encodeする必用がある。@refill
++
++また、こうした理由から、1行が 999 byte 以上の行が存在する可能性のある
++data は @strong{binary} (@ref{binary}) と呼ぶことにする。@refill
++
++ちなみに、7bit で表現できる data は 8bit でも表現できる。よって、
++``8bit'' と言った場合、1行が 998 byte 以下の任意の data を指すことが
++ある。
+ 
+ 
+ @node ASCII, Base64, 8bit, Glossary
+@@ -1142,8 +1148,8 @@
+ @cindex ANSI X3.4:1986
+ @cindex ASCII
+ 
+-$B%"%a%j%+O"K.$G;H$o$l$kJ8;z$rId9f2=$7$?Id9f2=J8;z=89g(B (@ref{$BId9f2=J8;z=8(B $B9g(B})$B!#(BA-Z, a-z $B$N(B Latin $BJ8;z$H?t;z!"4v$D$+$N5-9f$+$i$J$k!#(BISO 646 $B$N0l$D(B
+-$B$G!"8=:_$O9q:]4p=`HG(B (IRV) $B$K$J$C$F$$$k!#(B
++アメリカ連邦で使われる文字を符号化した符号化文字集合 (@ref{Coded character set})。A-Z, a-z の Latin 文字と数字、幾つかの記号からなる。ISO 646 の一つ
++で、現在は国際基準版 (IRV) になっている。
+ 
+ 
+ @noindent
+@@ -1159,16 +1165,16 @@
+ @subsection Base64
+ @cindex pad
+ 
+-RFC 2045 (@ref{RFC 2045}) $B$GDj5A$5$l$F$$$k(B MIME (@ref{MIME}) $B$K$*$1$k(B 
+-binary data (@ref{binary}) $B$N(B network $B$G$NJQ49K!$N#1$D!#(B@refill
++RFC 2045 (@ref{RFC 2045}) で定義されている MIME (@ref{MIME}) における 
++binary data (@ref{binary}) の network での変換法の1つ。@refill
+ 
+-$B!X(B64 $B?J?t!Y$H$$$&0UL#$G!"(B3 byte $B$N(B data $B$r(B 0 $B$+$i(B 63 $B$N?t$rI=$9(B ASCII
+-(@ref{ASCII}) 4 $BJ8;z$KJQ49$9$kJ}K!!#!J$b$7!"(B4 $BJ8;z$K$J$i$J$1$l$P(B 
+-@strong{pad} $B$H8F$P$l$k5M$aJ*$r$7$FD9$5$rD4@0$9$k!K(B@refill
+-
+-$B$3$N(B 65 $B<oN`$NJ8;z$O(B ASCII $B$H(B EBCDIC $B$N6&DLItJ,$+$iA*$P$l$F$*$j!"(B
+-Internet $B0J30$N(B network $B$r7PM3$9$k>l9g$G$b0BA4$KE>Aw$G$-$k$h$&$K@_7W$5(B
+-$B$l$F$$$k!#(B
++『64 進数』という意味で、3 byte の data を 0 から 63 の数を表す ASCII
++(@ref{ASCII}) 4 文字に変換する方法。(もし、4 文字にならなければ 
++@strong{pad} と呼ばれる詰め物をして長さを調整する)@refill
++
++この 65 種類の文字は ASCII と EBCDIC の共通部分から選ばれており、
++Internet 以外の network を経由する場合でも安全に転送できるように設計さ
++れている。
+ 
+ 
+ @node binary, Coded character set, Base64, Glossary
+@@ -1176,22 +1182,22 @@
+ @cindex binary data
+ @cindex binary
+ 
+-$BG$0U$N(B byte $BNs$r(B @strong{binary} $B$H8F$V!#(B@refill
++任意の byte 列を @strong{binary} と呼ぶ。@refill
+ 
+-8bit (@ref{8bit}) $B$H0[$J$k$N$O(B data $B$K9T$N9=B$$r2>Dj$7$J$$$3$H$G$"$k!#(B
++8bit (@ref{8bit}) と異なるのは data に行の構造を仮定しないことである。
+ 
+-$B$^$?!"9T$N9=B$$,$"$C$F$b!"(B999 byte $B0J>e$+$i$J$k9T$,$"$k>l9g$b(B binary $B$H(B
+-$B8F$V$3$H$K$9$k!#(B@refill
++また、行の構造があっても、999 byte 以上からなる行がある場合も binary と
++呼ぶことにする。@refill
+ 
+-$B$A$J$_$K!"(B7bit (@ref{7bit}) $B$d(B 8bit $B$GI=8=$G$-$k(B data $B$O(B binary $B$G$bI=8=(B
+-$B$G$-$k!#$h$C$F!"(B@strong{binary data} $B$H8@$C$?>l9g!"G$0U$N(B data $B$r;X$9$3(B
+-$B$H$,$"$k!#(B
++ちなみに、7bit (@ref{7bit}) や 8bit で表現できる data は binary でも表現
++できる。よって、@strong{binary data} と言った場合、任意の data を指すこ
++とがある。
+ 
+ 
+ @node Coded character set, media-type, binary, Glossary
+-@subsection Coded character set$B!JId9f2=J8;z=89g!K(B, Character code$B!JJ8;zId9f!K(B
++@subsection Coded character set(符号化文字集合), Character code(文字符号)
+ 
+-$BJ8;z$H(B byte $BNs$H#1BP#1$KBP1~IU$1$k[#Kf$G$J$$5,B'$N=89g!#(B
++文字と byte 列と1対1に対応付ける曖昧でない規則の集合。
+ 
+ 
+ @node media-type, message, Coded character set, Glossary
+@@ -1208,10 +1214,10 @@
+ @cindex subtype
+ @cindex primary-type
+ 
+-MIME (@ref{MIME}) $B$K$*$1$k(B entity (@ref{entity}) $B$N<oN`!#(B
+-@strong{primary-type} $B$H(B @strong{subtype} $B$+$i$J$k!#(BRFC 2046 (@ref{RFC 2046}) $B$GDj5A$5$l$F$$$k!#(B@refill
++MIME (@ref{MIME}) における entity (@ref{Entity}) の種類。
++@strong{primary-type} と @strong{subtype} からなる。RFC 2046 (@ref{RFC 2046}) で定義されている。@refill
+ 
+-primary-type $B$OI8=`$G$O(B
++primary-type は標準では
+ 
+ @itemize @bullet
+ @item
+@@ -1225,33 +1231,33 @@
+ @item
+ @strong{application}
+ @item
+-@strong{multipart} (@ref{multipart})
++@strong{multipart}
+ @item
+ @strong{message}
+ @end itemize
+ 
+ @noindent
+-$B$,Dj5A$5$l!"$=$l$>$l$K$O(B application/octet-stream, audio/basic,
+-image/jpeg, multipart/mixed (@ref{multipart/mixed}), text/plain
+-(@ref{text/plain}), video/mpeg $B$J$I$N$5$^$6$^$J(B subtype $B$,Dj5A$5$l$F$$$k!#(B
++が定義され、それぞれには application/octet-stream, audio/basic,
++image/jpeg, multipart/mixed, text/plain, video/mpeg などの
++さまざまな subtype が定義されている。
+ 
+ @noindent
+-@strong{[$BCm0U(B]}
++@strong{[注意]}
+ @quotation
+ 
+-$B$3$3$G$O!"(Btext/plain $B$J$I$N(B type/subtype $B$NAH$r$7$P$7$P(B 
+-@strong{primary-type/subtype} $B$H=q$/!#(B
++ここでは、text/plain などの type/subtype の組をしばしば 
++@strong{primary-type/subtype} と書く。
+ @end quotation
+ 
+ 
+-media-type $B$O!"(BRFC 2046 $B$GDj5A$5$l$F$$$k$b$N$K2C$($F!"EPO?$9$k$3$H$b$G$-(B
+-$B$k!#8=:_!"EPO?$5$l$F$$$k$b$N$O(B MEDIA TYPES
+-(ftp://ftp.isi.edu/in-notes/iana/assignments/media-types) $B$G;2>H$G$-$k!#(B
+-
+-$B$^$?!"(Btype $B$b$7$/$O(B subtype $B$K!"A0$K(B `x-' $B$rIU$1$?(B @strong{x-token} $B$rMQ(B
+-$B$$$k$3$H$K$h$j!"EPO?$5$l$F$$$J$$$b$N$r;dE*$KMQ$$$k$3$H$b$G$-$k!#$7$+$7!"(B
+-$BEvA3$N$3$H$J$,$i!"$3$&$7$?;dE*$J(B media-type $B$ONJ2r$rF@$?<T$N4V$G$7$+2r<a(B
+-$B$G$-$J$$$N$GMxMQ$K$OCm0U$9$k$3$H!#(B@refill
++media-type は、RFC 2046 で定義されているものに加えて、登録することもでき
++る。現在、登録されているものは MEDIA TYPES
++(ftp://ftp.isi.edu/in-notes/iana/assignments/media-types) で参照できる。
++
++また、type もしくは subtype に、前に `x-' を付けた @strong{x-token} を用
++いることにより、登録されていないものを私的に用いることもできる。しかし、
++当然のことながら、こうした私的な media-type は諒解を得た者の間でしか解釈
++できないので利用には注意すること。@refill
+ 
+ (cf. @ref{Content-Type})
+ 
+@@ -1260,59 +1266,59 @@
+ @node message, MIME, media-type, Glossary
+ @subsection message
+ 
+-$B$3$3$G$O(B mail $B$H(B news $B5-;v$NAm>N$H$7$FMQ$$$k!#(B
++ここでは mail と news 記事の総称として用いる。
+ 
+ 
+ @node MIME, MIME charset, message, Glossary
+ @subsection MIME
+ @cindex Multipurpose Internet Mail Extensions
+ 
+-@strong{Multipurpose Internet Mail Extensions} $B$NN,$G!"(BInternet $B$N(B mail 
+-$B$d(B news $B$G(B us-ascii plain text (@ref{us-ascii}) $B0J30$NJ8;z$r;H$&$?$a$N(B 
+-RFC 822 (@ref{RFC 822}) $B$KBP$9$k3HD%!#(B@refill
+-
+-RFC 2045 $B$OKAF,$G<!$N$h$&$K=R$Y$F$$$k!'(B@refill
+-
+-STD 11, RFC 822 $B$O!"(BUS-ASCII message header $B$K4X$7$FHs>o$K>\:Y$K5,Dj$7(B
+-$B$?(B message $BI=8=(B protocol $B$rDj5A$7$F$$$k!#$7$+$7!"$=$l$OC1$K(B flat $B$J(B 
+-US-ASCII text $B$N$_$KN1$^$j!"(Bmessage $B$NFbMF$d(B message body $B$K4X$9$k5,Dj(B
+-$B$O$J$5$l$F$$$J$$!#(BMultipurpose Internet Mail Extensions, $B$"$k$$$O(B MIME 
+-$B$HAm>N$5$l$k!"$3$N0lO"$NJ8=q$O!"0J2<$N;v$r2DG=$H$9$k$?$a$K(B message $B$N(B
+-$B7A<0$r:FDj5A$7$?!'(B
++@strong{Multipurpose Internet Mail Extensions} の略で、Internet の mail 
++や news で us-ascii plain text (@ref{us-ascii}) 以外の文字を使うための 
++RFC 822 (@ref{RFC 822}) に対する拡張。@refill
++
++RFC 2045 は冒頭で次のように述べている:@refill
++
++STD 11, RFC 822 は、US-ASCII message header に関して非常に詳細に規定し
++た message 表現 protocol を定義している。しかし、それは単に flat な 
++US-ASCII text のみに留まり、message の内容や message body に関する規定
++はなされていない。Multipurpose Internet Mail Extensions, あるいは MIME 
++と総称される、この一連の文書は、以下の事を可能とするために message の
++形式を再定義した:
+ 
+ @enumerate
+ @item
+-$BJ8=q(B message body $B$K$*$1$k(B US-ASCII $B0J30$NJ8;z=89g(B
++文書 message body における US-ASCII 以外の文字集合
+ @item
+-$BHsJ8=q(B message body
++非文書 message body
+ @item
+-$BJ#?t$NItJ,$+$i$J$k(B message body
++複数の部分からなる message body
+ @item
+-US-ASCII $B0J30$NJ8;z=89g$+$i$J$kJ8=q(B header $B>pJs(B
++US-ASCII 以外の文字集合からなる文書 header 情報
+ @end enumerate
+ 
+ 
+ RFC 2045 (@ref{RFC 2045}), RFC 2046 (@ref{RFC 2046}), RFC 2047
+-(@ref{encoded-word}), RFC 2048 (@ref{RFC 2048}), RFC 2049 (@ref{RFC 2049}) $B$GDj5A$5$l$F$$$k!#(B
++(@ref{encoded-word}), RFC 2048 (@ref{RFC 2048}), RFC 2049 (@ref{RFC 2049}) で定義されている。
+ 
+ 
+ @node MIME charset, MTA, MIME, Glossary
+ @subsection MIME charset
+ 
+-Content-Type (@ref{Content-Type}) $BMs$d(B encoded-word (@ref{encoded-word}) 
+-$B$N(B charset parameter $B$GMQ$$$i$l$kEPO?$5$l$?Id9f2=J8;z=89g(B(@ref{Coded character set})$B!#(B@refill
++Content-Type (@ref{Content-Type}) 欄や encoded-word (@ref{encoded-word}) 
++の charset parameter で用いられる登録された符号化文字集合(@ref{Coded character set})。@refill
+ 
+-RFC 2045 (@ref{RFC 2045}) $B$GDj5A$5$l$F$$$k!#(B@refill
++RFC 2045 (@ref{RFC 2045}) で定義されている。@refill
+ 
+-iso-2022-jp $B$d(B euc-kr $B$O$=$N#1$D!#(B
++iso-2022-jp や euc-kr はその1つ。
+ 
+ 
+ @node MTA, MUA, MIME charset, Glossary
+ @subsection MTA
+ @cindex Message Transfer Agent
+ 
+-@strong{Message Transfer Agent} $B$NN,$G!"(Bqmail $B$d(B sendmail $B$J$I$N(B mail $BG[(B
+-$BAw(B program $B$H(B inn $B$J$I$N(B news server $B$NAm>N!#(B@refill
++@strong{Message Transfer Agent} の略で、qmail や sendmail などの mail 配
++送 program と inn などの news server の総称。@refill
+ 
+ (cf. @ref{MUA})
+ 
+@@ -1322,7 +1328,7 @@
+ @subsection MUA
+ @cindex Message User Agent
+ 
+-@strong{Message User Agent} $B$NN,$G!"(Bmail reader $B$H(B news reader $B$NAm>N!#(B
++@strong{Message User Agent} の略で、mail reader と news reader の総称。
+ @refill
+ 
+ (cf. @ref{MTA})
+@@ -1332,16 +1338,16 @@
+ @node Quoted-Printable, RFC 822, MUA, Glossary
+ @subsection Quoted-Printable
+ 
+-RFC 2045 (@ref{RFC 2045}) $B$GDj5A$5$l$F$$$k(B MIME (@ref{MIME}) $B$K$*$1$k(B 
+-binary data (@ref{binary data}) $B$N(B network $B$G$NJQ49K!$N#1$D!#(B@refill
++RFC 2045 (@ref{RFC 2045}) で定義されている MIME (@ref{MIME}) における 
++binary data の network での変換法の1つ。@refill
+ 
+-`=' $B$d@)8fJ8;z$d(B 128 $B0J>e$NJ8;z$J$I$O(B `=AF' $B$N$h$&$K(B `=' $B$N8e$KB3$/(B 16 
+-$B?J?t$GI=8=$9$k!#$3$N$?$a!"(BASCII (@ref{ASCII}) $BJ8;zCf?4$N(B data $B$G$O(B 
+-Base64 (@ref{Base64}) $B$KHf$Y$k$H2DFI@-$,9b$/$J$k2DG=@-$,$"$k!#(B@refill
+-
+-$B$7$+$7$J$,$i!"(BEBCDIC $B$K$OB8:_$7$J$$J8;z$rMxMQ$9$k>l9g!"(BEBCDIC $B$rMxMQ$7(B
+-$B$F$$$k(B network $B$G$O0BA4$KE>Aw$9$k$3$H$,$G$-$:!"(BBase64 $B$KHf$Y$F0BA4@-$O(B
+-$BDc$$!#(B
++`=' や制御文字や 128 以上の文字などは `=AF' のように `=' の後に続く 16 
++進数で表現する。このため、ASCII (@ref{ASCII}) 文字中心の data では 
++Base64 (@ref{Base64}) に比べると可読性が高くなる可能性がある。@refill
++
++しかしながら、EBCDIC には存在しない文字を利用する場合、EBCDIC を利用し
++ている network では安全に転送することができず、Base64 に比べて安全性は
++低い。
+ 
+ 
+ @node RFC 822, RFC 1036, Quoted-Printable, Glossary
+@@ -1352,15 +1358,15 @@
+ @cindex Internet mail
+ @cindex message header
+ 
+-Internet mail $B$N<g$K(B @strong{message header} $B$K4X$9$k7A<0$K(B
+-$B4X$9$kI8=`$rDj$a$F$$$k(B RFC.
++Internet mail の主に @strong{message header} に関する形式に
++関する標準を定めている RFC.
+ 
+ @noindent
+ @strong{[Memo]}
+ @quotation
+ 
+-news message $B$b$3$l$K=`$8$F$$$k$N$G!"(B@strong{Internet mail} $B$H=q$/$h$j$b!"(B
+-@strong{Internet message} $B$H=q$$$?J}$,NI$$$+$b$7$l$J$$!#(B
++news message もこれに準じているので、@strong{Internet mail} と書くよりも、
++@strong{Internet message} と書いた方が良いかもしれない。
+ @end quotation
+ 
+ 
+@@ -1379,9 +1385,9 @@
+ @cindex RFC 1036
+ @cindex USENET
+ 
+-USENET $B$G$N(B message $B$N7A<0$rDj$a$?(B RFC.  RFC 822 (@ref{RFC 822}) $B$N(B 
+-subset $B$K$J$C$F$$$k!#(BInternet $B$NI8=`$G$O$J$$$,!"(BUSENET $B0J30$N(B netnews $B$G(B
+-$B$b$3$l$K=`$8$F$$$k$b$N$,B?$$!#(B
++USENET での message の形式を定めた RFC.  RFC 822 (@ref{RFC 822}) の 
++subset になっている。Internet の標準ではないが、USENET 以外の netnews で
++もこれに準じているものが多い。
+ 
+ 
+ @noindent
+@@ -1460,8 +1466,8 @@
+ @node plain text, us-ascii, RFC 2049, Glossary
+ @subsection plain text
+ 
+-$B=qBN$dAHHG$K4X$9$k>pJs$r;}$?$J$$J8;zId9f(B(@ref{Coded character set})$B$N$_(B
+-$B$GI=8=$5$l$k(B text $B>pJs!#(B(cf. @ref{text/plain})
++書体や組版に関する情報を持たない文字符号 (@ref{Coded character set}) のみ
++で表現される text 情報。
+ 
+ 
+ 
+@@ -1470,156 +1476,151 @@
+ @cindex ASCII
+ @cindex us-ascii
+ 
+-$B%"%a%j%+O"K.$J$I$G;H$o$l$k1Q8l$J$I$rI=8=$9$k$?$a$N(B MIME charset
+-(@ref{MIME charset}) $B$N#1$D!#(B@refill
++アメリカ連邦などで使われる英語などを表現するための MIME charset
++(@ref{MIME charset}) の1つ。@refill
+ 
+-ASCII (@ref{ASCII}) $B$N$_$+$i$J$j(B ISO 2022 $B$K$h$kId9f3HD%$O5v$5$l$J$$!#(B
++ASCII (@ref{ASCII}) のみからなり ISO 2022 による符号拡張は許されない。
+ 
+-Internet message $B$K$*$1$kI8=`$NId9f2=J8;z=89g(B(@ref{Coded character set}) 
+-$B$G$"$j!"L@<(E*$K(B MIME charset $B$,<($5$l$J$$>l9g$O86B'$H$7$F(B 
+-@strong{us-ascii} $B$,;H$o$l$k!#(B@refill
++Internet message における標準の符号化文字集合 (@ref{Coded character set})
++であり、明示的に MIME charset が示されない場合は原則として 
++@strong{us-ascii} が使われる。@refill
+ 
+-$B$^$?!"(BRFC 822 (@ref{RFC 822}) $B$K$*$1$k(B @strong{ASCII} $B$O(B us-ascii $B$G$"$k!#(B
++また、RFC 822 (@ref{RFC 822}) における @strong{ASCII} は us-ascii である。
+ 
+ 
+-@node Bug report, CVS, Glossary, Appendix
+-@section bug $BJs9p$N;EJ}(B
++@node Bug report, GitHub, Glossary, Appendix
++@section bug 報告の仕方
+ 
+-FLIM $B$N%P%0$r8+$D$1$?$i!"0J2<$N(B address $B$K(B mail $B$rAw$C$F$/$@$5$$!'(B
++FLIM-LB に関する議論は以下のメーリングリストで行われます。
++最新バージョンのアナウンスもこちらに流れます。
+ 
+-@itemize @bullet
+-@item
+- $B1Q8l(B <emacs-mime-en@@m17n.org>
+-@item
+- $BF|K\8l(B <emacs-mime-ja@@m17n.org>
+-@end itemize
++@display
++Wanderlust Mailing List @t{<wl@@ml.gentei.org>}
++@end display
+ 
++ここでは主に日本語での議論が行われています。また、英語専用のリストとして
+ 
+-$BC"$7!"$"$^$j$K$b8E$$HG$K4X$9$kJs9p$O4?7^$5$l$^$;$s!#8E$$HG$N(B bug $B$O!"?7(B
+-$B$7$$HG$G$O<#$C$F$$$k$+$b$7$l$^$;$s!#$^$:!":G?7HG$G3NG'$7$F$_$^$7$g$&!#(B
+-@refill
++@display
++Wanderlust List in English @t{<wl-en@@ml.gentei.org>}
++@end display
+ 
+-$B$=$l$+$i!"E,@Z$JJs9p$r$7$^$7$g$&!#C1$K!V$&$^$/F0$+$J$$!W$H8@$o$l$F$b$I$&(B
+-$B$$$&>u67$J$N$+$O$5$C$Q$jH=$j$^$;$s!#:GDc8B!"(BOS, emacs, APEL, FLIM, SEMI, 
+-$B;H$C$F$$$k(B MUA $B$N<oN`$*$h$SHG!"@_Dj$r=q$/I,MW$,$"$j$^$9!#$^$?!"(Berror $B$,(B
+-$B5/$C$F$$$k>l9g$O(B backtrace $B$rAw$k$3$H$b=EMW$G$9!#(B(cf. @ref{(emacs)Bugs})
+-
+-$B$^$?!"(Bbug $B$OBgDqJ#?t$N?M$,Ax6x$9$k$b$N$G$9!J$=$&$G$J$1$l$P!"(Bbug $B$G$O$J(B
+-$B$$2DG=@-$,$"$j$^$9!K!#$@$+$i!":n<T$KD>@\(B mail $B$rAw$k$H:n<T$OF1$8(B mail
+-$B$r2?DL$b=q$/1)L\$K$J$j$^$9!#$@$+$i!"I,$:(B bug $BJs9p$O>e5-$N(B address $B$KAw$C(B
+-$B$F$/$@$5$$!#(B
++もあります(こちらに投稿されたメッセージは前者にも配送されます)。
+ 
+-EMACS-MIME ML $B$G$O(B FLIM $B$N%P%0>pJs$N8r49$d:G?7HG$NG[I[!"(BFLIM $B$N2~NI$K(B
+-$B4X$9$k5DO@$r9T$J$C$F$$$^$9!#(BEMACS-MIME ML $B$K;22C$7$?$$J}$O(B
++これらのメーリングリストのガイドを得るには、@t{wl-ctl@@ml.gentei.org} 宛
++(英語の方は @t{wl-en-ctl@@ml.gentei.org} 宛) で、本文に
+ 
+-@itemize @bullet
+-@item
+- $B1Q8l(B <emacs-mime-en-ctl@@m17n.org>
+-@item
+- $BF|K\8l(B <emacs-mime-ja-ctl@@m17n.org>
+-@end itemize
++@example
++# guide
++@end example
+ 
+ @noindent
+-$B$K6u$N(B mail $B$rAw$C$F2<$5$$!#(B
++と書いたメールを送って下さい。
+ 
++バグ報告やパッチの送付もこれらのメーリングリストへ送ってください。メーリ
++ングリストへの送信はメンバになる必要があります。
+ 
+-@node CVS, History, Bug report, Appendix
+-@section CVS $B$K$h$k3+H/(B
+-
+-FLIM $B$N(B file $B$O(B CVS $B$r;H$C$F4IM}$5$l$F$$$^$9!#$3$N$?$a!"0J2<$NJ}K!$G:G(B
+-$B?7$N(B FLIM $B$rF~<j$9$k$3$H$,$G$-$^$9!'(B
++但し、あまりにも古い版に関する報告は歓迎されません。古い版の bug は、新
++しい版では治っているかもしれません。まず、最新版で確認してみましょう。
++@refill
+ 
+-@example
+-(0) cvs login
++それから、適切な報告をしましょう。単に「うまく動かない」と言われてもど
++ういう状況なのかはさっぱり判りません。最低限、OS, emacs, APEL, FLIM,
++SEMI, 使っている MUA の種類および版、設定を書く必要があります。また、
++error が起っている場合は backtrace を送ることも重要です。
++(cf. @ref{Bugs,Reporting Bugs ,Reporting Bugs, emacs, GNU Emacs
++Manual})
++
++また、bug は大抵複数の人が遭遇するものです(そうでなければ、bug ではな
++い可能性があります)。だから、作者に直接 mail を送ると作者は同じ mail
++を何通も書く羽目になります。だから、必ず bug 報告は上記の address に送っ
++てください。
+ 
+-    % cvs -d :pserver:anonymous@@cvs.m17n.org:/cvs/root login
+ 
+-    CVS password: [CR] # NULL string
++@node GitHub, History, Bug report, Appendix
++@section GitHub による開発
+ 
+-(1) checkout
++FLIM-LB のリポジトリは GitHub で公開されています。
+ 
+-    % cvs -d :pserver:anonymous@@cvs.m17n.org:/cvs/root checkout
+-      checkout [-r TAG] flim
++@example
++@uref{https://github.com/wanderlust/flim}
+ @end example
+ 
++プルリクエストを送る場合は、Emacs の様に、コミットメッセージに従来の
++@file{ChangeLog} エントリに相当する内容をインデントせずに入力して下さい。
++Emacs の @file{CONTRIBUTE} ファイル
++@footnote{@uref{https://git.savannah.gnu.org/cgit/emacs.git/plain/CONTRIBUTE}}
++にある @cite{Commit messages} セクションを参照して下さい。
++
++また、バグ報告の場合はバックトレースを取って添付すると原因究明しやすくな
++ります。 @footnote{バックトレースの取り方は
++@uref{http://www.jpl.org/elips/BUGS-ja.html}が参考になります。}
++
++
++@node History,  , GitHub, Appendix
++@section 歴史
++
++FLIM の code の最古の部分は 榎並 嗣智 氏が書いた @file{mime.el} に起源し
++ます。この小さな program は Nemacs で動作する iso-2022-jp の B-encoding 
++専用の encoded-word の復号化プログラムでした。@refill
++
++その後、守岡 知彦 は @file{mime.el} を元に@file{tiny-mime.el} というプロ
++グラムを書きます。これは、Nemacs と Mule で動作する encoded-word の符号
++化・復号化プログラムでした。@file{tiny-mime.el} は B-encoding だけでなく 
++Q-encoding もsupport し、また、MULE で扱うことができるさまざまな MIME
++charset (@ref{MIME charset}) を同時に使うことができました。この時、
++Nemacs と Mule の双方を support するために用いられたテクニックは後に emu
++package にまとめられます。@refill
++
++この頃、守岡 知彦 は @file{tiny-mime.el} をさまざまな MUA で使うための設
++定集も配布していましたが、それらは後に@file{tiny-mime.el} とともに1つの 
++package にまとめられ、tm という名前で配布されます。@refill
++
++守岡 知彦 はやがて、MIME message を閲覧するためのプログラムである
++@file{tm-body.el} を書きます。これは、すぐに@file{tm-view.el} という名前
++に変わりましたが、やがて、これが@file{tiny-mime.el} に代わって、tm の中
++核となります。@refill
++
++@file{tm-view.el} は当然、Content-Transfer-Encoding を扱う必要があります。
++この目的のために、MEL が整備されはじめました。Base64 に関しては 
++@file{tiny-mime.el} の code が移され、また、新たにQuoted-Printable の 
++code が追加されました。これらが@file{mel-b.el} と @file{mel-q.el} になり
++ました。@refill
++
++また、後に、守岡 知彦 によって uuencode 用の @file{mel-u.el} が追加され、
++その後に、小林 修平 氏によって x-gzip64 用の@file{mel-g.el} が追加されま
++した。@refill
++
++tm では後に、守岡 知彦 によって @file{tiny-mime.el} の再実装が行われ、こ
++の過程で、STD 11 の parser が書かれました。これは、現在の 
++@file{std11.el} に当たります。また、この過程で @file{tiny-mime.el} は復
++号化を行う @file{tm-ew-d.el} と符号化を行う @file{tm-ew-e.el} に分けられ
++ました。この両者が現在の @file{eword-decode.el} と 
++@file{eword-encode.el} の先祖に当たります。@refill
++
++後に、守岡 知彦 らによって tm の全面書き換え作業が行われ、この過程で、tm 
++は APEL, MEL, SEMI, EMH, RMAIL-MIME, Gnus-MIME などに分けられました。こ
++のうちの MEL が FLIM の直接の先祖に当たります。@refill
++
++後に、APEL から @file{std11.el} が移され、また、@file{mailcap.el},
++@file{eword-decode.el} および @file{eword-encode.el} が SEMI から移され、
++package の名前が FLIM となります。@refill
+ 
+-CVS $B$rMQ$$$?3+H/$K;22C$7$?$$J}$O(B
+-
+-@itemize @bullet
+-@item
+- <cvs@@cvs.m17n.org>
+-@end itemize
+-
+-@noindent
+-$B$^$G!"%"%+%&%s%HL>$H(B ssh $B$N8x3+80$rAw$C$F$/$@$5$$!#(Bssh $B7PM3$G$O!"(B
+-cvsroot $B$O(B :ext:cvs@@cvs.m17n.org:/cvs/root $B$H$J$j$^$9!#(B
+-
+-
+-@node History,  , CVS, Appendix
+-@section $BNr;K(B
+-
+-FLIM $B$N(B code $B$N:G8E$NItJ,$O(B $B1]JB(B $B;LCR(B $B;a$,=q$$$?(B @file{mime.el} $B$K5/8;$7(B
+-$B$^$9!#$3$N>.$5$J(B program $B$O(B Nemacs $B$GF0:n$9$k(B iso-2022-jp $B$N(B B-encoding 
+-$B@lMQ$N(B encoded-word $B$NI|9f2=%W%m%0%i%`$G$7$?!#(B@refill
+-
+-$B$=$N8e!"<i2,(B $BCNI'(B $B$O(B @file{mime.el} $B$r85$K(B@file{tiny-mime.el} $B$H$$$&%W%m(B
+-$B%0%i%`$r=q$-$^$9!#$3$l$O!"(BNemacs $B$H(B Mule $B$GF0:n$9$k(B encoded-word $B$NId9f(B
+-$B2=!&I|9f2=%W%m%0%i%`$G$7$?!#(B@file{tiny-mime.el} $B$O(B B-encoding $B$@$1$G$J$/(B 
+-Q-encoding $B$b(Bsupport $B$7!"$^$?!"(BMULE $B$G07$&$3$H$,$G$-$k$5$^$6$^$J(B MIME
+-charset (@ref{MIME charset}) $B$rF1;~$K;H$&$3$H$,$G$-$^$7$?!#$3$N;~!"(B
+-Nemacs $B$H(B Mule $B$NAPJ}$r(B support $B$9$k$?$a$KMQ$$$i$l$?%F%/%K%C%/$O8e$K(B emu
+-package $B$K$^$H$a$i$l$^$9!#(B@refill
+-
+-$B$3$N:"!"<i2,(B $BCNI'(B $B$O(B @file{tiny-mime.el} $B$r$5$^$6$^$J(B MUA $B$G;H$&$?$a$N@_(B
+-$BDj=8$bG[I[$7$F$$$^$7$?$,!"$=$l$i$O8e$K(B@file{tiny-mime.el} $B$H$H$b$K#1$D$N(B 
+-package $B$K$^$H$a$i$l!"(Btm $B$H$$$&L>A0$GG[I[$5$l$^$9!#(B@refill
+-
+-$B<i2,(B $BCNI'(B $B$O$d$,$F!"(BMIME message $B$r1\Mw$9$k$?$a$N%W%m%0%i%`$G$"$k(B
+-@file{tm-body.el} $B$r=q$-$^$9!#$3$l$O!"$9$0$K(B@file{tm-view.el} $B$H$$$&L>A0(B
+-$B$KJQ$o$j$^$7$?$,!"$d$,$F!"$3$l$,(B@file{tiny-mime.el} $B$KBe$o$C$F!"(Btm $B$NCf(B
+-$B3K$H$J$j$^$9!#(B@refill
+-
+-@file{tm-view.el} $B$OEvA3!"(BContent-Transfer-Encoding $B$r07$&I,MW$,$"$j$^$9!#(B
+-$B$3$NL\E*$N$?$a$K!"(BMEL $B$,@0Hw$5$l$O$8$a$^$7$?!#(BBase64 $B$K4X$7$F$O(B 
+-@file{tiny-mime.el} $B$N(B code $B$,0\$5$l!"$^$?!"?7$?$K(BQuoted-Printable $B$N(B 
+-code $B$,DI2C$5$l$^$7$?!#$3$l$i$,(B@file{mel-b.el} $B$H(B @file{mel-q.el} $B$K$J$j(B
+-$B$^$7$?!#(B@refill
+-
+-$B$^$?!"8e$K!"<i2,(B $BCNI'(B $B$K$h$C$F(B uuencode $BMQ$N(B @file{mel-u.el} $B$,DI2C$5$l!"(B
+-$B$=$N8e$K!">.NS(B $B=$J?(B $B;a$K$h$C$F(B x-gzip64 $BMQ$N(B@file{mel-g.el} $B$,DI2C$5$l$^(B
+-$B$7$?!#(B@refill
+-
+-tm $B$G$O8e$K!"<i2,(B $BCNI'(B $B$K$h$C$F(B @file{tiny-mime.el} $B$N:F<BAu$,9T$o$l!"$3(B
+-$B$N2aDx$G!"(BSTD 11 $B$N(B parser $B$,=q$+$l$^$7$?!#$3$l$O!"8=:_$N(B 
+-@file{std11.el} $B$KEv$?$j$^$9!#$^$?!"$3$N2aDx$G(B @file{tiny-mime.el} $B$OI|(B
+-$B9f2=$r9T$&(B @file{tm-ew-d.el} $B$HId9f2=$r9T$&(B @file{tm-ew-e.el} $B$KJ,$1$i$l(B
+-$B$^$7$?!#$3$NN><T$,8=:_$N(B @file{eword-decode.el} $B$H(B 
+-@file{eword-encode.el} $B$N@hAD$KEv$?$j$^$9!#(B@refill
+-
+-$B8e$K!"<i2,(B $BCNI'(B $B$i$K$h$C$F(B tm $B$NA4LL=q$-49$(:n6H$,9T$o$l!"$3$N2aDx$G!"(Btm 
+-$B$O(B APEL, MEL, SEMI, EMH, RMAIL-MIME, Gnus-MIME $B$J$I$KJ,$1$i$l$^$7$?!#$3(B
+-$B$N$&$A$N(B MEL $B$,(B FLIM $B$ND>@\$N@hAD$KEv$?$j$^$9!#(B@refill
+-
+-$B8e$K!"(BAPEL $B$+$i(B @file{std11.el} $B$,0\$5$l!"$^$?!"(B@file{mailcap.el},
+-@file{eword-decode.el} $B$*$h$S(B @file{eword-encode.el} $B$,(B SEMI $B$+$i0\$5$l!"(B
+-package $B$NL>A0$,(B FLIM $B$H$J$j$^$9!#(B@refill
+-
+-$B$3$ND>A0$+$iEDCf(B $BE/(B $B;a$,$h$j(B RFC $B$KCi<B$J<BAu$r=q$-;O$a!"$3$l$O!"8=:_!"(B
+-FLIM $B$N;^$G$"$k(B ``FLIM-FLAM'' $B$H$J$C$F$$$^$9!#(B
++この直前から田中 哲 氏がより RFC に忠実な実装を書き始め、これは、現在、
++FLIM の枝である ``FLIM-FLAM'' となっています。
+ 
+ 
+ @node Concept Index, Function Index, Appendix, Top
+-@chapter $B35G0:w0z(B
++@chapter 概念索引
+ 
+ @printindex cp
+ 
+ @node Function Index, Variable Index, Concept Index, Top
+-@chapter $B4X?t:w0z(B
++@chapter 関数索引
+ 
+ @printindex fn
+ 
+ @node Variable Index,  , Function Index, Top
+-@chapter $BJQ?t:w0z(B
++@chapter 変数索引
+ 
+ @printindex vr
+ @bye
Index: pkgsrc/devel/flim/patches/patch-mime-parse.el-00
diff -u /dev/null pkgsrc/devel/flim/patches/patch-mime-parse.el-00:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-mime-parse.el-00    Sun Sep  3 14:58:38 2023
@@ -0,0 +1,28 @@
+$NetBSD: patch-mime-parse.el-00,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+sync to  lexical-binding
+
+$NetBSD: patch-mime-parse.el-00,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+string-to-int -> string-to-number
+
+--- mime-parse.el~     2005-07-06 11:09:04.000000000 +0900
++++ mime-parse.el      2016-12-28 10:41:55.000000000 +0900
+@@ -97,7 +97,7 @@ be the result."
+     (insert text)
+     (goto-char (point-min))
+     (while (re-search-forward "%[0-9A-Fa-f][0-9A-Fa-f]" nil t)
+-      (insert (prog1 (string-to-int
++      (insert (prog1 (string-to-number
+                     (buffer-substring (point)(- (point) 2))
+                     16)
+                 (delete-region (point)(- (point) 3)))))
+@@ -147,7 +147,7 @@ property of the decoded-value."
+           (let* ((attribute (downcase
+                            (substring (car params) 0 (match-end 1))))
+                  (section (if (match-beginning 2)
+-                            (string-to-int
++                            (string-to-number
+                              (substring (car params)
+                                         (1+ (match-beginning 2))
+                                         (match-end 2)))
Index: pkgsrc/devel/flim/patches/patch-mime.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-mime.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-mime.el     Sun Sep  3 14:58:38 2023
@@ -0,0 +1,142 @@
+$NetBSD: patch-mime.el,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/mime.el 2005-07-06 11:09:04.000000000 +0900
++++ ./mime.el  2023-08-31 08:29:38.612092624 +0900
+@@ -1,4 +1,4 @@
+-;;; mime.el --- MIME library module
++;;; mime.el --- MIME library module  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1998,1999,2000,2001,2003 Free Software Foundation, Inc.
+ 
+@@ -25,6 +25,7 @@
+ ;;; Code:
+ 
+ (require 'alist)
++(require 'luna)
+ (require 'std11)
+ (require 'mime-def)
+ (require 'eword-decode)
+@@ -61,9 +62,7 @@
+   "Parse STRING as cid URI.")
+ 
+ (autoload 'mime-parse-buffer "mime-parse"
+-  "Parse BUFFER as a MIME message.")
+-
+-)
++  "Parse BUFFER as a MIME message."))
+ 
+ (autoload 'mime-encode-field-body "eword-encode"
+   "Encode FIELD-BODY as FIELD-NAME, and return the result.")
+@@ -110,9 +109,7 @@
+       message
+       (let ((rc (nth sn (mime-entity-children message))))
+       (if rc
+-          (mime-find-entity-from-number (cdr entity-number) rc)
+-        ))
+-      )))
++          (mime-find-entity-from-number (cdr entity-number) rc))))))
+ 
+ (defun mime-find-entity-from-node-id (entity-node-id message)
+   "Return entity from ENTITY-NODE-ID in MESSAGE."
+@@ -273,8 +270,7 @@
+       (let ((ret (mime-entity-fetch-field entity "Content-Type")))
+       (if ret
+           (mime-entity-set-content-type-internal
+-           entity (mime-parse-Content-Type ret))
+-        ))))
++           entity (mime-parse-Content-Type ret))))))
+ 
+ (defun mime-entity-content-disposition (entity)
+   "Return content-disposition of ENTITY."
+@@ -282,8 +278,7 @@
+       (let ((ret (mime-entity-fetch-field entity "Content-Disposition")))
+       (if ret
+           (mime-entity-set-content-disposition-internal
+-           entity (mime-parse-Content-Disposition ret))
+-        ))))
++           entity (mime-parse-Content-Disposition ret))))))
+ 
+ (defun mime-entity-encoding (entity &optional default-encoding)
+   "Return content-transfer-encoding of ENTITY.
+@@ -295,8 +290,7 @@
+       (mime-entity-set-encoding-internal
+        entity
+        (or (and ret (mime-parse-Content-Transfer-Encoding ret))
+-           default-encoding "7bit"))
+-      )))
++           default-encoding "7bit")))))
+ 
+ (defvar mime-field-parser-alist
+   '((Return-Path      . std11-parse-route-addr)
+@@ -324,8 +318,7 @@
+     (In-Reply-To      . std11-parse-msg-ids)
+     (References               . std11-parse-msg-ids)
+     
+-    (Content-Id               . mime-parse-msg-id)
+-    ))
++    (Content-Id               . mime-parse-msg-id)))
+ 
+ (defun mime-entity-read-field (entity field-name)
+   (let ((sym (if (symbolp field-name)
+@@ -334,14 +327,11 @@
+                  (setq field-name (symbol-name field-name)))
+              (intern (capitalize field-name)))))
+     (cond ((eq sym 'Content-Type)
+-         (mime-entity-content-type entity)
+-         )
++         (mime-entity-content-type entity))
+         ((eq sym 'Content-Disposition)
+-         (mime-entity-content-disposition entity)
+-         )
++         (mime-entity-content-disposition entity))
+         ((eq sym 'Content-Transfer-Encoding)
+-         (mime-entity-encoding entity)
+-         )
++         (mime-entity-encoding entity))
+         (t
+          (let* ((header (mime-entity-parsed-header-internal entity))
+                 (field (cdr (assq sym header))))
+@@ -355,8 +345,7 @@
+                          (if parser
+                              (funcall parser
+                                       (eword-lexical-analyze field-body))
+-                           (mime-decode-field-body field-body sym 'plain)
+-                           ))
++                           (mime-decode-field-body field-body sym 'plain)))
+                    (mime-entity-set-parsed-header-internal
+                     entity (put-alist sym field header))
+                    field))))))))
+@@ -385,22 +374,20 @@
+       (mime-insert-entity-body entity)
+       (if (re-search-forward "^begin [0-9]+ " nil t)
+           (if (looking-at ".+$")
+-              (buffer-substring (match-beginning 0)(match-end 0))
+-            )))))
++              (buffer-substring (match-beginning 0)(match-end 0)))))))
+ 
+ (defun mime-entity-filename (entity)
+   "Return filename of ENTITY."
+   (or (mime-entity-uu-filename entity)
+-      (let ((ret (mime-content-disposition-filename
+-                (mime-entity-content-disposition entity))))
+-      (if (and mime-header-accept-quoted-encoded-words
+-               ret)
++      (let ((ret (or (mime-content-disposition-filename
++                    (mime-entity-content-disposition entity))
++                   (cdr (let ((param (mime-content-type-parameters
++                                      (mime-entity-content-type entity))))
++                          (or (assoc "name" param)
++                              (assoc "x-name" param)))))))
++      (if ret
+           (eword-decode-string ret)
+-        ret))
+-      (cdr (let ((param (mime-content-type-parameters
+-                       (mime-entity-content-type entity))))
+-           (or (assoc "name" param)
+-               (assoc "x-name" param))))))
++        ""))))
+ 
+ 
+ (defsubst mime-entity-media-type (entity)
Index: pkgsrc/devel/flim/patches/patch-mmbuffer.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-mmbuffer.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-mmbuffer.el Sun Sep  3 14:58:38 2023
@@ -0,0 +1,187 @@
+$NetBSD: patch-mmbuffer.el,v 1.1 2023/09/03 14:58:38 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/mmbuffer.el     2005-07-06 11:09:04.000000000 +0900
++++ ./mmbuffer.el      2023-08-31 08:29:38.613469028 +0900
+@@ -1,4 +1,4 @@
+-;;; mmbuffer.el --- MIME entity module for binary buffer
++;;; mmbuffer.el --- MIME entity module for binary buffer  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1998,1999,2000 Free Software Foundation, Inc.
+ 
+@@ -35,16 +35,14 @@
+                     body-start
+                     body-end))
+ 
+-  (luna-define-internal-accessors 'mime-buffer-entity)
+-  )
++  (luna-define-internal-accessors 'mime-buffer-entity))
+ 
+ (luna-define-method initialize-instance :after ((entity mime-buffer-entity)
+-                                              &rest init-args)
++                                              &rest _init-args)
+   (or (mime-buffer-entity-buffer-internal entity)
+       (mime-buffer-entity-set-buffer-internal
+        entity (get-buffer (mime-entity-location-internal entity))))
+-  (save-excursion
+-    (set-buffer (mime-buffer-entity-buffer-internal entity))
++  (with-current-buffer (mime-buffer-entity-buffer-internal entity)
+     (let ((header-start
+          (or (mime-buffer-entity-header-start-internal entity)
+              (mime-buffer-entity-set-header-start-internal
+@@ -64,8 +62,7 @@
+         (setq header-end (point-min)
+               body-start (point-min)))
+       (mime-buffer-entity-set-header-end-internal entity header-end)
+-      (mime-buffer-entity-set-body-start-internal entity body-start)
+-      )
++      (mime-buffer-entity-set-body-start-internal entity body-start))
+       (or (mime-entity-content-type-internal entity)
+         (save-restriction
+           (narrow-to-region header-start header-end)
+@@ -73,15 +70,11 @@
+            entity
+            (let ((str (std11-fetch-field "Content-Type")))
+              (if str
+-                 (mime-parse-Content-Type str)
+-               )))
+-          ))
+-      ))
++                 (mime-parse-Content-Type str))))))))
+   entity)
+ 
+ (luna-define-method mime-entity-name ((entity mime-buffer-entity))
+-  (buffer-name (mime-buffer-entity-buffer-internal entity))
+-  )
++  (buffer-name (mime-buffer-entity-buffer-internal entity)))
+ 
+ 
+ ;;; @ entity
+@@ -90,12 +83,10 @@
+ (luna-define-method mime-insert-entity ((entity mime-buffer-entity))
+   (insert-buffer-substring (mime-buffer-entity-buffer-internal entity)
+                          (mime-buffer-entity-header-start-internal entity)
+-                         (mime-buffer-entity-body-end-internal entity))
+-  )
++                         (mime-buffer-entity-body-end-internal entity)))
+ 
+ (luna-define-method mime-write-entity ((entity mime-buffer-entity) filename)
+-  (save-excursion
+-    (set-buffer (mime-buffer-entity-buffer-internal entity))
++  (with-current-buffer (mime-buffer-entity-buffer-internal entity)
+     (let ((coding-system-for-write 'raw-text-dos))
+       (write-region (mime-buffer-entity-header-start-internal entity)
+                   (mime-buffer-entity-body-end-internal entity)
+@@ -110,21 +101,18 @@
+ ;;;
+ 
+ (luna-define-method mime-entity-body ((entity mime-buffer-entity))
+-  (save-excursion
+-    (set-buffer (mime-buffer-entity-buffer-internal entity))
++  (with-current-buffer (mime-buffer-entity-buffer-internal entity)
+     (buffer-substring (mime-buffer-entity-body-start-internal entity)
+                     (mime-buffer-entity-body-end-internal entity))))
+ 
+ (luna-define-method mime-insert-entity-body ((entity mime-buffer-entity))
+   (insert-buffer-substring (mime-buffer-entity-buffer-internal entity)
+                          (mime-buffer-entity-body-start-internal entity)
+-                         (mime-buffer-entity-body-end-internal entity))
+-  )
++                         (mime-buffer-entity-body-end-internal entity)))
+ 
+ (luna-define-method mime-write-entity-body ((entity mime-buffer-entity)
+                                           filename)
+-  (save-excursion
+-    (set-buffer (mime-buffer-entity-buffer-internal entity))
++  (with-current-buffer (mime-buffer-entity-buffer-internal entity)
+     (binary-write-decoded-region
+      (mime-buffer-entity-body-start-internal entity)
+      (mime-buffer-entity-body-end-internal entity)
+@@ -135,8 +123,7 @@
+ ;;;
+ 
+ (luna-define-method mime-entity-content ((entity mime-buffer-entity))
+-  (save-excursion
+-    (set-buffer (mime-buffer-entity-buffer-internal entity))
++  (with-current-buffer (mime-buffer-entity-buffer-internal entity)
+     (mime-decode-string
+      (buffer-substring (mime-buffer-entity-body-start-internal entity)
+                      (mime-buffer-entity-body-end-internal entity))
+@@ -151,13 +138,11 @@
+ 
+ (luna-define-method mime-write-entity-content ((entity mime-buffer-entity)
+                                              filename)
+-  (save-excursion
+-    (set-buffer (mime-buffer-entity-buffer-internal entity))
++  (with-current-buffer (mime-buffer-entity-buffer-internal entity)
+     (mime-write-decoded-region (mime-buffer-entity-body-start-internal entity)
+                              (mime-buffer-entity-body-end-internal entity)
+                              filename
+-                             (or (mime-entity-encoding entity) "7bit"))
+-    ))
++                             (or (mime-entity-encoding entity) "7bit"))))
+ 
+ 
+ ;;; @ header field
+@@ -166,8 +151,7 @@
+ (luna-define-method mime-entity-fetch-field :around
+   ((entity mime-buffer-entity) field-name)
+   (or (luna-call-next-method)
+-      (save-excursion
+-      (set-buffer (mime-buffer-entity-buffer-internal entity))
++      (with-current-buffer (mime-buffer-entity-buffer-internal entity)
+       (save-restriction
+         (narrow-to-region (mime-buffer-entity-header-start-internal entity)
+                           (mime-buffer-entity-header-end-internal entity))
+@@ -188,8 +172,7 @@
+    (mime-buffer-entity-buffer-internal entity)
+    (mime-buffer-entity-header-start-internal entity)
+    (mime-buffer-entity-header-end-internal entity)
+-   invisible-fields visible-fields)
+-  )
++   invisible-fields visible-fields))
+ 
+ 
+ ;;; @ header buffer
+@@ -275,8 +258,7 @@
+          (dc-ctl
+           (if (eq (mime-content-type-subtype content-type) 'digest)
+               (make-mime-content-type 'message 'rfc822)
+-            (make-mime-content-type 'text 'plain)
+-            ))
++            (make-mime-content-type 'text 'plain)))
+          (body-start (mime-buffer-entity-body-start-internal entity))
+          (body-end (mime-buffer-entity-body-end-internal entity)))
+       (save-restriction
+@@ -299,25 +281,20 @@
+               (save-restriction
+                 (narrow-to-region cb ce)
+                 (setq ret (mime-parse-message representation-type dc-ctl
+-                                              entity (cons i node-id)))
+-                )
++                                              entity (cons i node-id))))
+               (setq children (cons ret children))
+               (goto-char (setq cb ncb))
+-              (setq i (1+ i))
+-              )
++              (setq i (1+ i)))
+             (setq ce (point-max))
+             (save-restriction
+               (narrow-to-region cb ce)
+               (setq ret (mime-parse-message representation-type dc-ctl
+-                                            entity (cons i node-id)))
+-              )
++                                            entity (cons i node-id))))
+             (setq children (cons ret children))
+-            (mime-entity-set-children-internal entity (nreverse children))
+-            )
++            (mime-entity-set-children-internal entity (nreverse children)))
+         (mime-entity-set-content-type-internal
+          entity (make-mime-content-type 'message 'x-broken))
+-        nil)
+-      ))))
++        nil)))))
+ 
+ (defun mmbuffer-parse-encapsulated (entity &optional external
+                                          representation-type)
Index: pkgsrc/devel/flim/patches/patch-mmcooked.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-mmcooked.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-mmcooked.el Sun Sep  3 14:58:39 2023
@@ -0,0 +1,76 @@
+$NetBSD: patch-mmcooked.el,v 1.1 2023/09/03 14:58:39 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/mmcooked.el     2005-07-06 11:09:05.000000000 +0900
++++ ./mmcooked.el      2023-08-31 08:29:38.614742081 +0900
+@@ -1,4 +1,4 @@
+-;;; mmcooked.el --- MIME entity implementation for binary buffer
++;;; mmcooked.el --- MIME entity implementation for binary buffer  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1998,1999 Free Software Foundation, Inc.
+ 
+@@ -28,11 +28,10 @@
+ 
+ (mm-define-backend cooked (buffer))
+ 
+-(mm-define-method entity-cooked-p ((entity cooked)) t)
++(mm-define-method entity-cooked-p ((_entity cooked)) t)
+ 
+ (mm-define-method write-entity-content ((entity cooked) filename)
+-  (save-excursion
+-    (set-buffer (mime-buffer-entity-buffer-internal entity))
++  (with-current-buffer (mime-buffer-entity-buffer-internal entity)
+     (let ((encoding (or (mime-entity-encoding entity) "7bit")))
+       (if (member encoding '("7bit" "8bit" "binary"))
+         (write-region (mime-buffer-entity-body-start-internal entity)
+@@ -40,24 +39,19 @@
+       (mime-write-decoded-region
+        (mime-buffer-entity-body-start-internal entity)
+        (mime-buffer-entity-body-end-internal entity)
+-       filename encoding)
+-      ))))
++       filename encoding)))))
+ 
+ (mm-define-method write-entity ((entity cooked) filename)
+-  (save-excursion
+-    (set-buffer (mime-buffer-entity-buffer-internal entity))
++  (with-current-buffer (mime-buffer-entity-buffer-internal entity)
+     (write-region (mime-buffer-entity-header-start-internal entity)
+                 (mime-buffer-entity-body-end-internal entity)
+-                filename)
+-    ))
++                filename)))
+ 
+ (mm-define-method write-entity-body ((entity cooked) filename)
+-  (save-excursion
+-    (set-buffer (mime-buffer-entity-buffer-internal entity))
++  (with-current-buffer (mime-buffer-entity-buffer-internal entity)
+     (write-region (mime-buffer-entity-body-start-internal entity)
+                 (mime-buffer-entity-body-end-internal entity)
+-                filename)
+-    ))
++                filename)))
+ 
+ (luna-define-method mime-insert-header ((entity mime-cooked-entity)
+                                       &optional invisible-fields
+@@ -66,8 +60,7 @@
+     (funcall (car (luna-class-find-functions
+                  (luna-find-class 'mime-buffer-entity)
+                  'mime-insert-header))
+-           entity invisible-fields visible-fields)
+-    ))
++           entity invisible-fields visible-fields)))
+ 
+ (mm-define-method insert-text-content ((entity cooked))
+   (let ((str (mime-entity-content entity)))
+@@ -80,8 +73,7 @@
+                                       (mime-entity-content-type entity)
+                                       "charset")
+                                      default-mime-charset)
+-                                 'CRLF)
+-       ))))
++                                 'CRLF)))))
+ 
+ 
+ ;;; @ end
Index: pkgsrc/devel/flim/patches/patch-mmexternal.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-mmexternal.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-mmexternal.el       Sun Sep  3 14:58:39 2023
@@ -0,0 +1,12 @@
+$NetBSD: patch-mmexternal.el,v 1.1 2023/09/03 14:58:39 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/mmexternal.el   2005-07-06 11:09:05.000000000 +0900
++++ ./mmexternal.el    2023-08-31 08:29:38.615468807 +0900
+@@ -1,4 +1,4 @@
+-;;; mmexternal.el --- MIME entity module for external buffer
++;;; mmexternal.el --- MIME entity module for external buffer  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1998,1999,2000 Free Software Foundation, Inc.
+ 
Index: pkgsrc/devel/flim/patches/patch-mmgeneric.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-mmgeneric.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-mmgeneric.el        Sun Sep  3 14:58:39 2023
@@ -0,0 +1,173 @@
+$NetBSD: patch-mmgeneric.el,v 1.1 2023/09/03 14:58:39 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/mmgeneric.el    2005-07-06 11:09:05.000000000 +0900
++++ ./mmgeneric.el     2023-08-31 08:29:38.616263525 +0900
+@@ -1,4 +1,4 @@
+-;;; mmgeneric.el --- MIME generic entity module
++;;; mmgeneric.el --- MIME generic entity module  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc.
+ 
+@@ -24,11 +24,10 @@
+ 
+ ;;; Code:
+ 
++(require 'mcharset)
++(require 'std11)
+ (require 'luna)
+-
+-(eval-when-compile
+-  (require 'eword-decode) ; mime-find-field-presentation-method
+-  )
++(require 'eword-decode)
+ 
+ 
+ ;;; @ MIME entity
+@@ -50,8 +49,7 @@
+                     ;; for other fields
+                     original-header parsed-header))
+ 
+-  (luna-define-internal-accessors 'mime-entity)
+-  )
++  (luna-define-internal-accessors 'mime-entity))
+ 
+ (defalias 'mime-entity-representation-type-internal 'luna-class-name)
+ (defalias 'mime-entity-set-representation-type-internal 'luna-set-class-name)
+@@ -70,8 +68,7 @@
+                                   (mime-entity-content-type entity)
+                                   "charset")
+                                  default-mime-charset)
+-                             'CRLF)
+-   ))
++                             'CRLF)))
+ 
+ 
+ ;;; @ for mm-backend
+@@ -83,8 +80,7 @@
+ (defmacro mm-define-backend (type &optional parents)
+   `(luna-define-class ,(mm-expand-class-name type)
+                     ,(nconc (mapcar (lambda (parent)
+-                                      (mm-expand-class-name parent)
+-                                      )
++                                      (mm-expand-class-name parent))
+                                     parents)
+                             '(mime-entity))))
+ 
+@@ -96,8 +92,7 @@
+         (cons (list (car spec)
+                     (mm-expand-class-name (nth 1 spec)))
+               (cdr args)))
+-    `(luna-define-method ,name ,args ,@body)
+-    ))
++    `(luna-define-method ,name ,args ,@body)))
+ 
+ (put 'mm-define-method 'lisp-indent-function 'defun)
+ 
+@@ -105,8 +100,7 @@
+   (&define name ((arg symbolp)
+                [&rest arg]
+                [&optional ["&optional" arg &rest arg]]
+-               &optional ["&rest" arg]
+-               )
++               &optional ["&rest" arg])
+          def-body))
+ 
+ 
+@@ -117,57 +111,48 @@
+ ;; mechanism.  Please discuss in the emacs-mime mailing lists.
+ 
+ (defun mime-visible-field-p (field-name visible-fields invisible-fields)
+-  (or (catch 'found
+-      (while visible-fields
+-        (let ((regexp (car visible-fields)))
+-          (if (string-match regexp field-name)
+-              (throw 'found t)
+-            ))
+-        (setq visible-fields (cdr visible-fields))
+-        ))
+-      (catch 'found
+-      (while invisible-fields
+-        (let ((regexp (car invisible-fields)))
+-          (if (string-match regexp field-name)
+-              (throw 'found nil)
+-            ))
+-        (setq invisible-fields (cdr invisible-fields))
+-        )
+-      t)))
++  (let ((case-fold-search t))
++    (catch 'found
++      (while visible-fields
++      (when (string-match (car visible-fields) field-name)
++        (throw 'found t))
++      (setq visible-fields (cdr visible-fields)))
++      (while invisible-fields
++      (when (string-match (car invisible-fields) field-name)
++        (throw 'found nil))
++      (setq invisible-fields (cdr invisible-fields)))
++      t)))
+ 
+ (defun mime-insert-header-from-buffer (buffer start end
+                                             &optional invisible-fields
+                                             visible-fields)
+-  (let ((the-buf (current-buffer))
+-      (mode-obj (mime-find-field-presentation-method 'wide))
+-      field-decoder
+-      f-b p f-e field-name len field field-body)
+-    (save-excursion
+-      (set-buffer buffer)
+-      (save-restriction
+-      (narrow-to-region start end)
+-      (goto-char start)
+-      (while (re-search-forward std11-field-head-regexp nil t)
+-        (setq f-b (match-beginning 0)
+-              p (match-end 0)
+-              field-name (buffer-substring f-b p)
+-              len (string-width field-name)
+-              f-e (std11-field-end))
+-        (when (mime-visible-field-p field-name
+-                                    visible-fields invisible-fields)
+-          (setq field (intern
+-                       (capitalize (buffer-substring f-b (1- p))))
+-                field-body (buffer-substring p f-e)
+-                field-decoder (inline (mime-find-field-decoder-internal
+-                                       field mode-obj)))
+-          (with-current-buffer the-buf
+-            (insert field-name)
+-            (insert (if field-decoder
+-                        (funcall field-decoder field-body len)
+-                      ;; Don't decode
+-                      field-body))
+-            (insert "\n")
+-            )))))))
++  (let ((mode-obj (mime-find-field-presentation-method 'wide))
++      field-decoder f-b p field-name field-body result)
++    (with-current-buffer buffer
++      (goto-char start)
++      (while (re-search-forward std11-field-head-regexp end t)
++      (setq f-b (match-beginning 0)
++            p (match-end 0)
++            field-name (buffer-substring f-b p))
++      (when (mime-visible-field-p field-name
++                                  visible-fields invisible-fields)
++        (setq field-body (buffer-substring p (std11-field-end end))
++              field-decoder
++              (mime-find-field-decoder-internal
++               (intern (capitalize
++                        (buffer-substring-no-properties f-b (1- p))))
++               mode-obj)
++              result
++              (cons "\n"
++                    (cons (if field-decoder
++                              (funcall field-decoder
++                                       field-body
++                                       (string-width field-name))
++                            ;; Don't decode
++                            field-body)
++                          (cons field-name result)))))))
++    (when result
++      (apply #'insert (nreverse result)))))
+ 
+ 
+ ;;; @ end
Index: pkgsrc/devel/flim/patches/patch-qmtp.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-qmtp.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-qmtp.el     Sun Sep  3 14:58:39 2023
@@ -0,0 +1,30 @@
+$NetBSD: patch-qmtp.el,v 1.1 2023/09/03 14:58:39 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/qmtp.el 2005-07-06 11:09:05.000000000 +0900
++++ ./qmtp.el  2023-08-31 08:29:38.616972354 +0900
+@@ -1,4 +1,4 @@
+-;;; qmtp.el --- basic functions to send mail with QMTP server
++;;; qmtp.el --- basic functions to send mail with QMTP server  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 2000 Free Software Foundation, Inc.
+ 
+@@ -112,14 +112,12 @@
+       t)
+     (error)))
+ 
+-(make-obsolete 'qmtp-via-qmtp "It's old API.")
++(make-obsolete 'qmtp-via-qmtp "It's old API." "05 Nov 2000")
+ 
+ ;;;###autoload
+ (defun qmtp-send-buffer (sender recipients buffer)
+-  (save-excursion
+-    (set-buffer
+-     (get-buffer-create
+-      (format "*trace of QMTP session to %s*" qmtp-server)))
++  (with-current-buffer (get-buffer-create
++                      (format "*trace of QMTP session to %s*" qmtp-server))
+     (buffer-disable-undo)
+     (erase-buffer)
+     (make-local-variable 'qmtp-read-point)
Index: pkgsrc/devel/flim/patches/patch-sasl-cram.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-sasl-cram.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-sasl-cram.el        Sun Sep  3 14:58:39 2023
@@ -0,0 +1,20 @@
+$NetBSD: patch-sasl-cram.el,v 1.1 2023/09/03 14:58:39 mef Exp $
+
+sync to  lexical-binding
+
+--- /tmp/wip/flim/work/flim-1.14.9/./sasl-cram.el      2005-07-06 11:09:05.000000000 +0900
++++ ././sasl-cram.el   2020-09-05 16:02:39.901715405 +0900
+@@ -1,4 +1,4 @@
+-;;; sasl-cram.el --- CRAM-MD5 module for the SASL client framework
++;;; sasl-cram.el --- CRAM-MD5 module for the SASL client framework  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 2000 Free Software Foundation, Inc.
+ 
+@@ -27,6 +27,7 @@
+ 
+ (require 'sasl)
+ (require 'hmac-md5)
++(require 'hex-util)
+ 
+ (defconst sasl-cram-md5-steps
+   '(ignore                            ;no initial response
Index: pkgsrc/devel/flim/patches/patch-sasl-digest.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-sasl-digest.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-sasl-digest.el      Sun Sep  3 14:58:39 2023
@@ -0,0 +1,20 @@
+$NetBSD: patch-sasl-digest.el,v 1.1 2023/09/03 14:58:39 mef Exp $
+
+sync to  lexical-binding
+
+--- /tmp/wip/flim/work/flim-1.14.9/./sasl-digest.el    2005-07-06 11:09:05.000000000 +0900
++++ ././sasl-digest.el 2020-09-05 16:02:39.901792159 +0900
+@@ -1,4 +1,4 @@
+-;;; sasl-digest.el --- DIGEST-MD5 module for the SASL client framework
++;;; sasl-digest.el --- DIGEST-MD5 module for the SASL client framework  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 2000 Free Software Foundation, Inc.
+ 
+@@ -34,6 +34,7 @@
+ 
+ (require 'sasl)
+ (require 'hmac-md5)
++(require 'hex-util)
+ 
+ (defvar sasl-digest-md5-nonce-count 1)
+ (defvar sasl-digest-md5-unique-id-function
Index: pkgsrc/devel/flim/patches/patch-sasl-scram.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-sasl-scram.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-sasl-scram.el       Sun Sep  3 14:58:39 2023
@@ -0,0 +1,33 @@
+$NetBSD: patch-sasl-scram.el,v 1.1 2023/09/03 14:58:39 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/sasl-scram.el   2005-07-06 11:09:05.000000000 +0900
++++ ./sasl-scram.el    2023-08-31 08:29:38.617749986 +0900
+@@ -1,4 +1,4 @@
+-;;; sasl-scram.el --- Compute SCRAM-MD5.
++;;; sasl-scram.el --- Compute SCRAM-MD5.  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1999 Shuhei KOBAYASHI
+ 
+@@ -88,9 +88,9 @@
+     (if no-security-layer
+       (aset csecinfo 0 (logior (aref csecinfo 0) 1))
+       (aset csecinfo 1
+-          (lsh (logand buffer-size (lsh 255 16)) -16))
++          (ash (logand buffer-size (ash 255 16)) -16))
+       (aset csecinfo 2
+-          (lsh (logand buffer-size (lsh 255 8)) -8))
++          (ash (logand buffer-size (ash 255 8)) -8))
+       (aset csecinfo 3 (logand buffer-size 255)))
+     csecinfo))
+ 
+@@ -204,7 +204,7 @@
+       (fillarray server-salt 0)
+       (fillarray buff 0))))
+ 
+-(defun sasl-scram-md5-response-1 (client step)
++(defun sasl-scram-md5-response-1 (client _step)
+   (sasl-client-set-property
+    client 'client-msg-1
+    (sasl-scram-md5-make-client-msg-1
Index: pkgsrc/devel/flim/patches/patch-sasl-xoauth2.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-sasl-xoauth2.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-sasl-xoauth2.el     Sun Sep  3 14:58:39 2023
@@ -0,0 +1,255 @@
+$NetBSD: patch-sasl-xoauth2.el,v 1.1 2023/09/03 14:58:39 mef Exp $
+
+sync to  lexical-binding
+
+--- /tmp/wip/flim/work/flim-1.14.9/./sasl-xoauth2.el   1970-01-01 09:00:00.000000000 +0900
++++ ././sasl-xoauth2.el        2020-09-05 16:02:39.901994104 +0900
+@@ -0,0 +1,248 @@
++;;; sasl-xoauth2.el --- OAuth 2.0 module for the SASL client framework  -*- lexical-binding: t -*-
++
++;; Copyright (C) 2018 Kazuhiro Ito
++
++;; Author: Kazuhiro Ito <kzhr%d1.dion.ne.jp@localhost>
++;; Keywords: SASL, OAuth 2.0
++;; Version: 1.00
++;; Created: January 2018
++
++;; This program is free software; you can redistribute it and/or modify
++;; it under the terms of the GNU General Public License as published by
++;; the Free Software Foundation; either version 3, or (at your option)
++;; any later version.
++;;
++;; This program is distributed in the hope that it will be useful,
++;; but WITHOUT ANY WARRANTY; without even the implied warranty of
++;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++;; GNU General Public License for more details.
++;;
++;; You should have received a copy of the GNU General Public License
++;; along with this program; see the file COPYING.  If not, write to the
++;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++;; Boston, MA 02110-1301, USA.
++
++;;; Commentary:
++
++;; This is a SASL interface layer for OAuth 2.0 authorization message.
++
++;;; Requirements:
++;;
++;; * oauth2.el
++;; https://elpa.gnu.org/packages/oauth2.html
++
++;;; Usage
++;;
++;; 1. Set up sasl-xoauth2-host-url-table and
++;; sasl-xoauth2-host-user-id-table variables.
++;;
++;; 2. When passphrase is asked, input client secret.
++
++;;; Code:
++
++(require 'sasl)
++(require 'oauth2)
++
++(defconst sasl-xoauth2-steps
++  '(sasl-xoauth2-response))
++
++(defgroup sasl-xoauth2 nil
++  "SASL interface layer for OAuth 2.0 authorization message."
++  :group 'mail)
++
++(defcustom sasl-xoauth2-token-directory
++  (expand-file-name "sasl-xoauth2" user-emacs-directory)
++  "Directory name to store OAuth 2.0 tokens."
++  :type 'directory
++  :group 'sasl-xoauth2)
++
++(defcustom sasl-xoauth2-refresh-token-threshold 60
++  "Refresh token if expiration limit is left less than specified seconds."
++  :type 'number
++  :group 'sasl-xoauth2)
++
++(defcustom sasl-xoauth2-host-url-table
++  '(;; Gmail
++    ("gmail\\.com$"
++     "https://accounts.google.com/o/oauth2/v2/auth";
++     "https://www.googleapis.com/oauth2/v4/token";
++     "https://mail.google.com/";
++     nil)
++    ;; Outlook.com
++    ("outlook\\.com$"
++     "https://login.live.com/oauth20_authorize.srf";
++     "https://login.live.com/oauth20_token.srf";
++     "wl.offline_access wl.imap"
++     ;; You need register redirect URL at Application Registration Portal
++     ;; https://apps.dev.microsoft.com/
++     "http://localhost/result";))
++  "List of OAuth 2.0 URLs.  Each element of list is regexp for host, auth-url, token-url, scope and redirect-uri (optional)."
++      :type '(repeat (list
++                    (regexp :tag "Regexp for Host")
++                    (string :tag "Auth-URL")
++                    (string :tag "Token-URL")
++                    (string :tag "Scope")
++                    (choice string (const :tag "none" nil))))
++      :group 'sasl-xoauth2)
++
++(defcustom sasl-xoauth2-host-user-id-table
++  nil
++  "List of OAuth 2.0 Client IDs.  Each element of list is regexp for host, regexp for User ID, client ID and client secret (optional).
++Below is example to use Thunderbird's client ID and secret (not recommended, just an expample).
++
++(setq sasl-xoauth2-host-user-id-table
++      '((\"\\\\.gmail\\\\.com$\"
++       \".\"
++       \"91623021742-ud877vhta8ch9llegih22bc7er6589ar.apps.googleusercontent.com\"
++       \"iBn5rLbhbm_qoPbdGkgX81Dj\"))
++"
++  :type '(repeat (list
++                (regexp :tag "Regexp for Host")
++                (regexp :tag "Regexp for User ID")
++                (string :tag "Client ID")
++                (choice :tag "Client Secret"
++                        string
++                        (const :tag "none" nil))))
++  :group 'sasl-xoauth2)
++
++
++;; This advice makes oauth2.el to keep the time of getting token.
++(defadvice oauth2-make-access-request (after sasl-xoauth2 disable)
++  (setq ad-return-value (cons `(auth_time . ,(current-time))
++                            ad-return-value)))
++
++;; Modified version of oauth2-refresh-access.  It keeps refreshed time
++;; and updates expires_in parameter.
++(defun sasl-xoauth2-refresh-access (token)
++  "Refresh OAuth access TOKEN.
++TOKEN should be obtained with `oauth2-request-access'."
++  (let ((response
++       (oauth2-make-access-request
++          (oauth2-token-token-url token)
++          (concat "client_id=" (oauth2-token-client-id token)
++                  "&client_secret=" (oauth2-token-client-secret token)
++                  "&refresh_token=" (oauth2-token-refresh-token token)
++                  "&grant_type=refresh_token"))))
++    (setf (oauth2-token-access-token token)
++          (cdr (assq 'access_token response)))
++    ;; Update authorization time.
++    (setcdr (assq 'auth_time (oauth2-token-access-response token))
++          (current-time))
++    ;; Update expires_in parameter.
++    (cond
++     ((and (assq 'expires_in (oauth2-token-access-response token))
++         (assq 'expires_in response))
++      (setcdr (assq 'expires_in (oauth2-token-access-response token))
++            (cdr (assq 'expires_in response))))
++     ((assq 'expires_in (oauth2-token-access-response token))
++      (let ((list (memq (assq 'expires_in (oauth2-token-access-response token))
++                      (oauth2-token-access-response token))))
++      (setcdr list (cdr list))))
++     ((assq 'expires_in response)
++      (setf (oauth2-token-access-response token)
++          (cons (assq 'expires_in response)
++                (oauth2-token-access-response token))))))
++  ;; If the token has a plstore, update it
++  (let ((plstore (oauth2-token-plstore token)))
++    (when plstore
++      (plstore-put plstore (oauth2-token-plstore-id token)
++                   nil `(:access-token
++                         ,(oauth2-token-access-token token)
++                         :refresh-token
++                         ,(oauth2-token-refresh-token token)
++                         :access-response
++                         ,(oauth2-token-access-response token)))
++      (plstore-save plstore)))
++  token)
++
++(defun sasl-xoauth2-resolve-urls (host user)
++  (let (auth-url token-url client-id scope redirect-uri client-secret)
++    (let ((table sasl-xoauth2-host-url-table))
++      (while table
++      (when (string-match (caar table) host)
++        (setq auth-url  (nth 1 (car table))
++              token-url (nth 2 (car table))
++              scope     (nth 3 (car table))
++              redirect-uri (nth 4 (car table))
++              table nil))
++      (setq table (cdr table))))
++    (let ((table sasl-xoauth2-host-user-id-table))
++      (while table
++      (when (and (string-match (caar table) host)
++                 (string-match (nth 1 (car table)) user))
++        (setq client-id (nth 2 (car table))
++              client-secret (nth 3 (car table))
++              table nil))
++      (setq table (cdr table))))
++    (list auth-url token-url scope client-id client-secret redirect-uri)))
++
++(defun sasl-xoauth2-token-expired-p (token)
++  (let ((access-response (oauth2-token-access-response token)))
++    (or (null (assq 'expires_in access-response))
++      (time-less-p
++       (time-add (cdr (assq 'auth_time access-response))
++                 (cdr (assq 'expires_in access-response)))
++       (time-add (current-time)
++                 (- sasl-xoauth2-refresh-token-threshold))))))
++
++(defun sasl-xoauth2-response (client _step &optional _retry)
++  (let ((host (sasl-client-server client))
++      (user (sasl-client-name client))
++      info access-token oauth2-token
++      auth-url token-url client-id scope redirect-uri client-secret)
++    (setq info (sasl-xoauth2-resolve-urls host user)
++        auth-url
++        (or (car info)
++            (read-string (format "Input OAuth 2.0 AUTH-URL for %s: " host)))
++        token-url
++        (or (nth 1 info)
++            (read-string (format "Input OAuth 2.0 TOKEN-URL for %s: " host)))
++        scope
++        (or (nth 2 info)
++            (read-string (format "Input OAuth 2.0 SCOPE for %s: " host)))
++        client-id
++        (or (nth 3 info)
++            (read-string
++             (format "Input OAuth 2.0 CLIENT-ID for %s@%s: " user host)
++             user nil user))
++        client-secret
++        (or (nth 4 info)
++            (sasl-read-passphrase
++             (format "Input Oauth 2.0 CLIENT-SECRET for %s@%s: " user host)))
++        redirect-uri
++        (or (nth 5 info)
++            ;; Do not ask when sasl-xoauth2-host-url-table is
++            ;; matched.
++            (unless (car info)
++              (read-string
++               (format "Input OAuth 2.0 Redirect-URI for %s: " host)))))
++    (setq oauth2-token
++        (let ((oauth2-token-file
++               (expand-file-name (concat
++                                  (md5 (concat
++                                        client-id
++                                        client-secret
++                                        (sasl-client-name client)))
++                                  ".plstore")
++                                 sasl-xoauth2-token-directory)))
++          (ad-enable-advice 'oauth2-make-access-request 'after 'sasl-xoauth2)
++          (ad-activate 'oauth2-make-access-request)
++          (prog1
++              (oauth2-auth-and-store
++               auth-url token-url scope client-id client-secret redirect-uri)
++            (ad-disable-advice 'oauth2-make-access-request
++                               'after 'sasl-xoauth2)
++            (ad-activate 'oauth2-make-access-request))))
++    (when (sasl-xoauth2-token-expired-p oauth2-token)
++      (setq oauth2-token (sasl-xoauth2-refresh-access oauth2-token)))
++    (setq access-token (oauth2-token-access-token oauth2-token))
++    (format "user=%s\001auth=Bearer %s\001\001"
++          (sasl-client-name client)
++          access-token)))
++
++(put 'sasl-xoauth2 'sasl-mechanism
++     (sasl-make-mechanism "XOAUTH2" sasl-xoauth2-steps))
++
++(provide 'sasl-xoauth2)
++
++;;; sasl-xoauth2.el ends here
Index: pkgsrc/devel/flim/patches/patch-sasl.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-sasl.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-sasl.el     Sun Sep  3 14:58:39 2023
@@ -0,0 +1,119 @@
+$NetBSD: patch-sasl.el,v 1.1 2023/09/03 14:58:39 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/sasl.el 2005-07-06 11:09:05.000000000 +0900
++++ ./sasl.el  2023-08-31 08:29:38.619410439 +0900
+@@ -1,4 +1,4 @@
+-;;; sasl.el --- SASL client framework
++;;; sasl.el --- SASL client framework  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 2000 Free Software Foundation, Inc.
+ 
+@@ -36,18 +36,30 @@
+ 
+ ;;; Code:
+ 
+-(defvar sasl-mechanisms
+-  '("CRAM-MD5" "DIGEST-MD5" "PLAIN" "LOGIN" "ANONYMOUS"
+-    "NTLM" "SCRAM-MD5"))
++(defvar sasl-additional-mechanism-alist
++  '((sasl-scram-rfc "SCRAM-SHA-1")
++    (sasl-scram-sha256 "SCRAM-SHA-256")))
+ 
+ (defvar sasl-mechanism-alist
+-  '(("CRAM-MD5" sasl-cram)
+-    ("DIGEST-MD5" sasl-digest)
+-    ("PLAIN" sasl-plain)
+-    ("LOGIN" sasl-login)
+-    ("ANONYMOUS" sasl-anonymous)
+-    ("NTLM" sasl-ntlm)
+-    ("SCRAM-MD5" sasl-scram)))
++  (append '(("CRAM-MD5" sasl-cram)
++          ("DIGEST-MD5" sasl-digest)
++          ("PLAIN" sasl-plain)
++          ("LOGIN" sasl-login)
++          ("ANONYMOUS" sasl-anonymous)
++          ("NTLM" sasl-ntlm)
++          ("SCRAM-MD5" sasl-scram)
++          ("OAUTHBEARER" sasl-xoauth2)
++          ("XOAUTH2" sasl-xoauth2))
++        (let (result)
++          (mapc (lambda (elt)
++                  (when (locate-library (symbol-name (car elt)))
++                    (dolist (name (cdr elt))
++                      (setq result (cons (list name (car elt)) result)))))
++                sasl-additional-mechanism-alist)
++          result)))
++
++(defvar sasl-mechanisms
++  (mapcar 'car sasl-mechanism-alist))
+ 
+ (defvar sasl-unique-id-function #'sasl-unique-id-function)
+ 
+@@ -185,18 +197,18 @@
+   ;; Don't use microseconds from (current-time), they may be unsupported.
+   ;; Instead we use this randomly inited counter.
+   (setq sasl-unique-id-char
+-      (% (1+ (or sasl-unique-id-char (logand (random t) (1- (lsh 1 20)))))
++      (% (1+ (or sasl-unique-id-char (logand (random t) (1- (ash 1 20)))))
+          ;; (current-time) returns 16-bit ints,
+          ;; and 2^16*25 just fits into 4 digits i base 36.
+          (* 25 25)))
+-  (let ((tm (current-time)))
++  (let ((tm (floor (float-time))))
+     (concat
+      (sasl-unique-id-number-base36
+-      (+ (car   tm)
+-       (lsh (% sasl-unique-id-char 25) 16)) 4)
++      (+ (/ tm 65536)
++       (ash (% sasl-unique-id-char 25) 16)) 4)
+      (sasl-unique-id-number-base36
+-      (+ (nth 1 tm)
+-       (lsh (/ sasl-unique-id-char 25) 16)) 4))))
++      (+ (% tm 65536)
++       (ash (/ sasl-unique-id-char 25) 16)) 4))))
+ 
+ (defun sasl-unique-id-number-base36 (num len)
+   (if (if (< len 0)
+@@ -204,14 +216,13 @@
+       (= len 0))
+       ""
+     (concat (sasl-unique-id-number-base36 (/ num 36) (1- len))
+-          (char-to-string (aref "zyxwvutsrqponmlkjihgfedcba9876543210"
+-                                (% num 36))))))
++          (list (aref "zyxwvutsrqponmlkjihgfedcba9876543210" (% num 36))))))
+ 
+ ;;; PLAIN (RFC2595 Section 6)
+ (defconst sasl-plain-steps
+   '(sasl-plain-response))
+ 
+-(defun sasl-plain-response (client step)
++(defun sasl-plain-response (client _step)
+   (let ((passphrase
+        (sasl-read-passphrase
+         (format "PLAIN passphrase for %s: " (sasl-client-name client))))
+@@ -237,12 +248,12 @@
+     sasl-login-response-1
+     sasl-login-response-2))
+ 
+-(defun sasl-login-response-1 (client step)
++(defun sasl-login-response-1 (client _step)
+ ;;;  (unless (string-match "^Username:" (sasl-step-data step))
+ ;;;    (sasl-error (format "Unexpected response: %s" (sasl-step-data step))))
+   (sasl-client-name client))
+ 
+-(defun sasl-login-response-2 (client step)
++(defun sasl-login-response-2 (client _step)
+ ;;;  (unless (string-match "^Password:" (sasl-step-data step))
+ ;;;    (sasl-error (format "Unexpected response: %s" (sasl-step-data step))))
+   (sasl-read-passphrase
+@@ -258,7 +269,7 @@
+   '(ignore                            ;no initial response
+     sasl-anonymous-response))
+ 
+-(defun sasl-anonymous-response (client step)
++(defun sasl-anonymous-response (client _step)
+   (or (sasl-client-property client 'trace)
+       (sasl-client-name client)))
+ 
Index: pkgsrc/devel/flim/patches/patch-sha1.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-sha1.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-sha1.el     Sun Sep  3 14:58:39 2023
@@ -0,0 +1,40 @@
+$NetBSD: patch-sha1.el,v 1.1 2023/09/03 14:58:39 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/sha1.el 2005-07-06 11:09:05.000000000 +0900
++++ ./sha1.el  2023-08-31 08:29:38.620927012 +0900
+@@ -1,4 +1,4 @@
+-;;; sha1.el --- SHA1 Secure Hash Algorithm.
++;;; sha1.el --- SHA1 Secure Hash Algorithm.  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1999, 2001  Free Software Foundation, Inc.
+ 
+@@ -38,26 +38,7 @@
+ 
+ ;;; Code:
+ 
+-(defvar sha1-dl-module
+-  (cond
+-   ((and (fboundp 'sha1)
+-       (subrp (symbol-function 'sha1)))
+-    nil)
+-   ((fboundp 'dynamic-link)
+-    ;; Should we take care of `dynamic-link-path'?
+-    (let ((path (expand-file-name "sha1.so" exec-directory)))
+-      (if (file-exists-p path)
+-        path
+-      nil)))
+-   (t
+-    nil)))
+-
+-(cond
+- ((and (stringp sha1-dl-module)
+-       (file-exists-p sha1-dl-module))
+-  (require 'sha1-dl))
+- (t
+-  (require 'sha1-el)))
++(defvar sha1-dl-module nil)
+ 
+ (provide 'sha1)
+ 
Index: pkgsrc/devel/flim/patches/patch-smtp.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-smtp.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-smtp.el     Sun Sep  3 14:58:39 2023
@@ -0,0 +1,391 @@
+$NetBSD: patch-smtp.el,v 1.1 2023/09/03 14:58:39 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/smtp.el 2006-09-24 09:40:58.000000000 +0900
++++ ./smtp.el  2023-08-31 08:29:38.622738962 +0900
+@@ -1,4 +1,4 @@
+-;;; smtp.el --- basic functions to send mail with SMTP server
++;;; smtp.el --- basic functions to send mail with SMTP server  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001 ,2002, 2004
+ ;; Free Software Foundation, Inc.
+@@ -79,7 +79,7 @@
+   :group 'smtp)
+ 
+ (defcustom smtp-fqdn nil
+-  "Fully qualified domain name used for Message-ID."
++  "Fully qualified domain name used for SMTP HELO/EHLO."
+   :type '(choice (const nil) string)
+   :group 'smtp)
+ 
+@@ -98,17 +98,14 @@
+   :type 'boolean
+   :group 'smtp-extensions)
+ 
+-(defcustom smtp-use-starttls-ignore-error nil
+-  "If non-nil, do not use STARTTLS if STARTTLS is not available."
++(defcustom smtp-use-gnutls (gnutls-available-p)
++  "If non-nil, use built-in GnuTLS for STARTTLS."
+   :type 'boolean
+   :group 'smtp-extensions)
+ 
+-(defcustom smtp-starttls-program "starttls"
+-  "The program to run in a subprocess to open an TLSv1 connection."
+-  :group 'smtp-extensions)
+-
+-(defcustom smtp-starttls-extra-args nil
+-  "Extra arguments to `starttls-program'"
++(defcustom smtp-use-starttls-ignore-error nil
++  "If non-nil, do not use STARTTLS if STARTTLS is not available."
++  :type 'boolean
+   :group 'smtp-extensions)
+ 
+ (defcustom smtp-use-sasl nil
+@@ -145,8 +142,8 @@
+ `open-network-stream' and should return a process object.
+ Here is an example:
+ 
+-\(setq smtp-open-connection-function
+-      #'(lambda (name buffer host service)
++(setq smtp-open-connection-function
++      #\\='(lambda (name buffer host service)
+         (let ((process-connection-type nil))
+           (start-process name buffer \"ssh\" \"-C\" host
+                          \"nc\" host service))))
+@@ -186,8 +183,7 @@
+ 
+ (defun smtp-package-buffer-internal-size (package)
+   "Return the size of PACKAGE, an integer."
+-  (save-excursion
+-    (set-buffer (smtp-package-buffer-internal package))
++  (with-current-buffer (smtp-package-buffer-internal package)
+     (let ((size
+          (+ (buffer-size)
+             ;; Add one byte for each change-of-line
+@@ -245,14 +241,14 @@
+   "Return user's fully qualified domain name."
+   (if smtp-fqdn
+       smtp-fqdn
+-    (let ((system-name (system-name)))
++    (let ((name (system-name)))
+       (cond
+        (smtp-local-domain
+-      (concat system-name "." smtp-local-domain))
+-       ((string-match "[^.]\\.[^.]" system-name)
+-      system-name)
++      (concat name "." smtp-local-domain))
++       ((string-match "[^.]\\.[^.]" name)
++      name)
+        (t
+-      (error "Cannot generate valid FQDN"))))))
++      (error "invalid FQDN. Set smtp-fqdn or smtp-local-domain correctly"))))))
+ 
+ (defun smtp-find-connection (buffer)
+   "Find the connection delivering to BUFFER."
+@@ -268,7 +264,8 @@
+ 
+ (eval-and-compile
+   (autoload 'starttls-open-stream "starttls")
+-  (autoload 'starttls-negotiate "starttls"))
++  (autoload 'starttls-negotiate "starttls")
++  (autoload 'gnutls-negotiate "gnutls"))
+ 
+ (defun smtp-open-connection (buffer server service)
+   "Open a SMTP connection for a service to a host.
+@@ -276,9 +273,18 @@
+ BUFFER is the buffer to associate with the connection.  SERVER is name
+ of the host to connect to.  SERVICE is name of the service desired."
+   (let ((process
+-       (binary-funcall smtp-open-connection-function
+-                       "SMTP" buffer server service))
++       (binary-funcall
++        (cond
++         ((and smtp-use-starttls (null smtp-use-gnutls))
++          'starttls-open-stream)
++         (t
++          smtp-open-connection-function))
++        "SMTP" buffer server service))
+       connection)
++    (unless (and (processp process)
++               (memq (process-status process) '(open run)))
++      (error "Open SMTP connection function to %s:%s failed"
++           server (if (integerp service) (format "%d" service) service)))
+     (when process
+       (setq connection (smtp-make-connection process server service))
+       (set-process-filter process 'smtp-process-filter)
+@@ -341,7 +347,7 @@
+       t)
+     (smtp-error)))
+ 
+-(make-obsolete 'smtp-via-smtp "It's old API.")
++(make-obsolete 'smtp-via-smtp "It's old API." "02 Nov 2000")
+ 
+ ;;;###autoload
+ (defun smtp-send-buffer (sender recipients buffer)
+@@ -357,24 +363,22 @@
+             (or smtp-server
+                 (error "`smtp-server' not defined"))))
+          (package
+-          (smtp-make-package sender recipients buffer))
+-         (starttls-program smtp-starttls-program)
+-         (starttls-extra-args smtp-starttls-extra-args)
+-         (smtp-open-connection-function
+-          (if smtp-use-starttls
+-              #'starttls-open-stream
+-            smtp-open-connection-function)))
+-      (save-excursion
+-      (set-buffer
+-       (get-buffer-create
+-        (format "*trace of SMTP session to %s*" server)))
++          (smtp-make-package sender recipients buffer)))
++      (with-current-buffer
++        (setq buffer (get-buffer-create
++                      (format "*trace of SMTP session to %s*" server)))
+       (erase-buffer)
+       (buffer-disable-undo)
+-      (unless (smtp-find-connection (current-buffer))
+-        (smtp-open-connection (current-buffer) server smtp-service))
++      (unless (smtp-find-connection buffer)
++        (smtp-open-connection buffer server smtp-service))
+       (make-local-variable 'smtp-read-point)
+       (setq smtp-read-point (point-min))
+-      (funcall smtp-submit-package-function package)))))
++      (funcall smtp-submit-package-function package)
++      (unless (or smtp-debug (smtp-find-connection buffer))
++        (setq smtp-connection-alist
++              (delq (assq buffer smtp-connection-alist)
++                    smtp-connection-alist))
++        (kill-buffer nil))))))
+ 
+ (defun smtp-submit-package (package)
+   (unwind-protect
+@@ -399,7 +403,7 @@
+       (smtp-primitive-rcptto package)
+       (smtp-primitive-data package))
+     (let ((connection (smtp-find-connection (current-buffer))))
+-      (when (smtp-connection-opened connection)
++      (when (and connection (smtp-connection-opened connection))
+       (condition-case nil
+           (smtp-primitive-quit package)
+         (smtp-error))
+@@ -412,10 +416,6 @@
+ BUFFER may be a buffer or a buffer name which contains mail message."
+   (let ((servers
+        (smtp-find-server recipients))
+-      (smtp-open-connection-function
+-       (if smtp-use-starttls
+-           #'starttls-open-stream
+-         smtp-open-connection-function))
+       server package)
+       (while (car servers)
+       (setq server (caar servers))
+@@ -426,25 +426,29 @@
+                          (mapconcat 'concat recipients ">,<"))))
+       (setq package
+             (smtp-make-package sender recipients buffer))
+-      (save-excursion
+-        (set-buffer
+-         (get-buffer-create
+-          (format "*trace of SMTP session to %s*" server)))
++      (with-current-buffer
++          (setq buffer (get-buffer-create
++                        (format "*trace of SMTP session to %s*" server)))
+         (erase-buffer)
+         (buffer-disable-undo)
+-        (unless (smtp-find-connection (current-buffer))
+-          (smtp-open-connection (current-buffer) server smtp-service))
++        (unless (smtp-find-connection buffer)
++          (smtp-open-connection buffer server smtp-service))
+         (make-local-variable 'smtp-read-point)
+         (setq smtp-read-point (point-min))
+         (let ((smtp-use-sasl nil)
+               (smtp-use-starttls-ignore-error t))
+-          (funcall smtp-submit-package-function package)))
++          (funcall smtp-submit-package-function package))
++        (unless (or smtp-debug (smtp-find-connection buffer))
++          (setq smtp-connection-alist
++                (delq (assq buffer smtp-connection-alist)
++                      smtp-connection-alist))
++          (kill-buffer nil)))
+       (setq servers (cdr servers)))))
+ 
+ ;;; @ hook methods for `smtp-submit-package'
+ ;;;
+ 
+-(defun smtp-primitive-greeting (package)
++(defun smtp-primitive-greeting (_package)
+   (let* ((connection
+         (smtp-find-connection (current-buffer)))
+        (response
+@@ -452,7 +456,7 @@
+     (if (/= (car response) 220)
+       (smtp-response-error response))))
+ 
+-(defun smtp-primitive-ehlo (package)
++(defun smtp-primitive-ehlo (_package)
+   (let* ((connection
+         (smtp-find-connection (current-buffer)))
+        response)
+@@ -471,7 +475,7 @@
+                    extensions))
+                (cdr response)))))
+ 
+-(defun smtp-primitive-helo (package)
++(defun smtp-primitive-helo (_package)
+   (let* ((connection
+         (smtp-find-connection (current-buffer)))
+        response)
+@@ -480,7 +484,7 @@
+     (if (/= (car response) 250)
+       (smtp-response-error response))))
+ 
+-(defun smtp-primitive-auth (package)
++(defun smtp-primitive-auth (_package)
+   (let* ((connection
+         (smtp-find-connection (current-buffer)))
+        (mechanisms
+@@ -518,7 +522,11 @@
+         (smtp-response-error response)) ;Bogus server?
+       (if (/= (car response) 334)
+           (smtp-response-error response))
+-      (sasl-step-set-data step (base64-decode-string (nth 1 response)))
++      ;; Server may return human readable string.
++      ;; https://msdn.microsoft.com/en-us/library/cc246825.aspx
++      (sasl-step-set-data step (condition-case nil
++                                   (base64-decode-string (nth 1 response))
++                                 (error (nth 1 response))))
+       (setq step (sasl-next-step client step))
+       (smtp-send-command
+        connection
+@@ -531,16 +539,21 @@
+ ;;;     connection (sasl-client-decoder client))
+     ))
+ 
+-(defun smtp-primitive-starttls (package)
++(defun smtp-primitive-starttls (_package)
+   (let* ((connection
+         (smtp-find-connection (current-buffer)))
++       (process (smtp-connection-process-internal connection))
+        response)
+     ;; STARTTLS --- begin a TLS negotiation (RFC 2595)
+     (smtp-send-command connection "STARTTLS")
+     (setq response (smtp-read-response connection))
+     (if (/= (car response) 220)
+       (smtp-response-error response))
+-    (starttls-negotiate (smtp-connection-process-internal connection))))
++    (if (memq (process-status process) '(run stop exit signal))
++      (starttls-negotiate process)
++      (gnutls-negotiate
++       :process process
++       :hostname (smtp-connection-server-internal connection)))))
+ 
+ (defun smtp-primitive-mailfrom (package)
+   (let* ((connection
+@@ -555,7 +568,7 @@
+     ;; SIZE --- Message Size Declaration (RFC1870)
+     (if (and smtp-use-size
+            (assq 'size extensions))
+-      (setq extension (format "SIZE=%d" (smtp-package-buffer-internal-size package))))
++      (setq extension (format " SIZE=%d" (smtp-package-buffer-internal-size package))))
+     ;; 8BITMIME --- 8bit-MIMEtransport (RFC1652)
+     (if (and smtp-use-8bitmime
+            (assq '8bitmime extensions))
+@@ -563,7 +576,7 @@
+     (smtp-send-command
+      connection
+      (if extension
+-       (format "MAIL FROM:<%s> %s" sender extension)
++       (format "MAIL FROM:<%s>%s" sender extension)
+        (format "MAIL FROM:<%s>" sender)))
+     (setq response (smtp-read-response connection))
+     (if (/= (car response) 250)
+@@ -590,8 +603,7 @@
+     (setq response (smtp-read-response connection))
+     (if (/= (car response) 354)
+       (smtp-response-error response))
+-    (save-excursion
+-      (set-buffer (smtp-package-buffer-internal package))
++    (with-current-buffer (smtp-package-buffer-internal package)
+       (goto-char (point-min))
+       (while (not (eobp))
+       (smtp-send-data
+@@ -602,7 +614,7 @@
+     (if (/= (car response) 250)
+       (smtp-response-error response))))
+ 
+-(defun smtp-primitive-quit (package)
++(defun smtp-primitive-quit (_package)
+   (let* ((connection
+         (smtp-find-connection (current-buffer)))
+        response)
+@@ -614,8 +626,7 @@
+ ;;; @ low level process manipulating function
+ ;;;
+ (defun smtp-process-filter (process output)
+-  (save-excursion
+-    (set-buffer (process-buffer process))
++  (with-current-buffer (process-buffer process)
+     (goto-char (point-max))
+     (insert output)))
+ 
+@@ -663,12 +674,11 @@
+     response))
+ 
+ (defun smtp-send-command (connection command)
+-  (save-excursion
+-    (let ((process
+-         (smtp-connection-process-internal connection))
+-        (encoder
+-         (smtp-connection-encoder-internal connection)))
+-      (set-buffer (process-buffer process))
++  (let ((process
++       (smtp-connection-process-internal connection))
++      (encoder
++       (smtp-connection-encoder-internal connection)))
++    (with-current-buffer (process-buffer process)
+       (goto-char (point-max))
+       (setq command (concat command "\r\n"))
+       (insert command)
+@@ -683,9 +693,7 @@
+       (encoder
+        (smtp-connection-encoder-internal connection)))
+     ;; Escape "." at start of a line.
+-    (if (eq (string-to-char data) ?.)
+-      (setq data (concat "." data "\r\n"))
+-      (setq data (concat data "\r\n")))
++    (setq data (concat (when (eq (string-to-char data) ?.) ".") data "\r\n"))
+     (if encoder
+       (setq data (funcall encoder data)))
+     (process-send-string process data)))
+@@ -698,13 +706,10 @@
+       addr-regexp
+       (smtp-address-buffer (generate-new-buffer " *smtp-mail*")))
+     (unwind-protect
+-      (save-excursion
+-        ;;
+-        (set-buffer smtp-address-buffer)
++      (with-current-buffer smtp-address-buffer
+         (setq case-fold-search t)
+         (erase-buffer)
+-        (insert (save-excursion
+-                  (set-buffer smtp-text-buffer)
++        (insert (with-current-buffer smtp-text-buffer
+                   (buffer-substring-no-properties header-start header-end)))
+         (goto-char (point-min))
+         ;; RESENT-* fields should stop processing of regular fields.
+@@ -729,11 +734,11 @@
+         (erase-buffer)
+         (insert " " simple-address-list "\n")
+         ;; newline --> blank
+-        (subst-char-in-region (point-min) (point-max) 10 ?  t)
++        (subst-char-in-region (point-min) (point-max) 10 ?\s t)
+         ;; comma   --> blank
+-        (subst-char-in-region (point-min) (point-max) ?, ?  t)
++        (subst-char-in-region (point-min) (point-max) ?, ?\s t)
+         ;; tab     --> blank
+-        (subst-char-in-region (point-min) (point-max)  9 ?  t)
++        (subst-char-in-region (point-min) (point-max)  9 ?\s t)
+ 
+         (goto-char (point-min))
+         ;; tidyness in case hook is not robust when it looks at this
Index: pkgsrc/devel/flim/patches/patch-std11.el
diff -u /dev/null pkgsrc/devel/flim/patches/patch-std11.el:1.1
--- /dev/null   Sun Sep  3 14:58:39 2023
+++ pkgsrc/devel/flim/patches/patch-std11.el    Sun Sep  3 14:58:39 2023
@@ -0,0 +1,1102 @@
+$NetBSD: patch-std11.el,v 1.1 2023/09/03 14:58:39 mef Exp $
+
+ flim-1_14-wl branch at 2023-08-08
+
+--- /tmp/W/devel/flim/work/flim-1.14.9/std11.el        2005-11-13 10:04:36.000000000 +0900
++++ ./std11.el 2023-08-31 08:29:38.624627921 +0900
+@@ -1,4 +1,4 @@
+-;;; std11.el --- STD 11 functions for GNU Emacs
++;;; std11.el --- STD 11 functions for GNU Emacs  -*- lexical-binding: t -*-
+ 
+ ;; Copyright (C) 1995,96,97,98,99,2000,01,02 Free Software Foundation, Inc.
+ 
+@@ -24,8 +24,8 @@
+ 
+ ;;; Code:
+ 
+-(require 'custom)                     ; std11-lexical-analyzer
+-
++(require 'pccl)
++(require 'static)
+ 
+ ;;; @ fetch
+ ;;;
+@@ -54,21 +54,18 @@
+     (goto-char (point-min))
+     (let ((case-fold-search t))
+       (if (re-search-forward (concat "^" name ":[ \t]*") nil t)
+-        (buffer-substring-no-properties (match-end 0) (std11-field-end))
+-      ))))
++        (buffer-substring-no-properties (match-end 0) (std11-field-end))))))
+ 
+ ;;;###autoload
+ (defun std11-narrow-to-header (&optional boundary)
+-  "Narrow to the message header.
++  "Narrow to the message header when needed.
+ If BOUNDARY is not nil, it is used as message header separator."
+-  (narrow-to-region
+-   (goto-char (point-min))
+-   (if (re-search-forward
+-      (concat "^\\(" (regexp-quote (or boundary "")) "\\)?$")
+-      nil t)
+-       (match-beginning 0)
+-     (point-max)
+-     )))
++  (goto-char (point-min))
++  (when (re-search-forward
++       (if boundary (concat "^\\(" (regexp-quote boundary) "\\)?$")
++         "^$")
++       nil t)
++    (narrow-to-region (point-min) (match-beginning 0))))
+ 
+ ;;;###autoload
+ (defun std11-field-body (name &optional boundary)
+@@ -77,8 +74,7 @@
+   (save-excursion
+     (save-restriction
+       (inline (std11-narrow-to-header boundary)
+-            (std11-fetch-field name))
+-      )))
++            (std11-fetch-field name)))))
+ 
+ (defun std11-find-field-body (field-names &optional boundary)
+   "Return the first found field-body specified by FIELD-NAMES
+@@ -90,15 +86,13 @@
+       (let ((case-fold-search t)
+           field-name)
+       (catch 'tag
++        (goto-char (point-min))
+         (while (setq field-name (car field-names))
+-          (goto-char (point-min))
+           (if (re-search-forward (concat "^" field-name ":[ \t]*") nil t)
+               (throw 'tag
+                      (buffer-substring-no-properties
+-                      (match-end 0) (std11-field-end)))
+-            )
+-          (setq field-names (cdr field-names))
+-          ))))))
++                      (match-end 0) (std11-field-end))))
++          (setq field-names (cdr field-names))))))))
+ 
+ (defun std11-field-bodies (field-names &optional default-value boundary)
+   "Return list of each field-bodies of FIELD-NAMES of the message header
+@@ -117,11 +111,9 @@
+         (if (re-search-forward (concat "^" field-name ":[ \t]*") nil t)
+             (setcar d-rest
+                     (buffer-substring-no-properties
+-                     (match-end 0) (std11-field-end)))
+-          )
++                     (match-end 0) (std11-field-end))))
+         (setq s-rest (cdr s-rest)
+-              d-rest (cdr d-rest))
+-        )
++              d-rest (cdr d-rest)))
+       dest))))
+ 
+ (defun std11-header-string (regexp &optional boundary)
+@@ -136,11 +128,9 @@
+         (while (re-search-forward std11-field-head-regexp nil t)
+           (setq field
+                 (buffer-substring (match-beginning 0) (std11-field-end)))
+-          (if (string-match regexp field)
+-              (setq header (concat header field "\n"))
+-            ))
+-        header)
+-      ))))
++          (when (string-match regexp field)
++            (setq header (cons "\n" (cons field header)))))
++        (apply 'concat (nreverse header)))))))
+ 
+ (defun std11-header-string-except (regexp &optional boundary)
+   "Return string of message header fields not matched by REGEXP.
+@@ -155,10 +145,8 @@
+           (setq field
+                 (buffer-substring (match-beginning 0) (std11-field-end)))
+           (if (not (string-match regexp field))
+-              (setq header (concat header field "\n"))
+-            ))
+-        header)
+-      ))))
++              (setq header (cons "\n" (cons field header)))))
++        (apply 'concat (nreverse header)))))))
+ 
+ (defun std11-collect-field-names (&optional boundary)
+   "Return list of all field-names of the message header in current buffer.
+@@ -172,30 +160,34 @@
+         (setq name (buffer-substring-no-properties
+                     (match-beginning 0)(1- (match-end 0))))
+         (or (member name dest)
+-            (setq dest (cons name dest))
+-            )
+-        )
++            (setq dest (cons name dest))))
+       dest))))
+ 
+ 
+ ;;; @ unfolding
+ ;;;
+ 
++(defcustom std11-unfold-strip-leading-tab t
++  "When non-nil, `std11-unfold-string' strips leading TAB, which is
++mainly added by incorrect folding."
++  :group 'news
++  :group 'mail
++  :type 'boolean)
++
+ ;;;###autoload
+ (defun std11-unfold-string (string)
+   "Unfold STRING as message header field."
+-  (let ((dest "")
++  (let (dest
+       (p 0))
+-    (while (string-match "\n\\([ \t]\\)" string p)
+-      (setq dest (concat dest
+-                         (substring string p (match-beginning 0))
+-                         (substring string
+-                                  (match-beginning 1)
+-                                  (setq p (match-end 0)))
+-                         ))
+-      )
+-    (concat dest (substring string p))
+-    ))
++    (while (string-match "\\( ?\\)\n\\([ \t]\\)" string p)
++      (setq dest (cons (unless (and std11-unfold-strip-leading-tab
++                                  (< (match-beginning 0) (match-end 1))
++                                  (eq (aref string (match-beginning 2)) ?\t))
++                       (match-string 2 string))
++                     (cons (substring string p (match-end 1))
++                           dest))
++          p (match-end 0)))
++    (apply 'concat (nreverse (cons (substring string p) dest)))))
+ 
+ 
+ ;;; @ quoted-string
+@@ -205,18 +197,13 @@
+   (let (dest
+       (i 0)
+       (b 0)
+-      (len (length string))
+-      )
++      (len (length string)))
+     (while (< i len)
+-      (let ((chr (aref string i)))
+-      (if (memq chr specials)
+-          (setq dest (concat dest (substring string b i) "\\")
+-                b i)
+-        ))
+-      (setq i (1+ i))
+-      )
+-    (concat dest (substring string b))
+-    ))
++      (if (memq (aref string i) specials)
++        (setq dest (cons "\\" (cons (substring string b i) dest))
++              b i))
++      (setq i (1+ i)))
++    (apply 'concat (nreverse (cons (substring string b) dest)))))
+ 
+ (defconst std11-non-qtext-char-list '(?\" ?\\ ?\r ?\n))
+ 
+@@ -231,18 +218,14 @@
+   (let (dest
+       (b 0)
+       (i 0)
+-      (len (length string))
+-      )
++      (len (length string)))
+     (while (< i len)
+-      (let ((chr (aref string i)))
+-      (if (eq chr ?\\)
+-          (setq dest (concat dest (substring string b i))
+-                b (1+ i)
+-                i (+ i 2))
+-        (setq i (1+ i))
+-        )))
+-    (concat dest (substring string b))
+-    ))
++      (if (eq (aref string i) ?\\)
++        (setq dest (cons (substring string b i) dest)
++              b (1+ i)
++              i (+ i 2))
++      (setq i (1+ i))))
++    (apply 'concat (nreverse (cons (substring string b) dest)))))
+ 
+ (defun std11-strip-quoted-string (string)
+   "Strip quoted-string STRING."
+@@ -251,14 +234,144 @@
+            (let ((max (1- len)))
+              (and (eq (aref string 0) ?\")
+                   (eq (aref string max) ?\")
+-                  (std11-strip-quoted-pair (substring string 1 max))
+-                  )))
++                  (std11-strip-quoted-pair (substring string 1 max)))))
+       string)))
+ 
+ 
+ ;;; @ lexical analyze
+ ;;;
+ 
++(unless-broken ccl-usable
++(define-ccl-program std11-default-ccl-lexical-analyzer
++  ;; r0 input
++  ;; r1 flag means any character exists.
++  ;; r2 in parse flag
++  ;;    1 atom, 2 spaces, 3 quoted string or domain literal, 4 comment
++  ;; r3 comment depth
++  (eval-when-compile
++    (let* ((wrt `(if (r0 == ?\") (write "\\\"")
++                 (if (r0 == ?\\) (write "\\\\")
++                   (write r0))))
++         (atm `((branch r2
++                        ((r2 = 1)
++                         (write "(atom . \"")
++                         (write-read-repeat r0))
++                        (write-read-repeat r0)
++                        ((write "\")")
++                         (r2 = 1)
++                         (write "(atom . \"")
++                         (write-read-repeat r0)))))
++         (spc `((if r2 ((write "\")") (r2 = 0)))
++                (write "(specials . \"")
++                ,wrt
++                (write "\")")
++                (read r0)
++                (repeat)))
++         (sp  `((branch r2
++                        ((r2 = 2)
++                         (write "(spaces . \"")
++                         (write-read-repeat r0))
++                        ((write "\")")
++                         (r2 = 2)
++                         (write "(spaces . \"")
++                         (write-read-repeat r0))
++                        (write-read-repeat r0))))
++         (enc (lambda (name tag)
++                `((if r2 ((write "\")")))
++                  (write ,(concat "(" name " . \""))
++                  (r2 = 3)
++                  (loop
++                   (read-branch
++                    r0
++                    ,@(let* ((count (1+ (max tag ?\\)))
++                             (result (make-vector count '(write-repeat r0))))
++                        (aset result ?\\ `((write "\\\\")
++                                           (read r0)
++                                           ,wrt
++                                           (repeat)))
++                        (aset result ?\" '((write "\\\"")
++                                           (repeat)))
++                        (aset result tag '(break))
++                        (mapcar 'identity result)))
++                   (write-repeat r0))
++                  (write "\")")
++                  (r2 = 0)
++                  (read r0)
++                  (repeat))))
++         (qs (funcall enc "quoted-string" ?\"))
++         (dl (funcall enc "domain-literal" ?\]))
++         (cm  `((if r2 ((write "\")")))
++                (write "(comment . \"")
++                (r2 = 4)
++                (r3 = 1)
++                (loop
++                 (read-branch
++                  r0
++                  ,@(let* ((count (1+ (max ?\( ?\) ?\\)))
++                           (result (make-vector count '(write-repeat r0))))
++                      (aset result ?\( '((r3 += 1) (write-repeat r0)))
++                      (aset result ?\) '((r3 -= 1)
++                                         (if (r3 < 1) (break)
++                                           (write-repeat r0))))
++                      (aset result ?\\ `((write "\\\\")
++                                         (read r0)
++                                         ,wrt
++                                         (repeat)))
++                      (aset result ?\"
++                            '((write "\\\"") (repeat)))
++                      (mapcar 'identity result)))
++                 (write-repeat r0))
++                (write "\")")
++                (r2 = 0)
++                (read r0)
++                (repeat))))
++      `(8
++      ((r2 = 0)
++       (read r0)
++       (r1 = 1)
++       (write "((")
++       (loop
++        (branch r0
++                ,@(mapcar (lambda (elt)
++                            (eval elt))
++                          '(atm atm atm atm atm atm atm atm
++                                atm sp  sp  atm atm atm atm atm
++                                atm atm atm atm atm atm atm atm
++                                atm atm atm atm atm atm atm atm
++                                sp  atm qs  atm atm atm atm atm
++                                cm  spc atm atm spc atm spc atm
++                                atm atm atm atm atm atm atm atm
++                                atm atm spc spc spc atm spc atm
++                                spc atm atm atm atm atm atm atm
++                                atm atm atm atm atm atm atm atm
++                                atm atm atm atm atm atm atm atm
++                                atm atm atm dl  spc spc)))
++        ,@atm))
++      ((branch r1
++               (write "(nil . t)")
++               (branch r2
++                       (write ") . t)")
++                       (write "\")) . t)")
++                       (write "\")) . t)")
++                       (write "\")))")
++                       (write "\")))")))))))))
++
++(defcustom std11-ccl-lexical-analyzer
++  (static-unless (or (broken-p 'ccl-execute-eof-block)
++                   (broken-p 'ccl-usable))
++    'std11-default-ccl-lexical-analyzer)
++  "Specify CCL-program symbol for `std11-lexical-analyze'.
++When nil, do not use CCL.
++
++CCL-program returns a string which expresses a cons.  When cons's
++cdr is non-nil, CCL-program succeeds in analyzing and car is
++analyzed result.  When cdr is nil, CCL-program fails in analyzing.
++If you modify `std11-lexical-analyzer', set this variable to nil
++or prepare corresponding CCL-program."
++  :group 'news
++  :group 'mail
++  :type '(choice symbol (const :tag "Do not use CCL." nil)))
++
+ (defcustom std11-lexical-analyzer
+   '(std11-analyze-quoted-string
+     std11-analyze-domain-literal
+@@ -279,12 +392,11 @@
+   :type '(repeat function))
+ 
+ (eval-and-compile
+-  (defconst std11-space-char-list '(?  ?\t ?\n))
++  (defconst std11-space-char-list '(?\s ?\t ?\n))
+   (defconst std11-special-char-list '(?\] ?\[
+                                         ?\( ?\) ?< ?> ?@
+                                         ?, ?\; ?: ?\\ ?\"
+-                                        ?.))
+-  )
++                                        ?.)))
+ ;; (defconst std11-spaces-regexp
+ ;;   (eval-when-compile (concat "[" std11-space-char-list "]+")))
+ 
+@@ -304,16 +416,14 @@
+       (let ((end (match-end 0)))
+       (cons (cons 'spaces (substring string start end))
+             ;;(substring string end)
+-            end)
+-      )))
++            end))))
+ 
+ (defun std11-analyze-special (string start)
+   (if (and (> (length string) start)
+          (memq (aref string start) std11-special-char-list))
+       (cons (cons 'specials (substring string start (1+ start)))
+           ;;(substring string 1)
+-          (1+ start))
+-    ))
++          (1+ start))))
+ 
+ (defun std11-analyze-atom (string start)
+   (if (string-match std11-non-atom-regexp string start)
+@@ -334,8 +444,7 @@
+ 
+ (defun std11-check-enclosure (string open close &optional recursive from)
+   (let ((len (length string))
+-      (i (or from 0))
+-      )
++      (i (or from 0)))
+     (if (and (> len i)
+            (eq (aref string i) open))
+       (let (p chr)
+@@ -346,97 +455,83 @@
+             (cond ((eq chr ?\\)
+                    (setq i (1+ i))
+                    (if (>= i len)
+-                       (throw 'tag nil)
+-                     )
+-                   (setq i (1+ i))
+-                   )
++                       (throw 'tag nil))
++                   (setq i (1+ i)))
+                   ((eq chr close)
+-                   (throw 'tag (1+ i))
+-                   )
++                   (throw 'tag (1+ i)))
+                   ((eq chr open)
+                    (if (and recursive
+                             (setq p (std11-check-enclosure
+-                                     string open close recursive i))
+-                            )
++                                     string open close recursive i)))
+                        (setq i p)
+-                     (throw 'tag nil)
+-                     ))
++                     (throw 'tag nil)))
+                   (t
+-                   (setq i (1+ i))
+-                   ))
+-            ))))))
++                   (setq i (1+ i))))))))))
+ 
+ (defun std11-analyze-quoted-string (string start)
+   (let ((p (std11-check-enclosure string ?\" ?\" nil start)))
+     (if p
+       (cons (cons 'quoted-string (substring string (1+ start) (1- p)))
+             ;;(substring string p))
+-            p)
+-      )))
++            p))))
+ 
+ (defun std11-analyze-domain-literal (string start)
+   (let ((p (std11-check-enclosure string ?\[ ?\] nil start)))
+     (if p
+       (cons (cons 'domain-literal (substring string (1+ start) (1- p)))
+             ;;(substring string p))
+-            p)
+-      )))
++            p))))
+ 
+ (defun std11-analyze-comment (string start)
+   (let ((p (std11-check-enclosure string ?\( ?\) t start)))
+     (if p
+       (cons (cons 'comment (substring string (1+ start) (1- p)))
+             ;;(substring string p))
+-            p)
+-      )))
++            p))))
+ 
+ ;;;###autoload
+ (defun std11-lexical-analyze (string &optional analyzer start)
+   "Analyze STRING as lexical tokens of STD 11."
+-  (or analyzer
+-      (setq analyzer std11-lexical-analyzer))
+-  (or start
+-      (setq start 0))
+-  (let ((len (length string))
+-      dest ret)
+-    (while (< start len)
+-      (setq ret
+-          (let ((rest analyzer)
+-                func r)
+-            (while (and (setq func (car rest))
+-                        (null (setq r (funcall func string start))))
+-              (setq rest (cdr rest)))
+-            (or r
+-                (cons (cons 'error (substring string start)) (1+ len)))
+-            ))
+-      (setq dest (cons (car ret) dest)
+-          start (cdr ret))
+-      )
+-    (nreverse dest)
+-    ))
++  (let (len dest ret)
++    (if (and std11-ccl-lexical-analyzer
++           (null analyzer)
++           (cdr (setq ret (read (ccl-execute-on-string
++                                 std11-ccl-lexical-analyzer
++                                 (make-vector 9 0)
++                                 (if start (substring string start)
++                                   (or string "")))))))
++      (car ret)
++      (setq len (length string)
++          analyzer (or analyzer std11-lexical-analyzer)
++          start (or start 0))
++      (while (< start len)
++      (setq ret
++            (let ((rest analyzer)
++                  func r)
++              (while (and (setq func (car rest))
++                          (null (setq r (funcall func string start))))
++                (setq rest (cdr rest)))
++              (or r
++                  (cons (cons 'error (substring string start)) (1+ len)))))
++      (setq dest (cons (car ret) dest)
++            start (cdr ret)))
++      (nreverse dest))))
+ 
+ 
+ ;;; @ parser
+ ;;;
+ 
+ (defun std11-ignored-token-p (token)
+-  (let ((type (car token)))
+-    (or (eq type 'spaces)(eq type 'comment))
+-    ))
++  (memq (car token) '(spaces comment)))
+ 
+ (defun std11-parse-token (lal)
+   (let (token itl)
+     (while (and lal
+-              (progn
+-                (setq token (car lal))
+-                (std11-ignored-token-p token)
+-                ))
++              (std11-ignored-token-p (setq token (car lal))))
+       (setq lal (cdr lal))
+-      (setq itl (cons token itl))
+-      )
++      (setq itl (cons token itl)))
+     (cons (nreverse (cons token itl))
+-        (cdr lal))
+-    ))
++        (cdr lal))))
+ 
+ (defun std11-parse-ascii-token (lal)
+   (let (token itl parsed token-value)
+@@ -445,69 +540,51 @@
+               (or (std11-ignored-token-p token)
+                   (if (and (setq token-value (cdr token))
+                            (delq 'ascii (find-charset-string token-value)))
+-                      (setq token nil)
+-                    )))
++                      (setq token nil))))
+       (setq lal (cdr lal))
+-      (setq itl (cons token itl))
+-      )
++      (setq itl (cons token itl)))
+     (if (and token
+-           (setq parsed (nreverse (cons token itl)))
+-           )
+-      (cons parsed (cdr lal))
+-      )))
++           (setq parsed (nreverse (cons token itl))))
++      (cons parsed (cdr lal)))))
+ 
+ (defun std11-parse-token-or-comment (lal)
+   (let (token itl)
+     (while (and lal
+-              (progn
+-                (setq token (car lal))
+-                (eq (car token) 'spaces)
+-                ))
++              (eq (car (setq token (car lal))) 'spaces))
+       (setq lal (cdr lal))
+-      (setq itl (cons token itl))
+-      )
++      (setq itl (cons token itl)))
+     (cons (nreverse (cons token itl))
+-        (cdr lal))
+-    ))
++        (cdr lal))))
+ 
+ (defun std11-parse-word (lal)
+   (let ((ret (std11-parse-ascii-token lal)))
+     (if ret
+       (let ((elt (car ret))
+-            (rest (cdr ret))
+-            )
++            (rest (cdr ret)))
+         (if (or (assq 'atom elt)
+                 (assq 'quoted-string elt))
+-            (cons (cons 'word elt) rest)
+-          )))))
++            (cons (cons 'word elt) rest))))))
+ 
+ (defun std11-parse-word-or-comment-or-period (lal)
+   (let ((ret (std11-parse-token-or-comment lal)))
+     (if ret
+       (let ((elt (car ret))
+-            (rest (cdr ret))
+-            )
++            (rest (cdr ret)))
+         (cond ((or (assq 'atom elt)
+                    (assq 'quoted-string elt))
+-               (cons (cons 'word elt) rest)
+-               )
++               (cons (cons 'word elt) rest))
+               ((assq 'comment elt)
+-               (cons (cons 'comment-word elt) rest)
+-               )
++               (cons (cons 'comment-word elt) rest))
+               ((string-equal (cdr (assq 'specials elt)) ".")
+-               (cons (cons 'period elt) rest)
+-               ))
+-        ))))
++               (cons (cons 'period elt) rest)))))))
+ 
+ (defun std11-parse-phrase (lal)
+   (let (ret phrase)
+     (while (setq ret (std11-parse-word-or-comment-or-period lal))
+       (setq phrase (append phrase (cdr (car ret))))
+-      (setq lal (cdr ret))
+-      )
++      (setq lal (cdr ret)))
+     (if phrase
+-      (cons (cons 'phrase phrase) lal)
+-      )))
++      (cons (cons 'phrase phrase) lal))))
+ 
+ (defun std11-parse-local-part (lal)
+   (let ((ret (std11-parse-word lal)))
+@@ -519,24 +596,18 @@
+                     (string-equal (cdr (assq 'specials dot)) ".")
+                     (setq ret (std11-parse-word (cdr ret)))
+                     (setq local-part
+-                          (append local-part dot (cdr (car ret)))
+-                          )
+-                    (setq lal (cdr ret))
+-                    ))
+-        (cons (cons 'local-part local-part) lal)
+-        ))))
++                          (append local-part dot (cdr (car ret))))
++                    (setq lal (cdr ret))))
++        (cons (cons 'local-part local-part) lal)))))
+ 
+ (defun std11-parse-sub-domain (lal)
+   (let ((ret (std11-parse-ascii-token lal)))
+     (if ret
+       (let ((sub-domain (car ret)))
+         (if (or (assq 'atom sub-domain)
+-                (assq 'domain-literal sub-domain)
+-                )
++                (assq 'domain-literal sub-domain))
+             (cons (cons 'sub-domain sub-domain)
+-                  (cdr ret)
+-                  )
+-          )))))
++                  (cdr ret)))))))
+ 
+ (defun std11-parse-domain (lal)
+   (let ((ret (std11-parse-sub-domain lal)))
+@@ -548,23 +619,18 @@
+                     (string-equal (cdr (assq 'specials dot)) ".")
+                     (setq ret (std11-parse-sub-domain (cdr ret)))
+                     (setq domain
+-                          (append domain dot (cdr (car ret)))
+-                          )
+-                    (setq lal (cdr ret))
+-                    ))
+-        (cons (cons 'domain domain) lal)
+-        ))))
++                          (append domain dot (cdr (car ret))))
++                    (setq lal (cdr ret))))
++        (cons (cons 'domain domain) lal)))))
+ 
+ (defun std11-parse-at-domain (lal)
+   (let ((ret (std11-parse-ascii-token lal)) at-sign)
+     (if (and ret
+            (setq at-sign (car ret))
+            (string-equal (cdr (assq 'specials at-sign)) "@")
+-           (setq ret (std11-parse-domain (cdr ret)))
+-           )
++           (setq ret (std11-parse-domain (cdr ret))))
+       (cons (cons 'at-domain (append at-sign (cdr (car ret))))
+-            (cdr ret))
+-      )))
++            (cdr ret)))))
+ 
+ (defun std11-parse-addr-spec (lal)
+   (let ((ret (std11-parse-local-part lal))
+@@ -575,10 +641,8 @@
+              (setq lal (cdr ret))
+              (and (setq ret (std11-parse-at-domain lal))
+                   (setq addr (append addr (cdr (car ret))))
+-                  (setq lal (cdr ret))
+-                  )))
+-      (cons (cons 'addr-spec addr) lal)
+-      )))
++                  (setq lal (cdr ret)))))
++      (cons (cons 'addr-spec addr) lal))))
+ 
+ (defun std11-parse-route (lal)
+   (let ((ret (std11-parse-at-domain lal))
+@@ -590,21 +654,15 @@
+              (while (and (setq ret (std11-parse-ascii-token lal))
+                          (setq comma (car ret))
+                          (string-equal (cdr (assq 'specials comma)) ",")
+-                         (setq ret (std11-parse-at-domain (cdr ret)))
+-                         )
++                         (setq ret (std11-parse-at-domain (cdr ret))))
+                (setq route (append route comma (cdr (car ret))))
+-               (setq lal (cdr ret))
+-               )
++               (setq lal (cdr ret)))
+              (and (setq ret (std11-parse-ascii-token lal))
+                   (setq colon (car ret))
+                   (string-equal (cdr (assq 'specials colon)) ":")
+-                  (setq route (append route colon))
+-                  )
+-             ))
++                  (setq route (append route colon)))))
+       (cons (cons 'route route)
+-            (cdr ret)
+-            )
+-      )))
++            (cdr ret)))))
+ 
+ (defun std11-parse-route-addr (lal)
+   (let ((ret (std11-parse-ascii-token lal))
+@@ -615,34 +673,27 @@
+            (setq lal (cdr ret))
+            (progn (and (setq ret (std11-parse-route lal))
+                        (setq route (cdr (car ret)))
+-                       (setq lal (cdr ret))
+-                       )
+-                  (setq ret (std11-parse-addr-spec lal))
+-                  )
++                       (setq lal (cdr ret)))
++                  (setq ret (std11-parse-addr-spec lal)))
+            (setq addr-spec (cdr (car ret)))
+            (setq lal (cdr ret))
+            (setq ret (std11-parse-ascii-token lal))
+            (setq > (car ret))
+-           (string-equal (cdr (assq 'specials >)) ">")
+-           )
++           (string-equal (cdr (assq 'specials >)) ">"))
+       (cons (cons 'route-addr (append route addr-spec))
+-            (cdr ret)
+-            )
+-      )))
++            (cdr ret)))))
+ 
+ (defun std11-parse-phrase-route-addr (lal)
+   (let ((ret (std11-parse-phrase lal)) phrase)
+     (if ret
+       (progn
+         (setq phrase (cdr (car ret)))
+-        (setq lal (cdr ret))
+-        ))
++        (setq lal (cdr ret))))
+     (if (setq ret (std11-parse-route-addr lal))
+       (cons (list 'phrase-route-addr
+                   phrase
+                   (cdr (car ret)))
+-            (cdr ret))
+-      )))
++            (cdr ret)))))
+ 
+ (defun std11-parse-mailbox (lal)
+   (let ((ret (or (std11-parse-phrase-route-addr lal)
+@@ -653,13 +704,10 @@
+                (setq mbox (car ret))
+              (setq lal (cdr ret))
+              (if (and (setq ret (std11-parse-token-or-comment lal))
+-                      (setq comment (cdr (assq 'comment (car ret))))
+-                      )
+-                 (setq lal (cdr ret))
+-               )))
++                      (setq comment (cdr (assq 'comment (car ret)))))
++                 (setq lal (cdr ret)))))
+       (cons (list 'mailbox mbox comment)
+-            lal)
+-      )))
++            lal))))
+ 
+ (defun std11-parse-group (lal)
+   (let ((ret (std11-parse-phrase lal))
+@@ -675,30 +723,24 @@
+              (and (setq ret (std11-parse-mailbox lal))
+                   (setq mbox (list (car ret)))
+                   (setq lal (cdr ret))
+-                  (progn
+-                    (while (and (setq ret (std11-parse-ascii-token lal))
+-                                (setq comma (car ret))
+-                                (string-equal
+-                                 (cdr (assq 'specials comma)) ",")
+-                                (setq lal (cdr ret))
+-                                (setq ret (std11-parse-mailbox lal))
+-                                (setq mbox (cons (car ret) mbox))
+-                                (setq lal (cdr ret))
+-                                )
+-                      )))
++                  (while (and (setq ret (std11-parse-ascii-token lal))
++                              (setq comma (car ret))
++                              (string-equal
++                               (cdr (assq 'specials comma)) ",")
++                              (setq lal (cdr ret))
++                              (setq ret (std11-parse-mailbox lal))
++                              (setq mbox (cons (car ret) mbox))
++                              (setq lal (cdr ret)))))
+              (and (setq ret (std11-parse-ascii-token lal))
+                   (setq semicolon (car ret))
+                   (string-equal (cdr (assq 'specials semicolon)) ";")
+                   )))
+       (cons (list 'group phrase (nreverse mbox))
+-            (cdr ret)
+-            )
+-      )))
++            (cdr ret)))))
+ 
+ (defun std11-parse-address (lal)
+   (or (std11-parse-group lal)
+-      (std11-parse-mailbox lal)
+-      ))
++      (std11-parse-mailbox lal)))
+ 
+ (defun std11-parse-addresses (lal)
+   (let ((ret (std11-parse-address lal)))
+@@ -707,13 +749,10 @@
+         (setq lal (cdr ret))
+         (while (and (setq ret (std11-parse-ascii-token lal))
+                     (string-equal (cdr (assq 'specials (car ret))) ",")
+-                    (setq ret (std11-parse-address (cdr ret)))
+-                    )
++                    (setq ret (std11-parse-address (cdr ret))))
+           (setq dest (cons (car ret) dest))
+-          (setq lal (cdr ret))
+-          )
+-        (nreverse dest)
+-        ))))
++          (setq lal (cdr ret)))
++        (nreverse dest)))))
+ 
+ (defun std11-parse-msg-id (lal)
+   (let ((ret (std11-parse-ascii-token lal))
+@@ -727,11 +766,9 @@
+            (setq lal (cdr ret))
+            (setq ret (std11-parse-ascii-token lal))
+            (setq > (car ret))
+-           (string-equal (cdr (assq 'specials >)) ">")
+-           )
++           (string-equal (cdr (assq 'specials >)) ">"))
+       (cons (cons 'msg-id (cdr addr-spec))
+-            (cdr ret))
+-      )))
++            (cdr ret)))))
+ 
+ (defun std11-parse-msg-ids (tokens)
+   "Parse lexical TOKENS as `*(phrase / msg-id)', and return the result."
+@@ -743,13 +780,11 @@
+         (while (setq ret (or (std11-parse-msg-id tokens)
+                              (std11-parse-phrase tokens)))
+           (setq dest (cons (car ret) dest))
+-          (setq tokens (cdr ret))
+-          )
+-        (nreverse dest)
+-        ))))
++          (setq tokens (cdr ret)))
++        (nreverse dest)))))
+ 
+ (defalias 'std11-parse-in-reply-to 'std11-parse-msg-ids)
+-(make-obsolete 'std11-parse-in-reply-to 'std11-parse-msg-ids)
++(make-obsolete 'std11-parse-in-reply-to 'std11-parse-msg-ids "23 Jan 1999")
+ 
+ 
+ ;;; @ composer
+@@ -758,20 +793,16 @@
+ (defun std11-addr-to-string (seq)
+   "Return string from lexical analyzed list SEQ
+ represents addr-spec of RFC 822."
+-  (mapconcat (function
+-            (lambda (token)
+-              (let ((name (car token)))
+-                  (cond
+-                   ((eq name 'spaces) "")
+-                   ((eq name 'comment) "")
+-                   ((eq name 'quoted-string)
+-                    (concat "\"" (cdr token) "\""))
+-                   ((eq name 'domain-literal)
+-                    (concat "[" (cdr token) "]"))
+-                   (t (cdr token)))
+-                  )))
+-           seq "")
+-  )
++  (mapconcat (lambda (token)
++             (let ((name (car token)))
++                 (cond
++                  ((memq name '(spaces comment)) nil)
++                  ((eq name 'quoted-string)
++                   (concat "\"" (cdr token) "\""))
++                  ((eq name 'domain-literal)
++                   (concat "[" (cdr token) "]"))
++                  (t (cdr token)))))
++           seq nil))
+ 
+ ;;;###autoload
+ (defun std11-address-string (address)
+@@ -779,45 +810,34 @@
+   (cond ((eq (car address) 'group)
+        (mapconcat (function std11-address-string)
+                   (nth 2 address)
+-                  ", ")
+-       )
++                  ", "))
+       ((eq (car address) 'mailbox)
+        (let ((addr (nth 1 address)))
+          (std11-addr-to-string
+           (if (eq (car addr) 'phrase-route-addr)
+               (nth 2 addr)
+-            (cdr addr)
+-            )
+-          )))))
++            (cdr addr)))))))
+ 
+ (defun std11-comment-value-to-string (value)
+   (if (stringp value)
+       (std11-strip-quoted-pair value)
+-    (let ((dest ""))
++    (let (dest)
+       (while value
+       (setq dest
+-            (concat dest
+-                    (if (stringp (car value))
+-                        (car value)
+-                      (concat "("
+-                              (std11-comment-value-to-string
+-                               (cdr (car value)))
+-                              ")")
+-                      ))
+-            value (cdr value))
+-      )
+-      dest)))
++            (if (stringp (car value))
++                (cons (car value) dest)
++              (cons ")"
++                    (cons (std11-comment-value-to-string
++                           (cdr (car value)))
++                          (cons "(" dest))))
++            value (cdr value)))
++      (apply 'concat (nreverse dest)))))
+ 
+ ;;;###autoload
+ (defun std11-full-name-string (address)
+   "Return string of full-name part from parsed ADDRESS of RFC 822."
+   (cond ((eq (car address) 'group)
+-       (mapconcat (function
+-                   (lambda (token)
+-                     (cdr token)
+-                     ))
+-                  (nth 1 address) "")
+-       )
++       (mapconcat 'cdr (nth 1 address) ""))
+       ((eq (car address) 'mailbox)
+        (let ((addr (nth 1 address))
+              (comment (nth 2 address))
+@@ -825,33 +845,25 @@
+          (if (eq (car addr) 'phrase-route-addr)
+              (setq phrase
+                    (mapconcat
+-                    (function
+-                     (lambda (token)
+-                       (let ((type (car token)))
+-                         (cond ((eq type 'quoted-string)
+-                                (std11-strip-quoted-pair (cdr token))
+-                                )
+-                               ((eq type 'comment)
+-                                (concat "("
+-                                        (std11-comment-value-to-string
+-                                         (cdr token))
+-                                        ")")
+-                                )
+-                               (t
+-                                (cdr token)
+-                                )))))
+-                    (nth 1 addr) ""))
+-           )
++                    (lambda (token)
++                      (let ((type (car token)))
++                        (cond ((eq type 'quoted-string)
++                               (std11-strip-quoted-pair (cdr token)))
++                              ((eq type 'comment)
++                               (concat "("
++                                       (std11-comment-value-to-string
++                                        (cdr token))
++                                       ")"))
++                              (t
++                               (cdr token)))))
++                    (nth 1 addr) "")))
+          (cond ((> (length phrase) 0) phrase)
+-               (comment (std11-comment-value-to-string comment))
+-               )
+-         ))))
++               (comment (std11-comment-value-to-string comment)))))))
+ 
+ ;;;###autoload
+ (defun std11-msg-id-string (msg-id)
+   "Return string from parsed MSG-ID of RFC 822."
+-  (concat "<" (std11-addr-to-string (cdr msg-id)) ">")
+-  )
++  (concat "<" (std11-addr-to-string (cdr msg-id)) ">"))
+ 
+ ;;;###autoload
+ (defun std11-fill-msg-id-list-string (string &optional column)
+@@ -866,14 +878,12 @@
+                (len (length str)))
+           (setq lal (cdr ret))
+           (if (> (+ len column) 76)
+-              (setq dest (concat dest "\n " str)
++              (setq dest (cons str (cons "\n " dest))
+                     column (1+ len))
+             (setq dest str
+-                  column (+ column len))
+-            ))
+-      (setq dest (concat dest (cdr (car lal)))
+-            lal (cdr lal))
+-      ))
++                  column (+ column len))))
++      (setq dest (cons (cdr (car lal)) dest)
++            lal (cdr lal))))
+     (while lal
+       (let ((ret (std11-parse-msg-id lal)))
+       (if ret
+@@ -881,15 +891,13 @@
+                  (len (1+ (length str))))
+             (setq lal (cdr ret))
+             (if (> (+ len column) 76)
+-                (setq dest (concat dest "\n " str)
++                (setq dest (cons str (cons "\n " dest))
+                       column len)
+-              (setq dest (concat dest " " str)
+-                    column (+ column len))
+-              ))
+-        (setq dest (concat dest (cdr (car lal)))
+-              lal (cdr lal))
+-        )))
+-    dest))
++              (setq dest (cons str (cons " " dest))
++                    column (+ column len))))
++        (setq dest (cons (cdr (car lal)) dest)
++              lal (cdr lal)))))
++    (apply 'concat (nreverse dest))))
+ 
+ 
+ ;;; @ parser with lexical analyzer
+@@ -898,26 +906,22 @@
+ ;;;###autoload
+ (defun std11-parse-address-string (string)
+   "Parse STRING as mail address."
+-  (std11-parse-address (std11-lexical-analyze string))
+-  )
++  (std11-parse-address (std11-lexical-analyze string)))
+ 
+ ;;;###autoload
+ (defun std11-parse-addresses-string (string)
+   "Parse STRING as mail address list."
+-  (std11-parse-addresses (std11-lexical-analyze string))
+-  )
++  (std11-parse-addresses (std11-lexical-analyze string)))
+ 
+ ;;;###autoload
+ (defun std11-parse-msg-id-string (string)
+   "Parse STRING as msg-id."
+-  (std11-parse-msg-id (std11-lexical-analyze string))
+-  )
++  (std11-parse-msg-id (std11-lexical-analyze string)))
+ 
+ ;;;###autoload
+ (defun std11-parse-msg-ids-string (string)
+   "Parse STRING as `*(phrase / msg-id)'."
+-  (std11-parse-msg-ids (std11-lexical-analyze string))
+-  )
++  (std11-parse-msg-ids (std11-lexical-analyze string)))
+ 
+ ;;;###autoload
+ (defun std11-extract-address-components (string)
+@@ -927,10 +931,8 @@
+   (let* ((structure (car (std11-parse-address-string
+                         (std11-unfold-string string))))
+          (phrase  (std11-full-name-string structure))
+-         (address (std11-address-string structure))
+-         )
+-    (list phrase address)
+-    ))
++         (address (std11-address-string structure)))
++    (list phrase address)))
+ 
+ 
+ ;;; @ end



Home | Main Index | Thread Index | Old Index