diff --git a/apel-10.7/APEL-CFG b/apel-10.7/APEL-CFG new file mode 100644 index 0000000..d11d4f0 --- /dev/null +++ b/apel-10.7/APEL-CFG @@ -0,0 +1,88 @@ +;;; APEL-CFG --- user customizations for APEL installation. -*-Emacs-Lisp-*- + +;;; Commentary: + +;; Use this file to override variables defined in APEL-MK. +;; +;; The following variables are used in APEL-MK. +;; Note that you cannot use them in this file. +;; +;; For Emacs, or XEmacs without package system: +;; +;; PREFIX: Normally, "/usr/local". +;; Installer will try to detect it automatically. +;; LISPDIR: "PREFIX/share/emacs/site-lisp" if Emacs 19.29 and later. +;; "PREFIX/lib/emacs/site-lisp" if Emacs 19.28 and earlier. +;; Installer will try to detect it from PREFIX. +;; VERSION_SPECIFIC_LISPDIR: "PREFIX/share/emacs/VERSION/site-lisp" +;; if Emacs 19.31 and later, otherwise, same as LISPDIR. +;; +;; APEL_PREFIX: subdirectory of LISPDIR where APEL modules will be +;; installed, or "" if you don't want to make subdirectory. +;; EMU_PREFIX: subdirectory of VERSION_SPECIFIC_LISPDIR where EMU +;; modules will be installed, or "" if you don't want to +;; make subdirectory. +;; +;; APEL_DIR: The directory where APEL modules will be installed. +;; Generated from LISPDIR and APEL_PREFIX if it is not set. +;; EMU_DIR: The directory where EMU modules will be installed. +;; Generated from VERSION_SPECIFIC_LISPDIR and EMU_PREFIX +;; if it is not set. +;; +;; For XEmacs with package system: +;; +;; PACKAGEDIR: "/usr/local/lib/xemacs/xemacs-packages" +;; Installer will try to detect it automatically. +;; +;; APEL_PREFIX: subdirectory of PACKAGEDIR where both APEL and EMU +;; modules will be installed. + +;;; Code: + +;;; "custom" library. + +;; If you want to use "new custom" but do not use "subdirs.el" to add +;; "custom" directory to your load-path, uncomment and edit this. +;; (setq load-path +;; (cons "/usr/local/share/emacs/19.34/site-lisp/custom" load-path)) + + +;;; Install to home directory. + +;; If you want to install APEL to your home directory and you already +;; have the standard hierarchy such as "~/share/emacs/site-lisp" and +;; "~/share/emacs/VERSION/site-lisp", uncomment and edit this. +;; (setq PREFIX "~/") + +;; Or, you can specify APEL_DIR and EMU_DIR directly. +;; (setq APEL_DIR "~/lib/emacs/lisp/apel") +;; (setq EMU_DIR "~/lib/emacs/lisp/emu") + + +;;; Install to site-lisp directories. + +;; (setq PREFIX "/usr/local") + +;; Mule based on Emacs 19.28 and earlier. +;; (setq LISPDIR "/usr/local/share/mule/site-lisp") +;; Mule based on Emacs 19.29 and later. +;; (setq LISPDIR "/usr/local/share/emacs/site-lisp") +;; (setq LISPDIR "/usr/local/share/mule/site-lisp") +;; (setq VERSION_SPECIFIC_LISPDIR "/usr/local/share/emacs/19.34/site-lisp") +;; (setq VERSION_SPECIFIC_LISPDIR "/usr/local/share/mule/19.34/site-lisp") + +;; XEmacs 21.0 and later. +;; (setq PACKAGEDIR "/usr/local/lib/xemacs/xemacs-packages") + +;; (setq APEL_PREFIX "apel") +;; (setq EMU_PREFIX "emu") + +;; If you want to install all of APEL modules to VERSION_SPECIFIC_LISPDIR, +;; uncomment and edit this. +;; (setq APEL_DIR "/usr/local/share/emacs/19.34/site-lisp/apel") + +;; You can specify APEL_DIR and EMU_DIR directly. Uncomment and edit this. +;; (setq APEL_DIR "/usr/local/share/emacs/site-lisp/apel") +;; (setq EMU_DIR "/usr/local/share/emacs/19.34/site-lisp/emu") + +;;; APEL-CFG ends here diff --git a/apel-10.7/APEL-ELS b/apel-10.7/APEL-ELS new file mode 100644 index 0000000..98de7e6 --- /dev/null +++ b/apel-10.7/APEL-ELS @@ -0,0 +1,19 @@ +;;; APEL-ELS --- list of APEL modules to install. -*-Emacs-Lisp-*- + +;;; Commentary: + +;; APEL-MK imports `apel-modules' from here. + +;;; Code: + +(defvar apel-modules '(alist calist path-util filename install + ;; "mule-caesar" is version-dependent. + ;; moved to EMU-ELS. + ;; mule-caesar + + ;; [obsoleted modules] If you would like to + ;; install following, please activate them. + ;; atype file-detect + )) + +;;; APEL-ELS ends here diff --git a/apel-10.7/APEL-MK b/apel-10.7/APEL-MK new file mode 100644 index 0000000..1354835 --- /dev/null +++ b/apel-10.7/APEL-MK @@ -0,0 +1,197 @@ +;;; APEL-MK --- installer for APEL. -*-Emacs-Lisp-*- + +;;; Commentary: + +;; DON'T EDIT THIS FILE; edit APEL-CFG instead. + +;;; Code: + +;;; Configuration variables. + +;; Set these four variables in "APEL-CFG" or in "Makefile". + +;; This variable will be detected automatically. +(defvar PREFIX nil) + +;; This variable will be detected automatically using PREFIX. +;; v18: (no standard site-lisp directory) +;; Emacs 19.28 and earlier: "PREFIX/lib/emacs/site-lisp" +;; Emacs 19.29 and later: "PREFIX/share/emacs/site-lisp" +(defvar LISPDIR nil) + +;; This variable will be detected automatically using PREFIX. +;; Emacs 19.31 and later: "PREFIX/share/emacs/VERSION/site-lisp" +(defvar VERSION_SPECIFIC_LISPDIR nil) + +;; This variable will be detected automatically. +;; XEmacs 21.0 and later: "/usr/local/lib/xemacs/xemacs-packages" +(defvar PACKAGEDIR nil) + +;; Install APEL modules to "apel" subdirectory. +(defvar APEL_PREFIX "apel") + +;; Install EMU modules to "emu" subdirectory if emacs supports some features. +;; If your emacs does not have `normal-top-level-add-subdirs-to-load-path' +;; but have `normal-top-level-add-to-load-path' and you want to use it in +;; "subdirs.el", put the following line to "APEL-CFG". +;; (setq EMU_PREFIX "emu") +(defvar EMU_PREFIX + (if (or (featurep 'xemacs) + (fboundp 'normal-top-level-add-subdirs-to-load-path)) + ;; Make "emu" subdirectory. + "emu" + ;; Don't make "emu" subdirectory. + "")) + +;; The directories where APEL and EMU modules will be installed. +;; These two variables will be generated from other variables above. +(defvar APEL_DIR nil) ; LISPDIR/APEL_PREFIX +(defvar EMU_DIR nil) ; VERSION_SPECIFIC_LISPDIR/EMU_PREFIX + + +;;; Configure, Compile, and Install. + +(defun config-apel () + ;; Override everything you want. + (load-file "APEL-CFG") + ;; Override PREFIX, LISPDIR, and VERSION_SPECIFIC_LISPDIR with + ;; command-line options. + (let (prefix lisp-dir version-specific-lisp-dir) + (and (setq prefix + ;; Avoid using `pop'. + ;; (pop command-line-args-left) + (prog1 + (car command-line-args-left) + (setq command-line-args-left + (cdr command-line-args-left)))) + (or (string-equal "NONE" prefix) + (setq PREFIX prefix))) + (and (setq lisp-dir + ;; Avoid using `pop'. + ;; (pop command-line-args-left) + (prog1 + (car command-line-args-left) + (setq command-line-args-left + (cdr command-line-args-left)))) + (or (string-equal "NONE" lisp-dir) + (setq LISPDIR lisp-dir))) + (and (setq version-specific-lisp-dir + ;; Avoid using `pop'. + ;; (pop command-line-args-left) + (prog1 + (car command-line-args-left) + (setq command-line-args-left + (cdr command-line-args-left)))) + (or (string-equal "NONE" version-specific-lisp-dir) + (setq VERSION_SPECIFIC_LISPDIR version-specific-lisp-dir)))) + ;; Load some APEL modules from this directory. + (defvar default-load-path load-path) + (setq load-path (cons (expand-file-name ".") load-path)) + (require 'poe) + (require 'path-util) + (require 'install) + + ;; Import `apel-modules'. + (load-file "APEL-ELS") + ;; Import `emu-modules' and `emu-modules-to-compile'. + (load-file "EMU-ELS") + + ;; Set PREFIX, LISPDIR, and VERSION_SPECIFIC_LISPDIR if not set yet. + (or PREFIX + (setq PREFIX install-prefix)) + (or LISPDIR + (setq LISPDIR (install-detect-elisp-directory PREFIX))) + (or VERSION_SPECIFIC_LISPDIR + (setq VERSION_SPECIFIC_LISPDIR + (install-detect-elisp-directory PREFIX nil 'version-specific))) + ;; The directories where APEL and EMU will be installed. + (or APEL_DIR + (setq APEL_DIR (expand-file-name APEL_PREFIX LISPDIR))) + (or EMU_DIR + (setq EMU_DIR (expand-file-name EMU_PREFIX VERSION_SPECIFIC_LISPDIR))) + (princ (format "\nLISPDIR=%s\n" LISPDIR)) + (princ (format "VERSION_SPECIFIC_LISPDIR=%s\n" VERSION_SPECIFIC_LISPDIR))) + +(defun compile-apel () + (config-apel) + ;; Compile emu modules first. + (compile-elisp-modules emu-modules-to-compile ".") + (compile-elisp-modules apel-modules ".")) + +(defun install-apel (&optional just-print) + (config-apel) + (or just-print + (setq just-print (install-just-print-p))) + (install-elisp-modules emu-modules "." EMU_DIR just-print) + (install-elisp-modules apel-modules "." APEL_DIR just-print)) + +;; For XEmacs package system. +(defun config-apel-package () + ;; Override everything you want. + (load-file "APEL-CFG") + ;; Override PACKAGEDIR with command-line option. + (let (package-dir) + (and (setq package-dir + ;; Avoid using `pop'. + ;; (pop command-line-args-left) + (prog1 + (car command-line-args-left) + (setq command-line-args-left + (cdr command-line-args-left)))) + (or (string= "NONE" package-dir) + (setq PACKAGEDIR package-dir)))) + ;; Load some APEL modules from this directory. + (defvar default-load-path load-path) + (setq load-path (cons (expand-file-name ".") load-path)) + (require 'poe) + (require 'path-util) + (require 'install) + + ;; Import `apel-modules'. + (load-file "APEL-ELS") + ;; Import `emu-modules' and `emu-modules-to-compile'. + (load-file "EMU-ELS") + + ;; Set PACKAGEDIR if not set yet. + (or PACKAGEDIR + (setq PACKAGEDIR (install-get-default-package-directory))) + (if PACKAGEDIR + (princ (format "\nPACKAGEDIR=%s\n" PACKAGEDIR)) + (error "XEmacs package system is not available"))) + +(defun compile-apel-package () + (config-apel-package) + ;; Compile emu modules first. + (compile-elisp-modules emu-modules-to-compile ".") + (compile-elisp-modules apel-modules ".")) + +(defun install-apel-package () + (config-apel-package) + (let ((just-print (install-just-print-p)) + (dir (expand-file-name APEL_PREFIX + (expand-file-name "lisp" PACKAGEDIR)))) + (install-elisp-modules emu-modules "." dir just-print) + (install-elisp-modules apel-modules "." dir just-print) + (install-update-package-files "apel" dir just-print))) + +(defun what-where-apel () + (install-apel 'just-print) + ;; (config-apel) +;;; (princ (format " +;;; The files that belong to the EMU modules: +;;; %s +;;; -> %s + +;;; The files that belong to the APEL modules: +;;; %s +;;; -> %s + +;;; Do `make elc', `make install', `make package', or `make install-package'. +;;; " +;;; (mapconcat (function symbol-name) emu-modules ", ") +;;; EMU_DIR +;;; (mapconcat (function symbol-name) apel-modules ", ") +;;; APEL_DIR)) + ) + +;;; APEL-MK ends here diff --git a/apel-10.7/ChangeLog b/apel-10.7/ChangeLog new file mode 100644 index 0000000..e3bbf8a --- /dev/null +++ b/apel-10.7/ChangeLog @@ -0,0 +1,3900 @@ +2007-02-14 MORIOKA Tomohiko + + * APEL: Version 10.7 released. + + * Makefile (VERSION): Update to 10.7. + +2006-12-20 MORIOKA Tomohiko + + * APEL-MK (config-apel-package): Use + `install-get-default-package-directory'. + + * install.el (install-get-default-package-directory): New + function. + +2006-12-20 MORIOKA Tomohiko + + * apel-ver.el (apel-ver): Change APEL version to 10.7. + +2005-05-08 MORIOKA Tomohiko + + * poem-xm.el (char-valid-p): New alias. + +2006-12-13 Katsumi Yamaoka + + * APEL-MK (config-apel-package): Avoid an error concerning + PACKAGEDIR with old XEmacs that doesn't use the package system. + +2006-12-12 Katsumi Yamaoka + + * install.el (install-update-package-files): Use + batch-update-directory-autoloads if it is available instead of + batch-update-directory. + +2006-12-11 Katsumi Yamaoka + + * APEL-MK (config-apel-package): Check for + (early|late|last)-package-hierarchies and configure-package-path + as well as (early|late|last)-packages. + +2006-11-13 Katsumi Yamaoka + + * time-stamp.el: Remove. Suggested by Stephen Gildea, the + maintainer of time-stamp.el. + + * EMU-ELS (emu-modules): Exclude it. + + * README.en, README.ja: Remove time-stamp.el entry. + +2006-04-24 Katsumi Yamaoka + + * install.el (install-detect-elisp-directory): Fix 2002-11-29 + change; assume default-load-path contains nil; use regexp-quote to + compare directories even in Emacs. + +2005-12-06 Ville Skyttä + + * poe.el (minor-mode-overriding-map-alist): Doc fix. + + * product.el (product-version-as-string): Doc fix. + +2002-11-29 Ben Wing + + * install.el (install-detect-elisp-directory): Fix problems + handling backslashes in filenames (Windows). + +2005-06-06 Katsumi Yamaoka + + * filename.el (filename-special-filter-1): New macro defined for + filename-special-filter to use aref instead of sref for the recent + Emacsen. + (filename-special-filter): Use it. + +2005-06-05 Tatsuya Kinoshita + + * poe-xemacs.el: Load `timer' even if `timer-funcs' exists. + +2005-05-10 TAKAHASHI Kaoru + + * poe.el (split-string): Import from Emacs 22. Add omit-nulls + argument. + +2005-05-03 Tatsuya Kinoshita + + * poem.el (characterp): Use `char-valid-p' if it exists. + * poem.el (char-or-char-int-p): Ditto. + +2005-02-23 Katsumi Yamaoka + + * poe-xemacs.el (run-at-time): Attempt to load `timer-funcs' + before `timer'. + +2004-09-27 Katsumi Yamaoka + + * README.en, README.ja (CVS): Remove the description about + developers' pserver access. + +2004-02-06 Katsumi Yamaoka + + * calist.el (use-calist-package): Add missing arg to `format'. + +2004-01-26 Katsumi Yamaoka + + * Makefile: Make `elc' into the default entry. + +2004-01-07 Katsumi Yamaoka + + * poe-xemacs.el (run-at-time): Don't use `defadvice' in order to + avoid a conflict with the Gnus version. + +2003-12-12 Katsumi Yamaoka + + * poe-xemacs.el (run-at-time): Fully implement it for the recent + XEmacsen when the fsf-compat package is not available. + (run-at-time-tick-tock): Check closely whether a bug is in + `start-itimer'. + +2003-12-11 Katsumi Yamaoka + + * poe-xemacs.el (run-at-time): Redefine it to make it punctual. + +2003-09-05 Katsumi Yamaoka + + * poem-xm.el (char-length): Don't use `defun-maybe' to define it + since this module may be installed as the XEmacs package which + should be usable by all the XEmacs 21.x series. + + +2003-07-05 Yuuichi Teranishi + + * APEL: Version 10.6 released. + * apel-ver.el (apel-ver): Change APEL version to 10.6. + +2003-07-03 Shuhei KOBAYASHI + + * poe.el (make-temp-file) [2-args make-temp-file]: + Don't use octal number for file modes. + + * poe.el (toplevel): Fixed the compile-time check for the definition of + `make-temp-file' [apel-ja: 00874]. + (make-temp-file) [no make-temp-file, single-user system]: + Don't use `set-default-file-modes' nor `default-file-modes'. + +2003-07-03 Yuuichi Teranishi + + * poe-18.el (make-directory-internal): Signal an error according to + the exit status of mkdir. + (delete-directory): New function. + (write-region): Ditto. + + +2003-06-06 Yuuichi Teranishi + + * APEL: Version 10.5 released. + * apel-ver.el (apel-ver): Change APEL version to 10.5. + +2003-05-29 Yuuichi Teranishi + + * poe.el (make-temp-file) [no make-temp-file, single-user system]: + Modified for OS/2. + +2003-05-22 Yuuichi Teranishi + + * install.el (install-prefix): Change value for Meadow2 and NTEmacs. + +2003-05-20 Shuhei KOBAYASHI + + * poe.el (make-temp-file) [no make-temp-file, multi-user system]: + Modified comments. + +2003-05-19 Shuhei KOBAYASHI + + * poe.el (make-temp-file) [no make-temp-file, multi-user system]: + Flatten nested `unwind-protect'. Fixed comments. + +2003-05-15 Yuuichi Teranishi + + * poe.el (make-temp-file): New function. + +2002-11-05 MORIOKA Tomohiko + + * mcs-20.el (mcs-region-repertoire-p): New function for UTF-2000 + implementations. + (mcs-string-repertoire-p): Likewise. + (detect-mime-charset-region): New implementation for UTF-2000 + implementations. + (detect-mime-charset-string): New function for UTF-2000 + implementations. + +2002-11-03 Yoichi NAKAYAMA + + * filename.el (filename-filters): Change default value to nil. + + +2002-10-04 Katsumi Yamaoka + + * APEL: Version 10.4 released. + +2002-10-03 Takeshi Morishima + + * install.el (install-elisp-module): Delete an elc file if the + optional 5th argument `del-elc' is given. + (install-elisp-modules): Allow the optional 5th argument `del-elc' + and pass it to `install-elisp-module'. + +2002-10-02 Katsumi Yamaoka + + * mcs-ltn1.el (mime-charset-to-coding-system): Allow the 2nd arg. + * mcs-nemacs.el (mime-charset-to-coding-system): Ditto. + +2002-07-13 Daiki Ueno + + * mcs-xm.el (encode-mime-charset-string): Use `defun' instead of + `defsubst' + +2002-07-10 Adrian Aichner + + * emu.el: Conditionalise defalias 'tl:overlay-buffer on + 'tl:overlay-buffer, not 'tl:overlay-put. + +2002-06-26 Katsumi Yamaoka + + * mcs-e20.el (charsets-mime-charset-alist): Remove nil's from the + default value. + * mcs-xm.el (charsets-mime-charset-alist): Ditto. + +2002-06-21 Katsumi Yamaoka + + * mcs-e20.el (charsets-mime-charset-alist): Add Latin8 and Latin9 + charsets. Suggested by Tatsuya Kinoshita . + * mcs-xm.el (charsets-mime-charset-alist): Ditto. + +2002-05-14 Katsumi Yamaoka + + * pccl.el (ccl-usable): Make non-MULE XEmacs don't require `ccl' + even if this file is mis-compiled for XEmacs with MULE. + +2002-03-23 Nix + + * poem-ltn1.el (truncate-string): Act like the real `truncate-string': + do not fail if the string is shorter than the max length. + +2002-04-30 Katsumi Yamaoka + + * poem-xm.el (string-to-char-list): Revive it again. + +2002-04-25 Katsumi Yamaoka + + * poem-xm.el (string-to-char-list): Remove. It is restored in + XEmacs CVS. + +2002-04-15 Katsumi Yamaoka + + * poem-xm.el (char-length): New function. + (string-to-char-list): New function. + +2002-03-04 Katsumi Yamaoka + + * pym.el: Add a note that `def*-maybe' might not provide functions + or variables at run-time. + +2001-12-05 Katsumi Yamaoka + + * tinycustom.el (custom-declare-face): New function. + (defface): Use it. + +2001-10-15 Katsumi Yamaoka + + * poe.el (format-time-string): Support the 3rd arg `universal'. + (support-timezone-in-numeric-form-and-3rd-arg): Renamed from + `support-timezone-in-numeric-form'; + support the 3rd arg `universal'. + +2001-10-12 TSUCHIYA Masatoshi + + * poe.el (format-time-string): Support the construct `%z'. + (support-timezone-in-numeric-form): New advice. + +2001-09-09 Daiki Ueno + + * pccl.el (transform-make-coding-system-args): Follow old backquote + style. + +2001-07-20 NAKAJIMA Mikio + + * install.el (install-file, install-elisp-module): Set file modes + according to `install-overwritten-file-modes'. + + * poe-18.el (defalias): Remove alias to fset and define it by + using `defun'. + +2001-06-23 NAKAJIMA Mikio + + * install.el (install-files): Do not make DEST directory when + JUST-PRINT is non-nil. + +2001-06-20 Akihiro MOTOKI + + * install.el (install-elisp-modules): Do not make DEST directory + when JUST-PRINT is non-nil. + +2001-06-01 Tanaka Akira + + * pccl.el (ccl-compat): Since mule 2.3 accepts `t' and `nil' as `type' + argument, so arguments conversion shouln't applied in such case. + +2001-05-24 Tanaka Akira + + * pccl.el (accept-long-ccl-program): Don't advice for Emacs 21. + (transform-make-coding-system-args): New emulating function. + (ccl-compat): new advice for `make-coding-system' of + Emacs 20 or former to handle XEmacs style CCL coding system definition. + +2001-04-29 Shuhei KOBAYASHI + + * poe.el (remassoc, remassq, remrassoc, remrassq): Fixed. + +2001-03-26 Yuuichi Teranishi + + * EMU-ELS: Add checking whether the native timezone.el has an old + date string parser. + +2001-03-23 TSUCHIYA Masatoshi + + * timezone.el (timezone-parse-date): Import from Emacs-20.7. + +2001-02-23 Katsumi Yamaoka + + * emu.el (char-category for XEmacs): Don't use `int-char' when the + function `char-category-list' returns a list of characters. + +2001-02-01 NAKAJIMA Mikio + + * README.ja: Updated as to MAKEIT.BAT and MAKE1.BAT. + * make1.bat: New file. + * makeit.bat: Ditto. + * make.bat: Removed. + +2001-01-18 Katsumi Yamaoka + + * inv-19.el (next-visible-point): Return the value of `point-max' + when the position of next `invisible' property change is not found. + +2001-01-15 Yuuichi Teranishi + + * poe-18.el (floor): Removed. + + * timezone.el (timezone-floor): New function. + (timezone-fix-time-2): Use `timezone-floor' instead of `floor'. + +2000-12-31 NAKAJIMA Mikio + + * README.ja: Typo fixed. + + +2000-12-30 NAKAJIMA Mikio + + * APEL: Version 10.3 released. + * apel-ver.el (apel-ver): Change APEL version to 10.3. + + * Makefile : Apply patch from TAKAHASHI Kaoru + of Message-Id: <86vgs2s3cp.wl@tomoko.nantnaq.kaisei.org>. + +2000-12-28 Tanaka Akira + + * pccl-20.el (ccl-compat): new advice for `make-coding-system' of + XEmacs to handle Emacs style CCL coding system definition. + +2000-12-28 Kenichi Handa + + * static.el: Doc-string fixed. + +2000-12-28 MORIOKA Tomohiko + + * mcharset.el (default-mime-charset-for-write): Use + `mime-charset-p' instead of `find-coding-system'; don't require + `pces'. + + * mcs-nemacs.el, mcs-ltn1.el, mcs-20.el (mime-charset-p): New + alias. + +2000-12-26 NAKAJIMA Mikio + + * README.en: Change major mode to outline-mode. + (What's APEL?): Add description about pym.el, pces, time-stamp.el, + timezone.el, and product.el. + (run in expanded place): Add a reference to `make.bat (for MS-DOS + family)'. + + * README.ja: Change major mode to outline-mode. + (What's APEL?): Add description about pym.el, pces, time-stamp.el, + timezone.el, and product.el. + +2000-12-24 NAKAJIMA Mikio + + * poe.el (minor-mode-overriding-map-alist): Remove the filename + poe.el from doc string. + + * poe-18.el (current-time-world-timezones): Remove the filename + poe-18.el from doc string. + (current-time-local-timezone): Ditto. + (buffer-undo-list): Ditto. + (auto-fill-function): Ditto. + (unread-command-event): Ditto. + (unread-command-events): Ditto. + (minor-mode-map-alist): Ditto. + + * README.en ((d) make.bat (for MS-DOS family)): New section. + * README.ja ((d) make.bat $(B$rMxMQ$9$k(B (MS-DOS $(B7O(B OS $(B$N>l9g(B)): + Ditto. + +2000-12-22 MORIOKA Tomohiko + + * mcs-e20.el: Require `pces'. + +2000-12-22 Yuuichi Teranishi + + * timezone.el (timezone-time-from-absolute): Use `%' instead of + `mod'. + +2000-12-21 Katsumi Yamaoka + + * poe-18.el (numberp, mod): Removed. + +2000-12-21 MORIOKA Tomohiko + + * mcharset.el (default-mime-charset-for-write): Require `pces' for + `find-coding-system'. + +2000-12-21 NAKAJIMA Mikio + + * poe-18.el (minor-mode-alist): Removed. + (minor-mode-overriding-map-alist): Move to poe.el. + +2000-12-20 MORIOKA Tomohiko + + * APEL-MK (install-apel): Add new optional argument `just-print'. + (what-where-apel): New implementation [use `install-apel' with + `just-print' mode]. + +2000-12-20 MORIOKA Tomohiko + + * APEL-MK (install-just-print-p): Moved to install.el. + (install-update-package-files): Moved to install.el. + + * install.el (install-update-package-files): New function [moved + from APEL-MK]. + (install-just-print-p): Likewise. + +2000-12-15 MORIOKA Tomohiko + + * mcs-xm.el: Don't require `poem' instead of `mcs-20'. + + * mcs-e20.el: Don't require mcs-20. + + * mcs-20.el: - Don't require `poem'. + - Require `custom' instead of `pcustom'. + - Require mcs-xm for XEmacs-Mule. + - Require mcs-e20 for GNU Emacs 20.1 or later. + (default-mime-charset): Change initial value to `x-unknown'. + + * mcharset.el: Require mcs-20 if running with XEmacs-Mule and GNU + Emacs 20.1 or later. + +2000-12-19 Katsumi Yamaoka + + * poe.el (current-fill-column): New emulating function. + (current-left-margin): New emulating function. + + * poe-18.el (numberp): Use `defalias-maybe' instead of `defalias'. + (mod): Ditto. + +2000-12-20 NAKAJIMA Mikio + + * poe-18.el (set-frame-height): Typo fixed. + (read-from-minibuffer): Do not run `minibuffer-setup-hook' and + `minibuffer-exit-hook'. + (minibuffer-setup-hook): Comment out. + (minibuffer-exit-hook): Ditto. + +2000-12-19 NAKAJIMA Mikio + + * make.bat: Do not echo. + + * poe-18.el (set-frame-heigth): Bug fixed. + +2000-12-16 NAKAJIMA Mikio + + * poe-18.el (frame-width): New function. + (frame-height): Ditto. + (set-frame-width): Ditto. + (set-frame-heigth): Ditto. + (read-from-minibuffer): Run `minibuffer-setup-hook' and + `minibuffer-exit-hook'. + (buffer-undo-list): Declared with `defvar-maybe' and add doc + string. + (auto-fill-function): Add doc string. + (unread-command-event): Ditto. + (unread-command-events): Ditto. + (minibuffer-setup-hook): New variable. + (minibuffer-exit-hook): Ditto. + (minor-mode-map-alist): Ditto. + (minor-mode-alist): Ditto. + (minor-mode-overriding-map-alist): Ditto. + +2000-12-15 NAKAJIMA Mikio + + * make.bat (listing): Bug fixed. + + * README.en: Add URL that can be used to getting SKK 10.62a with + the new byte compiler for Emacs 18. + * README.ja: Ditto. + +2000-12-15 TAKAHASHI Kaoru + + * Makefile (tar): Remove .cvsignore. Use `cvs tag -R' instead of + `cvs tag -RF'. + +2000-12-15 Katsumi Yamaoka + + * poe-18.el (buffer-disable-undo): Define it as a function to make + an argument optional instead of the use of `defalias' to + `buffer-flush-undo'. + +2000-12-14 Daiki Ueno + + * alist.el (del-alist): Simplified. + +2000-12-14 Mikio Nakajima + + * pym.el (static-if): Put t on edebug spec instead of if. + +2000-12-13 Kenichi Handa + + * alist.el: Fix and add DOCs and comments; fix coding style. + +2000-04-26 MORIOKA Tomohiko + + * mcs-xm.el (charsets-mime-charset-alist): Add coded-charset + `japanese-jisx0208-1990' to MIME-charset `iso-2022-jp' and + `iso-2022-jp-2' in UTF-2000; add new MIME-charset `iso-2022-jp-3'. + +2000-11-26 Mikio Nakajima + + * make.bat: New file. + * .cvsignore: Ditto. + +2000-11-09 Katsumi Yamaoka + + * path-util.el (add-path): Check for both "path" and "path/". + +2000-10-06 Shuhei KOBAYASHI + + * poe.el (require): Update `current-load-list'. + +2000-10-10 Keiichi Suzuki + + * product.el (product-version-as-string): New function. + (product-string-1): Use `product-version-as-string'. + +2000-08-10 MORIOKA Tomohiko + + * poem-e20_3.el: Require `pym'. + +2000-07-12 MORIOKA Tomohiko + + * alist.el (vassoc): New function [to be compatible with XEmacs + 21.2.32 or later]. + +2000-05-25 Tanaka Akira + + * README.en, README.ja: Update for CVS via SSH. + +2000-05-24 Katsumi Yamaoka + + * pces-raw.el (encode-coding-string, decode-coding-string): Return + a copy of string. + +2000-04-25 Katsumi Yamaoka + + * EMU-ELS (emu-modules): Don't include `pccl-20' for XEmacs 20 and + earlier. + +2000-03-25 Mikio Nakajima + + * pym.el: Define edebug specs for `static-if', `static-when', + `static-unless', `static-condition-case', `static-defconst' and + `static-cond'. + +2000-03-08 Akihiro Arisawa + + * poe.el (format-time-string): Fix problem when `format' contains + "%d" or "%D". + +2000-03-04 Daiki Ueno + + * poe.el (remassq,remassoc,remrassoc): Rewrite. + (remrassq): New function. + + +2000-03-01 Yuuichi Teranishi + + * APEL: Version 10.2 released. + +2000-02-29 Yuuichi Teranishi + + * poe-18.el (current-time-string): Fixed leap year's day counting bug. + +2000-02-28 Katsumi Yamaoka + + * emu.el (enriched-encode): Do nothing for it if FSF Emacs 19.28 + and earlier or XEmacs 19.13 and earlier is used. + +2000-02-25 Katsumi Yamaoka + + * emu.el (enriched-encode): Allow the 3rd argument ORIG-BUF for old + Emacsen. + +2000-02-21 Makoto Nakagawa + + * poe.el (format-time-string): New function for Emacs 19.28 and + earlier. + (format-time-month-list): New constant for `format-time-string'. + (format-time-week-list): New constant for `format-time-string'. + +2000-02-21 Daiki Ueno + + * poe-18.el (walk-windows): New function. + + * poe-xemacs.el + (set-extent-properties): New function. + (run-at-time): New function. + (cancel-timer): New function. + (with-timeout-handler): New function. + (with-timeout): New function. + + * poe.el (remassq): New function. + (remassoc): New function. + (remrassoc): New function. + (get-buffer-window-list): New function. + (save-selected-frame): New macro. + +2000-02-10 Yuuichi Teranishi + + * poe.el (replace-match): Redefined to add `STRING' optional + argument. + +2000-02-07 Yuuichi Teranishi + + * poe-18.el (mod): Define as an alias for `%'. + (overlayp, move-overlay, delete-overlay, overlay-start, + overlay-end, overlay-buffer, overlay-properties, overlays-at, + overlays-in, next-overlay-change, previous-overlay-change, + overlay-lists, overlay-recenter, overlay-get): + Define as null function. + +2000-02-05 MORIOKA Tomohiko + + * mcs-20.el (mime-charset-coding-system-alist): Add + `iso-2022-jp-3'. + +2000-02-04 Katsumi Yamaoka + + * poe.el (read-file-name): Replacement for Emacs 19.28 and earlier + (except for Emacs 18) or XEmacs 19.13 and earlier, for + compatibility. + +2000-02-04 Yuuichi Teranishi + + * timezone.el (timezone-floor): Eliminated. + (timezone-fix-time-2): Use `floor' instead of `timezone-floor'. + + * poe-18.el (current-time): Fixed leap year count bug. + (set-time-zone-rule): New function. + (current-time-zone): Use `set-time-zone-rule'. + (floor): New function. + (window-live-p): New function. + (read-from-minibuffer): Redefined to add `HIST' optional argument. + (accept-process-output): Redefined to add `TIMEOUT' and + `TIMEOUT-MSECS' optional arguments. + (get-buffer-window): Redefined to add `FRAME' optional argument. + + * poe.el (completing-read): Redefined to adjust optional arguments + for some emacsen. + +2000-01-31 Mikio Nakajima + + * poe-18.el (defalias): Remove its definition as a function and + define it as an alias for `fset'. + (auto-fill-function): Declare with defvar-maybe. + (unread-command-event): Ditto. + (unread-command-events): Ditto. + (insert-and-inherit): Defile with defalias. + (insert-before-markers-and-inherit): Ditto. + (number-to-string): Ditto. + +2000-01-30 Mikio Nakajima + + * poe-18.el (window-minibuffer-p): New function. + +2000-01-30 Tsukamoto Tetsuo + + * pces-om.el (insert-file-contents-as-coding-system): Ignore BEG, + END and REPLACE under Emacs 18, or Mule 1.1 or earlier. + (insert-file-contents-as-binary): Ditto. + +2000-01-27 Shuhei KOBAYASHI + + * APEL-CFG: Typo. + +2000-01-26 Shuhei KOBAYASHI + + * poe-18.el (set-match-data): New alias for `store-match-data'. + (save-match-data-internal): New variable. + (save-match-data): New macro; use above. + + (defalias): Docstring sync. + (put-text-property): Typo. + +2000-01-23 Tsukamoto Tetsuo + + * poe-18.el (byte-code-function-p): Check if the CDR of OBJECT is + a cons cell. + + +2000-01-21 Yuuichi Teranishi + + * APEL: Version 10.1 released. + +2000-01-19 Shuhei KOBAYASHI + + * poe.el (require): Handle `file-error' only. + +2000-01-12 OKAZAKI Tetsurou + + * EMU-ELS (emu-modules): Add `pccl' even if `mule' is not provided. + +2000-01-05 Katsumi Yamaoka + + * Makefile, README.en, README.ja: Update for the new CVS server. + +1999-12-24 Shuhei KOBAYASHI + + * poe.el (functionp): Define it before loading "localhook". + + +1999-12-24 Yuuichi Teranishi + + * APEL: Version 10.0 released. + +1999-12-24 Keiichi Suzuki + + * apel-ver.el: Fix file header. + +1999-12-23 Yuuichi Teranishi + + * timezone.el (timezone-abs): Eliminated. + (timezone-zone-to-minute): Use `abs' instead of `timezone-abs'. + + * poe-18.el (current-time-zone): Use `abs'. + +1999-12-23 Keiichi Suzuki + + * product.el: Fix file header. `checkdoc' fix. + + * apel-ver.el: Fix file header. + +1999-12-22 Shuhei KOBAYASHI + + * APEL-ELS, EMU-ELS: product.el, apel-ver.el, time-stamp.el, + and timezone.el are version-dependent. + + * product.el (emacs-major-version, emacs-minor-version): Moved + from poe.el. + + * poe.el (emacs-major-version, emacs-minor-version): Removed. + + * pym.el: Add product information. + +1999-12-22 Yuuichi Teranishi + + * poe.el (string-to-int): Commented out an alias for + `string-to-number'. + +1999-12-13 Katsumi Yamaoka + + * poe-18.el: Fix open parenthesis. + + * README.ja: Sync up with README.en. + + * README.en: Fix what versions of Emacsen can use + `normal-top-level-add-to-load-path'. + +1999-12-12 Shuhei KOBAYASHI + + * APEL-MK: Modified comments. + + * poe.el: Modified comments. + + * pym.el: Modified comments. + (defalias-maybe): Don't update `current-load-list'. + +1999-12-06 Shuhei KOBAYASHI + + * pym.el (subr-fboundp): Reverted; but considered as obsolete. + +1999-12-05 Shuhei KOBAYASHI + + * poe-18.el (numberp): New function; alias for `integerp'. + (abs): New function. + + * poe-18.el (byte-code-function-p): Docstring sync. + (cyclic-function-indirection): New error symbol. + (indirect-function): New function; use above symbol. + +1999-11-30 Shuhei KOBAYASHI + + * poe-18.el (current-time-string): New local variable `lyear' + for leap year; renamed from `uru' and bind locally. + + * poe.el (emacs-major-version, emacs-minor-version): Define + at compile-time as well as at load-time in order to do compile- + time version check. + (tcp): Require if `open-network-stream' is not available; + moved from "pces.el". + + * pym.el: Removed comment. + +1999-11-28 Shuhei KOBAYASHI + + * poe.el, poe-18.el, poe-xemacs.el, pym.el: Modified comments. + +1999-11-25 Shuhei KOBAYASHI + + * poe-18.el: Modified comments. + (buffer-undo-list, data-directory): Use `defvar'. + (generate-new-buffer-name): Use `defun'. + +1999-11-22 Shuhei KOBAYASHI + + * pccl-20.el, pccl-om.el: Removed "[SOURCE INFO]" style + comment from docstrings. + + * pccl-om.el, localhook.el, pcustom.el: Updated header. + +1999-11-13 Shuhei KOBAYASHI + + * Removed "[SOURCE INFO]" style comment from docstrings. + Most of them are out of sync, and now there are some other + ways to get such information. + + * poe-18.el: Rearranged. + (lambda): New macro. + (get-char-property, next-single-property-change, + previous-property-change, previous-single-property-change, + text-property-any, text-property-not-all, + next-char-property-change, previous-char-property-change): + Define as null function. + + * poe-xemacs.el: Rearranged. + (eval-after-load): Moved to poe.el. + + * poe.el: Rearranged; reduce load-time check. + Moved many macros to pym.el. + (require): New function; emulate optional 3rd arg. + (plist-get, plist-put): New functions. + (string-to-number): New function. + (push, pop): New macros. + (assoc-default): New function. + (eval-after-load, eval-next-after-load): New functions; + moved from poe-xemacs.el and modified for Emacs 19.28. + (buffer-file-type): New variable. + (with-temp-message, with-output-to-string): New macros. + (combine-after-change-calls): Docstring sync. + (match-string-no-properties): New function. + (convert-standard-filename): Do load-time check. + +1999-11-13 Shuhei KOBAYASHI + + * pym.el (defsubst-maybe-cond): New macro. + + * pym.el (defun-maybe, defmacro-maybe, defsubst-maybe, + defalias-maybe, defvar-maybe, defconst-maybe, + defun-maybe-cond, defmacro-maybe-cond, def-edebug-spec): + Moved from poe.el. + + * EMU-ELS (emu-modules): Added 'pym. + + * pym.el: New file. + +1999-11-13 Shuhei KOBAYASHI + + * APEL-MK, APEL-CFG, APEL-ELS, EMU-ELS, Makefile: Revised. + +1999-11-12 Shuhei KOBAYASHI + + * inv-18.el, inv-19.el, inv-xemacs.el: + Require 'poe in each submodule. + (enable-invisible): Changed to function. + (disable-invisible): Renamed from `end-of-invisible'. + Changed to function. + (end-of-invisible): Make obsolete. + +1999-11-12 Shuhei KOBAYASHI + + * README.en (Version specific information): New section. + (Bug reports): Updated description of APEL mailing-lists. + + * pcustom.el [old custom]: Refer to it. + + * tinycustom.el: checkdoc. + +1999-11-12 Shuhei KOBAYASHI + + * APEL-MK: Require 'path-util explicitly. + +1999-11-12 Shuhei KOBAYASHI + + * APEL-MK, APEL-CFG, APEL-ELS, EMU-ELS: Rewritten. + + * install.el: Removed v18 stuff; now we require 'poe. + Modified some comments. + + +1999-12-22 Yuuichi Teranishi + + * timezone.el: Modified comments. + (toplevel): Require 'product. + +1999-12-21 Shuhei KOBAYASHI + + * apel-ver.el: Footer fix. + +1999-12-21 Yuuichi Teranishi + + * poe-18.el (current-time-zone): New function. + (current-time-world-timezones, current-time-local-timezone): + New variables. + (current-time-string): Use `current-time-zone' to get local timezone. + (current-time): Ditto. + + * timezone.el: New file. + + * APEL-ELS (apel-modules): Add `timezone' if existing timezone.el + has y2k problem. + + * product.el (product-string-1): Use `int-to-string' instead of + `number-to-string'. + +1999-12-20 Shuhei KOBAYASHI + + * apel-ver.el, product.el: Header fix. + +1999-12-20 Keiichi Suzuki + + * alist.el, atype.el, broken.el, calist.el, emu-mule.el, emu.el, + env.el, file-detect.el, filename.el, install.el, inv-18.el, + inv-19.el, inv-xemacs.el, invisible.el, localhook.el, + mcharset.el, mcs-20.el, mcs-e20.el, mcs-ltn1.el, mcs-nemacs.el, + mcs-om.el, mcs-xm.el, mcs-xmu.el, mule-caesar.el, path-util.el, + pccl-20.el, pccl-om.el, pccl.el, pces-20.el, pces-e20.el, + pces-e20_2.el, pces-nemacs.el, pces-om.el, pces-raw.el, + pces-xfc.el, pces-xm.el, pces.el, pcustom.el, poe-18.el, + poe-xemacs.el, poe.el, poem-e20.el, poem-e20_2.el, + poem-e20_3.el, poem-ltn1.el, poem-nemacs.el, poem-om.el, + poem-xm.el, poem.el, richtext.el, static.el, time-stamp.el, + tinycustom.el, tinyrich.el (TopLevel): Add product information. + + * Sync up with apel-product. + +* 1999-11-12 Keiichi Suzuki + + * product.el (product-define): Add new slot `version-string'. + (product-provide): Likewise. + (product-version-string): New function. + (product-set-version-string): New function. + (product-string-1): Use `version-string'. + (product-for-each): New function. + (product-string): Separate `product-string' and + `product-string-verbose'. + (product-string-verbose): Likewise. + (product-parse-version-string): New function. + +* 1999-11-12 Shuhei KOBAYASHI + + * product.el: Some `checkdoc' fixes. + (product-version>=): Eliminate local variable. + +* 1999-11-12 Keiichi Suzuki + + * product.el: New file. + + * apel-ver.el: New file. + + * APEL-ELS (apel-modules): Add `apel-ver' and `product'. + +1999-11-25 Yuuichi Teranishi + + * poe-18.el (current-time-string, current-time): New functions. + +1999-11-11 Shuhei KOBAYASHI + + * localhook.el, pcustom.el: checkdoc. + +1999-11-09 Katsumi Yamaoka + + * pcustom.el: Warn if the new custom library is not found at the + compile time. + + * APEL-CFG: Don't add the path of "custom" to `load-path'. + + * poe-18.el (file-executable-p): Returns nil if the file does not + exist. + +1999-11-08 Yuuichi Teranishi + + * poe-18.el (put-text-property, next-property-change, + text-properties-at): Define as null function. + +1999-11-02 Katsumi Yamaoka + + * poe-18.el (add-text-properties, get-text-property): Define as + null function. + (file-executable-p): New function. + + +1999-10-22 Katsumi Yamaoka + + * APEL: Version 9.23 released. + +1999-10-22 Katsumi Yamaoka + + * APEL-MK (compile-apel-package): Compile `emu-modules-to-compile' + instead of `emu-modules'. + (compile-apel): Likewise. + + * EMU-ELS (emu-modules-to-compile): New variable which is used for + compiling in APEL-MK. If the feature `utf-2000' is provided, + `mcs-xmu' is removed from its value even if `emu-modules' contains + it. + (emu-modules-not-to-compile): New variable. + + * mcs-xm.el (mime-iso646-character-unification-alist): Move to + mcs-xmu.el. + (mime-unified-character-face): Move to mcs-xmu.el. + (mime-character-unification-limit-size): Move to mcs-xmu.el. + (decode-mime-charset-region-with-iso646-unification): Move to + mcs-xmu.el. + + * mcs-xmu.el: New file. + +1999-10-22 Katsumi Yamaoka + + * EMU-ELS (pces-modules): Don't check for the feature `mule' + whether `pces-xfc' is required. + * pces.el: Likewise. + + * mcs-xm.el: (decode-mime-charset-region-with-iso646-unification): + Narrow to the region while decoding; bind `case-fold-search' to nil. + (mime-character-unification-limit-size): Make it can also be nil + which means the size is unlimited. + +1999-10-14 Mikio Nakajima + + * mcs-xm.el (decode-mime-charset-region-with-iso646-unification): + Don't put `mime-unified-character-face' to unified text if it is + nil. + (mime-character-unification-limit-size): Fix doc string. + +1999-10-13 Katsumi Yamaoka + + * poe.el (file-coding): Provide it for XEmacs 20.4 or earlier with + MULE. + +1999-10-13 Daiki Ueno + + * EMU-ELS (pces-modules): Add `pces-raw' if file-coding feature is + not available in a XEmacs-without-MULE. + + * pces.el: Require `pces-raw' if file-coding feature is not + available in a XEmacs-without-MULE. + +1999-10-04 Katsumi Yamaoka + + * path-util.el (exec-installed-p): Add parens. + +1999-10-04 Keiichi Suzuki + + * path-util.el (exec-installed-p): Use `file-executable-p' instead + of `file-exists-p'. + When FILE already inculdes suffix in `exec-suffix-list', do not + expand file name with `exec-suffix-list'. + (module-installed-p): Do not use `exec-installed-p'. + +1999-09-27 MORIOKA Tomohiko + + * mcs-xm.el: Use `unless' instead `static-unless' to share *.elc + between UTF-2000 and non-UTF-2000. + +1999-09-24 Mikio Nakajima + + * pces-om.el (find-coding-system): New inline function. + + +1999-09-23 MORIOKA Tomohiko + + * mcs-20.el (mime-charset-coding-system-alist): Use coding-system + `tis-620' instead of `tis620'. + + * mcs-xm.el (charsets-mime-charset-alist): Add setting for + `tis-620'. + +1999-09-22 MORIOKA Tomohiko + + * mcs-20.el (mime-charset-coding-system-alist): Add `cp874'. + +1999-09-21 Katsumi Yamaoka + + * EMU-ELS (pces-modules): Add `pces-xfc' if the feature `mule' is + provided even though the feature `file-coding' is not provided. + + * pces.el: Require `pces-xfc' if the feature `mule' is provided + even though the feature `file-coding' is not provided. + + +1999-09-13 MORIOKA Tomohiko + + * APEL: Version 9.22 released. + +1999-09-12 Mikio Nakajima + + * poe.el (defmacro-maybe-cond): Add edebug spec. + +1999-09-12 Yoshiki Hayashi + + * poe.el (defun-maybe-cond): Add edebug spec. + +1999-09-09 MORIOKA Tomohiko + + * mcs-xm.el (mime-charset-decoder-alist): Don't use + `decode-mime-charset-region-with-iso646-unification' if running + XEmacs-UTF-2000. + (mime-iso646-character-unification-alist): Don't define if running + XEmacs-UTF-2000. + (mime-unified-character-face): Likewise. + (mime-character-unification-limit-size): Likewise. + (decode-mime-charset-region-with-iso646-unification): Likewise. + +1999-09-09 Katsumi Yamaoka + + * tinycustom.el (defface): Allow `type' in SPEC; enrich doc string. + +1999-09-08 Katsumi Yamaoka + + * tinycustom.el (frame-background-mode): New variable. + + * poe.el (frame-background-mode): Move to tinycustom.el. + +1999-09-03 Katsumi Yamaoka + + * tinycustom.el (defface): Set the face attributes according to + SPEC. + + * poe.el (frame-background-mode): New variable. + +1999-09-02 MORIOKA Tomohiko + + * poe.el: Delete autoload setting for `filename'. + (convert-standard-filename): Require `filename'. + +1999-09-02 Katsumi Yamaoka + + * poe.el (convert-standard-filename): Rearrange. + +1999-09-01 Katsumi Yamaoka + + * poe.el (convert-standard-filename): New function. + +1999-08-27 MORIOKA Tomohiko + + * install.el (emacs-major-version): Deleted. + (emacs-minor-version): Deleted. + + * path-util.el: Require `poe'. [cf. ] + +1999-08-27 Katsumi Yamaoka + + * install.el: Require `poe'. + + * path-util.el (directory-files): Don't redefine. + +1999-08-26 Katsumi Yamaoka + + * path-util.el (directory-files): Emulate as Emacs 19 or later to + accept the optional fourth argument for old Emacsen. It is needed + here for compiling other packages. + + * APEL-ELS (apel-modules): Add `time-stamp' if Emacs version is + less than 19.16. + + * time-stamp.el: New file imported from Emacs 19.28. + +1999-08-26 Katsumi Yamaoka + + * tinycustom.el (defface): Quote the argument of `make-face'. + +1999-08-25 Katsumi Yamaoka + + * APEL-CFG: Don't provide `emu'; add the latest path of "custom" + to `load-path'. + +1999-08-25 MORIOKA Tomohiko + + * install.el: Don't require `emu'. + (emacs-major-version): New variable [for old emacsen]. + (emacs-minor-version): New variable [for old emacsen]. + +1999-08-25 MORIOKA Tomohiko + + * poe-18.el (inline): New implementation using `defmacro'. + + +1999-08-24 MORIOKA Tomohiko + + * APEL: Version 9.21 released. + +1999-08-24 Taiji Can + + * poem-nemacs.el: Use `char-width' instead of `char-columns'. + +1999-08-24 MORIOKA Tomohiko + + * poe-18.el (inline): Use `defalias' instead of `defalias-maybe'. + +1999-08-21 Mikio Nakajima + + * poe.el (rassoc): Just ignore elements of LIST that are not conse + cell and add doc string according to its features. + +1999-08-20 Yuuichi Teranishi + + * poe-18.el (delete): Return nil when argument 'list' is nil. + +1999-08-17 Yoshiki Hayashi + + * README.en, README.ja (Anonymous FTP): New section. + * README.ja (CVS): Translate. + + +1999-07-06 MORIOKA Tomohiko + + * APEL: Version 9.20 released. + +1999-06-27 OKUNISHI Fujikazu + + * EMU-ELS: Install env.el for v18. + +1999-06-25 Katsumi Yamaoka + + * poem-xm.el (split-char): Don't redefine for the recent XEmacs. + +1999-06-23 Shuhei KOBAYASHI + + * poe.el (defun-maybe, defmacro-maybe, defalias-maybe, + defsubst-maybe, defun-maybe-cond, defmacro-maybe-cond): + Set `current-load-list' explicitly. + +1999-06-22 Shuhei KOBAYASHI + + * atype.el: Require 'poe. + + * mule-caesar.el: Require 'poe and 'poem. + + * filename.el: Require 'poe and 'poem. + Don't require 'cl. + (filename-special-filter): Eliminate `assoc-if'. + +1999-06-22 Shuhei KOBAYASHI + + * install.el: Require 'emu for backward compatibility. + (defun-maybe): New macro; imported from poe.el. + (make-directory-internal, make-directory): New functions; imported + from poe-18.el. + + * APEL-CFG: Provide 'emu to prevent install.el from loading emu + while compiling APEL itself. + +1999-06-20 Shuhei KOBAYASHI + + * install.el: Require 'poe instead of 'emu. + (install-prefix): Don't use `running-emacs-18' or `running-xemacs'. + (install-detect-elisp-directory): Eliminate local variable `dir'. + Don't use `running-emacs-19_29-or-later' or `running-xemacs'. + + * mcs-20.el: Require 'pcustom instead of 'custom. + + * EMU-ELS: Don't use `running-emacs-19_29-or-later' or + `running-xemacs-19_14-or-later.' + +1999-06-18 Tanaka Akira + + * static.el (static-condition-case): Wrap lambda expression by + `function'. + + * calist.el (calist-default-field-match-method): Use `function' + instead of #'. + +1999-06-17 Shuhei KOBAYASHI + + * pcustom.el: Load "custom" anyway. + +1999-06-16 Katsumi Yamaoka + + * static.el (static-cond): New macro. + +1999-06-11 Tanaka Akira + + * static.el (static-defconst): New macro. + +1999-06-04 MORIOKA Tomohiko + + * pces-xfc.el (insert-file-contents-literally-treats-binary): New + facility. + (insert-file-contents-literally-treats-file-name-handler): New + facility. + (insert-file-contents-as-binary): Define as an alias for + `insert-file-contents-literally' if it is not broken. + +1999-06-04 MORIOKA Tomohiko + + * EMU-ELS (pces-modules): New variable. + + * poem.el: Require pces.el. + + * pces.el: New module. + + * poem-xfc.el: Deleted. + + * pces-xfc.el: New module. + + * pces-nemacs.el: New module. + + * poem-nemacs.el: Split off features about coding-system to + pces-nemacs.el. + + * pces-om.el: New module. + + * poem-om.el: Split off features about coding-system to + pces-om.el. + + * pces-raw.el: New module. + + * poem-ltn1.el: Split off features about coding-system to + pces-raw.el. + + * pces-xm.el: New module. + + * poem-xm.el: Split off features about coding-system to + pces-xm.el. + + * pces-e20_2.el: New module. + + * poem-e20_2.el: Split off features about coding-system to + pces-e20_2.el. + + * pces-e20.el: New module. + + * poem-e20.el (find-coding-system): Moved to pces-e20.el. + (set-process-input-coding-system): Likewise. + - Don't require `poem-20'. + + * pces-20.el: New module [renamed from poem-20.el]. + +1999-05-31 MORIOKA Tomohiko + + * calist.el (calist-field-match-method): Fix problem when + `field-type' is a string. + +1999-05-27 MORIOKA Tomohiko + + * calist.el (use-calist-package): New function. + (make-calist-package): Add new optional argument `use'. + +1999-05-27 MORIOKA Tomohiko + + * calist.el (calist-package-alist): New variable. + (make-calist-package): New function. + (find-calist-package): New function. + (in-calist-package): New function. + (standard): New calist package. + (calist-field-match-method): Use method for `t' as a default + method; set up `calist-default-field-match-method' as method for + `t' of `standard' package. + + +1999-05-26 MORIOKA Tomohiko + + * APEL: Version 9.19 released. + +1999-05-25 Shuhei KOBAYASHI + + * poe.el: Do not try to require 'edebug; it will be autoloaded. + +1999-05-24 Shuhei KOBAYASHI + + * poem-om.el (char-before, char-after): Moved to poe.el. + + * poe.el (char-before, char-after): Moved from poem-om.el. + Add definition for non-Mule. + +1999-05-24 MORIOKA Tomohiko + + * poe.el (def-edebug-spec): New macro. + (defun-maybe): Use `def-edebug-spec'. + (defmacro-maybe): Likewise. + (defsubst-maybe): Likewise. + (read-string): Use `static-unless'. + +1999-05-21 Shuhei KOBAYASHI + + * README.en: Add description of localhook.el. + + * README.ja: Ditto. + + * Makefile (GOMI): New variable. + (clean): Use `RM' and `GOMI'. + +1999-05-21 MORIOKA Tomohiko + + * mcs-20.el (detect-mime-charset-region): Use + `find-mime-charset-by-charsets'. + + * mcharset.el (find-mime-charset-by-charsets): New function. + +1999-05-21 MORIOKA Tomohiko + + * mcharset.el: Require pcustom. + (default-mime-charset-for-write): New variable [moved from + mcs-20.el]. + (default-mime-charset-detect-method-for-write): Likewise. + + * mcs-20.el (default-mime-charset-for-write): Abolished [moved to + mcharset.el]. + (default-mime-charset-detect-method-for-write): Likewise. + + * EMU-ELS: Don't install `localhook' for XEmacs. + +1999-05-19 MORIOKA Tomohiko + + * mcs-20.el (mime-charset-to-coding-system): Don't use `defsubst' + to avoid problem in XEmacs binary distributions. + +1999-05-17 Shuhei KOBAYASHI + + * poe-18.el (eval-when-compile, eval-and-compile): Reverted. + +1999-05-16 Shuhei KOBAYASHI + + * pcustom.el (toplevel): Require 'poe. + +1999-05-16 Shuhei KOBAYASHI + + * localhook.el (toplevel): Move provide to the top to avoid + circular dependency. + +1999-05-16 Shuhei KOBAYASHI + + * poe-18.el (inline): New alias for `progn'. + (make-obsolete-variable): New function. + (dont-compile): New macro. + +1999-05-16 Shuhei KOBAYASHI + + * poe.el (subr-fboundp): Use `defun' instead of `defsubst'. + +1999-05-16 Shuhei KOBAYASHI + + * poem-om.el (insert-binary-file-contents-literally): Removed, + since provided by emu.el. + (char-before, char-after): Use `fboundp', not `boundp'. + Use error-conditions directly. + +1999-05-15 Shuhei KOBAYASHI + + * poe.el (path-separator): Doc sync with 20.3. + (add-to-list): Ditto. + (buffer-live-p): Return bool value. + (cadr, cdar, cddr): New functions. + (save-current-buffer): Check whether `orig-buffer' is alive. + (functionp): Sync with 20.3; use `car-safe'. + (line-beginning-position, line-end-position): Use `forward-line' + or `end-of-line' only. + (point-at-bol, point-at-eol): Ditto. + +1999-05-15 Shuhei KOBAYASHI + + * localhook.el: New file; local hook variable support. + + * poe.el (add-hook, remove-hook, make-local-hook): Removed; + require 'localhook instead. + + * poe-18.el: (default-boundp): New function. + + * EMU-ELS: Added localhook. + +1999-05-14 Shuhei KOBAYASHI + + * pcustom.el: Rewrite using static.el. + + * tinycustom.el (defface): Use `defmacro-maybe-cond'. + + * EMU-ELS: Compilation order of tinycustom and pcustom was changed. + +1999-05-14 Shuhei KOBAYASHI + + * poe-18.el: Require 'poe. + Move provide to the top to avoid circular dependency. + (eval-when-compile, eval-and-compile): Modified for old compiler. + (defsubst): Moved from poe.el. + (make-obsolete): Do nothing. + + * poe.el (read-string): Don't use `eval-and-compile'. + +1999-05-14 Shuhei KOBAYASHI + + * poe.el (defmacro-maybe-cond): New macro. + (defun-maybe, defmacro-maybe, defsubst-maybe, defalias-maybe, + defvar-maybe, defconst-maybe, defun-maybe-cond): Return NAME. + (defun-maybe, defmacro-maybe, defsubst-maybe): Put edebug spec. + (defsubst): Moved to poe-18.el. + +1999-05-13 Tanaka Akira + + * pccl-om.el: pccl-om.el does not support Mule 1.*. + +1999-05-10 Daiki Ueno + + * tinycustom.el (define-widget): Accept the optional arguments. + +1999-05-08 Tanaka Akira + + * README.en (What's APEL?): Add notice for static.el. + + * README.ja: Ditto. + + +1999-05-08 MORIOKA Tomohiko + + * APEL: Version 9.18 released. + +1999-05-08 MORIOKA Tomohiko + + * mcs-e20.el: Don't require `poem'. + + * mcs-e20.el: Check coding-system `x-ctext' is not defined by + APEL. + +1999-05-08 MORIOKA Tomohiko + + * mcs-e20.el: Fix checking code about coding-system `x-ctext' + [cf. by akr] + + +1999-05-07 MORIOKA Tomohiko + + * APEL: Version 9.17 released. + +1999-05-07 MORIOKA Tomohiko + + * mcs-e20.el: Check coding-system `x-ctext' is not defined. + +1999-05-07 MORIOKA Tomohiko + + * poe-18.el (eval-when-compile): New macro. + + * poe.el (make-local-hook): Use `defun-maybe' directly. + + * poe.el (add-hook): Use `static-condition-case' instead of + `condition-case'; use `defun-maybe' instead of `defun'. + (remove-hook): Likewise. + +1999-04-22 MORIOKA Tomohiko + + * poe.el (caar): New function. + +1999-04-13 Tanaka Akira + + * mcs-e20.el (x-ctext): Use the definition in Emacs 20.4. + +1999-04-11 Tanaka Akira + + * mcs-e20.el (x-ctext): Define coding system `x-ctext' if `ctext' + is not proper for decoding `iso-2022-jp-2'. + +1999-04-09 Tanaka Akira + + * static.el: Add doc-strings. + +1999-04-09 Tanaka Akira + + * EMU-ELS (emu-modules): Add `static'. + + * static.el: New file. + + * broken.el: New implementation using `static'. + +1999-04-09 MORIOKA Tomohiko + + * EMU-ELS (poem-modules): Add `poem-xfc' if file-coding feature is + available in a XEmacs-without-MULE. + +1999-04-09 Andy Piper + + * poem.el: use poem-xfc when we have XEmacs with file coding. + + * poem-xfc.el: new file for file coding based XEmacs. + + +1999-04-08 MORIOKA Tomohiko + + * APEL: Version 9.16 released. + +1999-04-05 Shuhei KOBAYASHI + + * install.el (install-prefix): Check whether + `system-configuration-options' is defined or not before using it. + + * poe-18.el (add-hook, remove-hook): Moved to poe.el. + * poe.el (add-hook, remove-hook): Accept optional `local' arg. + (add-local-hook, remove-local-hook): Removed. + + * tinycustom.el (defface): Make face if 'faces is provided. + +1999-03-27 Shuhei KOBAYASHI + + * pcustom.el: New implementation using broken.el. + +1999-03-14 Shuhei KOBAYASHI + + * APEL-MK (compile-apel, what-where-apel): Use `load-file' to + ensure that EMU_ELS in the current directory is loaded. + +1999-03-11 Shuhei KOBAYASHI + + * emu.el (code-convert-string, code-convert-region, + insert-binary-file-contents): Doc fix. + +1999-03-16 Mikio Nakajima + + * README.en, README.ja: Add description of pcustom and tinycustom. + +1999-03-27 MORIOKA Tomohiko + + * tinycustom.el: Delete RCS keywords. + +1999-03-24 Mikio Nakajima + + * poe.el (make-local-hook): Move to after defining `add-local-hook' + and `remove-local-hook'. + +1999-03-20 Mikio Nakajima + + * tinycustom.el (define-widget): New nop macro. + (defface): Makes face FACE. + +1999-03-25 Keiichi Suzuki + + * poem.el (charset-after): New function. + + +1999-03-16 MORIOKA Tomohiko + + * APEL: Version 9.15 released. + +1999-03-16 MORIOKA Tomohiko + + * poe.el (defun-maybe-cond): Don't use `unless'. + +1999-03-16 MORIOKA Tomohiko + + * EMU-ELS (pcustom-modules): New variable. + (emu-modules): Add `pcustom-modules'. + +1999-03-13 Mikio Nakajima + + * tinycustom.el: New file. + * pcustom.el: Likewise. + + +1999-03-15 MORIOKA Tomohiko + + * APEL: Version 9.14 released. + +1999-03-11 MORIOKA Tomohiko + + * mcs-e20.el (charsets-mime-charset-alist): Add setting for + `tis-620'. + + * mcs-20.el (mime-charset-coding-system-alist): Add `tis-620' and + `windows-874'. + +1999-03-08 SL Baur + + * poem-ltn1.el (find-file-noselect-as-raw-text): Quote. + (find-file-noselect-as-raw-text-CRLF): Ditto. + +1999-03-08 SL Baur + + * mcs-xm.el (decode-mime-charset-region-with-iso646-unification): + Respect passed in boundaries. + From MORIOKA Tomohiko + +1999-03-08 SL Baur + + * poe.el (poe): Move provide to the top to avoid circular + dependency. + + * poe-xemacs.el: Explicitly require poe when bytecompiling. + * poem-xm.el: Ditto. + * poem-ltn1.el:Ditto. + + +1999-02-27 MORIOKA Tomohiko + + * APEL: Version 9.13 released. + +1999-02-27 MORIOKA Tomohiko + + * Makefile (package): New target. + (install-package): Depend on `package'. + + * APEL-MK (install-update-package-files): New function. + (config-apel-package): Load "EMU-ELS". + (compile-apel-package): New function. + (install-apel-package): Don't compile modules; use function + `install-update-package-files'. + +1999-02-26 MORIOKA Tomohiko + + * APEL-MK (install-just-print-p): Modify for special option of GNU + make. + +1999-02-26 MORIOKA Tomohiko + + * APEL-MK (install-just-print-p): New function. + (install-apel): Use `install-just-print-p'. + (install-apel-package): Likewise. + +1999-02-25 MORIOKA Tomohiko + + * Makefile (install): Add voodoo comment `# $(MAKE)'. + (install-package): Likewise. + + * APEL-MK (install-apel): Run installer with `just-print' mode if + environment variable "MAKEFLAGS" matches "^[^ =]*n" option. + (install-apel-package): Likewise. + +1999-02-21 Mikio Nakajima + + * install.el (install-file): New optional argument JUST-PRINT. + (install-files): Likewise. + (install-elisp-module): Likewise. + (install-elisp-modules): Likewise. + +1999-02-18 Keiichi Suzuki + + * mcs-e20.el (coding-system-get): New function. + (mime-charset-list): Fix for Emacs 20.2. + +1999-02-14 Katsumi Yamaoka + + * mcs-om.el (default-mime-charset-for-write): Delete the remaining + arguments for `defcustom'. + +1999-02-13 Tanaka Akira + + * mcs-e20.el (charsets-mime-charset-alist): Don't set up + `iso-2022-int-1' in default. + +1999-02-11 Tanaka Akira + + * README.en, README.ja, pccl.el: pccl does not support Mule 1.x. + + * pccl-20.el: Update broken facility message with Emacs version + it fixes. + +1999-02-07 MORIOKA Tomohiko + + * install.el (install-prefix): Modify for Meadow. + +1999-01-26 MORIOKA Tomohiko + + * mcs-20.el (mime-charset-to-coding-system-default-method): New + user option. + (mime-charset-to-coding-system): Call + `mime-charset-to-coding-system-default-method' if suitable + coding-system is not found. + +1999-01-21 Keiichi Suzuki + + * mcs-xm.el (encode-mime-charset-region): Add new optional + argument `lbt'. + (encode-mime-charset-string): Ditto. + + * mcs-nemacs.el (lbt-to-string): New inline function. + (encode-mime-charset-region): Add new optional argument `lbt'. + (encode-mime-charset-string): Ditto. + + * mcs-ltn1.el (lbt-to-string): New inline function. + (encode-mime-charset-region): Add new optional argument `lbt'. + (encode-mime-charset-string): Ditto. + (decode-mime-charset-region): Use `lbt-to-string'. + + * mcs-e20.el (encode-mime-charset-region): Add new optional + argument `lbt'. + (encode-mime-charset-string): Ditto. + + * mcs-om.el (lbt-to-string): New inline function. + (encode-mime-charset-region): Add new optional argument `lbt'. + (encode-mime-charset-string): Ditto. + (decode-mime-charset-region): Use `lbt-to-string'. + (decode-mime-charset-string): Ditto. + +1998-12-24 MORIOKA Tomohiko + + * mcs-om.el (default-mime-charset-for-write): New variable. + (detect-mime-charset-region): Return + `default-mime-charset-for-write' if suitable mime-charset is not + found. + + * mcs-20.el (detect-mime-charset-region): Don't call + `default-mime-charset-detect-method-for-write' if suitable + mime-charset is found. + + * mcharset.el (charsets-to-mime-charset): Return nil if suitable + mime-charset is not found; abolish optional argument `default'. + +1998-12-23 MORIOKA Tomohiko + + * mcs-xm.el (charsets-mime-charset-alist): Don't set up + `iso-2022-int-1' in default. + + * mcs-20.el (default-mime-charset-for-write): New user option. + (default-mime-charset-detect-method-for-write): New user option. + (detect-mime-charset-region): Refer + `default-mime-charset-detect-method-for-write' or + `default-mime-charset-for-write' if suitable mime-charset is not + found. + + * mcharset.el (charsets-to-mime-charset): Add new optional + argument `default'. + +1999-02-26 Katsumi Yamaoka + + * poem-nemacs.el (find-file-noselect-as-coding-system): Bind + `default-kanji-fileio-code' to specified coding system instead of + the use of `kanji-fileio-code'; bind `kanji-fileio-code' to nil. + (find-file-noselect-as-raw-text): Revert buffer if the file is + newer than the buffer. + (as-binary-input-file): Bind `default-kanji-flag' to nil. + + * poem-20.el (find-file-noselect-as-binary): Bug fix - use + `coding-system-for-read' instead of `coding-system-for-write'. + +1999-02-25 Katsumi Yamaoka + + * poem-om.el (find-file-noselect-as-raw-text-CRLF): New function. + It is an alias for `find-file-noselect-as-raw-text'. + (insert-file-contents-as-raw-text-CRLF): New function. + It is an alias for `insert-file-contents-as-raw-text'. + + * poem-nemacs.el (find-file-noselect-as-raw-text-CRLF): New + function. It is an alias for `find-file-noselect-as-raw-text'. + (find-file-noselect-as-raw-text): Convert line-break code from + CRLF to LF. + (insert-file-contents-as-raw-text-CRLF): New function. It is an + alias for `insert-file-contents-as-raw-text'. + (insert-file-contents-as-raw-text): Convert line-break code from + CRLF to LF. + (find-file-noselect-as-binary): Don't specify the optional third + argument `rawfile' for `find-file-noselect'. + + * poem-ltn1.el (find-file-noselect-as-raw-text-CRLF): New function. + It is an alias for `find-file-noselect'. + (insert-file-contents-as-raw-text-CRLF): New function. It is an + alias for `insert-file-contents'. + + * poem-20.el, poem-e20_2.el (find-file-noselect-as-raw-text-CRLF): + New function. + (insert-file-contents-as-raw-text-CRLF): New function. + +1999-02-25 Katsumi Yamaoka + + * poem-20.el, poem-e20_2.el, poem-om.el + (find-file-noselect-as-raw-text): Undo the last change. + (insert-file-contents-as-raw-text): Likewise. + +1999-02-25 Katsumi Yamaoka + + * poem-20.el, poem-e20_2.el, poem-om.el + (find-file-noselect-as-raw-text): Use `raw-text-dos' instead of + `raw-text'. + (insert-file-contents-as-raw-text): Likewise. + +1999-02-14 Katsumi Yamaoka + + * mcs-om.el (TopLevel): Don't refer to + `running-emacs-19_29-or-later', use `emacs-major-version' and + `emacs-minor-version' instead. + +1999-02-14 MORIOKA Tomohiko + + * poe.el (file-name-sans-extension): New function . + +1999-02-04 Katsumi Yamaoka + + * poem-20.el, poem-ltn1.el, poem-nemacs.el, poem-om.el + (save-buffer-as-binary): New function. + (save-buffer-as-raw-text-CRLF): New function. + (save-buffer-as-coding-system): New function. + + * poem-om.el (poem-ccl-decode-raw-text): Rewrite again for plural + `CR's. + +1999-02-04 Katsumi Yamaoka + + * poem-om.el (poem-ccl-decode-raw-text): Rewrite for fixing a bug + that the last datum will be missed if the input data is not ended + with `CRLF'. + (poem-ccl-encode-raw-text-CRLF): Use `read-if'. + +1998-12-24 MORIOKA Tomohiko + + * install.el (install-detect-elisp-directory): Avoid problem if + prefix of an emacs has its version. + + +1998-12-22 MORIOKA Tomohiko + + * APEL: Version 9.12 was released. + +1998-12-20 MORIOKA Tomohiko + + * mcs-om.el: Avoid error when cyrillic.el is not found. + +1998-12-19 MORIOKA Tomohiko + + * poem-xm.el: Define coding-system `gb2312-dos', `gb2312-mac' and + `gb2312-unix' if it is not found. + +1998-12-18 Katsumi Yamaoka + + * poem-om.el (poem-ccl-decode-raw-text): Renamed from + `ccl-decode-raw-text'. + (poem-ccl-encode-raw-text): Renamed from `ccl-encode-raw-text'. + (poem-ccl-encode-raw-text-CRLF): Renamed from + `ccl-encode-raw-text-CRLF`. + +1998-12-17 MORIOKA Tomohiko + + * poem-om.el (poem-decode-raw-text): New function for MULE 1. + (poem-encode-raw-text-CRLF): Likewise. + (raw-text): New coding-system for MULE 1. + (raw-text-dos): Likewise. + (insert-file-contents-as-raw-text): Share implementation. + (write-region-as-raw-text-CRLF): Likewise. + (find-file-noselect-as-raw-text): Likewise. + +1998-12-17 MORIOKA Tomohiko + + * poem-om.el: Share definition of coding-system `binary'. + (write-region-as-binary): Share implementation. + (find-file-noselect-as-binary): Likewise. + +1998-12-16 MORIOKA Tomohiko + + * poem-om.el (insert-file-contents-as-binary): Share + implementation. + +1998-12-16 Katsumi Yamaoka + + * poem-om.el (find-file-noselect-as-raw-text): Use + `find-file-noselect-as-coding-system' under Mule 2.*. + (find-file-noselect-as-binary): Likewise. + (insert-file-contents-as-raw-text): Use + `insert-file-contents-as-coding-system' under Mule 2.*. + (insert-file-contents-as-binary): Likewise. + (write-region-as-raw-text-CRLF): Use + `write-region-as-coding-system' under Mule 2.*. + (write-region-as-binary): Likewise. + (truncate-string): Use `defun-maybe'. + (toplevel): Don't refer to `running-emacs-19_29-or-later', use + `emacs-major-version' and `emacs-minor-version' instead. + +1998-12-16 Katsumi Yamaoka + + * pccl-om.el (toplevel): Don't require `poem'. + Use `code-convert-string' instead of `encode-coding-string' or + `decode-coding-string'. + + * poem-om.el (binary): EMACS 20 emulating coding-system for Mule + 2.3 based on Emacs 19.[28-34]. + (raw-text): EMACS 20 emulating coding-system based on native CCL + for Mule 2.3 based on Emacs 19.[28-34]. + (raw-text-dos): Likewise. + (find-file-noselect-as-binary): Separate for some Mules. + +1998-12-15 Tanaka Akira + + * pccl-20.el: Do not require 'poem. + +1998-12-14 Katsumi Yamaoka + + * poem-20.el, poem-e20_2.el, poem-ltn1.el, poem-nemacs.el, poem-om.el + (find-file-noselect-as-coding-system): Be CODING-SYSTEM the 1st arg. + (insert-file-contents-as-coding-system): Likewise. + * poem-20.el, poem-ltn1.el, poem-nemacs.el, poem-om.el + (write-region-as-coding-system): Likewise. + +1998-12-14 Katsumi Yamaoka + + * poem-20.el, poem-e20_2.el, poem-ltn1.el, poem-nemacs.el, poem-om.el + (find-file-noselect-as-coding-system): Renamed from + `find-file-noselect-as-specified-coding-system'. + + * poem-e20_2.el (insert-file-contents-as-coding-system): Renamed + from `insert-file-contents-as-specified-coding-system'. + + * poem-20.el, poem-ltn1.el, poem-nemacs.el, poem-om.el + (write-region-as-coding-system): Renamed from + `write-region-as-specified-coding-system'. + (insert-file-contents-as-coding-system): Renamed from + `insert-file-contents-as-specified-coding-system'. + +1998-12-09 Katsumi Yamaoka + + * poem-20.el, poem-e20_2.el, poem-ltn1.el, poem-nemacs.el, poem-om.el + (find-file-noselect-as-binary): New function. + (find-file-noselect-as-raw-text): New function. + (find-file-noselect-as-specified-coding-system): New function. + + * poem-nemacs.el (insert-file-contents-as-binary): Call + `insert-file-contents' with only two args - FILENAME and VISIT. + (insert-file-contents-as-raw-text): Likewise. + (insert-file-contents-as-specified-coding-system): Likewise. + +1998-12-09 Yuuichi Teranishi + + * poe-18.el (make-directory-internal): Rewrite. + +1998-12-08 Katsumi Yamaoka + + * poem-20.el (write-region-as-binary): Bind + `jam-zcat-filename-list' with nil. + * poem-xm.el (insert-file-contents-as-binary): Likewise. + + * poem.el: Require `tcp' if the function `open-network-stream' + does not exist. + +1998-12-04 Katsumi Yamaoka + + * poem-20.el, poem-ltn1.el, poem-nemacs.el, poem-om.el + (open-network-stream-as-binary): New function. + + * poem-e20_2.el (insert-file-contents-as-specified-coding-system): + New function. + + * poem-20.el, poem-ltn1.el, poem-nemacs.el, poem-om.el + (write-region-as-specified-coding-system): New function. + (insert-file-contents-as-specified-coding-system): New function. + +1998-12-01 MORIOKA Tomohiko + + * poem-xm.el: If coding-system `iso-2022-jp-dos' unifies JIS X + 0201-Latin to ASCII and JIS X 0208-1978 to JIS X 0208-1983 by + code-point, copy coding-system `iso-2022-7bit-dos' to + `iso-2022-jp-dos' to avoid this problem. + +1998-11-17 Kazuhiro Ohta + + * README.en, README.ja (add-latest-path): Fix typo. + + +1998-11-14 MORIOKA Tomohiko + + * APEL: Version 9.11 was released. + + * poem-ltn1.el (char-charset): Fix typo. + +1998-11-13 Tanaka Akira + + * broken.el: require 'poe. + +1998-11-13 Tanaka Akira + + * pccl.el: Enclose mule depended process by `unless-broken'. + +1998-11-13 MORIOKA Tomohiko + + * poe.el (defun-maybe-cond): fixed problem in Emacs 18. + + * poe.el (defsubst): Moved from poe-18.el. + + * poe-18.el: Move macro `defsubst' to poe.el. + + +1998-11-13 MORIOKA Tomohiko + + * APEL: Version 9.10 was released. + +1998-11-13 Tanaka Akira + + * pccl.el (define-ccl-program): Adviced. + +1998-11-12 Tanaka Akira + + * pccl-om.el (ccl-cascading-read): New facility. + +1998-11-10 Tanaka Akira + + * EMU-ELS (emu-modules): Always install 'pccl. + + * broken.el: Use 19.28 style quasi-quote. + + * pccl.el: - require 'broken. + - Does not require 'pccl-20 for XEmacs 20. + (ccl-usable): New facility. + +1998-11-10 Tanaka Akira + + * README.en, README.ja, pccl-20.el: Note that pccl-20 is not + for XEmacs 20. + +1998-11-08 MORIOKA Tomohiko + + * poe-18.el (eval-and-compile): Moved from poe.el. + + * poe.el: Move `eval-and-compile' to poe-18.el. + + * poe-xemacs.el (overlayp): New alias. + (delete-overlay): New alias. + + +1998-11-07 MORIOKA Tomohiko + + * APEL: Version 9.9 was released. + +1998-11-06 MORIOKA Tomohiko + + * poe.el (combine-after-change-calls): fixed. + +1998-10-31 Mikio Nakajima + + * poe.el (combine-after-change-calls): New macro. + +1998-10-28 MORIOKA Tomohiko + + * poe.el (defun-maybe-cond): New macro. + (next-command-event): Use `defun-maybe-cond'. + (cancel-undo-boundary): Use `defun-maybe-cond'. + +1998-10-28 Katsumi Yamaoka + + * poem-om.el (char-after): Redefine to change `POS' to optional + argument. + + +1998-10-27 MORIOKA Tomohiko + + * APEL: Version 9.8 was released. + + * README.ja, README.en (CVS): New section. + +1998-10-27 Mikio Nakajima + + * poem-om.el (char-before): Redefine to change `POS' to optional + argument. + +1998-10-27 MORIOKA Tomohiko + + * poe.el (subr-fboundp): New function. + (next-command-event): New function. + (character-to-event): New function. + +1998-10-25 Mikio Nakajima + + * poe.el (event-to-character): New function. + +1998-10-27 MORIOKA Tomohiko + + * poe.el (cancel-undo-boundary): Switch definition by existence of + variable `buffer-undo-list'. + + * poe-18.el: Move function `cancel-undo-boundary' to poe.el. + +1998-10-25 Mikio Nakajima + + * poe.el (cancel-undo-boundary): New function. + +1998-10-27 MORIOKA Tomohiko + + * poe-18.el (cancel-undo-boundary): New function (moved from + poem.el). + + * poem.el: Move function `cancel-undo-boundary' to poe-18.el. + + +1998-10-26 MORIOKA Tomohiko + + * APEL: Version 9.7 was released. + +1998-10-26 MORIOKA Tomohiko + + * poem.el (cancel-undo-boundary): New function. + +1998-10-26 MORIOKA Tomohiko + + * poe-xemacs.el (set-cursor-color): Add interactive spec; add + DOC-string. + +1998-10-25 Mikio Nakajima + + * poe-xemacs.el (set-cursor-color): New function. + +1998-10-26 MORIOKA Tomohiko + + * README.ja: Sync up with latest README.en. + +1998-10-26 MORIOKA Tomohiko + + * poe.el (remove-local-hook): Use `defmacro-maybe'. + +1998-10-26 Mikio Nakajima + + * poe.el (add-local-hook): fixed. + (remove-local-hook): fixed. + + +1998-10-26 MORIOKA Tomohiko + + * APEL: Version 9.6 was released. + +1998-10-25 MORIOKA Tomohiko + + * poe.el (rassoc): New function. + +1998-10-25 MORIOKA Tomohiko + + * poe-xemacs.el (eval-after-load): New function. + + * poem-e20_3.el (characterp): New alias. + + * poem.el (characterp): New alias. + (char-octet): New function. + +1998-10-25 Mikio Nakajima + + * poe.el (make-local-hook): New macro. + (add-local-hook): New macro. + (remove-local-hook): New macro. + +1998-10-25 MORIOKA Tomohiko + + * poem.el, poem-20.el, poem-e20_3.el, poem-e20.el, poem-xm.el: Add + setting of byte-compile-dynamic. + + * poem-xm.el (string-to-int-list): Use `defun-maybe'. + + * poem.el (string-as-unibyte): Use `defsubst-maybe' instead of + `defmacro-maybe'. + (string-as-multibyte): Likewise. + (char-int): Use `defalias-maybe'. + (int-char): Likewise. + (char-or-char-int-p): Likewise. + +1998-10-25 MORIOKA Tomohiko + + * poe.el, poe-xemacs.el: Add setting of byte-compile-dynamic. + +1998-10-25 MORIOKA Tomohiko + + * poe-18.el (data-directory): Use `defvar-maybe'. + (buffer-undo-list): Likewise. + + * poe-xemacs.el (face-list): Use `defalias-maybe'. + (line-beginning-position): Likewise. + (line-end-position): Likewise. + + * poe.el (defalias-maybe): New macro. + + * poe-xemacs.el (dired-other-frame): Use `defun-maybe'. + +1998-10-24 MORIOKA Tomohiko + + * poe.el (defvar-maybe): New macro. + (temporary-file-directory): New variable. + + +1998-10-23 MORIOKA Tomohiko + + * APEL: Version 9.5 was released. + +1998-10-22 Yoshiki Hayashi + + * README.ja: New file. + +1998-10-20 MORIOKA Tomohiko + + * alist.el: Add autoload cookies. + +1998-10-20 MORIOKA Tomohiko + + * poe.el, EMU-ELS, README.en: Move `find-face' from poe-19.el to + poe.el; abolish poe-19.el. + +1998-10-20 MORIOKA Tomohiko + + * invisible.el, inv-18.el, inv-19.el, inv-xemacs.el, poe-18.el, + poe-19.el, poe-xemacs.el, emu.el, EMU-ELS, README.en: Separate + invisible features from poe to invisible. + +1998-10-20 MORIOKA Tomohiko + + * poe.el (eval-and-compile): New macro. + Enclose redefinition of `read-string' by `eval-and-compile'. + +1998-10-20 MORIOKA Tomohiko + + * poe.el (string): New function. + +1998-10-19 MORIOKA Tomohiko + + * emu.el (char-list-to-string): New function. + + * poe-xemacs.el, poe-19.el: Abolish macro `char-list-to-string'. + + * poe-18.el: Abolish function `char-list-to-string'. + +1998-10-18 Tanaka Akira + + * broken.el (check-broken-facility): Also use compile time + description. + + +1998-10-18 MORIOKA Tomohiko + + * APEL: Version 9.4 was released. + +1998-10-17 Tanaka Akira + + * broken.el (check-broken-facility): New macro. + +1998-10-16 MORIOKA Tomohiko + + * poe.el (define-obsolete-function-alias): New function. + + +1998-10-12 MORIOKA Tomohiko + + * APEL: Version 9.3 was released. + +1998-10-12 Katsumi Yamaoka + + * README.en: Add explanations about + `LISPDIR', `VERSION_SPECIFIC_LISPDIR' and `what-where'. + + * Makefile (what-where): New target. + (install): Add new arg `VERSION_SPECIFIC_LISPDIR'. + + * APEL-MK (what-where-apel): New function. + (config-apel): Refer to `VERSION_SPECIFIC_LISPDIR'. + + * APEL-CFG (VERSION_SPECIFIC_LISPDIR): New variable. + +1998-10-12 MORIOKA Tomohiko + + * README.en (load-path): Modify for Emacs 20.3. + +1998-10-11 MORIOKA Tomohiko + + * APEL-CFG (EMU_PREFIX): Use "emu" for Emacs 20.3 or later. + + * EMU-ELS: Don't install pccl in anything older than XEmacs 21 + with MULE. + + +1998-10-10 MORIOKA Tomohiko + + * APEL: Version 9.2 was released. + + * poem-xm.el (insert-file-contents-as-binary): New function. + + * poem-20.el (write-region-as-binary): bind + `jka-compr-compression-info-list' with nil. + (insert-file-contents-as-binary): Change to alias of + `insert-file-contents-literally' for Emacs 20. + + +1998-10-07 MORIOKA Tomohiko + + * APEL: Version 9.1 was released. + +1998-10-06 MORIOKA Tomohiko + + * mcs-e20.el, mcs-xm.el (coding-system-to-mime-charset): New + function. + (mime-charset-list): New implementation. + + * Move `mime-charset-list' from mcs-20.el to mcs-e20.el and + mcs-xm.el. + +1998-10-01 MORIOKA Tomohiko + + * mcs-e20.el (charsets-mime-charset-alist): Use `gb2312' and + `big5' instead of `cn-gb-2312' and `cn-big5'. + + * mcs-xm.el (charsets-mime-charset-alist): Use `gb2312' and `big5' + instead of `cn-gb-2312' and `cn-big5'. + + * mcs-20.el (mime-charset-coding-system-alist): Add `cn-gb' to + default value. + + +1998-09-22 MORIOKA Tomohiko + + * APEL: Version 9.0 was released. + + * Delete EMU-CFG and EMU-MK because they have not been used. + +1998-09-22 Tanaka Akira + + * README.en (What's APEL?): Add notice for broken.el. + +1998-09-22 MORIOKA Tomohiko + + * README.en (What's APEL?): Modify for latest structure. + +1998-09-20 MORIOKA Tomohiko + + * mcs-xm.el (charsets-mime-charset-alist): Comment out invalid + definition for iso-2022-int-1. + +1998-09-19 Tanaka Akira + + * broken.el: New file. + + * pccl.el (apel-broken-facility): Abolished + (apel-broken-p): Abolished + + * EMU-ELS (emu-modules): Add 'broken. + + * Makefile (elc): Do not remove emu*.elc. + + * pccl-20.el: require 'broken. + (ccl-use-symbol-as-program): Abolished. + (ccl-accept-symbol-as-program): New facility. + (make-ccl-coding-system): Use `when-broken' to define. + (ccl-encoder-eof-block-is-broken): Abolished. + (ccl-decoder-eof-block-is-broken): Abolished. + (ccl-eof-block-is-broken): Abolished + (ccl-execute-eof-block-on-encoding-null): New facility. + (ccl-execute-eof-block-on-encoding-some): Ditto. + (ccl-execute-eof-block-on-decoding-null): Ditto. + (ccl-execute-eof-block-on-decoding-some): Ditto. + (ccl-execute-eof-block-on-encoding): Ditto. + (ccl-execute-eof-block-on-decoding): Ditto. + (ccl-execute-eof-block): Ditto. + + * pccl-om.el: require 'broken. + (ccl-use-symbol-as-program): Abolished. + (ccl-accept-symbol-as-program): New facility. + (ccl-encoder-eof-block-is-broken): Abolished. + (ccl-decoder-eof-block-is-broken): Abolished. + (ccl-eof-block-is-broken): Abolished + (ccl-execute-eof-block-on-encoding-null): New facility. + (ccl-execute-eof-block-on-encoding-some): Ditto. + (ccl-execute-eof-block-on-decoding-null): Ditto. + (ccl-execute-eof-block-on-decoding-some): Ditto. + (ccl-execute-eof-block-on-encoding): Ditto. + (ccl-execute-eof-block-on-decoding): Ditto. + (ccl-execute-eof-block): Ditto. + (ccl-execute-on-string-ignore-contin): New facility. + +1998-09-18 Tanaka Akira + + * pccl.el (apel-broken-facility): New function. + (apel-broken-p): New function. + +1998-09-18 Tanaka Akira + + * pccl.el: Fix author. + +1998-09-17 Katsumi Yamaoka + + * pccl-om.el (make-ccl-coding-system): Enclose with + `eval-and-compile'. + +1998-09-17 MORIOKA Tomohiko + + * poe.el (unless): New macro. + + * emu.el: Define tl:overlay obsolete aliases for all emacsen. + + * poem-nemacs.el (decode-coding-string): Regard integer as + coding-system. + (encode-coding-string): Likewise. + (decode-coding-region): Likewise. + (encode-coding-region): Likewise. + + * poe-18.el (set-text-properties): New function. + + * install.el (install-detect-elisp-directory): Fix problem on + Nemacs. + +1998-09-17 MORIOKA Tomohiko + + * poem-ltn1.el (set-buffer-multibyte): Use `defun-maybe' instead + of `defmacro-maybe'. + + * poem-e20_2.el (set-buffer-multibyte): Use `defun-maybe' instead + of `defsubst-maybe'. + +1998-09-17 MORIOKA Tomohiko + + * EMU-ELS: New implementation. + +1998-09-17 MORIOKA Tomohiko + + * emu.el, emu-mule.el, EMU-ELS: Move code about CCL from + emu-mule.el to pccl-om.el. + + * pccl.el: New file. + + * pccl.el: - Rename emu-e20.el to pccl-20.el. + - Move definition of emu-x20.el to pccl-20.el. + - Move code about CCL from emu-mule.el to pccl-om.el. + + * pccl-om.el: New file (move code about CCL from emu-mule.el). + + * pccl-20.el: New file (renamed from emu-e20.el; move definition + of emu-x20.el to pccl-20.el; abolish emu-x20.el). + +1998-09-17 MORIOKA Tomohiko + + * emu.el, emu-x20.el, emu-e20.el: Move function `char-category' + from emu-e20.el and emu-x20.el to emu.el. + +1998-09-17 MORIOKA Tomohiko + + * emu.el, emu-nemacs.el, emu-latin1.el, EMU-ELS: Move definitions + of emu-nemacs.el and emu-latin1.el to emu.el; abolish + emu-nemacs.el and emu-latin1.el. + +1998-09-17 MORIOKA Tomohiko + + * emu.el: Modify conditions to load sub-modules. + + * emu.el, emu-e20.el: Move alias + `insert-binary-file-contents-literally' from emu-e20.el to emu.el. + +1998-09-17 MORIOKA Tomohiko + + * poem.el, emu.el: Move `string-as-unibyte', + `string-as-multibyte', `char-int', `int-char' and + `char-or-char-int-p' from emu.el to poem.el. + +1998-09-17 MORIOKA Tomohiko + + * mcharset.el, emu.el: Move function `charsets-to-mime-charset' + from emu.el to mcharset.el. + +1998-09-17 MORIOKA Tomohiko + + * emu.el, emu-x20.el, emu-nemacs.el, emu-mule.el, emu-latin1.el, + emu-e20.el: + - Move `insert-binary-file-contents' from emu-e20.el, + emu-latin1.el, emu-mule.el, emu-nemacs.el and emu-x20.el to + emu.el. + - Move `insert-binary-file-contents-literally' from + emu-latin1.el, emu-mule.el, emu-nemacs.el and emu-x20.el to + emu.el. + +1998-09-17 MORIOKA Tomohiko + + * poe-18.el (make-obsolete): New function. + +1998-09-17 MORIOKA Tomohiko + + * emu.el, EMU-ELS: Split code about MIME charset from emu to + mcharset. + + * mcharset.el: New file. + + * mcs-xm.el: New file (split code about MIME charset from + emu-x20.el). + + * emu-x20.el: Split code about MIME charset to mcs-xm.el. + + * mcs-om.el: New file (split code about MIME charset from + emu-mule.el). + + * emu-mule.el: Split code about MIME charset to mcs-om.el. + + * mcs-nemacs.el: New file (split code about MIME charset from + emu-nemacs.el). + + * emu-nemacs.el: Split code about MIME charset to mcs-nemacs.el. + + * mcs-ltn1.el: New file (split code about MIME charset from + emu-latin1.el). + + * emu-latin1.el: Split code about MIME charset to mcs-latin1.el. + + * mcs-e20.el: New file (split code about MIME charset from + emu-e20.el). + + * emu-e20.el: Split code about MIME charset to mcs-e20.el. + + * mcs-20.el: New file (renamed from emu-20.el). + +1998-09-17 MORIOKA Tomohiko + + * emu.el, emu-20.el: Move constant `*noconv*' from emu-20.el to + emu.el. + +1998-09-17 MORIOKA Tomohiko + + * emu.el, EMU-ELS: Split core part about MULE from emu to poem. + + * poem.el: New file. + + * poem-e20_3.el: New file (renamed from emu-e20_3.el). + + * poem-e20_2.el: New file (renamed from poem-e20_2.el). + + * poem-xm.el: New file (split core part of MULE from emu-x20.el). + + * emu-x20.el: Split core part of MULE to poem-xm.el. + + * poem-om.el: New file (split core part of MULE from emu-mule.el). + + * emu-mule.el: Split core part of MULE to poem-om.el. + + * poem-ltn1.el: New file (split core part of MULE from + emu-latin1.el). + + * emu-latin1.el: Split core part of MULE to poem-ltn1.el. + + * poem-e20.el: New file (split core part of MULE from emu-e20.el). + + * emu-e20.el: Split core part of MULE to poem-e20.el. + + * poem-20.el: New file (split core part of MULE from emu-20.el). + + * emu-20.el: Split core part of MULE to poem-20.el. + + * poem-nemacs.el: New file (split core part of MULE from + emu-nemacs.el). + + * emu-nemacs.el: Split core part of MULE to poem-nemacs.el; move + overlay emulation code of Nemacs to poe-18.el. + + * poe-18.el: Move overlay emulation code of Nemacs from + emu-nemacs.el. + +1998-09-17 MORIOKA Tomohiko + + * poe.el, emu.el: Move function `point-at-bol' and `point-at-eol' + from emu.el to poe.el. + +1998-09-17 MORIOKA Tomohiko + + * emu.el (point-at-bol): New function. + (point-at-eol): Use `line-end-position'. + +1998-09-17 MORIOKA Tomohiko + + * poe.el (line-beginning-position): New function. + (line-end-position): New function. + + * poe-xemacs.el (line-beginning-position): New alias. + (line-end-position): New alias. + +1998-09-17 MORIOKA Tomohiko + + * poe.el, emu.el: Move function `functionp' from emu.el to poe.el. + +1998-09-17 MORIOKA Tomohiko + + * poe.el, emu.el: Move Emacs 19.30 emulating definitions, Emacs + 19.31 emulating definitions and Emacs 20.1 emulating definitions + from emu.el to poe.el. + +1998-09-17 MORIOKA Tomohiko + + * poe.el, emu.el: Move constant `emacs-minor-version', Emacs 19 + emulating definitions and Emacs 19.29 emulating definitions from + emu.el to poe.el. + +1998-09-17 MORIOKA Tomohiko + + * poe.el: New file (split core part from emu.el). + + * poe-xemacs.el: New file (renamed from emu-xemacs.el). + + * poe-19.el: New file (renamed from emu-e19.el). + + * poe-18.el: New file (renamed from emu-18.el). + + * emu.el, emu-nemacs.el, emu-mule.el, emu-e20.el, EMU-ELS: modify + for new structure. + +1998-09-17 MORIOKA Tomohiko + + * emu-x20.el (make-ccl-coding-system): New function. + +1998-09-17 Katsumi Yamaoka + + * emu-mule.el: Require `cyrillic' (suggested by MORIOKA-san). + + * emu-mule.el (decode-mime-charset-region): Cope with non existent + coding systems if the third arg `lbt' has specified. + (decode-mime-charset-string): Likewise. + + +1998-09-14 MORIOKA Tomohiko + + * APEL: Version 8.18 was released. + + * Makefile (install-package): Don't depend on target `elc'. + + * APEL-MK (install-apel-package): Compile emu-modules and + apel-modules. + +1998-09-13 MORIOKA Tomohiko + + * Makefile: Abolish target `package'. + (install-package): Use `elc' instead of `package'. + + * APEL-MK: Abolish function `compile-apel-package'. + (install-apel-package): Update auto-autoloads.el and + custom-load.el at target directory. + +1998-09-13 MORIOKA Tomohiko + + * README.en (run in expanded place): fixed. + (install as a XEmacs package): New description. + + * Makefile (XEMACS): New variable. + (PACKAGEDIR): New variable. + (package): New target. + (install-package): New target. + + * APEL-MK (config-apel-package): New function. + (compile-apel-package): New function. + (install-apel-package): New function. + + * APEL-CFG (PACKAGEDIR): New variable. + +1998-09-07 Tanaka Akira + + * Makefile (elc): Ignore errors when removing emu*.elc. + +1998-09-01 Tanaka Akira + + * emu-mule.el (ccl-execute-on-string): Fix arguments + order `status' and `string'. + + +1998-08-31 MORIOKA Tomohiko + + * APEL: Version 8.17 was released. + + * emu.el (with-temp-file): Must use old forms. + +1998-08-31 Katsumi Yamoaka + + * emu.el (with-temp-file): New macro (Emacs 20/XEmacs 20 + emulating macro). + +1998-08-29 Tanaka Akira + + * emu-e20.el: require 'ccl only for byte-compile time. + +1998-08-29 Tanaka Akira + + * Makefile (elc): Remove emu*.elc to use newest emu by + intall.el. + +1998-08-29 Shuhei KOBAYASHI + + * emu-e20.el (ccl-execute-on-string): Too few args. + (test-ccl-eof-block-cs): Revert existence checking. + + * emu-e20_2.el (insert-file-contents-as-binary): Return value. + (insert-file-contents-as-raw-text): Ditto. + + * emu-mule.el (insert-file-contents-as-raw-text): Return value. + (encode-coding-string): Check `coding-system' is non-nil. + (decode-coding-string): Ditto. + (insert-file-contents-as-binary): Use `as-binary-input-file'. + (insert-binary-file-contents-literally): Ditto. + (write-region-as-binary): Use `as-binary-output-file'. + (write-region-as-raw-text-CRLF): Definition for Emacs 19.28. + (write-region-as-mime-charset): Ditto. + (mime-charset-to-coding-system): New implementation. + + (ccl-use-symbol-as-program): New constant. + (ccl-encoder-eof-block-is-broken): New constant. + (ccl-decoder-eof-block-is-broken): New constant. + (ccl-eof-block-is-broken): New constant. + (make-ccl-coding-system): New function. + (ccl-execute): Emacs 20.3 emulating function. + (ccl-execute-on-string): Emacs 20.3 emulating function. + + * emu-nemacs.el (write-region-as-binary): Use + `as-binary-output-file' + (write-region-as-raw-text-CRLF): Ditto. + (insert-file-contents-as-binary): Use `as-binary-input-file'. + (insert-binary-file-contents-literally): Ditto. + (insert-file-contents-as-raw-text): Ditto. + + * emu.el (last): Emacs 20 emulation function. + (butlast), (nbutlast): CL emulation functions. + +1998-08-27 Tanaka Akira + + * emu-e20.el (ccl-use-symbol-as-program): Reduce + `eval-and-compile' and `eval-when-compile' nesting. + (test-ccl-eof-block-cs): Remove existence checking. + +1998-08-27 Tanaka Akira + + * emu-e20.el (ccl-use-symbol-as-program): Use + `ccl-vector-program-execute-on-string' if it is defined. + +1998-08-27 Tanaka Akira + + * emu-e20.el (ccl-use-symbol-as-program): Use + `ccl-execute-on-string' instead of `make-coding-system' for + avoiding the error "Coding system already exists". + +1998-08-27 Tanaka Akira + + * emu-e20.el (test-ccl-eof-block-cs): Check if it is already + defined. + +1998-08-27 Tanaka Akira + + * emu-e20.el (ccl-use-symbol-as-program): New constant. + (make-ccl-coding-system): New function. + (ccl-encoder-eof-block-is-broken): New constant. + (ccl-decoder-eof-block-is-broken): New constant. + (ccl-eof-block-is-broken): New constant. + (ccl-execute): Redefine if `ccl-use-symbol-as-program' is nil. + (ccl-execute-on-string): Ditto. + +1998-08-24 MORIOKA Tomohiko + + * emu-20.el (mime-charset-coding-system-alist): Add `unknown' and + `x-unknown'. + +1998-08-12 MORIOKA Tomohiko + + * emu-x20.el: Redefine coding-system `ctext' if `ctext-dos' is not + found. + +1998-08-12 Katsumi Yamaoka + + * emu-nemacs.el, emu-mule.el (decode-mime-charset-region): Add new + argument `lbt'. + (decode-mime-charset-string): Likewise. + + * emu-mule.el (mime-charset-to-coding-system): Regard `CRLF', + `LF', `CR' as line break code type. + +1998-08-11 MORIOKA Tomohiko + + * emu-latin1.el, emu-nemacs.el (write-region-as-raw-text-CRLF): + Fix regexp to canonicalize line break code. + + * emu-mule.el (write-region-as-raw-text-CRLF): Use + `write-region-as-binary' to specify `lockname' in MULE 2.3 based + on 19.34. + +1998-08-11 MORIOKA Tomohiko + + * emu-x20.el: Redefine coding-system `iso-2022-jp-2' if + `iso-2022-jp-2-dos' is not found. + +1998-08-11 Katsumi Yamaoka + + * emu-mule.el (write-region-as-raw-text-CRLF): New function. + + * emu-18.el (generate-new-buffer-name): New function (Emacs 19 + emulating function). + +1998-08-10 MORIOKA Tomohiko + + * emu-nemacs.el, emu-latin1.el (write-region-as-raw-text-CRLF): + New function. + + * emu-20.el (write-region-as-raw-text-CRLF): Renamed from + `write-region-as-CRLF'. + +1998-08-10 MORIOKA Tomohiko + + * emu-latin1.el, emu-e20.el (decode-mime-charset-region): Add new + argument `lbt'. + (decode-mime-charset-string): Likewise. + + * emu-x20.el: Define coding-system `raw-text-unix' and + `raw-text-mac' if they are not found. + Redefine coding-system `euc-kr' if `euc-kr-dos' is not found. + (decode-mime-charset-region-default): Add new argument `lbt'. + (decode-mime-charset-region-with-iso646-unification): Likewise. + (decode-mime-charset-region-for-hz): Likewise. + (decode-mime-charset-region): Likewise. + (decode-mime-charset-string): Likewise. + + * emu-20.el (mime-charset-to-coding-system): Regard `CRLF', `LF', + `CR' as line break code type. + +1998-08-07 MORIOKA Tomohiko + + * emu-x20.el: Define coding-system `raw-text-dos' if it is not + found. + + * emu-20.el (write-region-as-CRLF): New function. + +1998-07-21 MORIOKA Tomohiko + + * install.el (install-detect-elisp-directory): Modify for anything + older than Emacs 19.28. + + +1998-06-22 MORIOKA Tomohiko + + * APEL: Version 8.16 was released. + + * emu.el, emu-x20.el: Require `emu-20' in emu-x20.el. + +1998-06-20 MORIOKA Tomohiko + + * emu-x20.el (set-buffer-multibyte): Use `defsubst-maybe' instead + of `defmacro-maybe'. + +1998-06-20 MORIOKA Tomohiko + + * emu-20.el, emu-x20.el: Move `insert-file-contents-as-binary' and + `insert-file-contents-as-raw-text' from emu-x20.el to emu-20.el. + + * emu-e20_2.el, emu-e20.el: Move `insert-file-contents-as-binary' + and `insert-file-contents-as-raw-text' from emu-e20.el to + emu-e20_2.el. + + +1998-06-09 MORIOKA Tomohiko + + * APEL: Version 8.15 was released. + + * emu-xemacs.el: Use nil as variable of `condition-case' to avoid + byte-compiler warning. + +1998-06-09 MORIOKA Tomohiko + + * emu.el (when): New macro. + +1998-06-09 Katsumi Yamaoka + + * emu.el (split-string): New function (Emacs 20/XEmacs 20 + emulating function). + + * emu.el (with-temp-buffer): New macro (Emacs 20/XEmacs 20 + emulating macro). + + * emu.el (with-current-buffer): New macro (Emacs 20/XEmacs 20 + emulating macro). + + * emu.el (save-current-buffer): New macro (Emacs 20/XEmacs 20 + emulating macro). + +1998-06-08 MORIOKA Tomohiko + + * mule-caesar.el (mule-caesar-region): Don't compare charset with + 'us-ascii. + +1998-06-08 MORIOKA Tomohiko + + * emu-mule.el (split-char): fixed. + +1998-06-08 Katsumi Yamaoka + + * emu-mule.el (insert-file-contents-as-binary): Use + file-coding-system-for-read instead of file-coding-system. + + +1998-06-06 MORIOKA Tomohiko + + * APEL: Version 8.14 was released. + +1998-06-05 MORIOKA Tomohiko + + * emu-mule.el, emu-latin1.el (split-char): New function. + +1998-06-05 MORIOKA Tomohiko + + * emu-mule.el, emu-nemacs.el (insert-file-contents-as-raw-text): + New function. + + * emu-latin1.el (insert-file-contents-as-raw-text): New alias. + + * emu-e20.el, emu-x20.el (insert-file-contents-as-raw-text): New + function. + +1998-06-05 MORIOKA Tomohiko + + * emu-x20.el: Move `split-char' check and repair code from + mule-caesar.el. + + * mule-caesar.el: Move `split-char' check and repair code to + emu-x20.el; require 'emu. + +1998-06-05 MORIOKA Tomohiko + + * emu-nemacs.el, emu-mule.el (set-buffer-multibyte): New function. + + * emu-latin1.el, emu-x20.el (set-buffer-multibyte): New macro. + + * mule-caesar.el (mule-caesar-region): Use '(cdr (split-char ...)) + instead of `char-to-octet-list'; abolish function + `char-to-octet-list'. + +1998-06-05 MORIOKA Tomohiko + + * emu-mule.el (charset-chars): New function. + + * mule-caesar.el (split-char): Redefine if it has bug. + (char-to-octet-list): Use `split-char'. + + +1998-06-01 MORIOKA Tomohiko + + * APEL: Version 8.13 was released. + + * emu-x20.el (mime-character-unification-limit-size): Change + default value to 2048. + +1998-05-28 MORIOKA Tomohiko + + * emu.el (string-as-unibyte): New macro. + + +1998-05-17 MORIOKA Tomohiko + + * APEL: Version 8.12 was released. + +1998-05-15 MORIOKA Tomohiko + + * emu-x20.el (mime-character-unification-limit-size): New + variable. + (decode-mime-charset-region-with-iso646-unification): Don't unify + if size of region is larger than + 'mime-character-unification-limit-size. + +1998-05-15 MORIOKA Tomohiko + + * emu-x20.el, emu-nemacs.el, emu-mule.el, emu-latin1.el, + emu-e20_3.el (looking-at-as-unibyte): New alias. + + * emu-e20_2.el (looking-at-as-unibyte): New function. + +1998-05-14 MORIOKA Tomohiko + + * emu-x20.el: Delete definition of 'detect-mime-charset-region + because it is defined in emu-20.el. + + * emu-20.el (write-region-as-binary): fixed. + + * emu-20.el (write-region-as-mime-charset): New function. + + * emu-latin1.el (write-region-as-mime-charset): New alias. + + * emu-nemacs.el, emu-mule.el (write-region-as-mime-charset): New + function. + + +1998-05-09 MORIOKA Tomohiko + + * APEL: Version 8.11 was released. + +1998-05-09 MORIOKA Tomohiko + + * emu.el (string-as-multibyte): New macro (Emacs 20.3 emulating + macro). + + +1998-05-07 MORIOKA Tomohiko + + * APEL: Version 8.10 was released. + + * README.en (What's APEL?): Delete description about atype.el; add + description about calist.el. + +1998-05-07 MORIOKA Tomohiko + + * calist.el (ctree-add-calist-with-default): fixed. + + +1998-05-06 MORIOKA Tomohiko + + * APEL: Version 8.9 was released. + +1998-05-06 MORIOKA Tomohiko + + * calist.el (ctree-find-calist): fixed duplicated result. + + +1998-05-05 MORIOKA Tomohiko + + * APEL: Version 8.8 was released. + +1998-05-03 MORIOKA Tomohiko + + * calist.el (ctree-find-calist): Delete duplicated result. + + +1998-04-30 MORIOKA Tomohiko + + * APEL: Version 8.7 was released. + +1998-04-29 MORIOKA Tomohiko + + * calist.el (ctree-match-calist-partially): New function. + + +1998-04-28 MORIOKA Tomohiko + + * APEL: Version 8.6 was released. + +1998-04-27 MORIOKA Tomohiko + + * emu-20.el (mime-charset-coding-system-alist): Use 'raw-text for + us-ascii in default setting. + +1998-04-27 MORIOKA Tomohiko + + * calist.el (ctree-find-calist): Add optional argument 'all. + +1998-04-27 MORIOKA Tomohiko + + * calist.el (ctree-find-calist): Renamed from + 'ctree-match-calist-all. + + +1998-04-25 MORIOKA Tomohiko + + * APEL: Version 8.5 was released. + +1998-04-25 MORIOKA Tomohiko + + * calist.el (ctree-match-calist-all): New function. + +1998-04-24 MORIOKA Tomohiko + + * APEL-ELS: Comment out 'atype and 'file-detect. + +1998-04-24 MORIOKA Tomohiko + + * emu-x20.el (decode-mime-charset-string): Use + 'decode-mime-charset-region. + +1998-04-24 MORIOKA Tomohiko + + * emu-x20.el (mime-charset-decoder-alist): Add + 'decode-mime-charset-region-for-hz for 'hz-gb-2312. + (decode-mime-charset-region-for-hz): New function. + +1998-03-25 MORIOKA Tomohiko + + * emu-x20.el (mime-charset-decoder-alist): New variable. + (decode-mime-charset-region-default): New function. + (mime-iso646-character-unification-alist): New variable. + (mime-unified-character-face): New variable. + (decode-mime-charset-region-with-iso646-unification): New + function. + (decode-mime-charset-region): Use 'mime-charset-decoder-alist. + + +1998-04-22 MORIOKA Tomohiko + + * APEL: Version 8.4 was released. + + * EMU-ELS: Don't use HIRAGANA LETTER A ($(B$"(B) to detect character + indexing (Emacs 20.3 or later). + +1998-04-20 MORIOKA Tomohiko + + * emu-x20.el, emu-e20.el (charsets-mime-charset-alist): Add + 'shift_jis. + + * EMU-ELS (emu-modules): fixed. + + +1998-04-17 MORIOKA Tomohiko + + * APEL: Version 8.3 was released. + + * README.en (What's APEL?): Modify for latest emu. + +1998-04-17 MORIOKA Tomohiko + + * emu-nemacs.el, emu-mule.el, emu-latin1.el, emu-e20_2.el, + emu-e20_3.el, emu-x20.el (char-next-index): Fixed. + +1998-04-17 MORIOKA Tomohiko + + * EMU-ELS (emu-modules): Add 'emu-e20_3 for Emacs 20.3. + + * emu-e20_3.el: New module. + + * emu-e20.el: Select to require 'emu-e20_2 or 'emu-e20_3. + + * emu-e20_2.el (set-buffer-multibyte): New function. + + * emu-e20.el (insert-file-contents-as-binary): Use + 'set-buffer-multibyte. + +1998-04-17 MORIOKA Tomohiko + + * emu-e20_2.el, emu-e20.el, EMU-ELS: Separate Emacs 20.1 and 20.2 + depended definitions from emu-e20.el to emu-e20_2.el. + +1998-04-17 MORIOKA Tomohiko + + * emu.el: emu-x20.el doesn't require 'emu-xemacs and 'emu-20. + +1998-04-16 MORIOKA Tomohiko + + * emu-x20.el: Don't require 'emu-xemacs and 'emu-20. + + * emu.el: emu-latin1.el does not require 'emu-xemacs or 'emu-e19. + + * emu-latin1.el: Don't require 'emu-xemacs or 'emu-e19. + +1998-04-16 MORIOKA Tomohiko + + * emu-mule.el, emu-latin1.el, emu-e20.el, emu-e19.el, emu-19.el, + EMU-ELS: Rename emu-19.el -> emu-e19.el. + + * emu.el, emu-latin1.el, emu-e19.el, EMU-ELS: Rename emu-e19.el -> + emu-latin1.el. + + +1998-04-13 MORIOKA Tomohiko + + * APEL: Version 8.2 was released. + + * README.en (What's APEL?): Remove description about std11.el and + std11-parse.el. + + * install.el (install-detect-elisp-directory): Modify regexp to + allow trailing `/'. + + +1998-04-13 MORIOKA Tomohiko + + * APEL: Version 8.1 was released. + +1998-04-11 MORIOKA Tomohiko + + * emu-x20.el (encode-mime-charset-region): Use 'defun instead of + 'defsubst. + (decode-mime-charset-region): Use 'defun instead of 'defsubst. + +1998-04-10 MORIOKA Tomohiko + + * APEL-ELS (apel-modules): Delete 'std11 and 'std11-parse. + + * std11.el, std11-parse.el: Abolish std11-parse.el and std11.el + (moved to RIME). + + +1998-04-09 MORIOKA Tomohiko + + * APEL: Version 8.0 was released. + +1998-04-09 MORIOKA Tomohiko + + * emu-e19.el, emu-e20.el: Use 'make-obsolete for 'string-columns. + + * emu-e19.el, emu-nemacs.el, emu-x20.el: Abolish obsolete alias + `char-leading-char'. + +1998-04-09 MORIOKA Tomohiko + + * emu-e20.el, emu-mule.el, emu-nemacs.el, emu-e19.el: Abolish + obsolete alias `char-columns'. + + * emu-e19.el: Abolish constant `charset-ascii' and + `charset-iso8859-1'. + (charset-description): New implementation. + (charset-registry): New implementation. + (charset-width): Renamed from `charset-columns'; new + implementation. + (find-charset-string): New implementation. + (find-charset-region): New implementation. + (charsets-mime-charset-alist): New initial value. + (detect-mime-charset-region): New implementation. + (char-charset): New implementation. + + * emu-nemacs.el: Rename `charset-columns' -> `charset-width'. + + * emu-nemacs.el: Abolish constant `charset-ascii' and + `charset-jisx0208'. + Abolish constant `lc-ascii' and `lc-jp'. + (charset-description): New implementation. + (charset-registry): New implementation. + (charset-columns): New implementation. + (find-charset-string): New implementation. + (find-charset-region): New implementation. + (charsets-mime-charset-alist): New initial value. + (char-charset): New implementation. + +1998-04-09 MORIOKA Tomohiko + + * emu-e20.el, emu-x20.el, emu-e19.el, emu-mule.el, emu-nemacs.el + (char-next-index): New macro. + + +1998-03-26 MORIOKA Tomohiko + + * APEL: Version 7.6 was released. + + * std11.el: Require 'std11-parse when compile. + +1998-03-25 MORIOKA Tomohiko + + * calist.el (ctree-match-calist): Prefer normal choice than + default choice. + +1998-03-25 MORIOKA Tomohiko + + * emu-20.el (mime-charset-coding-system-alist): Use 'defcustom. + +1998-03-25 MORIOKA Tomohiko + + * emu-20.el: Require 'wid-edit when compile. + + +1998-03-25 MORIOKA Tomohiko + + * APEL: Version 7.5 was released. + +1998-03-24 MORIOKA Tomohiko + + * calist.el (calist-field-match-method-obarray): New variable. + (define-calist-field-match-method): New function. + (calist-default-field-match-method): New function. + (calist-field-match-method): New function. + (calist-field-match): New function. + (ctree-match-calist): Use `calist-field-match'. + + +1998-03-23 MORIOKA Tomohiko + + * APEL: Version 7.4 was released. + +1998-03-21 MORIOKA Tomohiko + + * emu-nemacs.el, emu-mule.el, emu-e19.el, emu-x20.el, emu-e20.el + (insert-file-contents-as-binary): Renamed from + `insert-binary-file-contents'; add `insert-binary-file-contents' + as obsolete alias. + +1998-03-21 MORIOKA Tomohiko + + * emu-e20.el (insert-binary-file-contents-literally): New alias + for `insert-file-contents-literally'. + + * emu-x20.el (insert-binary-file-contents-literally): Moved from + emu-20.el. + + * emu-20.el: Move `insert-binary-file-contents-literally' to + emu-x20.el. + +1998-03-21 MORIOKA Tomohiko + + * emu-e20.el (insert-binary-file-contents): Must save + `enable-multibyte-characters'. + + * emu-x20.el (insert-binary-file-contents): Moved from emu-20.el. + + * emu-20.el: Move `insert-binary-file-contents' to emu-x20.el. + + * calist.el (ctree-match-calist): Rename local variables. + + +1998-03-16 MORIOKA Tomohiko + + * APEL: Version 7.3 was released. + +1998-03-15 MORIOKA Tomohiko + + * APEL-ELS: Add calist.el. + + * calist.el: New module. + +1998-03-13 Katsumi Yamaoka + + * emu-mule.el (charsets-mime-charset-alist) fixed. + + +1998-03-13 MORIOKA Tomohiko + + * APEL: Version 7.2 was released. + +1998-03-11 MORIOKA Tomohiko + + * emu-nemacs.el, emu-mule.el, emu-e19.el, emu-20.el + (write-region-as-binary): New function. + +1998-03-11 MORIOKA Tomohiko + + * emu-nemacs.el, emu-mule.el, emu-e19.el, emu-20.el + (insert-binary-file-contents): New function. + +1998-03-08 Shuhei KOBAYASHI + + * README.en (Bug reports): Modify description of tm mailing list. + + +1998-02-12 MORIOKA Tomohiko + + * APEL: Version 7.1.1 was released. + + * README.en (Bug reports): Modify for APEL. + +1998-02-04 MORIOKA Tomohiko + + * std11.el (std11-msg-id-string): New function. + (std11-fill-msg-id-list-string): New function. + + * std11-parse.el (std11-parse-msg-id): New function. + +1998-01-10 MORIOKA Tomohiko + + * emu-x20.el: If coding-system `iso-2022-jp' unifies JIS X + 0201-Latin to ASCII and JIS X 0208-1978 to JIS X 0208-1983 by + code-point, copy coding-system `iso-2022-7bit' to `iso-2022-jp' to + avoid this problem. + + +1997-11-08 MORIOKA Tomohiko + + * APEL: Version 7.1 was released. + +1997-11-06 MORIOKA Tomohiko + + * README.en (What's APEL?): Rename file-detect.el -> path-util.el. + +1997-11-06 MORIOKA Tomohiko + + * install.el, filename.el (filename-filters): Use path-util.el + instead of file-detect.el. + + * path-util.el, file-detect.el, APEL-ELS: Rename file-detect.el -> + path-util.el (file name should be less than 13 bytes). + +1997-11-06 MORIOKA Tomohiko + + * emu-19.el (tl:make-overlay): New alias. + (tl:overlay-put): New alias. + (tl:overlay-buffer): New alias. + + +1997-11-05 MORIOKA Tomohiko + + * APEL: Version 4.2 was released. + +1997-11-05 MORIOKA Tomohiko + + * APEL-MK (config-apel): Regard LISPDIR. + +1997-11-05 MORIOKA Tomohiko + + * emu-19.el (tl:make-overlay): New obsolete function (for + tm-7.106). + (tl:overlay-put): New obsolete function (for tm-7.106). + (tl:overlay-buffer): New obsolete function (for tm-7.106). + + +1997-11-04 MORIOKA Tomohiko + + * APEL: Version 4.1 was released. + + * APEL-MK (compile-apel): Use `config-apel'; don't use + `add-to-list' for compatibility. + (install-apel): Don't call `config-apel' directly. + + * APEL-CFG: Add load-path setting. + +1997-11-04 MORIOKA Tomohiko + + * emu-20.el (mime-charset-list): New inline-function. + (widget-mime-charset-prompt-value-history): New variable. + (mime-charset): New widget. + (widget-mime-charset-prompt-value): New function. + (widget-mime-charset-action): New function. + (default-mime-charset): Use `defcustom'. + + * emu-20.el (default-mime-charset): Modify DOC-string. + + * emu-mule.el (charsets-mime-charset-alist): New implementation. + + * emu-e20.el (encode-mime-charset-region, + decode-mime-charset-region, encode-mime-charset-string, + decode-mime-charset-string): New function (copied from emu-20.el); + check `enable-multibyte-characters'. + + * emu-x20.el (encode-mime-charset-region, + decode-mime-charset-region, encode-mime-charset-string, + decode-mime-charset-string): New function (copied from emu-20.el). + + * emu-20.el: Move function `encode-mime-charset-region', + `decode-mime-charset-region', `encode-mime-charset-string' and + `decode-mime-charset-string' to emu-x20.el and emu-e20.el. + +1997-10-04 MORIOKA Tomohiko + + * emu-x20.el (charsets-mime-charset-alist): Use MIME charset + `iso-8859-5' for cyrillic. + + +1997-09-26 MORIOKA Tomohiko + + * APEL: Version 3.4.4 was released. + +1997-09-25 MORIOKA Tomohiko + + * std11-parse.el (std11-special-char-list): Fix order for regexp. + + +1997-09-25 MORIOKA Tomohiko + + * APEL: Version 3.4.3 was released. + + * README.en: Modify for Emacs 20. + +1997-09-25 MORIOKA Tomohiko + + * std11-parse.el (std11-special-char-list): New constant; abolish + `std11-special-chars'. + (std11-atom-regexp): Use it. + (std11-analyze-special): Use it; Don't use `find'. + + +1997-09-09 MORIOKA Tomohiko + + * APEL: Version 3.4.2 was released. + + * README.en (What's APEL?): Add emu-20.el. + +1997-09-07 MORIOKA Tomohiko + + * emu-20.el (mime-charset-to-coding-system): Use defsubst again; + modify implementation. + + * emu-20.el (mime-charset-to-coding-system): Use + `find-coding-system'. + + * emu-20.el (mime-charset-coding-system-alist): Use + `find-coding-system'. + + * emu-e20.el (find-coding-system): New inline function. + + * emu.el (defsubst-maybe): New macro. + +1997-09-03 MORIOKA Tomohiko + + * emu-20.el (mime-charset-to-coding-system): Use `defun' instead + of `defsubst'. + + +1997-09-02 MORIOKA Tomohiko + + * APEL: Version 3.4.1 was released. + +1997-08-30 MAEDA Shugo + + * emu-mule.el (decode-coding-region, encode-coding-string): New + function. + (decode-coding-string): Modify DOC-string. (cf. [cmail:3366]) + +1997-08-30 MORIOKA Tomohiko + + * emu.el (defconst-maybe): New macro. + + (emacs-major-version, emacs-minor-version): Use `defconst-maybe'. + + * emu.el (charsets-to-mime-charset): Abolish unused local variable + `csl'. + + * emu-e20.el, emu-20.el: Move function + `detect-mime-charset-region' from emu-e20.el to emu-20.el. + + * emu-20.el: Use `defsubst' for + `{encode|decode}-mime-charset-{region|string}'. + + * emu-e20.el (detect-mime-charset-region): Use + `find-charset-region'. + +1997-08-30 MORIOKA Tomohiko + + * emu-x20.el, emu-e20.el, emu-20.el: Move function + `{encode|decode}-mime-charset-{region|string}' from emu-e20.el and + emu-x20.el to emu-20.el. + + * emu-x20.el, emu-e20.el, emu-20.el: Move `default-mime-charset' + from emu-e20.el and emu-x20.el to emu-20.el. + +1997-08-30 MORIOKA Tomohiko + + * emu-20.el (mime-charset-coding-system-alist): Don't use + `coding-system-p' for symbol. + (mime-charset-to-coding-system): Ditto; modify DOC-string. + +1997-08-30 MORIOKA Tomohiko + + * emu-20.el (mime-charset-coding-system-alist): Check MIME charset + is defined as coding-system. + + * emu-x20.el, emu-e20.el, emu-20.el: Move + `mime-charset-coding-system-alist' from emu-e20.el and emu-x20.el + to emu-20.el. + + * emu-20.el (*noconv*): Add DOC-string. + +1997-08-30 MORIOKA Tomohiko + + * emu-20.el (mime-charset-to-coding-system): Check coding-system-p + even if CHARSET is found in `mime-charset-coding-system-alist'. + + * emu-x20.el: Use function `mime-charset-to-coding-system' in + emu-20.el. + + * emu-20.el (mime-charset-to-coding-system): Use `defsubst'. + + * emu-e20.el, emu-20.el: Move function + `mime-charset-to-coding-system' from emu-e20.el to emu-20.el. + +1997-08-30 MORIOKA Tomohiko + + * emu-x20.el, emu-e20.el, emu-20.el: Move features about Binary + accessing from emu-e20.el and emu-x20.el to emu-20.el. + + * EMU-ELS (emu-modules): Add emu-20 for Emacs 20 and XEmacs/mule. + +1997-08-30 MORIOKA Tomohiko + + * emu-x20.el (mime-charset-to-coding-system): Use `defsubst'. + + * emu-x20.el (default-mime-charset): Add DOC-string. + + (mime-charset-coding-system-alist): Add `us-ascii'. + +1997-08-25 MORIOKA Tomohiko + + * emu-x20.el (mime-charset-coding-system-alist): iso-2022-jp-2 is + defined as coding-system. + + +1997-07-14 MORIOKA Tomohiko + + * emu: Version 7.44 was released. + * APEL: Version 3.4 was released. + +1997-07-13 MORIOKA Tomohiko + + * emu-e20.el (mime-charset-coding-system-alist): `iso-2022-ss2-7' + -> `iso-2022-7bit-ss2'. (for Emacs 20.0.90) + +1997-07-13 MORIOKA Tomohiko + + * std11-parse.el (std11-parse-ascii-token): Allow non-ASCII + characters in comments. + +1997-06-28 MORIOKA Tomohiko + + * richtext.el: Add autoload comments for `richtext-encode' and + `richtext-decode'. + + * emu.el: Check richtext.el is bundled. + +1997-06-28 MORIOKA Tomohiko + + * file-detect.el: Add autoload comments for function `add-path', + `add-latest-path', `get-latest-path', `file-installed-p', + `exec-installed-p', `module-installed-p' and variable + `exec-suffix-list'. + +1997-06-08 MORIOKA Tomohiko + + * emu-x20.el (mime-charset-coding-system-alist): iso-8859-1, + hz-gb-2312, cn-gb-2312, gb2312, cn-big5 and koi8-r were defined as + coding-system. + + * emu-x20.el: Don't require cyrillic. + +Thu May 22 04:46:57 1997 MORIOKA Tomohiko + + * emu-mule.el (make-char): New alias. + + * emu-e20.el: Alias `make-character' was abolished. + +Sat May 10 19:39:12 1997 MORIOKA Tomohiko + + * README.en (What's APEL?): Add std11 and mule-caesar.el. + + +1997-05-09 MORIOKA Tomohiko + + * emu: Version 7.43.1 was released. + * APEL: Version 3.3.2 was released. + +Fri May 9 01:23:44 1997 MORIOKA Tomohiko + + * APEL-ELS: Add mule-caesar.el. + + * mule-caesar.el: New file. + +Thu May 8 22:21:36 1997 MORIOKA Tomohiko + + * emu-x20.el: Use `binary' instead of `no-conversion' temporary. + + +1997-04-30 MORIOKA Tomohiko + + * emu: Version 7.43 was released. + * APEL: Version 3.3.1 was released. + + * emu-x20.el: several changes for XEmacs 20.1-b12. + +Wed Apr 30 12:40:32 1997 MORIOKA Tomohiko + + * Makefile: add `release'. + +Mon Apr 28 16:47:30 1997 MORIOKA Tomohiko + + * Makefile: `TARFILE' was abolished. + +Tue Apr 8 09:47:40 1997 MORIOKA Tomohiko + + * emu.el (point-at-eol): New function. + +Sat Apr 5 16:23:23 1997 MORIOKA Tomohiko + + * emu-nemacs.el: `tl:available-face-attribute-alist' -> + `emu:available-face-attribute-alist'. + + * emu-nemacs.el, emu-mule.el: `tl:make-overlay' -> `make-overlay'; + `tl:overlay-put' -> `overlay-put'. + +Sat Apr 5 06:50:48 1997 MORIOKA Tomohiko + + * emu-xemacs.el: Alias `tl:make-overlay', `tl:overlay-put' and + `tl:overlay-buffer' were abolished; Function `tl:move-overlay' + were abolished. + + * emu-19.el: Alias `tl:make-overlay', `tl:overlay-put' and + `tl:overlay-buffer' were abolished. + + * emu-18.el: `tl:overlay-buffer' -> `overlay-buffer'. + + * emu-xemacs.el: Require overlay. + + * emu.el (char-or-char-int-p): New XEmacs 20 emulating alias. + + * emu.el (minibuffer-prompt-width): New function for Emacs 18 and + XEmacs. + +Thu Apr 3 17:14:39 1997 MORIOKA Tomohiko + + * APEL-ELS: std11.el and std11-parse.el were moved from mu/. + + +1997-03-20 MORIOKA Tomohiko + + * APEL: Version 3.3 was released. + + * APEL-CFG (EMU_PREFIX, EMU_DIR): New variables. + * APEL-MK: install emu. + +Thu Mar 20 06:09:03 1997 MORIOKA Tomohiko + + * Makefile: Add README.en. + +Thu Mar 20 06:08:29 1997 MORIOKA Tomohiko + + * file-detect.el: Header and DOC-strings were modified. + +Thu Mar 20 06:03:51 1997 MORIOKA Tomohiko + + * README.en: New file. + +Thu Mar 20 05:48:02 1997 MORIOKA Tomohiko + + * filename.el: Add DOC-strings. + + * APEL-MK (install-apel): Use `compile-apel'. + + * Makefile (install): Don't depend on `elc'. + +Thu Mar 20 02:04:19 1997 MORIOKA Tomohiko + + * APEL-MK: Setting for load-path and requiring install were moved + from APEL-CFG. + + (install-apel): Compile apel-modules. + + * APEL-CFG: Setting for load-path and requiring install were moved + to APEL-MK. + + +1997-03-14 MORIOKA Tomohiko + + * APEL: Version 3.2 was released. + +Fri Mar 14 09:54:04 1997 MORIOKA Tomohiko + + * file-detect.el (get-latest-path): Check directory is exist or not. + +Fri Mar 14 09:25:15 1997 MORIOKA Tomohiko + + * APEL-ELS: Add install.el. + +Fri Mar 14 07:24:37 1997 MORIOKA Tomohiko + + * Makefile, APEL-MK, APEL-CFG: New file. + +1997-03-10 MORIOKA Tomohiko + + * atype.el (field-unify): fixed. + +1997-03-10 MORIOKA Tomohiko + + * filename.el (filename-filters): Use `exec-installed-p' instead + of `file-installed-p' to search "kakasi". + +1997-03-10 MORIOKA Tomohiko + + * file-detect.el (module-installed-p): Use function + `exec-installed-p'. + + * file-detect.el (exec-suffix-list): New variable. + (exec-installed-p): New function. + +1997-03-04 MORIOKA Tomohiko + + * APEL-ELS (apel-modules): Add filename.el. + + * APEL-ELS: Initial revision + +1997-03-04 MORIOKA Tomohiko + + * filename.el (filename-replacement-alist): Don't use function + `string-to-char-list' and `expand-char-ranges'; Don't require + tl-str. + (filename-special-filter): Use function `assoc-if' instead of + `ASSOC'; Require cl instead of tl-list. + (poly-funcall): New inline-function; copied from tl-list.el. + +1997-03-03 MORIOKA Tomohiko + + * atype.el: Alias `fetch-field', `fetch-field-value', `put-field' + and `delete-field' were abolished. + + Don't require tl-str and tl-list. + + Require alist. + + (field-unify): Don't use function `symbol-concat'. + (assoc-unify): Use function `assoc' directly; use function + `put-alist' directly; use function `del-alist' directly. + + * atype.el: Function `put-fields' was abolished. + + * atype.el: tl-atype.el was renamed to atype.el. + +1997-03-03 MORIOKA Tomohiko + + * atype.el: tl-atype.el was renamed to atype.el. + +1997-03-03 MORIOKA Tomohiko + + * file-detect.el (file-installed-p): Fixed DOC-string. + +1997-02-28 Tomohiko Morioka + + * alist.el: New module; separated from tl-list.el. diff --git a/apel-10.7/EMU-ELS b/apel-10.7/EMU-ELS new file mode 100644 index 0000000..e8575a4 --- /dev/null +++ b/apel-10.7/EMU-ELS @@ -0,0 +1,220 @@ +;;; EMU-ELS --- list of EMU modules to install. -*-Emacs-Lisp-*- + +;;; Commentary: + +;; APEL-MK imports `emu-modules' and `emu-modules-to-compile' from here. + +;;; Code: + +(defvar emu-modules-not-to-compile nil) +(defvar emu-modules-to-compile nil) + +;; We use compile-time evaluation heavily. So, order of compilation is +;; very significant. For example, loading some module before compiling +;; it will cause "compile-time" evaluation many times. +(defvar emu-modules + (nconc + ;; modules are sorted by compilation order. + '(static broken) + + ;; product information. + '(product apel-ver) + + ;; poe modules; poe modules depend on static. + '(pym) + (cond + ;; XEmacs. + ((featurep 'xemacs) + '(poe-xemacs poe)) + ;; Emacs 19.29 and earlier. (yes, includes Emacs 19.29.) + ((and (= emacs-major-version 19) + (<= emacs-minor-version 29)) + '(localhook poe)) + ;; Emacs 19.30 and later. + ((>= emacs-major-version 19) + '(poe)) + (t + ;; v18. + '(localhook env poe-18 poe))) + + ;; pcustom modules; pcustom modules depend on poe. + (if (and (module-installed-p 'custom) + ;; new custom requires widget. + (module-installed-p 'widget)) + ;; if both 'custom and 'widget are found, we have new custom. + '(pcustom) + ;; pcustom does (require 'custom) at compile-time, and tinycustom + ;; need to test existence of some custom macros at compile-time! + ;; so, we must compile tinycustom first. + '(tinycustom pcustom)) + + ;; pccl modules; pccl modules depend on broken. + (cond + ((featurep 'xemacs) + (cond + ;; XEmacs 21 w/ mule. + ((and (featurep 'mule) + (>= emacs-major-version 21)) + '(pccl-20 pccl)) + (t + '(pccl)))) + ((featurep 'mule) + (cond + ;; Emacs 20. + ((>= emacs-major-version 20) + '(pccl-20 pccl)) + ;; Mule 1.* and 2.*. + (t + '(pccl-om pccl)))) + (t + '(pccl))) + + ;; pces modules; pces modules depend on poe. + (cond + ((featurep 'xemacs) + (cond + ((featurep 'mule) + ;; XEmacs w/ mule. + ;; pces-xfc depends pces-20, so we compile pces-20 first. + '(pces-20 pces-xm pces-xfc pces)) + ((featurep 'file-coding) + ;; XEmacs w/ file-coding. + ;; pces-xfc depends pces-20, so we compile pces-20 first. + '(pces-20 pces-xfc pces)) + (t + '(pces-raw pces)))) + ((featurep 'mule) + (cond + ;; Emacs 20.3 and later. + ((and (fboundp 'set-buffer-multibyte) + (subrp (symbol-function 'set-buffer-multibyte))) + ;; pces-e20 depends pces-20, so we compile pces-20 first. + '(pces-20 pces-e20 pces)) + ;; Emacs 20.1 and 20.2. + ((= emacs-major-version 20) + ;; pces-e20 depends pces-20, so we compile pces-20 first. + '(pces-20 pces-e20_2 pces-e20 pces)) + (t + ;; Mule 1.* and 2.*. + '(pces-om pces)))) + ((boundp 'NEMACS) + ;; Nemacs. + '(pces-nemacs pces)) + (t + '(pces-raw pces))) + + ;; poem modules; poem modules depend on pces. + (cond + ((featurep 'mule) + (cond + ((featurep 'xemacs) + ;; XEmacs w/ mule. + '(poem-xm poem)) + ((>= emacs-major-version 20) + (if (and (fboundp 'set-buffer-multibyte) + (subrp (symbol-function 'set-buffer-multibyte))) + ;; Emacs 20.3 and later. + '(poem-e20_3 poem-e20 poem) + ;; Emacs 20.1 and 20.2. + '(poem-e20_2 poem-e20 poem))) + (t + ;; Mule 1.* and 2.*. + '(poem-om poem)))) + ((boundp 'NEMACS) + '(poem-nemacs poem)) + (t + '(poem-ltn1 poem))) + + ;; mcharset modules; mcharset modules depend on poem and pcustom. + (cond + ((featurep 'mule) + (cond + ((featurep 'xemacs) + ;; XEmacs w/ mule. + (if (featurep 'utf-2000) + ;; XEmacs w/ UTF-2000. + (setq emu-modules-not-to-compile + (cons 'mcs-xmu emu-modules-not-to-compile))) + ;; mcs-xm depends mcs-20, so we compile mcs-20 first. + '(mcs-20 mcs-xmu mcs-xm mcharset)) + ((>= emacs-major-version 20) + ;; Emacs 20 and later. + ;; mcs-e20 depends mcs-20, so we compile mcs-20 first. + '(mcs-20 mcs-e20 mcharset)) + (t + ;; Mule 1.* and 2.*. + '(mcs-om mcharset)))) + ((boundp 'NEMACS) + ;; Nemacs. + '(mcs-nemacs mcharset)) + (t + '(mcs-ltn1 mcharset))) + + ;; timezone.el; Some versions have Y2K problem. + (condition-case nil + (let ((load-path (delete (expand-file-name ".") + (copy-sequence load-path)))) + ;; v18 does not have timezone.el. + (require 'timezone) + ;; Is timezone.el APEL version? + (if (product-find 'timezone) + (error "timezone.el is APEL version. Install newer version.")) + ;; Y2K test. + (or (string= (aref (timezone-parse-date "Sat, 1 Jan 00 00:00:00 GMT") + 0) + "2000") + (error "timezone.el has Y2K problem. Install fixed version.")) + ;; Old parser test. + (if (string= + (aref (timezone-parse-date "Wednesday, 31-Jan-01 09:00:00 GMT") + 0) + "0") + (error "timezone.el has old date parser. Install fixed version.")) + ;; no problem. + '()) + (error + '(timezone))) + + ;; invisible modules; provided for backward compatibility with old "tm". + (cond + ((featurep 'xemacs) + ;; XEmacs. + '(inv-xemacs invisible)) + ((>= emacs-major-version 19) + ;; Emacs 19 and later. + '(inv-19 invisible)) + (t + ;; v18. + '(inv-18 invisible))) + + ;; emu modules; provided for backward compatibility with old "tm". + (if (and (featurep 'mule) + (< emacs-major-version 20)) + ;; Mule 1.* and 2.*. + '(emu-mule emu) + '(emu)) + + ;; emu submodules; text/richtext and text/enriched support. + (if (if (featurep 'xemacs) + (or (>= emacs-major-version 20) + (and (= emacs-major-version 19) + (>= emacs-minor-version 14))) + (or (>= emacs-major-version 20) + (and (= emacs-major-version 19) + (>= emacs-minor-version 29)))) + ;; XEmacs 19.14 and later, or Emacs 19.29 and later. + '(richtext) + '(tinyrich)) + + ;; mule-caesar.el; part of apel-modules, but it is version-dependent. + '(mule-caesar))) + +;; Generate `emu-modules-to-compile' from `emu-modules-not-to-compile' +;; and `emu-modules'. +(let ((modules emu-modules-not-to-compile)) + (setq emu-modules-to-compile (copy-sequence emu-modules)) + (while modules + (setq emu-modules-to-compile (delq (car modules) emu-modules-to-compile) + modules (cdr modules)))) + +;;; EMU-ELS ends here diff --git a/apel-10.7/Makefile b/apel-10.7/Makefile new file mode 100644 index 0000000..a3329db --- /dev/null +++ b/apel-10.7/Makefile @@ -0,0 +1,67 @@ +# +# Makefile for APEL. +# + +VERSION = 10.7 + +TAR = tar +RM = /bin/rm -f +CP = /bin/cp -p + +EMACS = emacs +XEMACS = xemacs +FLAGS = -batch -q -no-site-file -l APEL-MK + +PREFIX = NONE +LISPDIR = NONE +PACKAGEDIR = NONE +VERSION_SPECIFIC_LISPDIR = NONE + +GOMI = *.elc + +ARCHIVE_DIR_PREFIX = /home/kanji/tomo/public_html/lemi/dist + +default: elc + +what-where: + $(EMACS) $(FLAGS) -f what-where-apel \ + $(PREFIX) $(LISPDIR) $(VERSION_SPECIFIC_LISPDIR) + +elc: + $(EMACS) $(FLAGS) -f compile-apel \ + $(PREFIX) $(LISPDIR) $(VERSION_SPECIFIC_LISPDIR) + +install: elc + $(EMACS) $(FLAGS) -f install-apel \ + $(PREFIX) $(LISPDIR) $(VERSION_SPECIFIC_LISPDIR) # $(MAKE) + +package: + $(XEMACS) $(FLAGS) -f compile-apel-package \ + $(PACKAGEDIR) + +install-package: package + $(XEMACS) $(FLAGS) -f install-apel-package \ + $(PACKAGEDIR) # $(MAKE) + + +clean: + -$(RM) $(GOMI) + + +tar: + cvs commit + sh -c 'cvs tag -R apel-`echo $(VERSION) \ + | sed s/\\\\./_/ | sed s/\\\\./_/`; \ + cd /tmp; \ + cvs -d :pserver:anonymous@cvs.m17n.org:/cvs/root \ + export -d apel-$(VERSION) \ + -r apel-`echo $(VERSION) | tr . _` apel' + cd /tmp; $(RM) apel-$(VERSION)/ftp.in apel-$(VERSION)/.cvsignore ; \ + $(TAR) cvzf apel-$(VERSION).tar.gz apel-$(VERSION) + cd /tmp; $(RM) -r apel-$(VERSION) + sed "s/VERSION/$(VERSION)/" < ftp.in > ftp + +release: + -$(RM) $(ARCHIVE_DIR_PREFIX)/apel/apel-$(VERSION).tar.gz + mv /tmp/apel-$(VERSION).tar.gz $(ARCHIVE_DIR_PREFIX)/apel + cd $(ARCHIVE_DIR_PREFIX)/semi/ ; ln -s ../apel/apel-$(VERSION).tar.gz . diff --git a/apel-10.7/README.en b/apel-10.7/README.en new file mode 100644 index 0000000..20bf5ca --- /dev/null +++ b/apel-10.7/README.en @@ -0,0 +1,492 @@ +-*- outline -*- + +[README for APEL (English Version)] + +* What's APEL? + +APEL stands for "A Portable Emacs Library". It consists of following +modules: + +** poe.el + +This is an emulation module mainly for basic functions and special +forms/macros of latest emacsen. + + poe-xemacs.el --- for XEmacs + poe-18.el --- for Emacs 18/Nemacs + env.el --- env.el for Emacs 18 + localhook.el --- hook functions for Emacs 19.28 and earlier. + pym.el --- macros for poe. + +** poem.el + +This module provides basic functions to write portable MULE programs. + + poem-nemacs.el --- for Nemacs + poem-ltn1.el --- for Emacs 19/XEmacs without MULE + poem-om.el --- for MULE 1.*, 2.* + poem-20.el --- shared module between Emacs 20 and XEmacs-MULE + poem-e20_2.el --- for Emacs 20.1/20.2 + poem-e20_3.el --- for Emacs 20.3 + poem-xm.el --- for XEmacs-MULE + +** pces.el + +This module provides portable character encoding scheme +(coding-system) features. + + pces-20.el --- for Emacs 20 and XEmacs with coding-system. + pces-e20.el --- for Emacs 20. + pces-e20_2.el --- for Emacs 20.1 and 20.2. + pces-nemacs.el --- for Nemacs. + pces-om.el --- for Mule 1.* and Mule 2.*. + pces-raw.el --- for emacsen without coding-system features. + pces-xfc.el --- for XEmacs with file coding. + pces-xm.el --- for XEmacs-mule. + +** invisible.el + +This modules provides features about invisible region. + + inv-18.el --- for Emacs 18 + inv-19.el --- for Emacs 19 + inv-xemacs.el --- for XEmacs + +** mcharset.el + +This modules provides MIME charset related features. + + mcs-nemacs.el --- for Nemacs + mcs-ltn1.el --- for Emacs 19/XEmacs without MULE + mcs-om.el --- for MULE 1.*, 2.* + mcs-20.el --- shared module between Emacs 20 and XEmacs-MULE + mcs-e20.el --- for Emacs 20 + mcs-xm.el --- for XEmacs-MULE + mcs-xmu.el --- for XEmacs-MULE to unify ISO646 characters + +** static.el --- utility for static evaluation + +** broken.el --- provide information of broken facilities of Emacs + +** pccl.el --- utility to write portable CCL program + + pccl-om.el --- for MULE 2.* + pccl-20.el --- for Emacs 20/XEmacs-21-MULE + +** alist.el: utility for Association-list + +** calist.el: utility for condition tree and condition/situation-alist + +** path-util.el: utility for path management or file detection + +** filename.el: utility to make file-name + +** install.el: utility to install emacs-lisp package + +** mule-caesar.el: ROT 13-47-48 Caesar rotation utility + +** emu.el + +This module provides emu bundled in tm-7.106 compatibility. It +required poe, poem and mcharset. + + emu-mule: --- for MULE 1.*, 2.*. + richtext.el --- text/richtext module for Emacs 19.29 or later, + XEmacs 19.14 or later + tinyrich.el --- text/richtext module for old emacsen + +** pcustom.el --- provide portable custom environment + + tinycustom.el --- emulation module of custom.el + +** timezone.el + +This is a utility of time zone. This is a Y2K fixed version. This +works with old GNUS 3.14.4 under version 18 of Emacs, too. + +** product.el --- Functions for product version information. + +* Installation + +** run in expanded place + +If you don't want to install other directories, please do only +following (You can use make.bat for MS-DOS OS family. If you want to +use it, see `make.bat (for MS-DOS family)'): + + % make + +You can specify the emacs command name, for example + + % make EMACS=xemacs + +If `EMACS=...' is omitted, EMACS=emacs is used. + +** make install + +If you want to install other directories, please do following: + + % make install + +You can specify the emacs command name, for example + + % make install EMACS=xemacs + +If `EMACS=...' is omitted, EMACS=emacs is used. + +You can specify the prefix of the directory tree for Emacs Lisp +programs and shell scripts, for example: + + % make install PREFIX=~/ + +If `PREFIX=...' is omitted, the prefix of the directory tree of the +specified emacs command is used (perhaps /usr/local). + +For example, if PREFIX=/usr/local and Emacs 20.2 is specified, it +will create the following directory tree: + + /usr/local/share/emacs/20.2/site-lisp/ --- emu + /usr/local/share/emacs/site-lisp/apel/ --- APEL + +You can specify the lisp directory for Emacs Lisp programs, +for example: + + % make install LISPDIR=~/elisp + +You can also specify the version specific lisp directory where the +emu modules will be installed in, for example: + + % make install VERSION_SPECIFIC_LISPDIR=~/elisp + +If you would like to know what files belong to the emu modules or +the apel modules, or where they will be installed in, for example, +please type the following command. + + % make what-where LISPDIR=~/elisp VERSION_SPECIFIC_LISPDIR=~/elisp + +You can specify other optional settings by editing the file +APEL-CFG. Please read comments in it. + +** install as a XEmacs package + +If you want to install to XEmacs package directory, please do +following: + + % make install-package + +You can specify the emacs command name, for example + + % make install-package XEMACS=xemacs-21 + +If `XEMACS=...' is omitted, XEMACS=xemacs is used. + +You can specify the package directory, for example: + + % make install PACKAGEDIR=~/.xemacs + +If `PACKAGEDIR=...' is omitted, the first existing package +directory is used. + +Notice that XEmacs package system requires XEmacs 21.0 or later. + + +** make.bat (for MS-DOS family) + +make.bat is available for MS-DOS family. You have to edit +make.bat if you want to use it. If you use cygwin environment, +you can use make.exe and Makefile instead of make.bat. + +In make.bat, a line which contain `rem' in its beginning is a +comment. You have to insert or delete `rem', if necessary. + +Default setups of make.bat is; + + set MEADOWVER=1.10 + set PREFIX=c:\usr\meadow + set EMACS=%PREFIX%\%MEADOWVER%\bin\meadow95.exe + set LISPDIR=%PREFIX%\site-lisp + set VLISPDIR=%PREFIX%\%MEADOWVER%\site-lisp + +It assumes that meadow executable binary exists in +c:\usr\meadow\1.10\bin\meadow95.exe. On such basis make.bat will +try to install meadow version independent modules of APEL to; + + c:\usr\meadow\site-lisp + +and meadow version dependent modules to; + + c:\usr\meadow\1.10\site-lisp + +Please edit make.bat for your own environment and run make.bat + +Emacs 19.3x or earlier does not have (e.x. Mule for Windows based on +19.28) an Emacs version dependent site-lisp directory +(e.x. c:\usr\meadow\1.10\site-lisp), and its load-path does not refer +to such directory by default. If you want install APEL to such an Emacs +you may install all APEL modules to an Emacs version independent +site-lisp directory such as c:\usr\mule\site-lisp. + +We cannot provide you with a Demacs example for make.bat. If you install +APEL to Demacs, please send us such an example to apel-en@m17n.org (you +can post a message to the ML, even if you are not a member). + +If you checkout APEL by using Windows native cvs.exe (not cygwin +version), cvs.exe will regularize end of line codes, LF to CRLF. And +it also will try to convert CRLF to CRCRLF. make.bat of which eol +code is CRCRLF does not work, so if you get such a make.bat, edit it +to really regularize eol codes to CRLF. If you need further +information, see the following URL (n.b. Japanese only) + + http://openlab.ring.gr.jp/skk/cvswin-ja.html + +* load-path (for Emacs or MULE) + +If you are using Emacs or Mule, please add directory of apel to +load-path. If you install by default setting with Emacs 19.29 or +later or Emacs 20.1/20.2, you can write subdirs.el for example: + +-------------------------------------------------------------------- +(normal-top-level-add-to-load-path '("apel")) +-------------------------------------------------------------------- + +If you are using Emacs 20.3 or later or XEmacs, there are no need to +set up load-path with normal installation. + + +* Version specific information + +** For Emacs 18 users: "old byte-compiler" vs "new byte-compiler" + +In this package, we use compile-time evaluation heavily. +Unfortunately, the byte-compiler bundled with Emacs 18 (the "old +byte-compiler") does not have features such as `eval-when-compile' +and `eval-and-compile', and our emulation version of these macros +evaluate "compile-time evaluation" at load-time or at run-time! +In addition, the "old byte-compiler" cannot compile top-level use of +macros and leaves most of our code uncompiled. + +Therefore, we recommend you to use the "new" optimizing byte-compiler. +It is the origin of byte-compiler bundled with Emacs 19 and later. + +Optimizing byte-compiler for Emacs 18 is available from the Emacs +Lisp Archive and its mirrors. + +In Mule 1.* days, "contrib" package for Mule 1.* was distributed and +it contained the "new byte-compiler" for Mule. But, I think it is +difficult to obtain this package now. + +AFAIK, the "new byte-compiler" for Emacs 18 is also bundled with SKK +9.6 or SKK 10.62a. You can get SKK 10.62a from the following URL; + + http://openlab.ring.gr.jp/skk/maintrunk + +They include patch for Mule 1.*. + + +** For Emacs 19.34 and XEmacs 19.14 users: "old custom" vs "new custom" + +"custom" library bundled with Emacs 19.32 - 19.34, XEmacs 19.14, and +Gnus 5.2/5.3 is "old", its API is incompatible with "new custom" +bundled with Emacs 20.1, XEmacs 19.15, or newer, and Gnus 5.4/5.5. + +"new custom" for Emacs 19.34 and XEmacs 19.15 - 20.2 is available +from the following URL. + +ftp://ftp.dina.kvl.dk/pub/Staff/Per.Abrahamsen/custom/custom-1.9962.tar.gz + +(Note that "new custom" bundled with XEmacs 19.15 - 20.2, and Gnus +5.4/5.5 is older than this version.) + +Before installing "new custom", you should check the following points. + + 1) If you stick to Gnus 5.2/5.3 (or any other applications which + use "old custom"), you should not install "new custom". + + 2) If you use Mule (based on Emacs 19), you must apply this patch + to "new custom". + +----8<------8<------8<------8<------8<------8<------8<------8<---- +--- custom-1.9962/cus-face.el~ Wed Mar 4 19:52:39 1998 ++++ custom-1.9962/cus-face.el Mon Mar 9 08:05:33 1998 +@@ -96,7 +96,7 @@ + "Define a new FACE on all frames, ignoring X resources." + (interactive "SMake face: ") + (or (internal-find-face name) +- (let ((face (make-vector 8 nil))) ++ (let ((face (make-vector face-vector-length nil))) + (aset face 0 'face) + (aset face 1 name) + (let* ((frames (frame-list)) +----8<------8<------8<------8<------8<------8<------8<------8<---- + + 3) Applications compiled with "custom" require the same version of + "custom" at load-time (and run-time). Therefore, if you use "new + custom", you must always include "new custom" in your load-path. + The easiest way to achieve this is "subdirs.el"; if you installed + "new custom" in "/usr/local/share/emacs/19.34/site-lisp/custom/", + put the following line to "/usr/local/share/emacs/19.34/site-lisp/subdirs.el". + + (normal-top-level-add-to-load-path '("custom")) + + +* How to use + +** alist + +*** Function put-alist (ITEM VALUE ALIST) + +Modify ALIST to set VALUE to ITEM. If there is a pair whose car is +ITEM, replace its cdr by VALUE. If there is not such pair, create +new pair (ITEM . VALUE) and return new alist whose car is the new +pair and cdr is ALIST. + +*** Function del-alist (ITEM ALIST) + +If there is a pair whose key is ITEM, delete it from ALIST. + +*** Function set-alist (SYMBOL ITEM VALUE) + +Modify a alist indicated by SYMBOL to set VALUE to ITEM. + + Ex. (set-alist 'auto-mode-alist "\\.pln$" 'text-mode) + +*** Function modify-alist (MODIFIER DEFAULT) + +Modify alist DEFAULT into alist MODIFIER. + +*** Function set-modified-alist (SYMBOL MODIFIER) + +Modify a value of a SYMBOL into alist MODIFIER. The SYMBOL should be +alist. If it is not bound, its value regard as nil. + +** path-util + +*** Function add-path (PATH &rest OPTIONS) + +Add PATH to `load-path' if it exists under `default-load-path' +directories and it does not exist in `load-path'. + +You can use following PATH styles: + + load-path relative: "PATH" (it is searched from `default-load-path') + + home directory relative: "~/PATH" "~USER/PATH" + + absolute path: "/FOO/BAR/BAZ" + +You can specify following OPTIONS: + + 'all-paths --- search from `load-path' instead of + `default-load-path' + + 'append --- add PATH to the last of `load-path' + +*** Function add-latest-path (PATTERN &optional ALL-PATHS) + +Add latest path matched by regexp PATTERN to `load-path' if it +exists under `default-load-path' directories and it does not exist +in `load-path'. + +For example, if there is bbdb-1.50 and bbdb-1.51 under site-lisp, +and if bbdb-1.51 is newer than bbdb-1.50, and site-lisp is +/usr/local/share/emacs/site-lisp, + + (add-latest-path "bbdb") + +it adds "/usr/local/share/emacs/site-lisp/bbdb-1.51" to top of +`load-path'. + +If optional argument ALL-PATHS is specified, it is searched from all +of `load-path' instead of `default-load-path'. + +*** Function get-latest-path (PATTERN &optional ALL-PATHS) + +Return latest directory in default-load-path which is matched to +regexp PATTERN. If optional argument ALL-PATHS is specified, it is +searched from all of load-path instead of default-load-path. + + Ex. (let ((gnus-path (get-latest-path "gnus"))) + (add-path (expand-file-name "lisp" gnus-path)) + (add-to-list 'Info-default-directory-list + (expand-file-name "texi" gnus-path))) + +*** Function file-installed-p (FILE &optional PATHS) + +Return absolute-path of FILE if FILE exists in PATHS. If PATHS is +omitted, `load-path' is used. + +*** Function exec-installed-p (FILE &optional PATHS SUFFIXES) + +Return absolute-path of FILE if FILE exists in PATHS. If PATHS is +omitted, `exec-path' is used. If SUFFIXES is omitted, +`exec-suffix-list' is used. + +*** Function module-installed-p (MODULE &optional PATHS) + +Return non-nil if MODULE is provided or exists in PATHS. If PATHS is +omitted, `load-path' is used. + +** filename + +*** Function replace-as-filename (string) + +Return safety file-name from STRING. + +It refers variable `filename-filters'. It is list of functions for +file-name filter. Default filter refers following variables: + +**** Variable filename-limit-length + +Limit size of file-name. + +**** Variable filename-replacement-alist + +Alist list of characters vs. string as replacement. List of +characters represents characters not allowed as file-name. + +* Bug reports + +If you write bug-reports and/or suggestions for improvement, please +send them to the APEL Mailing List: + + apel-en@m17n.org (English) + apel-ja@m17n.org (Japanese) + +Via the APEL ML, you can report APEL bugs, obtain the latest release +of APEL, and discuss future enhancements to APEL. To join the APEL +ML, send an empty e-mail to + + apel-en-ctl@m17n.org (English) + apel-ja-ctl@m17n.org (Japanese) + + +* Anonymous FTP + +Latest release of APEL can be obtained from: + + ftp://ftp.m17n.org/pub/mule/apel/ + + +* CVS + +Development of APEL uses CVS. So latest developing version is +available at CVS. + +** cvs login (first time only) + + % cvs -d :pserver:anonymous@cvs.m17n.org:/cvs/root login + + CVS password: [CR] # NULL string + +** checkout + + % cvs -d :pserver:anonymous@cvs.m17n.org:/cvs/root checkout apel + + If you would like to join CVS based development, please send mail to + + cvs@cvs.m17n.org + +with your account name and your public key for ssh. cvsroot is +:ext:cvs@cvs.m17n.org:/cvs/root. + +We hope you will join the open development. diff --git a/apel-10.7/README.ja b/apel-10.7/README.ja new file mode 100644 index 0000000..50af252 --- /dev/null +++ b/apel-10.7/README.ja @@ -0,0 +1,585 @@ +-*- outline -*- + +[APEL $B$N(B README ($BF|K\8lHG(B)] + +* APEL $B$H$O!)(B + +APEL $B$O(B "A Portable Emacs Library." $B$NN,$G$9!#$3$l$O0J2<$N%b%8%e!<%k$G(B +$B9=@.$5$l$F$$$^$9(B: + +** poe.el + +$B2A$N$?$a$N%f!<%F%#%j%F%#!<(B + +** broken.el --- Emacs $B$N2u$l$F$$$k5!G=$N>pJs$rDs6!$9$k(B + +** pccl.el --- $B0\?"2DG=$J(B CCL $B%W%m%0%i%`$r=q$/$?$a$N%f!<%F%#%j%F%#!<(B + + pccl-om.el --- MULE 2.* $BMQ(B + pccl-20.el --- Emacs 20/XEmacs-21-MULE $BMQ(B + +** alist.el: $BO"A[%j%9%H$N$?$a$N%f!<%F%#%j%F%#!<(B + +** calist.el: $B>uBVLZ$H>uBV(B/$B>u67O"A[%j%9%HMQ$N%f!<%F%#%j%F%#!<(B + +** path-util.el: $B%Q%94IM}$H%U%!%$%kC5:w$N$?$a$N%f!<%F%#%j%F%#!<(B + +** filename.el:$B%U%!%$%kL>$r:n$k$?$a$N%f!<%F%#%j%F%#(B + +** install.el: emacs-lisp $B%Q%C%1!<%8%$%s%9%H!<%k$9$k$?$a$N%f!<%F%#%j%F%#!<(B + +** mule-caesar.el: ROT 13-47-48 Caesar $BJQ49$N%f!<%F%#%j%F%#!<(B + +** emu.el + +tm-7.106 $B$KF~$C$F$$$?(B emu $B$H$N8_49@-$rJ]$D$?$a$N%b%8%e!<%k!#(Bpoe, poem, +mcharset $B$r(B require $B$9$k!#(B + + emu-mule: MULE 1.*, 2.* $BMQ(B + + richtext.el --- Emacs 19.29 $B$+$=$l0J9_(B XEmacs 19.14 $B$+$=$l0J9_$N$?(B + $B$a$N(B text/richtext $B%b%8%e!<%k(B + tinyrich.el --- $B8E$$(B emacs $B4D6-$N$?$a$N(B text/richtext $B%b%8%e!<%k(B + +** pcustom.el --- $B0\?"@-$N9b$$(B custom $B4D6-$rDs6!$9$k(B + + tinycustom.el --- custom.el $B$N%(%_%e%l!<%7%g%s$r9T$J$&(B + +** timezone.el + +$B%?%$%`%>!<%s%f!<%F%#%j%F%#!#(B2000 $BG/LdBjBP1~HG!#(BEmacs 18 $B$H(B GNUS 3.14.4 +$B$G$bF0:n2D!#(B + +** product.el --- $B%W%m%@%/%H$N%P!<%8%g%s>pJs$N$?$a$N5!G=$rDs6!$9$k%b%8%e!<%k!#(B + + +* $B%$%s%9%H!<%k(B + +** $BE83+$7$?>l=j$G$N%G%#%l%/%H%j!<$K%$%s%9%H!<%k$7$?$/$J$$$J$i!"0J2<$N$3$H$@$1$r$d$C$F(B +$B$/$@$5$$(B (MS-DOS $B7O$N(B OS $B$N$?$a$K(B MAKEIT.BAT $B$,MQ0U$5$l$F$$$^$9!#(B +MAKEIT.BAT $B$NMxMQ$K$D$$$F$O2<5-!V(BMAKEIT.BAT $B$rMxMQ$9$k(B (MS-DOS $B7O(B OS +$B$N>l9g(B)$B!W$r;2>H$7$F2<$5$$(B)$B!#(B: + + % make + +emacs $B$N%3%^%s%IL>$r;XDj$9$k$3$H$,$G$-$^$9!#Nc$($P!"(B + + % make EMACS=xemacs + +`EMACS=...' $B$,>JN,$5$l$k$H!"(BEmacs=emacs $B$,;H$o$l$^$9!#(B + +** make install + +$BB>$N%G%#%l%/%H%j!<$K%$%s%9%H!<%k$7$?$$$J$i!"0J2<$N$3$H$r$7$F$/$@$5$$(B: + + % make install + +emacs $B$N%3%^%s%IL>$r;XDj$9$k$3$H$,$G$-$^$9!#Nc$($P!"(B + + % make install EMACS=xemacs + +`EMACS=...' $B$,>JN,$5$l$k$H!"(BEmacs=emacs $B$,;H$o$l$^$9!#(B + +Emacs Lisp $B%W%m%0%i%`$H%7%'%k%9%/%j%W%H$N$?$a$N%G%#%l%/%H%j!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 + +$BNc$($P!"(BPREFIX=/usr/local $B$H(B Emacs 20.2 $B$,;XDj$5$l$l$P!"0J2<$N%G%#%l%/(B +$B%H%j!$NA*Br<+M3$J@_Dj$r;XDj$9$k$3$H$,$G(B +$B$-$^$9!#$=$NCf$N%3%a%s%H$rFI$s$G$/$@$5$$!#(B + +** XEmacs $B$N%Q%C%1!<%8$H$7$F%$%s%9%H!<%k$9$k(B + +XEmacs $B$N%Q%C%1!<%8%G%#%l%/%H%j!<$K%$%s%9%H!<%k$9$k>l9g$O!"0J2<$N$3$H(B +$B$r$7$F$/$@$5$$(B: + + % make install-package + +emacs $B$N%3%^%s%IL>$r;XDj$9$k$3$H$,$G$-$^$9!#Nc$($P!"(B + + % make install-package XEMACS=xemacs-21 + +`XEMACS=...' $B$,>JN,$5$l$k$H!"(BXEMACS=xemacs $B$,;HMQ$5$l$^$9!#(B + +$B%Q%C%1!<%8$N%G%#%l%/%H%j!<$r;XDj$9$k$3$H$,$G$-$^$9!#Nc$($P(B: + + % make install PACKAGEDIR=~/.xemacs + +`PACKAGEDIR=...' $B$,>JN,$5$l$k$H!"B8:_$9$k%Q%C%1!<%8%G%#%l%/%H%j!<$N:G(B +$B=i$N$b$N$,;H$o$l$^$9!#(B + +XEmacs $B$N%Q%C%1!<%8%7%9%F%`$O(B XEmacs 21.0 $B$+$=$l0J9_$rMW5a$9$k$3$H$KCm(B +$B0U$7$F$/$@$5$$!#(B + +** MAKEIT.BAT $B$rMxMQ$9$k(B (MS-DOS $B7O(B OS $B$N>l9g(B) + +MS-DOS $B7O$N(B OS $B$N$?$a$K(B MAKEIT.BAT $B$H(B MAKE1.BAT $B$,MQ0U$5$l$F$$$^$9(B +(cygwin $B4D6-$rMxMQ$7$F$$$kJ}$O(B make.exe $B$H(B Makefile $B$rMxMQ$9$k$3$H$,$G(B +$B$-$^$9(B)$B!#(BMAKEIT.BAT $B$O!"%$%s%9%H!<%k$N4D6-JQ?t$r@_Dj$7$?8e$K(B MAKE1.BAT +$B$r8F=P$7$^$9!#(BMAKE1.BAT $B$K$h$C$F(B%' $B$Ol9g$NJQ?t@_Dj$NNc$r5s$2$^$9!#(B + + set PREFIX=c:\usr\Meadow + set EMACS=%PREFIX%\1.10\bin\meadow95.exe + set EXEC_PREFIX= + set LISPDIR=%PREFIX%\site-lisp + set VERSION_SPECIFIC_LISPDIR=%PREFIX%\1.10\site-lisp + set DEFAULT_MAKE_ARG=elc + +$B>e5-$NNc$G$O!"(Bmeadow $B$N%P%$%J%j$,(B c:\usr\Meadow\1.10\bin\meadow95.exe +$B$K%$%s%9%H!<%k$5$l$F$$$k$3$H$rA0Ds$K$7$F$$$^$9!#$=$NA0Ds$K4p$E$-!"(BAPEL +$B$N%b%8%e!<%k$N$&$A!"(Bmeadow $B$N%P!<%8%g%s$K0MB8$7$J$$%b%8%e!<%k$r(B + + c:\usr\Meadow\site-lisp + +$B$K!"%P!<%8%g%s$K0MB8$9$k%b%8%e!<%k$r(B + + c:\usr\Meadow\1.10\site-lisp + +$B$K%$%s%9%H!<%k$7$h$&$H$7$^$9!#(B + +19.3x $B0JA0$N(B Emacs ($BNc$($P(B 19.28 $B%Y!<%9$N(B Mule for Windows) $B$K$O%P!<%8%g(B +$B%s0MB8$N(B site-lisp $B%G%#%l%/%H%j(B ($B>e5-$NNc$G8@$($P(B +c:\usr\Meadow\1.10\site-lisp) $B$,B8:_$;$:!"%G%#%U%)%k%H$G$O(B load-path $B$b(B +$BDL$C$F$$$^$;$s!#$3$N>l9g$O(B c:\usr\mule\site-lisp $B$J$I$N%P!<%8%g%sHs0MB8(B +$B$N(B site-lisp $B%G%#%l%/%H%j$K(B APEL $B$NA4$F$N%b%8%e!<%k$rF~$l$l$PNI$$$G$7$g(B +$B$&!#(B + +Demacs $B$N@_DjNc$r=`Hw$9$k$3$H$,$G$-$^$;$s$G$7$?!#(BDemacs $B$K(B APEL $B$r%$%s(B +$B%9%H!<%k$7$?J}$O!"@_DjNc$r(B apel-ja@m17n.org $B$KAw$C$F2<$5$$(B ($BHs9XFIl9g$O!"(BDOSPROMPT $B$N%W%m%Q%F%#$G4D6-JQ?t$N=i4|%5%$%:$,!V<+(B +$BF0!W$K$J$C$F$$$k$H!"4D6-JQ?t$,@_Dj$G$-$J$$$H$$$&%(%i!<$,=P$k$N$G!"E,Ev(B +$B$JCM(B (2048 $B$J$I(B) $B$rF~$l$F$*$/I,MW$,$"$j$^$9!#(Bnon Windows $B$N(B DOS $B$N>l9g(B +$B$O!"(Bconfig.sys $B$K(B + + SHELL=C:\COMMAND.COM /E:4096 /P + +$B$J$I$H=q$-!"4D6-JQ?t$K3dEv$F2DG=$J%a%b%j$r3NJ]$7$^$9!#(BDOS $B$N%P!<%8%g%s(B +$B$K$h$C$F(B /E:nnn $B$G;XDj$G$-$k4D6-JQ?tNN0h$N%5%$%:$N@)Ls$,0[$J$j!";XDj$N(B +$B;EJ}$,0c$C$?$j!"FCDj$NCM$r;XDj$9$k$HIT6q9g$r@8$8$k2DG=@-$,$"$k$N$G>\$7(B +$B$/$O$4MxMQ$N(B version $B$N%^%K%e%"%kEy$r$4Mw2<$5$$!#(B + +*** Windows $B$N(B cvs.exe $B$G%A%'%C%/%"%&%H$7$?(B MAKEIT.BAT $B$rMxMQ$9$k>l9g$NLdBjE@(B + +$B$J$*!"(BWindows $B%M%$%F%#%V$N(B cvs.exe (not cygwin) $B$rMxMQ$7$F(B APEL $B$r(B +checkout $B$7$?>l9g$O!"(Bcvs.exe $B$K$h$j9TKv%3!<%I$,@55,2=$5$l$F(B CRCRLF $B$K(B +$B$J$C$F$$$k2DG=@-$,$"$j$^$9!#$3$N$h$&$J>l9g!"(BMAKEIT.BAT, MAKE1.BAT $B$OF0(B +$B$-$^$;$s$N$G9TKv%3!<%I$r(B CRLF $B$K=$@5$7$F$*;H$$2<$5$$!#$3$NLdBj$K$D$$$F(B +$B>\$7$/$O!"(B + + http://openlab.ring.gr.jp/skk/cvswin-ja.html + +$B$r$4;2>H2<$5$$!#(B + +* load-path$B!J(BEmacs $B$H(B MULE $B$N>l9g!K(B + +$B$b$7(B Emacs $B$b$7$/$O(B Mule $B$r$*;H$$$J$i!"(BAPEL $B$r(B install $B$7$?>l=j$r(B +load-path $B$KDI2C$7$F$/$@$5$$!#$b$7(B Emacs 19.29 $B0J9_$^$?$O(B Emacs 20.1, +20.2 $B$r;H$C$F=i4|@_Dj$G%$%s%9%H!<%k$7$?$N$J$i!"pJs(B + +** $B!V8E$$(B byte-compiler$B!W$H!V?7$7$$(B byte-compiler$B!W(B + +Emacs 18 $B$N%f!<%6$N$_$J$5$s$X(B: + +$B$3$N%Q%C%1!<%8$G$O%3%s%Q%$%k;~$K$*$1$k>r7oH=CG$r$?$/$5$s9T$J$C$F$$$^(B +$B$9!#;DG0$J$,$i(B Emacs 18 $B$KIUB0$7$F$$$k(B byte-compiler $B$K$O!"Nc$($P(B +`eval-when-compile' $B$d(B `eval-and-compile' $B$N5!G=$,L5$$$N$GBeMQIJ$N%^(B +$B%/%m$rMQ0U$7$F$"$j$^$9$,!"$3$l$i$O%3%s%Q%$%k;~$@$1$G$J$/(B load $B;~$^$?(B +$B$O$N!V8E$$(B custom$B!W$r;H$&%"%W(B + $B%j%1!<%7%g%s(B) $B$r;H$&$3$H$K8G<9$7$F$$$k$N$J$i$P!V?7$7$$(B custom$B!W(B + $B$r%$%s%9%H!<%k$7$F$O$$$1$^$;$s!#(B + + 2) Emacs 19 $B$r85$K$7$?(B Mule $B$r;H$&$N$J$i$P!"$3$N%Q%C%A$r!V?7$7$$(B + custom$B!W$KEv$F$kI,MW$,$"$j$^$9!#(B + +----8<------8<------8<------8<------8<------8<------8<------8<---- +--- custom-1.9962/cus-face.el~ Wed Mar 4 19:52:39 1998 ++++ custom-1.9962/cus-face.el Mon Mar 9 08:05:33 1998 +@@ -96,7 +96,7 @@ + "Define a new FACE on all frames, ignoring X resources." + (interactive "SMake face: ") + (or (internal-find-face name) +- (let ((face (make-vector 8 nil))) ++ (let ((face (make-vector face-vector-length nil))) + (aset face 0 'face) + (aset face 1 name) + (let* ((frames (frame-list)) +----8<------8<------8<------8<------8<------8<------8<------8<---- + + 3) custom $B$r;H$&%3%s%Q%$%k$5$l$?%"%W%j%1!<%7%g%s$O!"$=$l$r(B load $B$9(B + $B$k$H$-$dJN,2DG=$J0z?t(B ALL-PATHS $B$,;XDj$5$l$k$H!"(B`default-load-path' $B$N$+$o$j(B +$B$K(B `load-path' $B$+$iC5$7$^$9!#(B + +*** $B4X?t(B get-latest-path (PATTERN &optional ALL-PATHS) + +$B@55,I=8=(B PATTERN $B$K9gCW$9$k(B default-load-path $B$K$"$k:G?7$N%G%#%l%/%H%j!<(B +$B$rJV$7$^$9!#>JN,2DG=$J0z?t(B ALL-PATHS $B$,;XDj$5$l$k$H!"(Bdefault-load-path +$B$NBe$o$j$K(B load-path $B$NA4$F$+$iC5$7$^$9!#(B + + $BNc(B. (let ((gnus-path (get-latest-path "gnus"))) + (add-path (expand-file-name "lisp" gnus-path)) + (add-to-list 'Info-default-directory-list + (expand-file-name "texi" gnus-path))) + +*** $B4X?t(B file-installed-p (FILE &optional PATHS) + +FILE $B$,(B PATHS $B$KB8:_$7$?>l9g!"(BFILE $B$N@dBP%Q%9$rJV$7$^$9!#(BPATHS $B$,>JN,(B +$B$5$l$k$H!"(B`load-path' $B$,;H$o$l$^$9!#(B + +*** $B4X?t(B exec-installed-p (FILE &optional PATHS SUFFIXES) + +FILE $B$,(B PATHS $B$KB8:_$7$?>l9g$K(B FILE $B$N@dBP%Q%9$rJV$7$^$9!#(BPATHS $B$,>JN,(B +$B$5$l$k$H!"(B`exec-path' $B$,;H$o$l$^$9!#(BSUFFIXES $B$,>JN,$5$l$k$H!"(B +`exec-suffix-list' $B$,;H$o$l$^$9!#(B + +*** $B4X?t(B module-installed-p (MODULE &optional PATHS) + +MODULE $B$,Ds6!$5$l$F$$$k(B (provided) $B$+!"(BPATHS $B$KB8:_$9$k>l9g$K(B nil $B$G(B +$B$J$$CM$rJV$7$^$9!#(BPATHS $B$,>JN,$5$l$k$H!"(B`load-path' $B$,;H$o$l$^$9!#(B + +** filename + +*** $B4X?t(B replace-as-filename (string) + +STRING $B$+$i0BA4$J%U%!%$%kL>$rJV$7$^$9!#(B + +$B$=$l$OJQ?t(B 'filename-filters' $B$r;2>H$7$^$9!#$=$NJQ?t$O%U%!%$%kL>$NA*(B +$BJL4o$N$?$a$N4X?t$N%j%9%H$G$9!#=i4|@_Dj$NA*JL4o$O0J2<$NJQ?t$r;2>H$7$F$$(B +$B$^$9!#(B + +**** $BJQ?t(B filename-limit-length + +$B%U%!%$%kL>$ND9$5$N@)8B!#(B + +**** $BJQ?t(B filename-replacement-alist + +$BJ8;z$HJ8;zNs$,BP$K$J$C$?%j%9%H$NO"A[%j%9%H$G$9!#J8;z$N%j%9%H$O%U%!%$%k(B +$BL>$H$7$F5v$5$l$J$$J8;z$r8=$o$7$^$9!#(B + + +* $B%P%0Js9p(B + +$B%P%0Js9p$d2~A1$NDs0F$r=q$$$?$H$-$O!"@'Hs(B APEL $B%a!<%j%s%0%j%9%H$KAw$C$F(B +$B$/$@$5$$(B: + + apel-en@m17n.org ($B1Q8l(B) + apel-ja@m17n.org ($BF|K\8l(B) + +APEL ML $B$rDL$7$F!"(BAPEL $B$N%P%0$rJs9p$7$?$j!"(BAPEL $B$N:G?7$N%j%j!<%9$r-Mh$N3HD%$N5DO@$r$7$?$j$9$k$3$H$,$G$-$^$9!#(BAPEL ML $B$K(B +$B;22C$9$k$K$O!"6u$NEE;R%a!<%k$r(B + + apel-en-ctl@m17n.org ($B1Q8l(B) + apel-ja-ctl@m17n.org ($BF|K\8l(B) + +$B$KAw$C$F$/$@$5$$!#(B + + +* Anonymous FTP + +$B:G?7$N(B APEL $B$N%j%j!<%9$O0J2<$N>l=j$+$i$H!"(Bssh $B$N8x3+80$rAw$C$F$/$@$5$$!#(Bssh $B7PM3$G$O!"(Bcvsroot +$B$O(B :ext:cvs@cvs.m17n.org:/cvs/root $B$H$J$j$^$9!#(B + +$B3+$+$l$?3+H/$K;22C$7$F$/$@$5$k$3$H$r4|BT$7$^$9!#(B diff --git a/apel-10.7/alist.el b/apel-10.7/alist.el new file mode 100644 index 0000000..d8d8d18 --- /dev/null +++ b/apel-10.7/alist.el @@ -0,0 +1,101 @@ +;;; alist.el --- utility functions for association list + +;; Copyright (C) 1993,1994,1995,1996,1998,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: alist + +;; This file is part of GNU Emacs. + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +;;;###autoload +(defun put-alist (key value alist) + "Set cdr of an element (KEY . ...) in ALIST to VALUE and return ALIST. +If there is no such element, create a new pair (KEY . VALUE) and +return a new alist whose car is the new pair and cdr is ALIST." + (let ((elm (assoc key alist))) + (if elm + (progn + (setcdr elm value) + alist) + (cons (cons key value) alist)))) + +;;;###autoload +(defun del-alist (key alist) + "Delete an element whose car equals KEY from ALIST. +Return the modified ALIST." + (let ((pair (assoc key alist))) + (if pair + (delq pair alist) + alist))) + +;;;###autoload +(defun set-alist (symbol key value) + "Set cdr of an element (KEY . ...) in the alist bound to SYMBOL to VALUE." + (or (boundp symbol) + (set symbol nil)) + (set symbol (put-alist key value (symbol-value symbol)))) + +;;;###autoload +(defun remove-alist (symbol key) + "Delete an element whose car equals KEY from the alist bound to SYMBOL." + (and (boundp symbol) + (set symbol (del-alist key (symbol-value symbol))))) + +;;;###autoload +(defun modify-alist (modifier default) + "Store elements in the alist MODIFIER in the alist DEFAULT. +Return the modified alist." + (mapcar (function + (lambda (as) + (setq default (put-alist (car as)(cdr as) default)))) + modifier) + default) + +;;;###autoload +(defun set-modified-alist (symbol modifier) + "Store elements in the alist MODIFIER in an alist bound to SYMBOL. +If SYMBOL is not bound, set it to nil at first." + (if (not (boundp symbol)) + (set symbol nil)) + (set symbol (modify-alist modifier (eval symbol)))) + + +;;; @ association-vector-list +;;; + +;;;###autoload +(defun vassoc (key avlist) + "Search AVLIST for an element whose first element equals KEY. +AVLIST is a list of vectors. +See also `assoc'." + (while (and avlist + (not (equal key (aref (car avlist) 0)))) + (setq avlist (cdr avlist))) + (and avlist + (car avlist))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'alist) (require 'apel-ver)) + +;;; alist.el ends here diff --git a/apel-10.7/apel-ver.el b/apel-10.7/apel-ver.el new file mode 100644 index 0000000..05fed97 --- /dev/null +++ b/apel-10.7/apel-ver.el @@ -0,0 +1,62 @@ +;;; apel-ver.el --- Declare APEL version. + +;; Copyright (C) 1999, 2000, 2003, 2006 Free Software Foundation, Inc. + +;; Author: Shuhei KOBAYASHI +;; Keiichi Suzuki +;; Keywords: compatibility + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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: + +;; Put the following lines to each file of APEL package. +;; +;; (require 'product) +;; (product-provide (provide FEATURE) (require 'apel-ver)) + +;;; Code: + +(require 'product) ; beware of circular dependency. +(provide 'apel-ver) ; these two files depend on each other. + +(product-provide 'apel-ver + ;; (product-define "APEL" nil '(9 23)) ; comment. + ;; (product-define "APEL" nil '(10 0)) ; Released 24 December 1999 + ;; (product-define "APEL" nil '(10 1)) ; Released 20 January 2000 + ;; (product-define "APEL" nil '(10 2)) ; Released 01 March 2000 + ;; (product-define "APEL" nil '(10 3)) ; Released 30 December 2000 + ;; (product-define "APEL" nil '(10 4)) ; Released 04 October 2002 + ;; (product-define "APEL" nil '(10 5)) ; Released 06 June 2003 + ;; (product-define "APEL" nil '(10 6)) ; Released 05 July 2003 + (product-define "APEL" nil '(10 7)) + ) + +(defun apel-version () + "Print APEL version." + (interactive) + (let ((product-info (product-string-1 'apel-ver t))) + (if (interactive-p) + (message "%s" product-info) + product-info))) + + +;;; @ End. +;;; + +;;; apel-ver.el ends here diff --git a/apel-10.7/atype.el b/apel-10.7/atype.el new file mode 100644 index 0000000..d7e17ca --- /dev/null +++ b/apel-10.7/atype.el @@ -0,0 +1,191 @@ +;;; atype.el --- atype functions + +;; Copyright (C) 1994,1995,1996,1997 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Version: $Id: atype.el,v 6.6 1997/03/10 14:11:23 morioka Exp $ +;; Keywords: atype + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'emu) ; for backward compatibility. +(require 'poe) ; delete. +(require 'alist) + + +;;; @ field unifier +;;; + +(defun field-unifier-for-default (a b) + (let ((ret + (cond ((equal a b) a) + ((null (cdr b)) a) + ((null (cdr a)) b) + ))) + (if ret + (list nil ret nil) + ))) + +(defun field-unify (a b) + (let ((f + (let ((type (car a))) + (and (symbolp type) + (intern (concat "field-unifier-for-" (symbol-name type))) + )))) + (or (fboundp f) + (setq f (function field-unifier-for-default)) + ) + (funcall f a b) + )) + + +;;; @ type unifier +;;; + +(defun assoc-unify (class instance) + (catch 'tag + (let ((cla (copy-alist class)) + (ins (copy-alist instance)) + (r class) + cell aret ret prev rest) + (while r + (setq cell (car r)) + (setq aret (assoc (car cell) ins)) + (if aret + (if (setq ret (field-unify cell aret)) + (progn + (if (car ret) + (setq prev (put-alist (car (car ret)) + (cdr (car ret)) + prev)) + ) + (if (nth 2 ret) + (setq rest (put-alist (car (nth 2 ret)) + (cdr (nth 2 ret)) + rest)) + ) + (setq cla (put-alist (car cell)(cdr (nth 1 ret)) cla)) + (setq ins (del-alist (car cell) ins)) + ) + (throw 'tag nil) + )) + (setq r (cdr r)) + ) + (setq r (copy-alist ins)) + (while r + (setq cell (car r)) + (setq aret (assoc (car cell) cla)) + (if aret + (if (setq ret (field-unify cell aret)) + (progn + (if (car ret) + (setq prev (put-alist (car (car ret)) + (cdr (car ret)) + prev)) + ) + (if (nth 2 ret) + (setq rest (put-alist (car (nth 2 ret)) + (cdr (nth 2 ret)) + rest)) + ) + (setq cla (del-alist (car cell) cla)) + (setq ins (put-alist (car cell)(cdr (nth 1 ret)) ins)) + ) + (throw 'tag nil) + )) + (setq r (cdr r)) + ) + (list prev (append cla ins) rest) + ))) + +(defun get-unified-alist (db al) + (let ((r db) ret) + (catch 'tag + (while r + (if (setq ret (nth 1 (assoc-unify (car r) al))) + (throw 'tag ret) + ) + (setq r (cdr r)) + )))) + + +;;; @ utilities +;;; + +(defun delete-atype (atl al) + (let* ((r atl) ret oal) + (setq oal + (catch 'tag + (while r + (if (setq ret (nth 1 (assoc-unify (car r) al))) + (throw 'tag (car r)) + ) + (setq r (cdr r)) + ))) + (delete oal atl) + )) + +(defun remove-atype (sym al) + (and (boundp sym) + (set sym (delete-atype (eval sym) al)) + )) + +(defun replace-atype (atl old-al new-al) + (let* ((r atl) ret oal) + (if (catch 'tag + (while r + (if (setq ret (nth 1 (assoc-unify (car r) old-al))) + (throw 'tag (rplaca r new-al)) + ) + (setq r (cdr r)) + )) + atl))) + +(defun set-atype (sym al &rest options) + (if (null (boundp sym)) + (set sym al) + (let* ((replacement (memq 'replacement options)) + (ignore-fields (car (cdr (memq 'ignore options)))) + (remove (or (car (cdr (memq 'remove options))) + (let ((ral (copy-alist al))) + (mapcar (function + (lambda (type) + (setq ral (del-alist type ral)) + )) + ignore-fields) + ral))) + ) + (set sym + (or (if replacement + (replace-atype (eval sym) remove al) + ) + (cons al + (delete-atype (eval sym) remove) + ) + ))))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'atype) (require 'apel-ver)) + +;;; atype.el ends here diff --git a/apel-10.7/broken.el b/apel-10.7/broken.el new file mode 100644 index 0000000..81d1ec6 --- /dev/null +++ b/apel-10.7/broken.el @@ -0,0 +1,114 @@ +;;; broken.el --- Emacs broken facility information registry. + +;; Copyright (C) 1998, 1999 Tanaka Akira + +;; Author: Tanaka Akira +;; Keywords: emulation, compatibility, incompatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'static) +(require 'poe) + +(eval-and-compile + + (defvar notice-non-obvious-broken-facility t + "If the value is t, non-obvious broken facility is noticed when +`broken-facility' macro is expanded.") + + (defun broken-facility-internal (facility &optional docstring assertion) + "Declare that FACILITY emulation is broken if ASSERTION is nil." + (when docstring + (put facility 'broken-docstring docstring)) + (put facility 'broken (not assertion))) + + (defun broken-p (facility) + "t if FACILITY emulation is broken." + (get facility 'broken)) + + (defun broken-facility-description (facility) + "Return description for FACILITY." + (get facility 'broken-docstring)) + + ) + +(put 'broken-facility 'lisp-indent-function 1) +(defmacro broken-facility (facility &optional docstring assertion no-notice) + "Declare that FACILITY emulation is broken if ASSERTION is nil. +ASSERTION is evaluated statically. + +FACILITY must be symbol. + +If ASSERTION is not omitted and evaluated to nil and NO-NOTICE is nil, +it is noticed." + (` (static-if (, assertion) + (eval-and-compile + (broken-facility-internal '(, facility) (, docstring) t)) + (eval-when-compile + (when (and '(, assertion) (not '(, no-notice)) + notice-non-obvious-broken-facility) + (message "BROKEN FACILITY DETECTED: %s" (, docstring))) + nil) + (eval-and-compile + (broken-facility-internal '(, facility) (, docstring) nil))))) + +(put 'if-broken 'lisp-indent-function 2) +(defmacro if-broken (facility then &rest else) + "If FACILITY is broken, expand to THEN, otherwise (progn . ELSE)." + (` (static-if (broken-p '(, facility)) + (, then) + (,@ else)))) + + +(put 'when-broken 'lisp-indent-function 1) +(defmacro when-broken (facility &rest body) + "If FACILITY is broken, expand to (progn . BODY), otherwise nil." + (` (static-when (broken-p '(, facility)) + (,@ body)))) + +(put 'unless-broken 'lisp-indent-function 1) +(defmacro unless-broken (facility &rest body) + "If FACILITY is not broken, expand to (progn . BODY), otherwise nil." + (` (static-unless (broken-p '(, facility)) + (,@ body)))) + +(defmacro check-broken-facility (facility) + "Check FACILITY is broken or not. If the status is different on +compile(macro expansion) time and run time, warn it." + (` (if-broken (, facility) + (unless (broken-p '(, facility)) + (message "COMPILE TIME ONLY BROKEN FACILITY DETECTED: %s" + (or + '(, (broken-facility-description facility)) + (broken-facility-description '(, facility))))) + (when (broken-p '(, facility)) + (message "RUN TIME ONLY BROKEN FACILITY DETECTED: %s" + (or + (broken-facility-description '(, facility)) + '(, (broken-facility-description facility)))))))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'broken) (require 'apel-ver)) + +;;; broken.el ends here diff --git a/apel-10.7/calist.el b/apel-10.7/calist.el new file mode 100644 index 0000000..22cb3ec --- /dev/null +++ b/apel-10.7/calist.el @@ -0,0 +1,331 @@ +;;; calist.el --- Condition functions + +;; Copyright (C) 1998 Free Software Foundation, Inc. +;; Copyright (C) 1999 Electrotechnical Laboratory, JAPAN. +;; Licensed to the Free Software Foundation. + +;; Author: MORIOKA Tomohiko +;; Keywords: condition, alist, tree + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(eval-when-compile (require 'cl)) + +(require 'alist) + +(defvar calist-package-alist nil) +(defvar calist-field-match-method-obarray nil) + +(defun find-calist-package (name) + "Return a calist-package by NAME." + (cdr (assq name calist-package-alist))) + +(defun define-calist-field-match-method (field-type function) + "Set field-match-method for FIELD-TYPE to FUNCTION." + (fset (intern (symbol-name field-type) calist-field-match-method-obarray) + function)) + +(defun use-calist-package (name) + "Make the symbols of package NAME accessible in the current package." + (mapatoms (lambda (sym) + (if (intern-soft (symbol-name sym) + calist-field-match-method-obarray) + (signal 'conflict-of-calist-symbol + (list (format "Conflict of symbol %s" sym))) + (if (fboundp sym) + (define-calist-field-match-method + sym (symbol-function sym)) + ))) + (find-calist-package name))) + +(defun make-calist-package (name &optional use) + "Create a new calist-package." + (let ((calist-field-match-method-obarray (make-vector 7 0))) + (set-alist 'calist-package-alist name + calist-field-match-method-obarray) + (use-calist-package (or use 'standard)) + calist-field-match-method-obarray)) + +(defun in-calist-package (name) + "Set the current calist-package to a new or existing calist-package." + (setq calist-field-match-method-obarray + (or (find-calist-package name) + (make-calist-package name)))) + +(in-calist-package 'standard) + +(defun calist-default-field-match-method (calist field-type field-value) + (let ((s-field (assoc field-type calist))) + (cond ((null s-field) + (cons (cons field-type field-value) calist) + ) + ((eq field-value t) + calist) + ((equal (cdr s-field) field-value) + calist)))) + +(define-calist-field-match-method t (function calist-default-field-match-method)) + +(defsubst calist-field-match-method (field-type) + (symbol-function + (or (intern-soft (if (symbolp field-type) + (symbol-name field-type) + field-type) + calist-field-match-method-obarray) + (intern-soft "t" calist-field-match-method-obarray)))) + +(defsubst calist-field-match (calist field-type field-value) + (funcall (calist-field-match-method field-type) + calist field-type field-value)) + +(defun ctree-match-calist (rule-tree alist) + "Return matched condition-alist if ALIST matches RULE-TREE." + (if (null rule-tree) + alist + (let ((type (car rule-tree)) + (choices (cdr rule-tree)) + default) + (catch 'tag + (while choices + (let* ((choice (car choices)) + (choice-value (car choice))) + (if (eq choice-value t) + (setq default choice) + (let ((ret-alist (calist-field-match alist type (car choice)))) + (if ret-alist + (throw 'tag + (if (cdr choice) + (ctree-match-calist (cdr choice) ret-alist) + ret-alist)) + )))) + (setq choices (cdr choices))) + (if default + (let ((ret-alist (calist-field-match alist type t))) + (if ret-alist + (if (cdr default) + (ctree-match-calist (cdr default) ret-alist) + ret-alist)))) + )))) + +(defun ctree-match-calist-partially (rule-tree alist) + "Return matched condition-alist if ALIST matches RULE-TREE." + (if (null rule-tree) + alist + (let ((type (car rule-tree)) + (choices (cdr rule-tree)) + default) + (catch 'tag + (while choices + (let* ((choice (car choices)) + (choice-value (car choice))) + (if (eq choice-value t) + (setq default choice) + (let ((ret-alist (calist-field-match alist type (car choice)))) + (if ret-alist + (throw 'tag + (if (cdr choice) + (ctree-match-calist-partially + (cdr choice) ret-alist) + ret-alist)) + )))) + (setq choices (cdr choices))) + (if default + (let ((ret-alist (calist-field-match alist type t))) + (if ret-alist + (if (cdr default) + (ctree-match-calist-partially (cdr default) ret-alist) + ret-alist))) + (calist-field-match alist type t)) + )))) + +(defun ctree-find-calist (rule-tree alist &optional all) + "Return list of condition-alist which matches ALIST in RULE-TREE. +If optional argument ALL is specified, default rules are not ignored +even if other rules are matched for ALIST." + (if (null rule-tree) + (list alist) + (let ((type (car rule-tree)) + (choices (cdr rule-tree)) + default dest) + (while choices + (let* ((choice (car choices)) + (choice-value (car choice))) + (if (eq choice-value t) + (setq default choice) + (let ((ret-alist (calist-field-match alist type (car choice)))) + (if ret-alist + (if (cdr choice) + (let ((ret (ctree-find-calist + (cdr choice) ret-alist all))) + (while ret + (let ((elt (car ret))) + (or (member elt dest) + (setq dest (cons elt dest)) + )) + (setq ret (cdr ret)) + )) + (or (member ret-alist dest) + (setq dest (cons ret-alist dest))) + ))))) + (setq choices (cdr choices))) + (or (and (not all) dest) + (if default + (let ((ret-alist (calist-field-match alist type t))) + (if ret-alist + (if (cdr default) + (let ((ret (ctree-find-calist + (cdr default) ret-alist all))) + (while ret + (let ((elt (car ret))) + (or (member elt dest) + (setq dest (cons elt dest)) + )) + (setq ret (cdr ret)) + )) + (or (member ret-alist dest) + (setq dest (cons ret-alist dest))) + )))) + ) + dest))) + +(defun calist-to-ctree (calist) + "Convert condition-alist CALIST to condition-tree." + (if calist + (let* ((cell (car calist))) + (cons (car cell) + (list (cons (cdr cell) + (calist-to-ctree (cdr calist)) + )))))) + +(defun ctree-add-calist-strictly (ctree calist) + "Add condition CALIST to condition-tree CTREE without default clause." + (cond ((null calist) ctree) + ((null ctree) + (calist-to-ctree calist) + ) + (t + (let* ((type (car ctree)) + (values (cdr ctree)) + (ret (assoc type calist))) + (if ret + (catch 'tag + (while values + (let ((cell (car values))) + (if (equal (car cell)(cdr ret)) + (throw 'tag + (setcdr cell + (ctree-add-calist-strictly + (cdr cell) + (delete ret (copy-alist calist))) + )))) + (setq values (cdr values))) + (setcdr ctree (cons (cons (cdr ret) + (calist-to-ctree + (delete ret (copy-alist calist)))) + (cdr ctree))) + ) + (catch 'tag + (while values + (let ((cell (car values))) + (setcdr cell + (ctree-add-calist-strictly (cdr cell) calist)) + ) + (setq values (cdr values)))) + ) + ctree)))) + +(defun ctree-add-calist-with-default (ctree calist) + "Add condition CALIST to condition-tree CTREE with default clause." + (cond ((null calist) ctree) + ((null ctree) + (let* ((cell (car calist)) + (type (car cell)) + (value (cdr cell))) + (cons type + (list (list t) + (cons value (calist-to-ctree (cdr calist))))) + )) + (t + (let* ((type (car ctree)) + (values (cdr ctree)) + (ret (assoc type calist))) + (if ret + (catch 'tag + (while values + (let ((cell (car values))) + (if (equal (car cell)(cdr ret)) + (throw 'tag + (setcdr cell + (ctree-add-calist-with-default + (cdr cell) + (delete ret (copy-alist calist))) + )))) + (setq values (cdr values))) + (if (assq t (cdr ctree)) + (setcdr ctree + (cons (cons (cdr ret) + (calist-to-ctree + (delete ret (copy-alist calist)))) + (cdr ctree))) + (setcdr ctree + (list* (list t) + (cons (cdr ret) + (calist-to-ctree + (delete ret (copy-alist calist)))) + (cdr ctree))) + )) + (catch 'tag + (while values + (let ((cell (car values))) + (setcdr cell + (ctree-add-calist-with-default (cdr cell) calist)) + ) + (setq values (cdr values))) + (let ((cell (assq t (cdr ctree)))) + (if cell + (setcdr cell + (ctree-add-calist-with-default (cdr cell) + calist)) + (let ((elt (cons t (calist-to-ctree calist)))) + (or (member elt (cdr ctree)) + (setcdr ctree (cons elt (cdr ctree))) + )) + ))) + ) + ctree)))) + +(defun ctree-set-calist-strictly (ctree-var calist) + "Set condition CALIST in CTREE-VAR without default clause." + (set ctree-var + (ctree-add-calist-strictly (symbol-value ctree-var) calist))) + +(defun ctree-set-calist-with-default (ctree-var calist) + "Set condition CALIST to CTREE-VAR with default clause." + (set ctree-var + (ctree-add-calist-with-default (symbol-value ctree-var) calist))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'calist) (require 'apel-ver)) + +;;; calist.el ends here diff --git a/apel-10.7/emu-mule.el b/apel-10.7/emu-mule.el new file mode 100644 index 0000000..154cd39 --- /dev/null +++ b/apel-10.7/emu-mule.el @@ -0,0 +1,61 @@ +;;; emu-mule.el --- emu module for Mule 1.* and Mule 2.* + +;; Copyright (C) 1995,1996,1997,1998 MORIOKA Tomohiko + +;; Author: MORIOKA Tomohiko +;; Katsumi Yamaoka +;; Keywords: emulation, compatibility, Mule + +;; This file is part of emu. + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'poem) + + +;;; @ regulation +;;; + +(defun regulate-latin-char (chr) + (cond ((and (<= ?$B#A(B chr)(<= chr ?$B#Z(B)) + (+ (- chr ?$B#A(B) ?A)) + ((and (<= ?$B#a(B chr)(<= chr ?$B#z(B)) + (+ (- chr ?$B#a(B) ?a)) + ((eq chr ?$B!%(B) ?.) + ((eq chr ?$B!$(B) ?,) + (t chr))) + +(defun regulate-latin-string (str) + (let ((len (length str)) + (i 0) + chr (dest "")) + (while (< i len) + (setq chr (sref str i)) + (setq dest (concat dest + (char-to-string (regulate-latin-char chr)))) + (setq i (+ i (char-bytes chr)))) + dest)) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'emu-mule) (require 'apel-ver)) + +;;; emu-mule.el ends here diff --git a/apel-10.7/emu.el b/apel-10.7/emu.el new file mode 100644 index 0000000..b6c36dc --- /dev/null +++ b/apel-10.7/emu.el @@ -0,0 +1,262 @@ +;;; emu.el --- Emulation module for each Emacs variants + +;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Nemacs, MULE, Emacs/mule, XEmacs + +;; This file is part of emu. + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'poe) + +(defvar running-emacs-18 (<= emacs-major-version 18)) +(defvar running-xemacs (featurep 'xemacs)) + +(defvar running-mule-merged-emacs (and (not (boundp 'MULE)) + (not running-xemacs) (featurep 'mule))) +(defvar running-xemacs-with-mule (and running-xemacs (featurep 'mule))) + +(defvar running-emacs-19 (and (not running-xemacs) (= emacs-major-version 19))) +(defvar running-emacs-19_29-or-later + (or (and running-emacs-19 (>= emacs-minor-version 29)) + (and (not running-xemacs)(>= emacs-major-version 20)))) + +(defvar running-xemacs-19 (and running-xemacs + (= emacs-major-version 19))) +(defvar running-xemacs-20-or-later (and running-xemacs + (>= emacs-major-version 20))) +(defvar running-xemacs-19_14-or-later + (or (and running-xemacs-19 (>= emacs-minor-version 14)) + running-xemacs-20-or-later)) + +(cond (running-xemacs + ;; for XEmacs + (defvar mouse-button-1 'button1) + (defvar mouse-button-2 'button2) + (defvar mouse-button-3 'button3) + ) + ((>= emacs-major-version 19) + ;; mouse + (defvar mouse-button-1 [mouse-1]) + (defvar mouse-button-2 [mouse-2]) + (defvar mouse-button-3 [down-mouse-3]) + ) + (t + ;; mouse + (defvar mouse-button-1 nil) + (defvar mouse-button-2 nil) + (defvar mouse-button-3 nil) + )) + +;; for tm-7.106 +(unless (fboundp 'tl:make-overlay) + (defalias 'tl:make-overlay 'make-overlay) + (make-obsolete 'tl:make-overlay 'make-overlay) + ) +(unless (fboundp 'tl:overlay-put) + (defalias 'tl:overlay-put 'overlay-put) + (make-obsolete 'tl:overlay-put 'overlay-put) + ) +(unless (fboundp 'tl:overlay-buffer) + (defalias 'tl:overlay-buffer 'overlay-buffer) + (make-obsolete 'tl:overlay-buffer 'overlay-buffer) + ) + +(require 'poem) +(require 'mcharset) +(require 'invisible) + +(defsubst char-list-to-string (char-list) + "Convert list of character CHAR-LIST to string." + (apply (function string) char-list)) + +(cond ((featurep 'mule) + (cond ((featurep 'xemacs) ; for XEmacs with MULE + ;; old Mule emulating aliases + + ;;(defalias 'char-leading-char 'char-charset) + + (defun char-category (character) + "Return string of category mnemonics for CHAR in TABLE. +CHAR can be any multilingual character +TABLE defaults to the current buffer's category table." + (mapconcat (lambda (chr) + (if (integerp chr) + (char-to-string (int-char chr)) + (char-to-string chr))) + ;; `char-category-list' returns a list of + ;; characters in XEmacs 21.2.25 and later, + ;; otherwise integers. + (char-category-list character) + "")) + ) + ((>= emacs-major-version 20) ; for Emacs 20 + (defalias 'insert-binary-file-contents-literally + 'insert-file-contents-literally) + + ;; old Mule emulating aliases + (defun char-category (character) + "Return string of category mnemonics for CHAR in TABLE. +CHAR can be any multilingual character +TABLE defaults to the current buffer's category table." + (category-set-mnemonics (char-category-set character))) + ) + (t ; for MULE 1.* and 2.* + (require 'emu-mule) + )) + ) + ((boundp 'NEMACS) + ;; for Nemacs and Nepoch + + ;; old MULE emulation + (defconst *noconv* 0) + (defconst *sjis* 1) + (defconst *junet* 2) + (defconst *ctext* 2) + (defconst *internal* 3) + (defconst *euc-japan* 3) + + (defun code-convert-string (str ic oc) + "Convert code in STRING from SOURCE code to TARGET code, +On successful conversion, returns the result string, +else returns nil." + (if (not (eq ic oc)) + (convert-string-kanji-code str ic oc) + str)) + + (defun code-convert-region (beg end ic oc) + "Convert code of the text between BEGIN and END from SOURCE +to TARGET. On successful conversion returns t, +else returns nil." + (if (/= ic oc) + (save-excursion + (save-restriction + (narrow-to-region beg end) + (convert-region-kanji-code beg end ic oc))) + )) + ) + (t + ;; for Emacs 19 and XEmacs without MULE + + ;; old MULE emulation + (defconst *internal* nil) + (defconst *ctext* nil) + (defconst *noconv* nil) + + (defun code-convert-string (str ic oc) + "Convert code in STRING from SOURCE code to TARGET code, +On successful conversion, returns the result string, +else returns nil. [emu-latin1.el; old MULE emulating function]" + str) + + (defun code-convert-region (beg end ic oc) + "Convert code of the text between BEGIN and END from SOURCE +to TARGET. On successful conversion returns t, +else returns nil. [emu-latin1.el; old MULE emulating function]" + t) + )) + + +;;; @ Mule emulating aliases +;;; +;;; You should not use it. + +(or (boundp '*noconv*) + (defconst *noconv* 'binary + "Coding-system for binary. +This constant is defined to emulate old MULE anything older than MULE 2.3. +It is obsolete, so don't use it.")) + + +;;; @ without code-conversion +;;; + +(defalias 'insert-binary-file-contents 'insert-file-contents-as-binary) +(make-obsolete 'insert-binary-file-contents 'insert-file-contents-as-binary) + +(defun-maybe insert-binary-file-contents-literally (filename + &optional visit + beg end replace) + "Like `insert-file-contents-literally', q.v., but don't code conversion. +A buffer may be modified in several ways after reading into the buffer due +to advanced Emacs features, such as file-name-handlers, format decoding, +find-file-hooks, etc. + This function ensures that none of these modifications will take place." + (as-binary-input-file + ;; Returns list absolute file name and length of data inserted. + (insert-file-contents-literally filename visit beg end replace))) + + +;;; @ for text/richtext and text/enriched +;;; + +(cond ((fboundp 'richtext-decode) + ;; have richtext.el + ) + ((or running-emacs-19_29-or-later running-xemacs-19_14-or-later) + ;; have enriched.el + (autoload 'richtext-decode "richtext") + (or (assq 'text/richtext format-alist) + (setq format-alist + (cons + (cons 'text/richtext + '("Extended MIME text/richtext format." + "Content-[Tt]ype:[ \t]*text/richtext" + richtext-decode richtext-encode t enriched-mode)) + format-alist))) + ) + (t + ;; don't have enriched.el + (autoload 'richtext-decode "tinyrich") + (autoload 'enriched-decode "tinyrich") + )) + +(if (or (and (eq emacs-major-version 19) + (>= emacs-minor-version (if (featurep 'xemacs) 14 29))) + (and (eq emacs-major-version 20) + (< emacs-minor-version (if (featurep 'xemacs) 3 1)))) + (eval-after-load "enriched" + '(if (fboundp 'si:enriched-encode) + nil + (fset 'si:enriched-encode (symbol-function 'enriched-encode)) + (defun enriched-encode (from to &optional orig-buf) + (let* ((si:enriched-initial-annotation enriched-initial-annotation) + (enriched-initial-annotation + (if (stringp si:enriched-initial-annotation) + si:enriched-initial-annotation + (function + (lambda () + (save-excursion + ;; Eval this in the buffer we are annotating. This + ;; fixes a bug which was saving incorrect File-Width + ;; information, since we were looking at local + ;; variables in the wrong buffer. + (if orig-buf (set-buffer orig-buf)) + (funcall si:enriched-initial-annotation))))))) + (si::enriched-encode from to)))))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'emu) (require 'apel-ver)) + +;;; emu.el ends here diff --git a/apel-10.7/env.el b/apel-10.7/env.el new file mode 100644 index 0000000..12572c9 --- /dev/null +++ b/apel-10.7/env.el @@ -0,0 +1,115 @@ +;;; env.el --- functions to manipulate environment variables. + +;; Copyright (C) 1991, 1994 Free Software Foundation, Inc. + +;; Maintainer: FSF +;; Keywords: processes, unix + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Commentary: + +;; UNIX processes inherit a list of name-to-string associations from their +;; parents called their `environment'; these are commonly used to control +;; program options. This package permits you to set environment variables +;; to be passed to any sub-process run under Emacs. + +;;; Code: + +;; History list for environment variable names. +(defvar read-envvar-name-history nil) + +(defun read-envvar-name (prompt &optional mustmatch) + "Read environment variable name, prompting with PROMPT. +Optional second arg MUSTMATCH, if non-nil, means require existing envvar name. +If it is also not t, RET does not exit if it does non-null completion." + (completing-read prompt + (mapcar (function + (lambda (enventry) + (list (substring enventry 0 + (string-match "=" enventry))))) + process-environment) + nil mustmatch nil 'read-envvar-name-history)) + +;; History list for VALUE argument to setenv. +(defvar setenv-history nil) + +;;;###autoload +(defun setenv (variable &optional value unset) + "Set the value of the environment variable named VARIABLE to VALUE. +VARIABLE should be a string. VALUE is optional; if not provided or is +`nil', the environment variable VARIABLE will be removed. + +Interactively, a prefix argument means to unset the variable. +Interactively, the current value (if any) of the variable +appears at the front of the history list when you type in the new value. + +This function works by modifying `process-environment'." + (interactive + (if current-prefix-arg + (list (read-envvar-name "Clear environment variable: " 'exact) nil t) + (let* ((var (read-envvar-name "Set environment variable: " nil)) + (oldval (getenv var)) + newval + oldhist) + ;; Don't put the current value on the history + ;; if it is already there. + (if (equal oldval (car setenv-history)) + (setq oldval nil)) + ;; Now if OLDVAL is non-nil, we should add it to the history. + (if oldval + (setq setenv-history (cons oldval setenv-history))) + (setq oldhist setenv-history) + (setq newval (read-from-minibuffer (format "Set %s to value: " var) + nil nil nil 'setenv-history)) + ;; If we added the current value to the history, remove it. + ;; Note that read-from-minibuffer may have added the new value. + ;; Don't remove that! + (if oldval + (if (eq oldhist setenv-history) + (setq setenv-history (cdr setenv-history)) + (setcdr setenv-history (cdr (cdr setenv-history))))) + ;; Here finally we specify the args to give call setenv with. + (list var newval)))) + (if unset (setq value nil)) + (if (string-match "=" variable) + (error "Environment variable name `%s' contains `='" variable) + (let ((pattern (concat "\\`" (regexp-quote (concat variable "=")))) + (case-fold-search nil) + (scan process-environment) + found) + (if (string-equal "TZ" variable) + (set-time-zone-rule value)) + (while scan + (cond ((string-match pattern (car scan)) + (setq found t) + (if (eq nil value) + (setq process-environment (delq (car scan) process-environment)) + (setcar scan (concat variable "=" value))) + (setq scan nil))) + (setq scan (cdr scan))) + (or found + (if value + (setq process-environment + (cons (concat variable "=" value) + process-environment))))))) + +(require 'product) +(product-provide (provide 'env) (require 'apel-ver)) + +;;; env.el ends here diff --git a/apel-10.7/file-detect.el b/apel-10.7/file-detect.el new file mode 100644 index 0000000..360c3a5 --- /dev/null +++ b/apel-10.7/file-detect.el @@ -0,0 +1,39 @@ +;;; file-detect.el --- Path management or file detection utility + +;; Copyright (C) 1996,1997 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Version: $Id: file-detect.el,v 7.1 1997/11/08 07:40:52 morioka Exp $ +;; Keywords: file detection, install, module +;; Status: obsoleted + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; 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 file is existed only for compatibility. Please use +;; path-util.el instead of this file. + +;;; Code: + +(require 'path-util) + +(require 'product) +(product-provide (provide 'file-detect) (require 'apel-ver)) + +;;; file-detect.el ends here diff --git a/apel-10.7/filename.el b/apel-10.7/filename.el new file mode 100644 index 0000000..6aa4edd --- /dev/null +++ b/apel-10.7/filename.el @@ -0,0 +1,170 @@ +;;; filename.el --- file name filter + +;; Copyright (C) 1996,1997 MORIOKA Tomohiko + +;; Author: MORIOKA Tomohiko +;; Version: $Id: filename.el,v 2.1 1997/11/06 15:50:53 morioka Exp $ +;; Keywords: file name, string + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'emu) ; for backward compatibility. +(require 'poe) ; functionp. +(require 'poem) ; char-int, and char-length. +(require 'path-util) + +(defsubst poly-funcall (functions argument) + "Apply initial ARGUMENT to sequence of FUNCTIONS. +FUNCTIONS is list of functions. + +\(poly-funcall '(f1 f2 .. fn) arg) is as same as +\(fn .. (f2 (f1 arg)) ..). + +For example, (poly-funcall '(car number-to-string) '(100)) returns +\"100\"." + (while functions + (setq argument (funcall (car functions) argument) + functions (cdr functions))) + argument) + + +;;; @ variables +;;; + +(defvar filename-limit-length 21 "Limit size of file-name.") + +(defvar filename-replacement-alist + '(((?\ ?\t) . "_") + ((?! ?\" ?# ?$ ?% ?& ?' ?\( ?\) ?* ?/ + ?: ?\; ?< ?> ?? ?\[ ?\\ ?\] ?` ?{ ?| ?}) . "_") + (filename-control-p . "")) + "Alist list of characters vs. string as replacement. +List of characters represents characters not allowed as file-name.") + +(defvar filename-filters nil + "List of functions for file-name filter. + +Example: +\(setq filename-filters '\(filename-special-filter + filename-eliminate-top-low-lines + filename-canonicalize-low-lines + filename-maybe-truncate-by-size + filename-eliminate-bottom-low-lines\)\) + +Moreover, if you want to convert Japanese filename to roman string by kakasi, + +\(if \(exec-installed-p \"kakasi\"\) + \(setq filename-filters + \(append '\(filename-japanese-to-roman-string\) filename-filters\)\)\)") + +;;; @ filters +;;; + +(defun filename-japanese-to-roman-string (str) + (save-excursion + (set-buffer (get-buffer-create " *temp kakasi*")) + (erase-buffer) + (insert str) + (call-process-region + (point-min)(point-max) + "kakasi" t t t "-Ha" "-Ka" "-Ja" "-Ea" "-ka") + (buffer-string))) + +(defun filename-control-p (character) + (let ((code (char-int character))) + (or (< code 32)(= code 127)))) + +(eval-when-compile + (defmacro filename-special-filter-1 (string) + (let (sref inc-i) + (if (or (not (fboundp 'sref)) + (>= emacs-major-version 21) + (and (= emacs-major-version 20) + (>= emacs-minor-version 3))) + (setq sref 'aref + inc-i '(1+ i)) + (setq sref 'aref + inc-i '(+ i (char-length chr)))) + (` (let ((len (length (, string))) + (b 0)(i 0) + (dest "")) + (while (< i len) + (let ((chr ((, sref) (, string) i)) + (lst filename-replacement-alist) + ret) + (while (and lst (not ret)) + (if (if (functionp (car (car lst))) + (setq ret (funcall (car (car lst)) chr)) + (setq ret (memq chr (car (car lst))))) + t ; quit this loop. + (setq lst (cdr lst)))) + (if ret + (setq dest (concat dest (substring (, string) b i) + (cdr (car lst))) + i (, inc-i) + b i) + (setq i (, inc-i))))) + (concat dest (substring (, string) b))))))) + +(defun filename-special-filter (string) + (filename-special-filter-1 string)) + +(defun filename-eliminate-top-low-lines (string) + (if (string-match "^_+" string) + (substring string (match-end 0)) + string)) + +(defun filename-canonicalize-low-lines (string) + (let ((dest "")) + (while (string-match "__+" string) + (setq dest (concat dest (substring string 0 (1+ (match-beginning 0))))) + (setq string (substring string (match-end 0)))) + (concat dest string))) + +(defun filename-maybe-truncate-by-size (string) + (if (and (> (length string) filename-limit-length) + (string-match "_" string filename-limit-length)) + (substring string 0 (match-beginning 0)) + string)) + +(defun filename-eliminate-bottom-low-lines (string) + (if (string-match "_+$" string) + (substring string 0 (match-beginning 0)) + string)) + + +;;; @ interface +;;; + +(defun replace-as-filename (string) + "Return safety filename from STRING. +It refers variable `filename-filters' and default filters refers +`filename-limit-length', `filename-replacement-alist'." + (and string + (poly-funcall filename-filters string))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'filename) (require 'apel-ver)) + +;;; filename.el ends here diff --git a/apel-10.7/install.el b/apel-10.7/install.el new file mode 100644 index 0000000..3d5bae0 --- /dev/null +++ b/apel-10.7/install.el @@ -0,0 +1,306 @@ +;;; install.el --- Emacs Lisp package install utility + +;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2006 +;; Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Created: 1996/08/18 +;; Keywords: install, byte-compile, directory detection + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'poe) ; make-directory for v18 +(require 'path-util) ; default-load-path + + +;;; @ compile Emacs Lisp files +;;; + +(defun compile-elisp-module (module &optional path every-time) + (setq module (expand-file-name (symbol-name module) path)) + (let ((el-file (concat module ".el")) + (elc-file (concat module ".elc"))) + (if (or every-time + (file-newer-than-file-p el-file elc-file)) + (byte-compile-file el-file)))) + +(defun compile-elisp-modules (modules &optional path every-time) + (mapcar + (function + (lambda (module) + (compile-elisp-module module path every-time))) + modules)) + + +;;; @ install files +;;; + +(defvar install-overwritten-file-modes (+ (* 64 6)(* 8 4) 4)) ; 0644 + +(defun install-file (file src dest &optional move overwrite just-print) + (if just-print + (princ (format "%s -> %s\n" file dest)) + (let ((src-file (expand-file-name file src))) + (if (file-exists-p src-file) + (let ((full-path (expand-file-name file dest))) + (if (and (file-exists-p full-path) overwrite) + (delete-file full-path)) + (copy-file src-file full-path t t) + (set-file-modes full-path install-overwritten-file-modes) + (if move + (catch 'tag + (while (and (file-exists-p src-file) + (file-writable-p src-file)) + (condition-case err + (progn + (delete-file src-file) + (throw 'tag nil)) + (error (princ (format "%s\n" (nth 1 err)))))))) + (princ (format "%s -> %s\n" file dest))))))) + +(defun install-files (files src dest &optional move overwrite just-print) + (or just-print + (file-exists-p dest) + (make-directory dest t)) + (mapcar + (function + (lambda (file) + (install-file file src dest move overwrite just-print))) + files)) + + +;;; @@ install Emacs Lisp files +;;; + +(defun install-elisp-module (module src dest &optional just-print del-elc) + (let (el-file elc-file) + (let ((name (symbol-name module))) + (setq el-file (concat name ".el")) + (setq elc-file (concat name ".elc"))) + (let ((src-file (expand-file-name el-file src))) + (if (not (file-exists-p src-file)) + nil + (if just-print + (princ (format "%s -> %s\n" el-file dest)) + (let ((full-path (expand-file-name el-file dest))) + (if (file-exists-p full-path) + (delete-file full-path)) + (copy-file src-file full-path t t) + (set-file-modes full-path install-overwritten-file-modes) + (princ (format "%s -> %s\n" el-file dest))))) + (setq src-file (expand-file-name elc-file src)) + (if (not (file-exists-p src-file)) + (let ((full-path (expand-file-name elc-file dest))) + (if (and del-elc (file-exists-p full-path)) + (if just-print + (princ (format "%s -> to be deleted\n" full-path)) + (delete-file full-path) + (princ (format "%s -> deleted\n" full-path))))) + (if just-print + (princ (format "%s -> %s\n" elc-file dest)) + (let ((full-path (expand-file-name elc-file dest))) + (if (file-exists-p full-path) + (delete-file full-path)) + (copy-file src-file full-path t t) + (set-file-modes full-path install-overwritten-file-modes) + (catch 'tag + (while (file-exists-p src-file) + (condition-case err + (progn + (delete-file src-file) + (throw 'tag nil)) + (error (princ (format "%s\n" (nth 1 err))))))) + (princ (format "%s -> %s\n" elc-file dest)))))))) + +(defun install-elisp-modules (modules src dest &optional just-print del-elc) + (or just-print + (file-exists-p dest) + (make-directory dest t)) + (mapcar + (function + (lambda (module) + (install-elisp-module module src dest just-print del-elc))) + modules)) + + +;;; @ detect install path +;;; + +;; install to shared directory (maybe "/usr/local") +(defvar install-prefix + (if (or (<= emacs-major-version 18) + (featurep 'xemacs) + (featurep 'meadow) ; for Meadow + (and (eq system-type 'windows-nt) ; for NTEmacs + (>= emacs-major-version 20))) + (expand-file-name "../../.." exec-directory) + (expand-file-name "../../../.." data-directory))) + +(defvar install-elisp-prefix + (if (>= emacs-major-version 19) + "site-lisp" + ;; v18 does not have standard site directory. + "local.lisp")) + +;; Avoid compile warning. +(eval-when-compile (autoload 'replace-in-string "subr")) + +(defun install-detect-elisp-directory (&optional prefix elisp-prefix + allow-version-specific) + (or prefix + (setq prefix install-prefix)) + (or elisp-prefix + (setq elisp-prefix install-elisp-prefix)) + (or (catch 'tag + (let ((rest (delq nil (copy-sequence default-load-path))) + (regexp + (concat "^" + (regexp-quote (if (featurep 'xemacs) + ;; Handle backslashes (Windows) + (replace-in-string + (file-name-as-directory + (expand-file-name prefix)) + "\\\\" "/") + (file-name-as-directory + (expand-file-name prefix)))) + ".*/" + (regexp-quote + (if (featurep 'xemacs) + ;; Handle backslashes (Windows) + (replace-in-string elisp-prefix "\\\\" "/") + elisp-prefix)) + "/?$")) + dir) + (while rest + (setq dir (if (featurep 'xemacs) + ;; Handle backslashes (Windows) + (replace-in-string (car rest) "\\\\" "/") + (car rest))) + (if (string-match regexp dir) + (if (or allow-version-specific + (not (string-match (format "/%d\\.%d" + emacs-major-version + emacs-minor-version) + dir))) + (throw 'tag (car rest)))) + (setq rest (cdr rest))))) + (expand-file-name (concat (if (and (not (featurep 'xemacs)) + (or (>= emacs-major-version 20) + (and (= emacs-major-version 19) + (> emacs-minor-version 28)))) + "share/" + "lib/") + (cond + ((featurep 'xemacs) + (if (featurep 'mule) + "xmule/" + "xemacs/")) + ;; unfortunately, unofficial mule based on + ;; 19.29 and later use "emacs/" by default. + ((boundp 'MULE) "mule/") + ((boundp 'NEMACS) "nemacs/") + (t "emacs/")) + elisp-prefix) + prefix))) + +(defvar install-default-elisp-directory + (install-detect-elisp-directory)) + + +;;; @ for XEmacs package system +;;; + +(defun install-get-default-package-directory () + (let ((dirs (append + (cond + ((boundp 'early-package-hierarchies) + (append (if early-package-load-path + early-package-hierarchies) + (if late-package-load-path + late-package-hierarchies) + (if last-package-load-path + last-package-hierarchies)) ) + ((boundp 'early-packages) + (append (if early-package-load-path + early-packages) + (if late-package-load-path + late-packages) + (if last-package-load-path + last-packages)) )) + (if (and (boundp 'configure-package-path) + (listp configure-package-path)) + (delete "" configure-package-path)))) + dir) + (while (and (setq dir (car dirs)) + (not (file-exists-p dir))) + (setq dirs (cdr dirs))) + dir)) + +(defun install-update-package-files (package dir &optional just-print) + (cond + (just-print + (princ (format "Updating autoloads in directory %s..\n\n" dir)) + + (princ (format "Processing %s\n" dir)) + (princ "Generating custom-load.el...\n\n") + + (princ (format "Compiling %s...\n" + (expand-file-name "auto-autoloads.el" dir))) + (princ (format "Wrote %s\n" + (expand-file-name "auto-autoloads.elc" dir))) + + (princ (format "Compiling %s...\n" + (expand-file-name "custom-load.el" dir))) + (princ (format "Wrote %s\n" + (expand-file-name "custom-load.elc" dir)))) + (t + (if (fboundp 'batch-update-directory-autoloads) + ;; XEmacs 21.5.19 and newer. + (let ((command-line-args-left (list package dir))) + (batch-update-directory-autoloads)) + (setq autoload-package-name package) + (let ((command-line-args-left (list dir))) + (batch-update-directory))) + + (let ((command-line-args-left (list dir))) + (Custom-make-dependencies)) + + (byte-compile-file (expand-file-name "auto-autoloads.el" dir)) + (byte-compile-file (expand-file-name "custom-load.el" dir))))) + + +;;; @ Other Utilities +;;; + +(defun install-just-print-p () + (let ((flag (getenv "MAKEFLAGS")) + (case-fold-search nil)) + (princ (format "%s\n" flag)) + (if flag + (string-match "^\\(\\(--[^ ]+ \\)+-\\|[^ =-]\\)*n" flag)))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'install) (require 'apel-ver)) + +;;; install.el ends here diff --git a/apel-10.7/inv-18.el b/apel-10.7/inv-18.el new file mode 100644 index 0000000..f5220d8 --- /dev/null +++ b/apel-10.7/inv-18.el @@ -0,0 +1,79 @@ +;;; inv-18.el --- invisible feature implementation for Emacs 18 + +;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: invisible, text-property, region, Emacs 18 + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'poe) + +(defun enable-invisible () + (make-local-variable 'original-selective-display) + (setq original-selective-display selective-display) + (setq selective-display t)) + +(defun disable-invisible () + (setq selective-display + (and (boundp 'original-selective-display) + original-selective-display))) +(defalias 'end-of-invisible 'disable-invisible) +(make-obsolete 'end-of-invisible 'disable-invisible) + +(defun invisible-region (start end) + (let ((buffer-read-only nil) + (modp (buffer-modified-p))) + (if (save-excursion + (goto-char (1- end)) + (eq (following-char) ?\n)) + (setq end (1- end))) + (unwind-protect + (subst-char-in-region start end ?\n ?\r t) + (set-buffer-modified-p modp)))) + +(defun visible-region (start end) + (let ((buffer-read-only nil) + (modp (buffer-modified-p))) + (unwind-protect + (subst-char-in-region start end ?\r ?\n t) + (set-buffer-modified-p modp)))) + +(defun invisible-p (pos) + (save-excursion + (goto-char pos) + (eq (following-char) ?\r))) + +(defun next-visible-point (pos) + (save-excursion + (goto-char pos) + (end-of-line) + (if (eq (following-char) ?\n) + (forward-char)) + (point))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'inv-18) (require 'apel-ver)) + +;;; inv-18.el ends here diff --git a/apel-10.7/inv-19.el b/apel-10.7/inv-19.el new file mode 100644 index 0000000..00993e9 --- /dev/null +++ b/apel-10.7/inv-19.el @@ -0,0 +1,61 @@ +;;; inv-19.el --- invisible feature implementation for Emacs 19 or later + +;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: invisible, text-property, region, Emacs 19 + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'poe) + +(defun enable-invisible ()) +(defun disable-invisible ()) +(defalias 'end-of-invisible 'disable-invisible) +(make-obsolete 'end-of-invisible 'disable-invisible) + +(defun invisible-region (start end) + (if (save-excursion + (goto-char (1- end)) + (eq (following-char) ?\n)) + (setq end (1- end))) + (put-text-property start end 'invisible t)) + +(defun visible-region (start end) + (put-text-property start end 'invisible nil)) + +(defun invisible-p (pos) + (get-text-property pos 'invisible)) + +(defun next-visible-point (pos) + (if (setq pos (next-single-property-change pos 'invisible)) + (if (eq ?\n (char-after pos)) + (1+ pos) + pos) + (point-max))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'inv-19) (require 'apel-ver)) + +;;; inv-19.el ends here diff --git a/apel-10.7/inv-xemacs.el b/apel-10.7/inv-xemacs.el new file mode 100644 index 0000000..3652326 --- /dev/null +++ b/apel-10.7/inv-xemacs.el @@ -0,0 +1,68 @@ +;;; inv-xemacs.el --- invisible feature implementation for XEmacs + +;; Copyright (C) 1995 Free Software Foundation, Inc. +;; Copyright (C) 1995,1996,1997 MORIOKA Tomohiko + +;; Author: MORIOKA Tomohiko +;; Keywords: invisible, text-property, region, XEmacs + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 XEmacs; see the file COPYING. If not, write to the Free +;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. + +;;; Code: + +(require 'poe) + +(defun enable-invisible ()) +(defun disable-invisible ()) +(defalias 'end-of-invisible 'disable-invisible) +(make-obsolete 'end-of-invisible 'disable-invisible) + +(defun invisible-region (start end) + (if (save-excursion + (goto-char start) + (eq (following-char) ?\n)) + (setq start (1+ start))) + (put-text-property start end 'invisible t)) + +(defun visible-region (start end) + (put-text-property start end 'invisible nil)) + +(defun invisible-p (pos) + (if (save-excursion + (goto-char pos) + (eq (following-char) ?\n)) + (setq pos (1+ pos))) + (get-text-property pos 'invisible)) + +(defun next-visible-point (pos) + (save-excursion + (if (save-excursion + (goto-char pos) + (eq (following-char) ?\n)) + (setq pos (1+ pos))) + (or (next-single-property-change pos 'invisible) + (point-max)))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'inv-xemacs) (require 'apel-ver)) + +;;; inv-xemacs.el ends here diff --git a/apel-10.7/invisible.el b/apel-10.7/invisible.el new file mode 100644 index 0000000..c210ebc --- /dev/null +++ b/apel-10.7/invisible.el @@ -0,0 +1,42 @@ +;;; invisible.el --- hide region + +;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: invisible, text-property, region + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(cond + ((featurep 'xemacs) + (require 'inv-xemacs)) + ((>= emacs-major-version 19) + (require 'inv-19)) + (t + (require 'inv-18))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'invisible) (require 'apel-ver)) + +;;; invisible.el ends here diff --git a/apel-10.7/localhook.el b/apel-10.7/localhook.el new file mode 100644 index 0000000..b8bd7e9 --- /dev/null +++ b/apel-10.7/localhook.el @@ -0,0 +1,308 @@ +;;; localhook.el --- local hook variable support in emacs-lisp. + +;; Copyright (C) 1985,86,92,94,95,1999 Free Software Foundation, Inc. + +;; Author: Shuhei KOBAYASHI +;; Keywords: compatibility + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 file (re)defines the following functions. +;; These functions support local hook feature in emacs-lisp level. +;; +;; add-hook, remove-hook, make-local-hook, +;; run-hooks, run-hook-with-args, +;; run-hook-with-args-until-success, and +;; run-hook-with-args-until-failure. + +;; The following functions which do not exist in 19.28 are used in the +;; original definitions of add-hook, remove-hook, and make-local-hook. +;; +;; local-variable-p, and local-variable-if-set-p. +;; +;; In this file, these functions are replaced with mock versions. + +;; In addition, the following functions which do not exist in v18 are used. +;; +;; default-boundp, byte-code-function-p, functionp, member, and delete. +;; +;; These functions are provided by poe-18.el. + +;; For historians: +;; +;; `add-hook' and `remove-hook' were introduced in v19. +;; +;; Local hook feature and `make-local-hook' were introduced in 19.29. +;; +;; `run-hooks' exists in v17. +;; `run-hook-with-args' was introduced in 19.23 as a lisp function. +;; Two variants of `run-hook-with-args' were introduced in 19.29 as +;; lisp functions. `run-hook' family became C primitives in 19.30. + +;;; Code: + +;; beware of circular dependency. +(require 'product) +(product-provide (provide 'localhook) (require 'apel-ver)) + +(require 'poe) ; this file is loaded from poe.el. + +;; These two functions are not complete, but work enough for our purpose. +;; +;; (defun local-variable-p (variable &optional buffer) +;; "Non-nil if VARIABLE has a local binding in buffer BUFFER. +;; BUFFER defaults to the current buffer." +;; (and (or (assq variable (buffer-local-variables buffer)) ; local and bound. +;; (memq variable (buffer-local-variables buffer))); local but void. +;; ;; docstring is ambiguous; 20.3 returns bool value. +;; t)) +;; +;; (defun local-variable-if-set-p (variable &optional buffer) +;; "Non-nil if VARIABLE will be local in buffer BUFFER if it is set there. +;; BUFFER defaults to the current buffer." +;; (and (or (assq variable (buffer-local-variables buffer)) ; local and bound. +;; (memq variable (buffer-local-variables buffer))); local but void. +;; ;; docstring is ambiguous; 20.3 returns bool value. +;; t)) + +;;; Hook manipulation functions. + +;; The following three functions are imported from emacs-20.3/lisp/subr.el. +;; (local-variable-p, and local-variable-if-set-p are expanded.) +(defun make-local-hook (hook) + "Make the hook HOOK local to the current buffer. +The return value is HOOK. + +When a hook is local, its local and global values +work in concert: running the hook actually runs all the hook +functions listed in *either* the local value *or* the global value +of the hook variable. + +This function works by making `t' a member of the buffer-local value, +which acts as a flag to run the hook functions in the default value as +well. This works for all normal hooks, but does not work for most +non-normal hooks yet. We will be changing the callers of non-normal +hooks so that they can handle localness; this has to be done one by +one. + +This function does nothing if HOOK is already local in the current +buffer. + +Do not use `make-local-variable' to make a hook variable buffer-local." + (if ;; (local-variable-p hook) + (or (assq hook (buffer-local-variables)) ; local and bound. + (memq hook (buffer-local-variables))); local but void. + nil + (or (boundp hook) (set hook nil)) + (make-local-variable hook) + (set hook (list t))) + hook) + +(defun add-hook (hook function &optional append local) + "Add to the value of HOOK the function FUNCTION. +FUNCTION is not added if already present. +FUNCTION is added (if necessary) at the beginning of the hook list +unless the optional argument APPEND is non-nil, in which case +FUNCTION is added at the end. + +The optional fourth argument, LOCAL, if non-nil, says to modify +the hook's buffer-local value rather than its default value. +This makes no difference if the hook is not buffer-local. +To make a hook variable buffer-local, always use +`make-local-hook', not `make-local-variable'. + +HOOK should be a symbol, and FUNCTION may be any valid function. If +HOOK is void, it is first set to nil. If HOOK's value is a single +function, it is changed to a list of functions." + (or (boundp hook) (set hook nil)) + (or (default-boundp hook) (set-default hook nil)) + ;; If the hook value is a single function, turn it into a list. + (let ((old (symbol-value hook))) + (if (or (not (listp old)) (eq (car old) 'lambda)) + (set hook (list old)))) + (if (or local + ;; Detect the case where make-local-variable was used on a hook + ;; and do what we used to do. + (and ;; (local-variable-if-set-p hook) + (or (assq hook (buffer-local-variables)) ; local and bound. + (memq hook (buffer-local-variables))); local but void. + (not (memq t (symbol-value hook))))) + ;; Alter the local value only. + (or (if (or (consp function) (byte-code-function-p function)) + (member function (symbol-value hook)) + (memq function (symbol-value hook))) + (set hook + (if append + (append (symbol-value hook) (list function)) + (cons function (symbol-value hook))))) + ;; Alter the global value (which is also the only value, + ;; if the hook doesn't have a local value). + (or (if (or (consp function) (byte-code-function-p function)) + (member function (default-value hook)) + (memq function (default-value hook))) + (set-default hook + (if append + (append (default-value hook) (list function)) + (cons function (default-value hook))))))) + +(defun remove-hook (hook function &optional local) + "Remove from the value of HOOK the function FUNCTION. +HOOK should be a symbol, and FUNCTION may be any valid function. If +FUNCTION isn't the value of HOOK, or, if FUNCTION doesn't appear in the +list of hooks to run in HOOK, then nothing is done. See `add-hook'. + +The optional third argument, LOCAL, if non-nil, says to modify +the hook's buffer-local value rather than its default value. +This makes no difference if the hook is not buffer-local. +To make a hook variable buffer-local, always use +`make-local-hook', not `make-local-variable'." + (if (or (not (boundp hook)) ;unbound symbol, or + (not (default-boundp hook)) + (null (symbol-value hook)) ;value is nil, or + (null function)) ;function is nil, then + nil ;Do nothing. + (if (or local + ;; Detect the case where make-local-variable was used on a hook + ;; and do what we used to do. + (and ;; (local-variable-p hook) + (or (assq hook (buffer-local-variables)) ; local and bound. + (memq hook (buffer-local-variables))); local but void. + (consp (symbol-value hook)) + (not (memq t (symbol-value hook))))) + (let ((hook-value (symbol-value hook))) + (if (consp hook-value) + (if (member function hook-value) + (setq hook-value (delete function (copy-sequence hook-value)))) + (if (equal hook-value function) + (setq hook-value nil))) + (set hook hook-value)) + (let ((hook-value (default-value hook))) + (if (and (consp hook-value) (not (functionp hook-value))) + (if (member function hook-value) + (setq hook-value (delete function (copy-sequence hook-value)))) + (if (equal hook-value function) + (setq hook-value nil))) + (set-default hook hook-value))))) + +;;; Hook execution functions. + +(defun run-hook-with-args-internal (hook args cond) + "Run HOOK with the specified arguments ARGS. +HOOK should be a symbol, a hook variable. Its value should be a list of +functions. We call those functions, one by one, passing arguments ARGS +to each of them, until specified COND is satisfied. If COND is nil, we +call those functions until one of them returns a non-nil value, and then +we return that value. If COND is t, we call those functions until one +of them returns nil, and then we return nil. If COND is not nil and not +t, we call all the functions." + (if (not (boundp hook)) + ;; hook is void. + (not cond) + (let* ((functions (symbol-value hook)) + (ret (eq cond t)) + (all (and cond (not ret))) + function) + (if (functionp functions) + ;; hook is just a function. + (apply functions args) + ;; hook is nil or a list of functions. + (while (and functions + (or all ; to-completion + (if cond + ret ; until-failure + (null ret)))) ; until-success + (setq function (car functions) + functions(cdr functions)) + (if (eq function t) + ;; this hook has a local binding. + ;; we must run the global binding too. + (let ((globals (default-value hook)) + global) + (if (functionp globals) + (setq ret (apply globals args)) + (while (and globals + (or all + (if cond + ret + (null ret)))) + (setq global (car globals) + globals(cdr globals)) + (or (eq global t) ; t should not occur. + (setq ret (apply global args)))))) + (setq ret (apply function args)))) + ret)))) + +;; The following four functions are direct translation of their +;; C definitions in emacs-20.3/src/eval.c. +(defun run-hooks (&rest hooks) + "Run each hook in HOOKS. Major mode functions use this. +Each argument should be a symbol, a hook variable. +These symbols are processed in the order specified. +If a hook symbol has a non-nil value, that value may be a function +or a list of functions to be called to run the hook. +If the value is a function, it is called with no arguments. +If it is a list, the elements are called, in order, with no arguments. + +To make a hook variable buffer-local, use `make-local-hook', +not `make-local-variable'." + (while hooks + (run-hook-with-args-internal (car hooks) nil 'to-completion) + (setq hooks (cdr hooks)))) + +(defun run-hook-with-args (hook &rest args) + "Run HOOK with the specified arguments ARGS. +HOOK should be a symbol, a hook variable. If HOOK has a non-nil +value, that value may be a function or a list of functions to be +called to run the hook. If the value is a function, it is called with +the given arguments and its return value is returned. If it is a list +of functions, those functions are called, in order, +with the given arguments ARGS. +It is best not to depend on the value return by `run-hook-with-args', +as that may change. + +To make a hook variable buffer-local, use `make-local-hook', +not `make-local-variable'." + (run-hook-with-args-internal hook args 'to-completion)) + +(defun run-hook-with-args-until-success (hook &rest args) + "Run HOOK with the specified arguments ARGS. +HOOK should be a symbol, a hook variable. Its value should +be a list of functions. We call those functions, one by one, +passing arguments ARGS to each of them, until one of them +returns a non-nil value. Then we return that value. +If all the functions return nil, we return nil. + +To make a hook variable buffer-local, use `make-local-hook', +not `make-local-variable'." + (run-hook-with-args-internal hook args nil)) + +(defun run-hook-with-args-until-failure (hook &rest args) + "Run HOOK with the specified arguments ARGS. +HOOK should be a symbol, a hook variable. Its value should +be a list of functions. We call those functions, one by one, +passing arguments ARGS to each of them, until one of them +returns nil. Then we return nil. +If all the functions return non-nil, we return non-nil. + +To make a hook variable buffer-local, use `make-local-hook', +not `make-local-variable'." + (run-hook-with-args-internal hook args t)) + +;;; localhook.el ends here diff --git a/apel-10.7/make1.bat b/apel-10.7/make1.bat new file mode 100644 index 0000000..7e79146 --- /dev/null +++ b/apel-10.7/make1.bat @@ -0,0 +1,56 @@ +echo off +rem MAKE1.BAT for APEL. +rem +rem Version: $Id: make1.bat,v 1.1 2001/02/01 03:19:36 minakaji Exp $ +rem Last Modified: $Date: 2001/02/01 03:19:36 $ + +rem --- argument +rem --- elc : byte compile +rem --- all, install : install +rem --- clean : cleaning garbage file +rem --- what-where : print where to install +rem --- + +rem --- check calling from make.bat +if not "%SUBMAKEOK%"=="OK" goto prnusage +set SUBMAKEOK= + +rem argument check + +set arg1=%1 + +if "%arg1%"=="elc" goto compile +if "%arg1%"=="all" goto install +if "%arg1%"=="install" goto install +if "%arg1%"=="what-where" goto listing +if "%arg1%"=="clean" goto clean +echo Unrecognized argument: specify either 'elc', 'all', +echo 'install', 'clean' or 'what-where'. +goto pauseend + +:compile +%EMACS% -q -batch -no-site-file -l APEL-MK -f compile-apel NONE %LISPDIR% %VLISPDIR% +goto end + +:install +%EMACS% -q -batch -no-site-file -l APEL-MK -f install-apel NONE %LISPDIR% %VLISPDIR% +goto end + +:listing +%EMACS% -batch -q -no-site-file -l APEL-MK -f what-where-apel +goto end + +:clean +del *.elc + +rem --- This file should not be executed by itself. Use make.bat. +:prnusage +echo This file should not be executed by itself. Use make.bat. + +rem --- If error occurs, stay display until any key is typed. +:pauseend +echo Type any key when you're done reading the error message. +pause + +:end + diff --git a/apel-10.7/makeit.bat b/apel-10.7/makeit.bat new file mode 100644 index 0000000..6374b69 --- /dev/null +++ b/apel-10.7/makeit.bat @@ -0,0 +1,215 @@ +@echo off +rem --- +rem --- common install batch file for Meadow & NTEmacs +rem --- 1999/07/07, Masaki YATSU mailto:yatsu@aurora.dti.ne.jp +rem --- cmail ML member +rem --- modified 1999/12/01, Yuh Ohmura, mailto:yutopia@t3.rim.or.jp +rem --- modified 2000/12/26, Takeshi Morishima mailto:tm@interaccess.com +rem --- date $Date: 2001/02/01 03:19:36 $ +rem --- version $Id: makeit.bat,v 1.1 2001/02/01 03:19:36 minakaji Exp $ + +set ELISPMK_APP=apel + +rem --- Japanese Comments: +rem --- +rem --- +rem --- ɂ‚Ă make1.bat ̃RgQƂĂD +rem --- makeit.bat ́ACXg[̊‹ϐݒ肵 +rem --- make1.bat ďoăCXg[s܂B +rem --- +rem --- ϐݒ +rem --- ̃RĝƂɂ PREFIX, EMACS, EXEC_PREFIX, LISPDIR, +rem --- INFODIR, VERSION_SPECIFIC_LISPDIR ̊eϐCg̊‹ +rem --- KɍĐݒ肵ĂD +rem --- ɁCEMACS ̒lC +rem --- Windows95/98 𗘗pĂ meadow95.exe +rem --- WindowsNT4.0 𗘗pĂ meadownt.exe +rem --- NTEmacs 𗘗pĂ emacs.exe +rem --- w肷̂YȂ悤ɁD +rem --- +rem --- KXw肪I makeit.bat ͉̂ꂩ̃t@CƂ +rem --- Rs[ĂƂD悵Ďs܂B(AbvO[h +rem --- ̍ۂ makeit.bat ĕҏWKv܂.) D揇: +rem --- +rem --- 1-1. %HOME%\.elispmk.%ELISPMK_APP%.bat +rem --- 1-2. %HOME%\elisp\elispmk.%ELISPMK_APP%.bat +rem --- 1-3. %HOME%\config\elispmk.%ELISPMK_APP%.bat +rem --- 1-4. c:\Program Files\Meadow\elispmk.%ELISPMK_APP%.bat +rem --- 1-5. c:\Meadow\elispmk.%ELISPMK_APP%.bat +rem --- 1-6. d:\Meadow\elispmk.%ELISPMK_APP%.bat +rem --- +rem --- 2-1. %HOME%\.elispmk.bat +rem --- 2-2. %HOME%\elisp\elispmk.bat +rem --- 2-3. %HOME%\config\elispmk.bat +rem --- 2-4. c:\Program Files\Meadow\elispmk.bat +rem --- 2-5. c:\Meadow\elispmk.bat +rem --- 2-6. d:\Meadow\elispmk.bat +rem --- +rem --- ƂȂ܂B +rem --- +rem --- English Comments: +rem --- +rem --- Arguments +rem --- Please refer to comment section of make1.bat. Makeit.bat +rem --- will perform installation procedure by executing make1.bat. +rem --- +rem --- Specifying variables +rem --- After this comment section, PREFIX, EMACS, EXEC_PREFIX, +rem --- LISPDIR, INFODIR, VERSION_SPECIFIC_LISPDIR is defined using +rem --- 'set' batch command. Please specify them appropriately +rem --- according to your Emacs environment. Especially remember to set +rem --- the EMACS variable to meadow95.exe if you use Meadow on +rem --- Windows95/98, or to meadownt.exe if you use Meadow on +rem --- WindowsNT4.0, or to emacs.exe if you use NTEmacs. +rem --- +rem --- After modification, you may make a copy of makeit.bat as a pre- +rem --- configured file as one of the following name. Any future +rem --- execution of makeit.bat will automatically use this pre- +rem --- configured batch file instead of makeit.bat itself. (When +rem --- upgrading new distribution file for example, you do not have to +rem --- make modification to makeit.bat again.) A pre-configured batch +rem --- file is searched in order listed below: +rem --- +rem --- 1-1. %HOME%\.elispmk.%ELISPMK_APP%.bat +rem --- 1-2. %HOME%\elisp\elispmk.%ELISPMK_APP%.bat +rem --- 1-3. %HOME%\config\elispmk.%ELISPMK_APP%.bat +rem --- 1-4. c:\Program Files\Meadow\elispmk.%ELISPMK_APP%.bat +rem --- 1-5. c:\Meadow\elispmk.%ELISPMK_APP%.bat +rem --- 1-6. d:\Meadow\elispmk.%ELISPMK_APP%.bat +rem --- +rem --- 2-1. %HOME%\.elispmk.bat +rem --- 2-2. %HOME%\elisp\elispmk.bat +rem --- 2-3. %HOME%\config\elispmk.bat +rem --- 2-4. c:\Program Files\Meadow\elispmk.bat +rem --- 2-5. c:\Meadow\elispmk.bat +rem --- 2-6. d:\Meadow\elispmk.bat + +rem --- ϐݒ̗ (Example of variable definition) +rem --- c:\usr\Meadow ɃCXg[Ă 1.10 Meadow gp +rem --- Ăꍇ̐ݒ. (An example of variable definition. In +rem --- this example, Meadow 1.10 installed in c:\usr\Meadow directory +rem --- is used.) +rem --- set PREFIX=c:\usr\Meadow +rem --- set EMACS=%PREFIX%\1.10\bin\meadow95.exe +rem --- set EXEC_PREFIX= +rem --- set LISPDIR=%PREFIX%\site-lisp +rem --- set VERSION_SPECIFIC_LISPDIR=%PREFIX%\1.10\site-lisp +rem --- set DEFAULT_MAKE_ARG=elc +rem --- Ŝ߃ftHg̒lׂ͂ċ󕶎ɂȂĂ܂Bg +rem --- ̃VXeɂ킹Ă̕ϐw肵ĂB(To take a +rem --- safe side, default values are all set to null strings. Please +rem --- specify these variables accordingly for your system.) +rem --- ȂADEFAULT_MAKE_ARG ɉ”\Ȓl make1.bat 䗗B +rem --- (Please see make1.bat for possible values of DEFAULT_MAKE_ARG.) + +set PREFIX= +set EMACS= +set LISPDIR= +set DEFAULT_MAKE_ARG= + + +rem --- makeit.bat Ă΂Ăꍇ͍ċAĂяo make1 s +if not "%ELISPMK%"=="" goto execsubmk + +rem --- +set ELISPMK=%HOME%\.elispmk.%ELISPMK_APP%.bat +if exist %ELISPMK% goto execelmkb +set ELISPMK=%HOME%\elisp\elispmk.%ELISPMK_APP%.bat +if exist %ELISPMK% goto execelmkb +set ELISPMK=%HOME%\config\elispmk.%ELISPMK_APP%.bat +if exist %ELISPMK% goto execelmkb +set ELISPMK="c:\Program Files\Meadow\elispmk.%ELISPMK_APP%.bat" +if exist %ELISPMK% goto execelmkb +set ELISPMK=c:\Meadow\elispmk.%ELISPMK_APP%.bat +if exist %ELISPMK% goto execelmkb +set ELISPMK=d:\Meadow\elispmk.%ELISPMK_APP%.bat +if exist %ELISPMK% goto execelmkb +rem --- +set ELISPMK=%HOME%\.elispmk.bat +if exist %ELISPMK% goto execelmkb +set ELISPMK=%HOME%\elisp\elispmk.bat +if exist %ELISPMK% goto execelmkb +set ELISPMK=%HOME%\config\elispmk.bat +if exist %ELISPMK% goto execelmkb +set ELISPMK="c:\Program Files\Meadow\elispmk.bat" +if exist %ELISPMK% goto execelmkb +set ELISPMK=c:\Meadow\elispmk.bat +if exist %ELISPMK% goto execelmkb +set ELISPMK=d:\Meadow\elispmk.bat +if exist %ELISPMK% goto execelmkb + +echo ---- +echo INFORMATIVE: No pre-configured batch (e.g. ~/.elispmk.bat +echo INVORMATIVE: or ~/.elispmk.%ELISPMK_APP%.bat) found. +echo INFORMATIVE: You may create one for your convenience. +echo INFORMATIVE: See comments in makeit.bat. +echo ---- + +:execsubmk +set ELISPMK= +rem --- %EMACS% ꍇ̓G[I +if "%EMACS%"=="" goto errnotspecified +if not exist "%EMACS%" goto errnonexistent + +rem --- MAKE1.BAT Control +set SUBMAKEOK=OK + +echo ---- +echo Executing make1.bat in the current directory using the folloiwing env. +echo HOME=%HOME% +echo PREFIX=%PREFIX% +echo EMACS=%EMACS% +echo EXEC_PREFIX=%EXEC_PREFIX% +echo LISPDIR=%LISPDIR% +echo INFODIR=%INFODIR% +echo VERSION_SPECIFIC_LISPDIR=%VERSION_SPECIFIC_LISPDIR% +echo ---- + +set ARG=%1 +if "%ARG%"=="" set ARG=%DEFAULT_MAKE_ARG% + +echo Executing .\make1.bat with argument=%ARG% +.\make1.bat %ARG% + +echo Error: for some reason .\make1.bat could not be executed. +echo Please check if .\make1.bat exists and correct. +goto pauseend + +:execelmkb +echo ---- +echo Found %ELISPMK%. Executing it... +echo ---- +%ELISPMK% %1 +echo Error: for some reason %ELISPMK% could not be executed. +echo Please check if ELISPMK=%ELISPMK% exists and correct. +goto printenv + +rem --- %EMACS% ݒ肳ĂȂ +:errnotspecified +echo Error: Environment variable EMACS is not specified. +goto printenv + +rem --- %EMACS% ɐݒ肳Ăt@C݂Ȃ +:errnonexistent +echo Error: EMACS=%EMACS% does not exist. + +:printenv +echo ---- +echo Check correctness of the following environment variables. +echo HOME=%HOME% +echo PREFIX=%PREFIX% +echo EMACS=%EMACS% +echo EXEC_PREFIX=%EXEC_PREFIX% +echo LISPDIR=%LISPDIR% +echo INFODIR=%INFODIR% +echo VERSION_SPECIFIC_LISPDIR=%VERSION_SPECIFIC_LISPDIR% +echo DEFAULT_MAKE_ARG=%DEFAULT_MAKE_ARG% +echo See comments in makeit.bat and make1.bat for setup instruction. +echo ---- + +:pauseend +echo Type any key when you're done reading the error message. +pause + +rem --- end of makeit.bat +:end diff --git a/apel-10.7/mcharset.el b/apel-10.7/mcharset.el new file mode 100644 index 0000000..04281e5 --- /dev/null +++ b/apel-10.7/mcharset.el @@ -0,0 +1,109 @@ +;;; mcharset.el --- MIME charset API + +;; Copyright (C) 1997,1998,1999,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'poe) +(require 'pcustom) + +(cond ((featurep 'mule) + (if (>= emacs-major-version 20) + (require 'mcs-20) + ;; for MULE 1.* and 2.* + (require 'mcs-om))) + ((boundp 'NEMACS) + ;; for Nemacs and Nepoch + (require 'mcs-nemacs)) + (t + (require 'mcs-ltn1))) + +(defcustom default-mime-charset-for-write + (if (mime-charset-p 'utf-8) + 'utf-8 + default-mime-charset) + "Default value of MIME-charset for encoding. +It may be used when suitable MIME-charset is not found. +It must be symbol." + :group 'i18n + :type 'mime-charset) + +(defcustom default-mime-charset-detect-method-for-write + nil + "Function called when suitable MIME-charset is not found to encode. +It must be nil or function. +If it is nil, variable `default-mime-charset-for-write' is used. +If it is a function, interface must be (TYPE CHARSETS &rest ARGS). +CHARSETS is list of charset. +If TYPE is 'region, ARGS has START and END." + :group 'i18n + :type '(choice function (const nil))) + +(defun charsets-to-mime-charset (charsets) + "Return MIME charset from list of charset CHARSETS. +Return nil if suitable mime-charset is not found." + (if charsets + (catch 'tag + (let ((rest charsets-mime-charset-alist) + cell) + (while (setq cell (car rest)) + (if (catch 'not-subset + (let ((set1 charsets) + (set2 (car cell)) + obj) + (while set1 + (setq obj (car set1)) + (or (memq obj set2) + (throw 'not-subset nil)) + (setq set1 (cdr set1))) + t)) + (throw 'tag (cdr cell))) + (setq rest (cdr rest))) + )))) + +(defun find-mime-charset-by-charsets (charsets &optional mode &rest args) + "Like `charsets-to-mime-charset', but it does not return nil. + +When suitable mime-charset is not found and variable +`default-mime-charset-detect-method-for-write' is not nil, +`find-mime-charset-by-charsets' calls the variable as function and +return the return value of the function. +Interface of the function is (MODE CHARSETS &rest ARGS). + +When suitable mime-charset is not found and variable +`default-mime-charset-detect-method-for-write' is nil, +variable `default-mime-charset-for-write' is returned." + (or (charsets-to-mime-charset charsets) + (if default-mime-charset-detect-method-for-write + (apply default-mime-charset-detect-method-for-write + mode charsets args) + default-mime-charset-for-write))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'mcharset) (require 'apel-ver)) + +;;; mcharset.el ends here diff --git a/apel-10.7/mcs-20.el b/apel-10.7/mcs-20.el new file mode 100644 index 0000000..944384b --- /dev/null +++ b/apel-10.7/mcs-20.el @@ -0,0 +1,235 @@ +;;; mcs-20.el --- MIME charset implementation for Emacs 20 and XEmacs/mule + +;; Copyright (C) 1997,1998,1999,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; 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 module requires Emacs 20.0.93, XEmacs 20.3-b5 (with mule) +;; or later. + +;;; Code: + +(require 'custom) +(eval-when-compile (require 'wid-edit)) + +(if (featurep 'xemacs) + (require 'mcs-xm) + (require 'mcs-e20)) + + +;;; @ MIME charset +;;; + +(defcustom mime-charset-coding-system-alist + (let ((rest + '((us-ascii . raw-text) + (gb2312 . cn-gb-2312) + (cn-gb . cn-gb-2312) + (iso-2022-jp-2 . iso-2022-7bit-ss2) + (iso-2022-jp-3 . iso-2022-7bit-ss2) + (tis-620 . tis620) + (windows-874 . tis-620) + (cp874 . tis-620) + (x-ctext . ctext) + (unknown . undecided) + (x-unknown . undecided) + )) + dest) + (while rest + (let ((pair (car rest))) + (or (find-coding-system (car pair)) + (setq dest (cons pair dest)) + )) + (setq rest (cdr rest)) + ) + dest) + "Alist MIME CHARSET vs CODING-SYSTEM. +MIME CHARSET and CODING-SYSTEM must be symbol." + :group 'i18n + :type '(repeat (cons symbol coding-system))) + +(defcustom mime-charset-to-coding-system-default-method + nil + "Function called when suitable coding-system is not found from MIME-charset. +It must be nil or function. +If it is a function, interface must be (CHARSET LBT CODING-SYSTEM)." + :group 'i18n + :type '(choice function (const nil))) + +(defun mime-charset-to-coding-system (charset &optional lbt) + "Return coding-system corresponding with CHARSET. +CHARSET is a symbol whose name is MIME charset. +If optional argument LBT (`CRLF', `LF', `CR', `unix', `dos' or `mac') +is specified, it is used as line break code type of coding-system." + (if (stringp charset) + (setq charset (intern (downcase charset))) + ) + (let ((cs (assq charset mime-charset-coding-system-alist))) + (setq cs + (if cs + (cdr cs) + charset)) + (if lbt + (setq cs (intern (format "%s-%s" cs + (cond ((eq lbt 'CRLF) 'dos) + ((eq lbt 'LF) 'unix) + ((eq lbt 'CR) 'mac) + (t lbt))))) + ) + (if (find-coding-system cs) + cs + (if mime-charset-to-coding-system-default-method + (funcall mime-charset-to-coding-system-default-method + charset lbt cs) + )))) + +(defalias 'mime-charset-p 'mime-charset-to-coding-system) + +(defvar widget-mime-charset-prompt-value-history nil + "History of input to `widget-mime-charset-prompt-value'.") + +(define-widget 'mime-charset 'coding-system + "A mime-charset." + :format "%{%t%}: %v" + :tag "MIME-charset" + :prompt-history 'widget-mime-charset-prompt-value-history + :prompt-value 'widget-mime-charset-prompt-value + :action 'widget-mime-charset-action) + +(defun widget-mime-charset-prompt-value (widget prompt value unbound) + ;; Read mime-charset from minibuffer. + (intern + (completing-read (format "%s (default %s) " prompt value) + (mapcar (function + (lambda (sym) + (list (symbol-name sym)))) + (mime-charset-list))))) + +(defun widget-mime-charset-action (widget &optional event) + ;; Read a mime-charset from the minibuffer. + (let ((answer + (widget-mime-charset-prompt-value + widget + (widget-apply widget :menu-tag-get) + (widget-value widget) + t))) + (widget-value-set widget answer) + (widget-apply widget :notify widget event) + (widget-setup))) + +(defcustom default-mime-charset 'x-unknown + "Default value of MIME-charset. +It is used when MIME-charset is not specified. +It must be symbol." + :group 'i18n + :type 'mime-charset) + +(cond ((featurep 'utf-2000) +;; for CHISE Architecture +(defun mcs-region-repertoire-p (start end charsets &optional buffer) + (save-excursion + (if buffer + (set-buffer buffer)) + (save-restriction + (narrow-to-region start end) + (goto-char (point-min)) + (catch 'tag + (let (ch) + (while (not (eobp)) + (setq ch (char-after (point))) + (unless (some (lambda (ccs) + (encode-char ch ccs)) + charsets) + (throw 'tag nil)) + (forward-char))) + t)))) + +(defun mcs-string-repertoire-p (string charsets &optional start end) + (let ((i (if start + (if (< start 0) + (error 'args-out-of-range string start end) + start) + 0)) + ch) + (if end + (if (> end (length string)) + (error 'args-out-of-range string start end)) + (setq end (length string))) + (catch 'tag + (while (< i end) + (setq ch (aref string i)) + (unless (some (lambda (ccs) + (encode-char ch ccs)) + charsets) + (throw 'tag nil)) + (setq i (1+ i))) + t))) + +(defun detect-mime-charset-region (start end) + "Return MIME charset for region between START and END." + (let ((rest charsets-mime-charset-alist) + cell) + (catch 'tag + (while rest + (setq cell (car rest)) + (if (mcs-region-repertoire-p start end (car cell)) + (throw 'tag (cdr cell))) + (setq rest (cdr rest))) + default-mime-charset-for-write))) + +(defun detect-mime-charset-string (string) + "Return MIME charset for STRING." + (let ((rest charsets-mime-charset-alist) + cell) + (catch 'tag + (while rest + (setq cell (car rest)) + (if (mcs-string-repertoire-p string (car cell)) + (throw 'tag (cdr cell))) + (setq rest (cdr rest))) + default-mime-charset-for-write))) +) +(t +;; for legacy Mule +(defun detect-mime-charset-region (start end) + "Return MIME charset for region between START and END." + (find-mime-charset-by-charsets (find-charset-region start end) + 'region start end)) +)) + +(defun write-region-as-mime-charset (charset start end filename + &optional append visit lockname) + "Like `write-region', q.v., but encode by MIME CHARSET." + (let ((coding-system-for-write + (or (mime-charset-to-coding-system charset) + 'binary))) + (write-region start end filename append visit lockname))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'mcs-20) (require 'apel-ver)) + +;;; mcs-20.el ends here diff --git a/apel-10.7/mcs-e20.el b/apel-10.7/mcs-e20.el new file mode 100644 index 0000000..908dcad --- /dev/null +++ b/apel-10.7/mcs-e20.el @@ -0,0 +1,187 @@ +;;; mcs-e20.el --- MIME charset implementation for Emacs 20.1 and 20.2 + +;; Copyright (C) 1996,1997,1998,1999,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; 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 module requires Emacs 20.1 and 20.2. + +;;; Code: + +(require 'pces) +(eval-when-compile (require 'static)) + +(defsubst encode-mime-charset-region (start end charset &optional lbt) + "Encode the text between START and END as MIME CHARSET." + (let (cs) + (if (and enable-multibyte-characters + (setq cs (mime-charset-to-coding-system charset lbt))) + (encode-coding-region start end cs) + ))) + +(defsubst decode-mime-charset-region (start end charset &optional lbt) + "Decode the text between START and END as MIME CHARSET." + (let (cs) + (if (and enable-multibyte-characters + (setq cs (mime-charset-to-coding-system charset lbt))) + (decode-coding-region start end cs) + ))) + + +(defsubst encode-mime-charset-string (string charset &optional lbt) + "Encode the STRING as MIME CHARSET." + (let (cs) + (if (and enable-multibyte-characters + (setq cs (mime-charset-to-coding-system charset lbt))) + (encode-coding-string string cs) + string))) + +(defsubst decode-mime-charset-string (string charset &optional lbt) + "Decode the STRING as MIME CHARSET." + (let (cs) + (if (and enable-multibyte-characters + (setq cs (mime-charset-to-coding-system charset lbt))) + (decode-coding-string string cs) + string))) + + +(defvar charsets-mime-charset-alist + (delq + nil + `(((ascii) . us-ascii) + ((ascii latin-iso8859-1) . iso-8859-1) + ((ascii latin-iso8859-2) . iso-8859-2) + ((ascii latin-iso8859-3) . iso-8859-3) + ((ascii latin-iso8859-4) . iso-8859-4) + ;;((ascii cyrillic-iso8859-5) . iso-8859-5) + ((ascii cyrillic-iso8859-5) . koi8-r) + ((ascii arabic-iso8859-6) . iso-8859-6) + ((ascii greek-iso8859-7) . iso-8859-7) + ((ascii hebrew-iso8859-8) . iso-8859-8) + ((ascii latin-iso8859-9) . iso-8859-9) + ,(if (find-coding-system 'iso-8859-14) + '((ascii latin-iso8859-14) . iso-8859-14)) + ,(if (find-coding-system 'iso-8859-15) + '((ascii latin-iso8859-15) . iso-8859-15)) + ((ascii latin-jisx0201 + japanese-jisx0208-1978 japanese-jisx0208) . iso-2022-jp) + ((ascii latin-jisx0201 + katakana-jisx0201 japanese-jisx0208) . shift_jis) + ((ascii korean-ksc5601) . euc-kr) + ((ascii chinese-gb2312) . gb2312) + ((ascii chinese-big5-1 chinese-big5-2) . big5) + ((ascii thai-tis620 composition) . tis-620) + ((ascii latin-iso8859-1 greek-iso8859-7 + latin-jisx0201 japanese-jisx0208-1978 + chinese-gb2312 japanese-jisx0208 + korean-ksc5601 japanese-jisx0212) . iso-2022-jp-2) + ;;((ascii latin-iso8859-1 greek-iso8859-7 + ;; latin-jisx0201 japanese-jisx0208-1978 + ;; chinese-gb2312 japanese-jisx0208 + ;; korean-ksc5601 japanese-jisx0212 + ;; chinese-cns11643-1 chinese-cns11643-2) . iso-2022-int-1) + ;;((ascii latin-iso8859-1 latin-iso8859-2 + ;; cyrillic-iso8859-5 greek-iso8859-7 + ;; latin-jisx0201 japanese-jisx0208-1978 + ;; chinese-gb2312 japanese-jisx0208 + ;; korean-ksc5601 japanese-jisx0212 + ;; chinese-cns11643-1 chinese-cns11643-2 + ;; chinese-cns11643-3 chinese-cns11643-4 + ;; chinese-cns11643-5 chinese-cns11643-6 + ;; chinese-cns11643-7) . iso-2022-int-1) + ))) + +(defun-maybe coding-system-get (coding-system prop) + "Extract a value from CODING-SYSTEM's property list for property PROP." + (plist-get (coding-system-plist coding-system) prop) + ) + +(defun coding-system-to-mime-charset (coding-system) + "Convert CODING-SYSTEM to a MIME-charset. +Return nil if corresponding MIME-charset is not found." + (or (car (rassq coding-system mime-charset-coding-system-alist)) + (coding-system-get coding-system 'mime-charset) + )) + +(defun-maybe-cond mime-charset-list () + "Return a list of all existing MIME-charset." + ((boundp 'coding-system-list) + (let ((dest (mapcar (function car) mime-charset-coding-system-alist)) + (rest coding-system-list) + cs) + (while rest + (setq cs (car rest)) + (unless (rassq cs mime-charset-coding-system-alist) + (if (setq cs (coding-system-get cs 'mime-charset)) + (or (rassq cs mime-charset-coding-system-alist) + (memq cs dest) + (setq dest (cons cs dest)) + ))) + (setq rest (cdr rest))) + dest)) + (t + (let ((dest (mapcar (function car) mime-charset-coding-system-alist)) + (rest (coding-system-list)) + cs) + (while rest + (setq cs (car rest)) + (unless (rassq cs mime-charset-coding-system-alist) + (when (setq cs (or (coding-system-get cs 'mime-charset) + (and + (setq cs (aref + (coding-system-get cs 'coding-spec) + 2)) + (string-match "(MIME:[ \t]*\\([^,)]+\\)" cs) + (match-string 1 cs)))) + (setq cs (intern (downcase cs))) + (or (rassq cs mime-charset-coding-system-alist) + (memq cs dest) + (setq dest (cons cs dest)) + ))) + (setq rest (cdr rest))) + dest) + )) + +(static-when (and (string= (decode-coding-string "\e.A\eN!" 'ctext) "\eN!") + (or (not (find-coding-system 'x-ctext)) + (coding-system-get 'x-ctext 'apel))) + (unless (find-coding-system 'x-ctext) + (make-coding-system + 'x-ctext 2 ?x + "Compound text based generic encoding for decoding unknown messages." + '((ascii t) (latin-iso8859-1 t) t t + nil ascii-eol ascii-cntl nil locking-shift single-shift nil nil nil + init-bol nil nil) + '((safe-charsets . t) + (mime-charset . x-ctext))) + (coding-system-put 'x-ctext 'apel t) + )) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'mcs-e20) (require 'apel-ver)) + +;;; mcs-e20.el ends here diff --git a/apel-10.7/mcs-ltn1.el b/apel-10.7/mcs-ltn1.el new file mode 100644 index 0000000..8cf14e6 --- /dev/null +++ b/apel-10.7/mcs-ltn1.el @@ -0,0 +1,110 @@ +;;; mcs-ltn1.el --- MIME charset implementation for Emacs 19 +;;; and XEmacs without MULE + +;; Copyright (C) 1995,1996,1997,1998,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(defvar charsets-mime-charset-alist + '(((ascii) . us-ascii))) + +(defvar default-mime-charset 'iso-8859-1) + +(defsubst lbt-to-string (lbt) + (cdr (assq lbt '((nil . nil) + (CRLF . "\r\n") + (CR . "\r") + (dos . "\r\n") + (mac . "\r")))) + ) + +(defun mime-charset-to-coding-system (charset &optional lbt) + (if (stringp charset) + (setq charset (intern (downcase charset)))) + (if (memq charset (list 'us-ascii default-mime-charset)) + charset)) + +(defalias 'mime-charset-p 'mime-charset-to-coding-system) + +(defun detect-mime-charset-region (start end) + "Return MIME charset for region between START and END." + (if (save-excursion + (goto-char start) + (re-search-forward "[\200-\377]" end t)) + default-mime-charset + 'us-ascii)) + +(defun encode-mime-charset-region (start end charset &optional lbt) + "Encode the text between START and END as MIME CHARSET." + (let ((newline (lbt-to-string lbt))) + (if newline + (save-excursion + (save-restriction + (narrow-to-region start end) + (goto-char (point-min)) + (while (search-forward "\n" nil t) + (replace-match newline)) + ))) + )) + +(defun decode-mime-charset-region (start end charset &optional lbt) + "Decode the text between START and END as MIME CHARSET." + (let ((newline (lbt-to-string lbt))) + (if newline + (save-excursion + (save-restriction + (narrow-to-region start end) + (goto-char (point-min)) + (while (search-forward newline nil t) + (replace-match "\n")) + ))) + )) + +(defun encode-mime-charset-string (string charset &optional lbt) + "Encode the STRING as MIME CHARSET." + (if lbt + (with-temp-buffer + (insert string) + (encode-mime-charset-region (point-min)(point-max) charset lbt) + (buffer-string)) + string)) + +(defun decode-mime-charset-string (string charset &optional lbt) + "Decode the STRING as MIME CHARSET." + (if lbt + (with-temp-buffer + (insert string) + (decode-mime-charset-region (point-min)(point-max) charset lbt) + (buffer-string)) + string)) + +(defalias 'write-region-as-mime-charset 'write-region) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'mcs-ltn1) (require 'apel-ver)) + +;;; mcs-ltn1.el ends here diff --git a/apel-10.7/mcs-nemacs.el b/apel-10.7/mcs-nemacs.el new file mode 100644 index 0000000..e203a10 --- /dev/null +++ b/apel-10.7/mcs-nemacs.el @@ -0,0 +1,130 @@ +;;; mcs-nemacs.el --- MIME charset implementation for Nemacs + +;; Copyright (C) 1995,1996,1997,1998,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(defvar charsets-mime-charset-alist + '(((ascii) . us-ascii))) + +(defvar default-mime-charset 'iso-2022-jp) + +(defvar mime-charset-coding-system-alist + '((iso-2022-jp . 2) + (shift_jis . 1) + )) + +(defsubst lbt-to-string (lbt) + (cdr (assq lbt '((nil . nil) + (CRLF . "\r\n") + (CR . "\r") + (dos . "\r\n") + (mac . "\r")))) + ) + +(defun mime-charset-to-coding-system (charset &optional lbt) + (if (stringp charset) + (setq charset (intern (downcase charset))) + ) + (cdr (assq charset mime-charset-coding-system-alist))) + +(fset 'mime-charset-p 'mime-charset-to-coding-system) + +(defun detect-mime-charset-region (start end) + "Return MIME charset for region between START and END. +\[emu-nemacs.el]" + (if (save-excursion + (save-restriction + (narrow-to-region start end) + (goto-char start) + (re-search-forward "[\200-\377]" nil t))) + default-mime-charset + 'us-ascii)) + +(defun encode-mime-charset-region (start end charset &optional lbt) + "Encode the text between START and END as MIME CHARSET. +\[emu-nemacs.el]" + (let ((cs (mime-charset-to-coding-system charset)) + (nl (lbt-to-string lbt))) + (and (numberp cs) + (or (= cs 3) + (save-excursion + (save-restriction + (narrow-to-region start end) + (convert-region-kanji-code start end 3 cs) + (if nl + (progn + (goto-char (point-min)) + (while (search-forward "\n" nil t) + (replace-match nl))) + ))) + )))) + +(defun decode-mime-charset-region (start end charset &optional lbt) + "Decode the text between START and END as MIME CHARSET. +\[emu-nemacs.el]" + (let ((cs (mime-charset-to-coding-system charset)) + (nl (lbt-to-string lbt))) + (and (numberp cs) + (or (= cs 3) + (save-excursion + (save-restriction + (narrow-to-region start end) + (convert-region-kanji-code start end cs 3) + (if nl + (progn + (goto-char (point-min)) + (while (search-forward nl nil t) + (replace-match "\n"))) + ))) + )))) + +(defun encode-mime-charset-string (string charset &optional lbt) + "Encode the STRING as MIME CHARSET. [emu-nemacs.el]" + (with-temp-buffer + (insert string) + (encode-mime-charset-region (point-min)(point-max) charset lbt) + (buffer-string))) + +(defun decode-mime-charset-string (string charset &optional lbt) + "Decode the STRING as MIME CHARSET. [emu-nemacs.el]" + (with-temp-buffer + (insert string) + (decode-mime-charset-region (point-min)(point-max) charset lbt) + (buffer-string))) + +(defun write-region-as-mime-charset (charset start end filename) + "Like `write-region', q.v., but code-convert by MIME CHARSET. +\[emu-nemacs.el]" + (let ((kanji-fileio-code + (or (mime-charset-to-coding-system charset) 0))) + (write-region start end filename))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'mcs-nemacs) (require 'apel-ver)) + +;;; mcs-nemacs.el ends here diff --git a/apel-10.7/mcs-om.el b/apel-10.7/mcs-om.el new file mode 100644 index 0000000..35bb53d --- /dev/null +++ b/apel-10.7/mcs-om.el @@ -0,0 +1,243 @@ +;;; mcs-om.el --- MIME charset implementation for Mule 1.* and Mule 2.* + +;; Copyright (C) 1995,1996,1997,1998 MORIOKA Tomohiko + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'poem) + +(defsubst lbt-to-string (lbt) + (cdr (assq lbt '((nil . nil) + (CRLF . "\r\n") + (CR . "\r") + (dos . "\r\n") + (mac . "\r")))) + ) + +(defun encode-mime-charset-region (start end charset &optional lbt) + "Encode the text between START and END as MIME CHARSET." + (let ((cs (mime-charset-to-coding-system charset lbt))) + (if cs + (code-convert start end *internal* cs) + (if (and lbt (setq cs (mime-charset-to-coding-system charset))) + (let ((newline (lbt-to-string lbt))) + (save-excursion + (save-restriction + (narrow-to-region start end) + (code-convert (point-min) (point-max) *internal* cs) + (if newline + (goto-char (point-min)) + (while (search-forward "\n" nil t) + (replace-match newline)))))))))) + +(defun decode-mime-charset-region (start end charset &optional lbt) + "Decode the text between START and END as MIME CHARSET." + (let ((cs (mime-charset-to-coding-system charset lbt))) + (if cs + (code-convert start end cs *internal*) + (if (and lbt (setq cs (mime-charset-to-coding-system charset))) + (let ((newline (lbt-to-string lbt))) + (if newline + (save-excursion + (save-restriction + (narrow-to-region start end) + (goto-char (point-min)) + (while (search-forward newline nil t) + (replace-match "\n"))) + (code-convert (point-min) (point-max) cs *internal*)) + (code-convert start end cs *internal*))))))) + +(defun encode-mime-charset-string (string charset &optional lbt) + "Encode the STRING as MIME CHARSET." + (let ((cs (mime-charset-to-coding-system charset lbt))) + (if cs + (code-convert-string string *internal* cs) + (if (and lbt (setq cs (mime-charset-to-coding-system charset))) + (let ((newline (lbt-to-string lbt))) + (if newline + (with-temp-buffer + (insert string) + (code-convert (point-min) (point-max) *internal* cs) + (goto-char (point-min)) + (while (search-forward "\n" nil t) + (replace-match newline)) + (buffer-string)) + (decode-coding-string string cs))) + string)))) + +(defun decode-mime-charset-string (string charset &optional lbt) + "Decode the STRING which is encoded in MIME CHARSET." + (let ((cs (mime-charset-to-coding-system charset lbt))) + (if cs + (decode-coding-string string cs) + (if (and lbt (setq cs (mime-charset-to-coding-system charset))) + (let ((newline (lbt-to-string lbt))) + (if newline + (with-temp-buffer + (insert string) + (goto-char (point-min)) + (while (search-forward newline nil t) + (replace-match "\n")) + (code-convert (point-min) (point-max) cs *internal*) + (buffer-string)) + (decode-coding-string string cs))) + string)))) + +(cond + ((and (>= emacs-major-version 19) (>= emacs-minor-version 29)) + ;; for MULE 2.3 based on Emacs 19.34. + (defun write-region-as-mime-charset (charset start end filename + &optional append visit lockname) + "Like `write-region', q.v., but code-convert by MIME CHARSET." + (let ((file-coding-system + (or (mime-charset-to-coding-system charset) + *noconv*))) + (write-region start end filename append visit lockname))) + ) + (t + ;; for MULE 2.3 based on Emacs 19.28. + (defun write-region-as-mime-charset (charset start end filename + &optional append visit lockname) + "Like `write-region', q.v., but code-convert by MIME CHARSET." + (let ((file-coding-system + (or (mime-charset-to-coding-system charset) + *noconv*))) + (write-region start end filename append visit))) + )) + + +;;; @ to coding-system +;;; + +(condition-case nil + (require 'cyrillic) + (error nil)) + +(defvar mime-charset-coding-system-alist + '((iso-8859-1 . *ctext*) + (x-ctext . *ctext*) + (gb2312 . *euc-china*) + (koi8-r . *koi8*) + (iso-2022-jp-2 . *iso-2022-ss2-7*) + (x-iso-2022-jp-2 . *iso-2022-ss2-7*) + (shift_jis . *sjis*) + (x-shiftjis . *sjis*) + )) + +(defsubst mime-charset-to-coding-system (charset &optional lbt) + "Return coding-system corresponding with CHARSET. +CHARSET is a symbol whose name is MIME charset. +If optional argument LBT (`CRLF', `LF', `CR', `unix', `dos' or `mac') +is specified, it is used as line break code type of coding-system." + (if (stringp charset) + (setq charset (intern (downcase charset))) + ) + (setq charset (or (cdr (assq charset mime-charset-coding-system-alist)) + (intern (concat "*" (symbol-name charset) "*")))) + (if lbt + (setq charset (intern (format "%s%s" charset + (cond ((eq lbt 'CRLF) 'dos) + ((eq lbt 'LF) 'unix) + ((eq lbt 'CR) 'mac) + (t lbt))))) + ) + (if (coding-system-p charset) + charset + )) + + +;;; @ detection +;;; + +(defvar charsets-mime-charset-alist + (let ((alist + '(((lc-ascii) . us-ascii) + ((lc-ascii lc-ltn1) . iso-8859-1) + ((lc-ascii lc-ltn2) . iso-8859-2) + ((lc-ascii lc-ltn3) . iso-8859-3) + ((lc-ascii lc-ltn4) . iso-8859-4) +;;; ((lc-ascii lc-crl) . iso-8859-5) + ((lc-ascii lc-crl) . koi8-r) + ((lc-ascii lc-arb) . iso-8859-6) + ((lc-ascii lc-grk) . iso-8859-7) + ((lc-ascii lc-hbw) . iso-8859-8) + ((lc-ascii lc-ltn5) . iso-8859-9) + ((lc-ascii lc-roman lc-jpold lc-jp) . iso-2022-jp) + ((lc-ascii lc-kr) . euc-kr) + ((lc-ascii lc-cn) . gb2312) + ((lc-ascii lc-big5-1 lc-big5-2) . big5) + ((lc-ascii lc-roman lc-ltn1 lc-grk + lc-jpold lc-cn lc-jp lc-kr + lc-jp2) . iso-2022-jp-2) + ((lc-ascii lc-roman lc-ltn1 lc-grk + lc-jpold lc-cn lc-jp lc-kr lc-jp2 + lc-cns1 lc-cns2) . iso-2022-int-1) + ((lc-ascii lc-roman + lc-ltn1 lc-ltn2 lc-crl lc-grk + lc-jpold lc-cn lc-jp lc-kr lc-jp2 + lc-cns1 lc-cns2 lc-cns3 lc-cns4 + lc-cns5 lc-cns6 lc-cns7) . iso-2022-int-1) + )) + dest) + (while alist + (catch 'not-found + (let ((pair (car alist))) + (setq dest + (append dest + (list + (cons (mapcar (function + (lambda (cs) + (if (boundp cs) + (symbol-value cs) + (throw 'not-found nil) + ))) + (car pair)) + (cdr pair))))))) + (setq alist (cdr alist))) + dest)) + +(defvar default-mime-charset 'x-ctext + "Default value of MIME-charset. +It is used when MIME-charset is not specified. +It must be symbol.") + +(defvar default-mime-charset-for-write + default-mime-charset + "Default value of MIME-charset for encoding. +It is used when suitable MIME-charset is not found. +It must be symbol.") + +(defun detect-mime-charset-region (start end) + "Return MIME charset for region between START and END." + (or (charsets-to-mime-charset + (cons lc-ascii (find-charset-region start end))) + default-mime-charset-for-write)) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'mcs-om) (require 'apel-ver)) + +;;; mcs-om.el ends here diff --git a/apel-10.7/mcs-xm.el b/apel-10.7/mcs-xm.el new file mode 100644 index 0000000..718794c --- /dev/null +++ b/apel-10.7/mcs-xm.el @@ -0,0 +1,201 @@ +;;; mcs-xm.el --- MIME charset implementation for XEmacs-mule + +;; Copyright (C) 1997,1998,1999,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: MIME-charset, coding-system, emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; 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 module requires Emacs 20.0.93, XEmacs 20.3-b5 (with mule) +;; or later. + +;;; Code: + +(require 'poem) + + +(defun encode-mime-charset-region (start end charset &optional lbt) + "Encode the text between START and END as MIME CHARSET." + (let ((cs (mime-charset-to-coding-system charset lbt))) + (if cs + (encode-coding-region start end cs) + ))) + + +(defcustom mime-charset-decoder-alist + (let ((alist + '((hz-gb-2312 . decode-mime-charset-region-for-hz) + (t . decode-mime-charset-region-default)))) + (if (featurep 'utf-2000) + alist + (list* + '(iso-2022-jp . decode-mime-charset-region-with-iso646-unification) + '(iso-2022-jp-2 . decode-mime-charset-region-with-iso646-unification) + alist))) + "Alist MIME-charset vs. decoder function." + :group 'i18n + :type '(repeat (cons mime-charset function))) + +(defsubst decode-mime-charset-region-default (start end charset lbt) + (let ((cs (mime-charset-to-coding-system charset lbt))) + (if cs + (decode-coding-region start end cs) + ))) + +(unless (featurep 'utf-2000) + (require 'mcs-xmu)) + +(defun decode-mime-charset-region-for-hz (start end charset lbt) + (if lbt + (save-restriction + (narrow-to-region start end) + (decode-coding-region (point-min)(point-max) + (mime-charset-to-coding-system 'raw-text lbt)) + (decode-hz-region (point-min)(point-max))) + (decode-hz-region start end))) + +(defun decode-mime-charset-region (start end charset &optional lbt) + "Decode the text between START and END as MIME CHARSET." + (if (stringp charset) + (setq charset (intern (downcase charset))) + ) + (let ((func (cdr (or (assq charset mime-charset-decoder-alist) + (assq t mime-charset-decoder-alist))))) + (funcall func start end charset lbt))) + +(defun encode-mime-charset-string (string charset &optional lbt) + "Encode the STRING as MIME CHARSET." + (let ((cs (mime-charset-to-coding-system charset lbt))) + (if cs + (encode-coding-string string cs) + string))) + +;; (defsubst decode-mime-charset-string (string charset) +;; "Decode the STRING as MIME CHARSET." +;; (let ((cs (mime-charset-to-coding-system charset))) +;; (if cs +;; (decode-coding-string string cs) +;; string))) +(defun decode-mime-charset-string (string charset &optional lbt) + "Decode the STRING as MIME CHARSET." + (with-temp-buffer + (insert string) + (decode-mime-charset-region (point-min)(point-max) charset lbt) + (buffer-string))) + + +(defvar charsets-mime-charset-alist + (delq + nil + `(((ascii) . us-ascii) + ((ascii latin-iso8859-1) . iso-8859-1) + ((ascii latin-iso8859-2) . iso-8859-2) + ((ascii latin-iso8859-3) . iso-8859-3) + ((ascii latin-iso8859-4) . iso-8859-4) + ((ascii cyrillic-iso8859-5) . iso-8859-5) + ;;((ascii cyrillic-iso8859-5) . koi8-r) + ((ascii arabic-iso8859-6) . iso-8859-6) + ((ascii greek-iso8859-7) . iso-8859-7) + ((ascii hebrew-iso8859-8) . iso-8859-8) + ((ascii latin-iso8859-9) . iso-8859-9) + ,(if (find-coding-system 'iso-8859-14) + '((ascii latin-iso8859-14) . iso-8859-14)) + ,(if (find-coding-system 'iso-8859-15) + '((ascii latin-iso8859-15) . iso-8859-15)) + ,(if (featurep 'utf-2000) + '((ascii latin-jisx0201 + japanese-jisx0208-1978 + japanese-jisx0208 + japanese-jisx0208-1990) . iso-2022-jp) + '((ascii latin-jisx0201 + japanese-jisx0208-1978 japanese-jisx0208) + . iso-2022-jp)) + ,(if (featurep 'utf-2000) + '((ascii latin-jisx0201 + japanese-jisx0208-1978 + japanese-jisx0208 + japanese-jisx0208-1990 + japanese-jisx0213-1 + japanese-jisx0213-2) . iso-2022-jp-3) + '((ascii latin-jisx0201 + japanese-jisx0208-1978 japanese-jisx0208 + japanese-jisx0213-1 + japanese-jisx0213-2) . iso-2022-jp-3)) + ,(if (featurep 'utf-2000) + '((ascii latin-jisx0201 katakana-jisx0201 + japanese-jisx0208-1990) . shift_jis) + '((ascii latin-jisx0201 + katakana-jisx0201 japanese-jisx0208) . shift_jis)) + ((ascii korean-ksc5601) . euc-kr) + ((ascii chinese-gb2312) . gb2312) + ((ascii chinese-big5-1 chinese-big5-2) . big5) + ((ascii thai-xtis) . tis-620) + ,(if (featurep 'utf-2000) + '((ascii latin-jisx0201 latin-iso8859-1 + greek-iso8859-7 + japanese-jisx0208-1978 japanese-jisx0208 + japanese-jisx0208-1990 + japanese-jisx0212 + chinese-gb2312 + korean-ksc5601) . iso-2022-jp-2) + '((ascii latin-jisx0201 latin-iso8859-1 + greek-iso8859-7 + japanese-jisx0208-1978 japanese-jisx0208 + japanese-jisx0212 + chinese-gb2312 + korean-ksc5601) . iso-2022-jp-2)) + ;;((ascii latin-iso8859-1 greek-iso8859-7 + ;; latin-jisx0201 japanese-jisx0208-1978 + ;; chinese-gb2312 japanese-jisx0208 + ;; korean-ksc5601 japanese-jisx0212 + ;; chinese-cns11643-1 chinese-cns11643-2) . iso-2022-int-1) + ))) + + +(defun coding-system-to-mime-charset (coding-system) + "Convert CODING-SYSTEM to a MIME-charset. +Return nil if corresponding MIME-charset is not found." + (setq coding-system + (coding-system-name (coding-system-base coding-system))) + (or (car (rassq coding-system mime-charset-coding-system-alist)) + coding-system)) + +(defun mime-charset-list () + "Return a list of all existing MIME-charset." + (let ((dest (mapcar (function car) mime-charset-coding-system-alist)) + (rest (coding-system-list)) + cs) + (while rest + (setq cs (coding-system-name (coding-system-base (car rest)))) + (or (rassq cs mime-charset-coding-system-alist) + (memq cs dest) + (setq dest (cons cs dest))) + (setq rest (cdr rest))) + dest)) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'mcs-xm) (require 'apel-ver)) + +;;; mcs-xm.el ends here diff --git a/apel-10.7/mcs-xmu.el b/apel-10.7/mcs-xmu.el new file mode 100644 index 0000000..28ec95d --- /dev/null +++ b/apel-10.7/mcs-xmu.el @@ -0,0 +1,101 @@ +;;; mcs-xmu.el --- Functions to unify ISO646 characters for XEmacs-mule + +;; Copyright (C) 1997,1998,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; 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 module will be loaded from mcs-xm automatically. +;; There is no guarantee that it will work alone. + +;;; Code: + +(defcustom mime-iso646-character-unification-alist + (eval-when-compile + (let (dest + (i 33)) + (while (< i 92) + (setq dest + (cons (cons (char-to-string (make-char 'latin-jisx0201 i)) + (format "%c" i)) + dest)) + (setq i (1+ i))) + (setq i 93) + (while (< i 126) + (setq dest + (cons (cons (char-to-string (make-char 'latin-jisx0201 i)) + (format "%c" i)) + dest)) + (setq i (1+ i))) + (nreverse dest))) + "Alist unified string vs. canonical string." + :group 'i18n + :type '(repeat (cons string string))) + +(defcustom mime-unified-character-face nil + "Face of unified character." + :group 'i18n + :type 'face) + +(defcustom mime-character-unification-limit-size 2048 + "Limit size to unify characters. It is referred by the function +`decode-mime-charset-region-with-iso646-unification'. If the length of +the specified region (start end) is larger than its value, the function +works for only decoding MIME-CHARSET. If it is nil, size is unlimited." + :group 'i18n + :type '(radio (integer :tag "Max size") + (const :tag "Unlimited" nil))) + +(defun decode-mime-charset-region-with-iso646-unification (start end charset + lbt) + (save-excursion + (save-restriction + (narrow-to-region start end) + (if (prog1 + (or (null mime-character-unification-limit-size) + (<= (- end start) mime-character-unification-limit-size)) + (decode-mime-charset-region-default start end charset lbt)) + (let ((rest mime-iso646-character-unification-alist)) + (while rest + (let ((pair (car rest)) + case-fold-search) + (goto-char (point-min)) + (while (search-forward (car pair) nil t) + (let ((str (cdr pair))) + (if mime-unified-character-face + (put-text-property + 0 (length str) + 'face mime-unified-character-face str)) + (replace-match str 'fixed-case 'literal) + ) + )) + (setq rest (cdr rest))))) + ))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'mcs-xmu) (require 'apel-ver)) + +;;; mcs-xmu.el ends here diff --git a/apel-10.7/mule-caesar.el b/apel-10.7/mule-caesar.el new file mode 100644 index 0000000..172b586 --- /dev/null +++ b/apel-10.7/mule-caesar.el @@ -0,0 +1,86 @@ +;;; mule-caesar.el --- ROT 13-47 Caesar rotation utility + +;; Copyright (C) 1997,1998 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: ROT 13-47, caesar, mail, news, text/x-rot13-47 + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'emu) ; for backward compatibility. +(require 'poe) ; char-after. +(require 'poem) ; charset-chars, char-charset, + ; and split-char. + +(defun mule-caesar-region (start end &optional stride-ascii) + "Caesar rotation of current region. +Optional argument STRIDE-ASCII is rotation-size for Latin alphabet +\(A-Z and a-z). For non-ASCII text, ROT-N/2 will be performed in any +case (N=charset-chars; 94 for 94 or 94x94 graphic character set; 96 +for 96 or 96x96 graphic character set)." + (interactive "r\nP") + (setq stride-ascii (if stride-ascii + (mod stride-ascii 26) + 13)) + (save-excursion + (save-restriction + (narrow-to-region start end) + (goto-char start) + (while (< (point)(point-max)) + (let* ((chr (char-after (point)))) + (cond ((and (<= ?A chr) (<= chr ?Z)) + (setq chr (+ chr stride-ascii)) + (if (> chr ?Z) + (setq chr (- chr 26)) + ) + (delete-char 1) + (insert chr) + ) + ((and (<= ?a chr) (<= chr ?z)) + (setq chr (+ chr stride-ascii)) + (if (> chr ?z) + (setq chr (- chr 26)) + ) + (delete-char 1) + (insert chr) + ) + ((<= chr ?\x9f) + (forward-char) + ) + (t + (let* ((stride (lsh (charset-chars (char-charset chr)) -1)) + (ret (mapcar (function + (lambda (octet) + (if (< octet 80) + (+ octet stride) + (- octet stride) + ))) + (cdr (split-char chr))))) + (delete-char 1) + (insert (make-char (char-charset chr) + (car ret)(car (cdr ret)))) + ))) + ))))) + + +(require 'product) +(product-provide (provide 'mule-caesar) (require 'apel-ver)) + +;;; mule-caesar.el ends here diff --git a/apel-10.7/path-util.el b/apel-10.7/path-util.el new file mode 100644 index 0000000..2d004db --- /dev/null +++ b/apel-10.7/path-util.el @@ -0,0 +1,201 @@ +;;; path-util.el --- Emacs Lisp file detection utility + +;; Copyright (C) 1996,1997,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: file detection, install, module + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'poe) + +(defvar default-load-path load-path + "*Base of `load-path'. +It is used as default value of target path to search file or +subdirectory under load-path.") + +;;;###autoload +(defun add-path (path &rest options) + "Add PATH to `load-path' if it exists under `default-load-path' +directories and it does not exist in `load-path'. + +You can use following PATH styles: + load-path relative: \"PATH/\" + (it is searched from `default-load-path') + home directory relative: \"~/PATH/\" \"~USER/PATH/\" + absolute path: \"/HOO/BAR/BAZ/\" + +You can specify following OPTIONS: + 'all-paths search from `load-path' + instead of `default-load-path' + 'append add PATH to the last of `load-path'" + (let ((rest (if (memq 'all-paths options) + load-path + default-load-path)) + p) + (if (and (catch 'tag + (while rest + (setq p (expand-file-name path (car rest))) + (if (file-directory-p p) + (throw 'tag p)) + (setq rest (cdr rest)))) + (not (or (member p load-path) + (if (string-match "/$" p) + (member (substring p 0 (1- (length p))) load-path) + (member (file-name-as-directory p) load-path))))) + (setq load-path + (if (memq 'append options) + (append load-path (list p)) + (cons p load-path)))))) + +;;;###autoload +(defun add-latest-path (pattern &optional all-paths) + "Add latest path matched by PATTERN to `load-path' +if it exists under `default-load-path' directories +and it does not exist in `load-path'. + +If optional argument ALL-PATHS is specified, it is searched from all +of load-path instead of default-load-path." + (let ((path (get-latest-path pattern all-paths))) + (if path + (add-to-list 'load-path path) + ))) + +;;;###autoload +(defun get-latest-path (pattern &optional all-paths) + "Return latest directory in default-load-path +which is matched to regexp PATTERN. +If optional argument ALL-PATHS is specified, +it is searched from all of load-path instead of default-load-path." + (catch 'tag + (let ((paths (if all-paths + load-path + default-load-path)) + dir) + (while (setq dir (car paths)) + (if (and (file-exists-p dir) + (file-directory-p dir) + ) + (let ((files (sort (directory-files dir t pattern t) + (function file-newer-than-file-p))) + file) + (while (setq file (car files)) + (if (file-directory-p file) + (throw 'tag file) + ) + (setq files (cdr files)) + ))) + (setq paths (cdr paths)) + )))) + +;;;###autoload +(defun file-installed-p (file &optional paths) + "Return absolute-path of FILE if FILE exists in PATHS. +If PATHS is omitted, `load-path' is used." + (if (null paths) + (setq paths load-path) + ) + (catch 'tag + (let (path) + (while paths + (setq path (expand-file-name file (car paths))) + (if (file-exists-p path) + (throw 'tag path) + ) + (setq paths (cdr paths)) + )))) + +;;;###autoload +(defvar exec-suffix-list '("") + "*List of suffixes for executable.") + +;;;###autoload +(defun exec-installed-p (file &optional paths suffixes) + "Return absolute-path of FILE if FILE exists in PATHS. +If PATHS is omitted, `exec-path' is used. +If suffixes is omitted, `exec-suffix-list' is used." + (or paths + (setq paths exec-path) + ) + (or suffixes + (setq suffixes exec-suffix-list) + ) + (let (files) + (catch 'tag + (while suffixes + (let ((suf (car suffixes))) + (if (and (not (string= suf "")) + (string-match (concat (regexp-quote suf) "$") file)) + (progn + (setq files (list file)) + (throw 'tag nil) + ) + (setq files (cons (concat file suf) files)) + ) + (setq suffixes (cdr suffixes)) + ))) + (setq files (nreverse files)) + (catch 'tag + (while paths + (let ((path (car paths)) + (files files) + ) + (while files + (setq file (expand-file-name (car files) path)) + (if (file-executable-p file) + (throw 'tag file) + ) + (setq files (cdr files)) + ) + (setq paths (cdr paths)) + ))))) + +;;;###autoload +(defun module-installed-p (module &optional paths) + "Return t if module is provided or exists in PATHS. +If PATHS is omitted, `load-path' is used." + (or (featurep module) + (let ((file (symbol-name module))) + (or paths + (setq paths load-path) + ) + (catch 'tag + (while paths + (let ((stem (expand-file-name file (car paths))) + (sufs '(".elc" ".el")) + ) + (while sufs + (let ((file (concat stem (car sufs)))) + (if (file-exists-p file) + (throw 'tag file) + )) + (setq sufs (cdr sufs)) + )) + (setq paths (cdr paths)) + ))))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'path-util) (require 'apel-ver)) + +;;; path-util.el ends here diff --git a/apel-10.7/pccl-20.el b/apel-10.7/pccl-20.el new file mode 100644 index 0000000..0a62e95 --- /dev/null +++ b/apel-10.7/pccl-20.el @@ -0,0 +1,175 @@ +;;; pccl-20.el --- Portable CCL utility for Emacs 20 and XEmacs-21-mule + +;; Copyright (C) 1998 Free Software Foundation, Inc. +;; Copyright (C) 1998 Tanaka Akira + +;; Author: Tanaka Akira +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(eval-when-compile (require 'ccl)) +(require 'broken) + +(broken-facility ccl-accept-symbol-as-program + "Emacs does not accept symbol as CCL program." + (progn + (define-ccl-program test-ccl-identity + '(1 ((read r0) (loop (write-read-repeat r0))))) + (condition-case nil + (progn + (funcall + (if (fboundp 'ccl-vector-execute-on-string) + 'ccl-vector-execute-on-string + 'ccl-execute-on-string) + 'test-ccl-identity + (make-vector 9 nil) + "") + t) + (error nil))) + t) + +(eval-and-compile + + (static-if (featurep 'xemacs) + (defadvice make-coding-system (before ccl-compat (name type &rest ad-subr-args) activate) + (when (and (integerp type) + (eq type 4) + (characterp (ad-get-arg 2)) + (stringp (ad-get-arg 3)) + (consp (ad-get-arg 4)) + (symbolp (car (ad-get-arg 4))) + (symbolp (cdr (ad-get-arg 4)))) + (setq type 'ccl) + (setq ad-subr-args + (list + (ad-get-arg 3) + (append + (list + 'mnemonic (char-to-string (ad-get-arg 2)) + 'decode (symbol-value (car (ad-get-arg 4))) + 'encode (symbol-value (cdr (ad-get-arg 4)))) + (ad-get-arg 5))))))) + + (if (featurep 'xemacs) + (defun make-ccl-coding-system (name mnemonic docstring decoder encoder) + "\ +Define a new CODING-SYSTEM by CCL programs DECODER and ENCODER. + +CODING-SYSTEM, DECODER and ENCODER must be symbol." + (make-coding-system + name 'ccl docstring + (list 'mnemonic (char-to-string mnemonic) + 'decode (symbol-value decoder) + 'encode (symbol-value encoder)))) + (defun make-ccl-coding-system + (coding-system mnemonic docstring decoder encoder) + "\ +Define a new CODING-SYSTEM by CCL programs DECODER and ENCODER. + +CODING-SYSTEM, DECODER and ENCODER must be symbol." + (when-broken ccl-accept-symbol-as-program + (setq decoder (symbol-value decoder)) + (setq encoder (symbol-value encoder))) + (make-coding-system coding-system 4 mnemonic docstring + (cons decoder encoder))) + ) + + (when-broken ccl-accept-symbol-as-program + + (when (subrp (symbol-function 'ccl-execute)) + (fset 'ccl-vector-program-execute + (symbol-function 'ccl-execute)) + (defun ccl-execute (ccl-prog reg) + "\ +Execute CCL-PROG with registers initialized by REGISTERS. +If CCL-PROG is symbol, it is dereferenced." + (ccl-vector-program-execute + (if (symbolp ccl-prog) (symbol-value ccl-prog) ccl-prog) + reg))) + + (when (subrp (symbol-function 'ccl-execute-on-string)) + (fset 'ccl-vector-program-execute-on-string + (symbol-function 'ccl-execute-on-string)) + (defun ccl-execute-on-string (ccl-prog status string &optional contin) + "\ +Execute CCL-PROG with initial STATUS on STRING. +If CCL-PROG is symbol, it is dereferenced." + (ccl-vector-program-execute-on-string + (if (symbolp ccl-prog) (symbol-value ccl-prog) ccl-prog) + status string contin))) + ) + ) + +(eval-when-compile + (define-ccl-program test-ccl-eof-block + '(1 + ((read r0) + (write r0) + (read r0)) + (write "[EOF]"))) + + (make-ccl-coding-system + 'test-ccl-eof-block-cs ?T "CCL_EOF_BLOCK tester" + 'test-ccl-eof-block 'test-ccl-eof-block) + ) + +(broken-facility ccl-execute-eof-block-on-encoding-null + "Emacs forgets executing CCL_EOF_BLOCK with encoding on empty input. (Fixed on Emacs 20.4)" + (equal (encode-coding-string "" 'test-ccl-eof-block-cs) "[EOF]")) + +(broken-facility ccl-execute-eof-block-on-encoding-some + "Emacs forgets executing CCL_EOF_BLOCK with encoding on non-empty input. (Fixed on Emacs 20.3)" + (equal (encode-coding-string "a" 'test-ccl-eof-block-cs) "a[EOF]")) + +(broken-facility ccl-execute-eof-block-on-decoding-null + "Emacs forgets executing CCL_EOF_BLOCK with decoding on empty input. (Fixed on Emacs 20.4)" + (equal (decode-coding-string "" 'test-ccl-eof-block-cs) "[EOF]")) + +(broken-facility ccl-execute-eof-block-on-decoding-some + "Emacs forgets executing CCL_EOF_BLOCK with decoding on non-empty input. (Fixed on Emacs 20.4)" + (equal (decode-coding-string "a" 'test-ccl-eof-block-cs) "a[EOF]")) + +(broken-facility ccl-execute-eof-block-on-encoding + "Emacs may forget executing CCL_EOF_BLOCK with encoding." + (not (or (broken-p 'ccl-execute-eof-block-on-encoding-null) + (broken-p 'ccl-execute-eof-block-on-encoding-some))) + t) + +(broken-facility ccl-execute-eof-block-on-decoding + "Emacs may forget executing CCL_EOF_BLOCK with decoding." + (not (or (broken-p 'ccl-execute-eof-block-on-decoding-null) + (broken-p 'ccl-execute-eof-block-on-decoding-some))) + t) + +(broken-facility ccl-execute-eof-block + "Emacs may forget executing CCL_EOF_BLOCK." + (not (or (broken-p 'ccl-execute-eof-block-on-encoding) + (broken-p 'ccl-execute-eof-block-on-decoding))) + t) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'pccl-20) (require 'apel-ver)) + +;;; pccl-20.el ends here diff --git a/apel-10.7/pccl-om.el b/apel-10.7/pccl-om.el new file mode 100644 index 0000000..9f9a26f --- /dev/null +++ b/apel-10.7/pccl-om.el @@ -0,0 +1,129 @@ +;;; pccl-om.el --- Portable CCL utility for Mule 2.* + +;; Copyright (C) 1998 Free Software Foundation, Inc. +;; Copyright (C) 1998 Tanaka Akira + +;; Author: Tanaka Akira +;; Shuhei KOBAYASHI +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(eval-when-compile (require 'ccl)) +(require 'broken) + +(broken-facility ccl-accept-symbol-as-program + "Emacs does not accept symbol as CCL program.") + +(eval-and-compile + (defun make-ccl-coding-system + (coding-system mnemonic doc-string decoder encoder) + "\ +Define a new CODING-SYSTEM by CCL programs DECODER and ENCODER. + +CODING-SYSTEM, DECODER and ENCODER must be symbol." + (setq decoder (symbol-value decoder) + encoder (symbol-value encoder)) + (make-coding-system coding-system 4 mnemonic doc-string + nil ; Mule takes one more optional argument: EOL-TYPE. + (cons decoder encoder))) + ) + +(defun ccl-execute (ccl-prog reg) + "Execute CCL-PROG with registers initialized by REGISTERS. +If CCL-PROG is symbol, it is dereferenced." + (exec-ccl + (if (symbolp ccl-prog) (symbol-value ccl-prog) ccl-prog) + reg)) + +(defun ccl-execute-on-string (ccl-prog status string &optional contin) + "Execute CCL-PROG with initial STATUS on STRING. +If CCL-PROG is symbol, it is dereferenced." + (exec-ccl-string + (if (symbolp ccl-prog) (symbol-value ccl-prog) ccl-prog) + status string)) + +(broken-facility ccl-execute-on-string-ignore-contin + "CONTIN argument for ccl-execute-on-string is ignored.") + +(eval-when-compile + (define-ccl-program test-ccl-eof-block + '(1 + ((read r0) + (write r0) + (read r0)) + (write "[EOF]"))) + + (make-ccl-coding-system + 'test-ccl-eof-block-cs ?T "CCL_EOF_BLOCK tester" + 'test-ccl-eof-block 'test-ccl-eof-block) + ) + +(broken-facility ccl-execute-eof-block-on-encoding-null + "Emacs forgets executing CCL_EOF_BLOCK with encoding on empty input." + (equal (code-convert-string "" *internal* 'test-ccl-eof-block-cs) "[EOF]")) + +(broken-facility ccl-execute-eof-block-on-encoding-some + "Emacs forgets executing CCL_EOF_BLOCK with encoding on non-empty input." + (equal (code-convert-string "a" *internal* 'test-ccl-eof-block-cs) "a[EOF]")) + +(broken-facility ccl-execute-eof-block-on-decoding-null + "Emacs forgets executing CCL_EOF_BLOCK with decoding on empty input." + (equal (code-convert-string "" 'test-ccl-eof-block-cs *internal*) "[EOF]")) + +(broken-facility ccl-execute-eof-block-on-decoding-some + "Emacs forgets executing CCL_EOF_BLOCK with decoding on non-empty input." + (equal (code-convert-string "a" 'test-ccl-eof-block-cs *internal*) "a[EOF]")) + +(broken-facility ccl-execute-eof-block-on-encoding + "Emacs may forget executing CCL_EOF_BLOCK with encoding." + (not (or (broken-p 'ccl-execute-eof-block-on-encoding-null) + (broken-p 'ccl-execute-eof-block-on-encoding-some))) + t) + +(broken-facility ccl-execute-eof-block-on-decoding + "Emacs may forget executing CCL_EOF_BLOCK with decoding." + (not (or (broken-p 'ccl-execute-eof-block-on-decoding-null) + (broken-p 'ccl-execute-eof-block-on-decoding-some))) + t) + +(broken-facility ccl-execute-eof-block + "Emacs may forget executing CCL_EOF_BLOCK." + (not (or (broken-p 'ccl-execute-eof-block-on-encoding) + (broken-p 'ccl-execute-eof-block-on-decoding))) + t) + +(broken-facility ccl-cascading-read + "Emacs CCL read command does not accept more than 2 arguments." + (condition-case nil + (progn + (define-ccl-program cascading-read-test + '(1 + (read r0 r1 r2))) + t) + (error nil))) + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'pccl-om) (require 'apel-ver)) + +;;; pccl-om.el ends here diff --git a/apel-10.7/pccl.el b/apel-10.7/pccl.el new file mode 100644 index 0000000..088d5c9 --- /dev/null +++ b/apel-10.7/pccl.el @@ -0,0 +1,170 @@ +;;; pccl.el --- Portable CCL utility for Mule 2.* + +;; Copyright (C) 1998 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'broken) + +(broken-facility ccl-usable + "Emacs has not CCL." + (and (featurep 'mule) + (if (featurep 'xemacs) + (>= emacs-major-version 21) + (>= emacs-major-version 19)))) + +(unless-broken ccl-usable + (require 'advice) + + (if (featurep 'mule) + (progn + (require 'ccl) + (if (featurep 'xemacs) + (if (>= emacs-major-version 21) + ;; for XEmacs 21 with mule + (require 'pccl-20)) + (if (>= emacs-major-version 20) + ;; for Emacs 20 + (require 'pccl-20) + ;; for Mule 2.* + (require 'pccl-om))))) + + (static-if (or (featurep 'xemacs) (< emacs-major-version 21)) + (defadvice define-ccl-program + (before accept-long-ccl-program activate) + "When CCL-PROGRAM is too long, internal buffer is extended automatically." + (let ((try-ccl-compile t) + (prog (eval (ad-get-arg 1)))) + (ad-set-arg 1 (` '(, prog))) + (while try-ccl-compile + (setq try-ccl-compile nil) + (condition-case sig + (ccl-compile prog) + (args-out-of-range + (if (and (eq (car (cdr sig)) ccl-program-vector) + (= (car (cdr (cdr sig))) (length ccl-program-vector))) + (setq ccl-program-vector + (make-vector (* 2 (length ccl-program-vector)) 0) + try-ccl-compile t) + (signal (car sig) (cdr sig))))))))) + + (static-when (and (not (featurep 'xemacs)) (< emacs-major-version 21)) + (defun-maybe transform-make-coding-system-args (name type &optional doc-string props) + "For internal use only. +Transform XEmacs style args for `make-coding-system' to Emacs style. +Value is a list of transformed arguments." + (let ((mnemonic (string-to-char (or (plist-get props 'mnemonic) "?"))) + (eol-type (plist-get props 'eol-type)) + properties tmp) + (cond + ((eq eol-type 'lf) (setq eol-type 'unix)) + ((eq eol-type 'crlf) (setq eol-type 'dos)) + ((eq eol-type 'cr) (setq eol-type 'mac))) + (if (setq tmp (plist-get props 'post-read-conversion)) + (setq properties (plist-put properties 'post-read-conversion tmp))) + (if (setq tmp (plist-get props 'pre-write-conversion)) + (setq properties (plist-put properties 'pre-write-conversion tmp))) + (cond + ((eq type 'shift-jis) + (` ((, name) 1 (, mnemonic) (, doc-string) + nil (, properties) (, eol-type)))) + ((eq type 'iso2022) ; This is not perfect. + (if (plist-get props 'escape-quoted) + (error "escape-quoted is not supported: %S" + (` ((, name) (, type) (, doc-string) (, props))))) + (let ((g0 (plist-get props 'charset-g0)) + (g1 (plist-get props 'charset-g1)) + (g2 (plist-get props 'charset-g2)) + (g3 (plist-get props 'charset-g3)) + (use-roman + (and + (eq (cadr (assoc 'latin-jisx0201 + (plist-get props 'input-charset-conversion))) + 'ascii) + (eq (cadr (assoc 'ascii + (plist-get props 'output-charset-conversion))) + 'latin-jisx0201))) + (use-oldjis + (and + (eq (cadr (assoc 'japanese-jisx0208-1978 + (plist-get props 'input-charset-conversion))) + 'japanese-jisx0208) + (eq (cadr (assoc 'japanese-jisx0208 + (plist-get props 'output-charset-conversion))) + 'japanese-jisx0208-1978)))) + (if (charsetp g0) + (if (plist-get props 'force-g0-on-output) + (setq g0 (` (nil (, g0)))) + (setq g0 (` ((, g0) t))))) + (if (charsetp g1) + (if (plist-get props 'force-g1-on-output) + (setq g1 (` (nil (, g1)))) + (setq g1 (` ((, g1) t))))) + (if (charsetp g2) + (if (plist-get props 'force-g2-on-output) + (setq g2 (` (nil (, g2)))) + (setq g2 (` ((, g2) t))))) + (if (charsetp g3) + (if (plist-get props 'force-g3-on-output) + (setq g3 (` (nil (, g3)))) + (setq g3 (` ((, g3) t))))) + (` ((, name) 2 (, mnemonic) (, doc-string) + ((, g0) (, g1) (, g2) (, g3) + (, (plist-get props 'short)) + (, (not (plist-get props 'no-ascii-eol))) + (, (not (plist-get props 'no-ascii-cntl))) + (, (plist-get props 'seven)) + t + (, (not (plist-get props 'lock-shift))) + (, use-roman) + (, use-oldjis) + (, (plist-get props 'no-iso6429)) + nil nil nil nil) + (, properties) (, eol-type))))) + ((eq type 'big5) + (` ((, name) 3 (, mnemonic) (, doc-string) + nil (, properties) (, eol-type)))) + ((eq type 'ccl) + (` ((, name) 4 (, mnemonic) (, doc-string) + ((, (plist-get props 'decode)) . (, (plist-get props 'encode))) + (, properties) (, eol-type)))) + (t + (error "unsupported XEmacs style make-coding-style arguments: %S" + (` ((, name) (, type) (, doc-string) (, props)))))))) + (defadvice make-coding-system + (before ccl-compat (name type &rest ad-subr-args) activate) + "Emulate XEmacs style make-coding-system." + (when (and (symbolp type) (not (memq type '(t nil)))) + (let ((args (apply 'transform-make-coding-system-args + name type ad-subr-args))) + (setq type (cadr args) + ad-subr-args (cddr args))))))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'pccl) (require 'apel-ver)) + +;;; pccl.el ends here diff --git a/apel-10.7/pces-20.el b/apel-10.7/pces-20.el new file mode 100644 index 0000000..66e47ad --- /dev/null +++ b/apel-10.7/pces-20.el @@ -0,0 +1,239 @@ +;;; -*-byte-compile-dynamic: t;-*- +;;; pces-20.el --- pces submodule for Emacs 20 and XEmacs with coding-system + +;; Copyright (C) 1997,1998,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; 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 module requires Emacs 20.0.93, XEmacs 20.3-b5 (with mule) +;; or later. + +;;; Code: + +;; (defun-maybe-cond multibyte-string-p (object) +;; "Return t if OBJECT is a multibyte string." +;; ((featurep 'mule) (stringp object)) +;; (t nil)) + + +;;; @ without code-conversion +;;; + +(defmacro as-binary-process (&rest body) + `(let (selective-display ; Disable ^M to nl translation. + (coding-system-for-read 'binary) + (coding-system-for-write 'binary)) + ,@body)) + +(defmacro as-binary-input-file (&rest body) + `(let ((coding-system-for-read 'binary)) + ,@body)) + +(defmacro as-binary-output-file (&rest body) + `(let ((coding-system-for-write 'binary)) + ,@body)) + +(defun write-region-as-binary (start end filename + &optional append visit lockname) + "Like `write-region', q.v., but don't encode." + (let ((coding-system-for-write 'binary) + jka-compr-compression-info-list jam-zcat-filename-list) + (write-region start end filename append visit lockname))) + +(require 'broken) + +(broken-facility insert-file-contents-literally-treats-binary + "Function `insert-file-contents-literally' decodes text." + (let* ((str "\r\n") + (coding-system-for-write 'binary) + (coding-system-for-read 'raw-text-dos) + ;; (default-enable-multibyte-characters (multibyte-string-p str)) + ) + (with-temp-buffer + (insert str) + (write-region (point-min)(point-max) "literal-test-file") + ) + (string= + (with-temp-buffer + (let (file-name-handler-alist) + (insert-file-contents-literally "literal-test-file") + ) + (buffer-string) + ) + str))) + +(broken-facility insert-file-contents-literally-treats-file-name-handler + "Function `insert-file-contents' doesn't call file-name-handler." + (let (called) + (with-temp-buffer + (let ((file-name-handler-alist + '(("literal-test-file" . (lambda (operation &rest args) + (setq called t) + (let (file-name-handler-alist) + (apply operation args) + )))))) + (insert-file-contents-literally "literal-test-file") + ) + (delete-file "literal-test-file") + ) + called)) + +(static-if + (or (broken-p 'insert-file-contents-literally-treats-binary) + (broken-p 'insert-file-contents-literally-treats-file-name-handler)) + (defun insert-file-contents-as-binary (filename + &optional visit beg end replace) + "Like `insert-file-contents', but only reads in the file literally. +A buffer may be modified in several ways after reading into the buffer, +to Emacs features such as format decoding, character code +conversion, find-file-hooks, automatic uncompression, etc. + +This function ensures that none of these modifications will take place." + (let ((format-alist nil) + (after-insert-file-functions nil) + (coding-system-for-read 'binary) + (coding-system-for-write 'binary) + (jka-compr-compression-info-list nil) + (jam-zcat-filename-list nil) + (find-buffer-file-type-function + (if (fboundp 'find-buffer-file-type) + (symbol-function 'find-buffer-file-type) + nil))) + (unwind-protect + (progn + (fset 'find-buffer-file-type (lambda (filename) t)) + (insert-file-contents filename visit beg end replace)) + (if find-buffer-file-type-function + (fset 'find-buffer-file-type find-buffer-file-type-function) + (fmakunbound 'find-buffer-file-type))))) + (defalias 'insert-file-contents-as-binary 'insert-file-contents-literally) + ) + +(defun insert-file-contents-as-raw-text (filename + &optional visit beg end replace) + "Like `insert-file-contents', q.v., but don't code and format conversion. +Like `insert-file-contents-literary', but it allows find-file-hooks, +automatic uncompression, etc. +Like `insert-file-contents-as-binary', but it converts line-break +code." + (let ((coding-system-for-read 'raw-text) + format-alist) + ;; Returns list of absolute file name and length of data inserted. + (insert-file-contents filename visit beg end replace))) + +(defun insert-file-contents-as-raw-text-CRLF (filename + &optional visit beg end replace) + "Like `insert-file-contents', q.v., but don't code and format conversion. +Like `insert-file-contents-literary', but it allows find-file-hooks, +automatic uncompression, etc. +Like `insert-file-contents-as-binary', but it converts line-break code +from CRLF to LF." + (let ((coding-system-for-read 'raw-text-dos) + format-alist) + ;; Returns list of absolute file name and length of data inserted. + (insert-file-contents filename visit beg end replace))) + +(defun write-region-as-raw-text-CRLF (start end filename + &optional append visit lockname) + "Like `write-region', q.v., but write as network representation." + (let ((coding-system-for-write 'raw-text-dos)) + (write-region start end filename append visit lockname))) + +(defun find-file-noselect-as-binary (filename &optional nowarn rawfile) + "Like `find-file-noselect', q.v., but don't code and format conversion." + (let ((coding-system-for-read 'binary) + format-alist) + (find-file-noselect filename nowarn rawfile))) + +(defun find-file-noselect-as-raw-text (filename &optional nowarn rawfile) + "Like `find-file-noselect', q.v., but it does not code and format conversion +except for line-break code." + (let ((coding-system-for-read 'raw-text) + format-alist) + (find-file-noselect filename nowarn rawfile))) + +(defun find-file-noselect-as-raw-text-CRLF (filename &optional nowarn rawfile) + "Like `find-file-noselect', q.v., but it does not code and format conversion +except for line-break code." + (let ((coding-system-for-read 'raw-text-dos) + format-alist) + (find-file-noselect filename nowarn rawfile))) + +(defun save-buffer-as-binary (&optional args) + "Like `save-buffer', q.v., but don't encode." + (let ((coding-system-for-write 'binary)) + (save-buffer args))) + +(defun save-buffer-as-raw-text-CRLF (&optional args) + "Like `save-buffer', q.v., but save as network representation." + (let ((coding-system-for-write 'raw-text-dos)) + (save-buffer args))) + +(defun open-network-stream-as-binary (name buffer host service) + "Like `open-network-stream', q.v., but don't code conversion." + (let ((coding-system-for-read 'binary) + (coding-system-for-write 'binary)) + (open-network-stream name buffer host service))) + + +;;; @ with code-conversion +;;; + +(defun insert-file-contents-as-coding-system + (coding-system filename &optional visit beg end replace) + "Like `insert-file-contents', q.v., but CODING-SYSTEM the first arg will +be applied to `coding-system-for-read'." + (let ((coding-system-for-read coding-system) + format-alist) + (insert-file-contents filename visit beg end replace))) + +(defun write-region-as-coding-system + (coding-system start end filename &optional append visit lockname) + "Like `write-region', q.v., but CODING-SYSTEM the first arg will be +applied to `coding-system-for-write'." + (let ((coding-system-for-write coding-system) + jka-compr-compression-info-list jam-zcat-filename-list) + (write-region start end filename append visit lockname))) + +(defun find-file-noselect-as-coding-system + (coding-system filename &optional nowarn rawfile) + "Like `find-file-noselect', q.v., but CODING-SYSTEM the first arg will +be applied to `coding-system-for-read'." + (let ((coding-system-for-read coding-system) + format-alist) + (find-file-noselect filename nowarn rawfile))) + +(defun save-buffer-as-coding-system (coding-system &optional args) + "Like `save-buffer', q.v., but CODING-SYSTEM the first arg will be +applied to `coding-system-for-write'." + (let ((coding-system-for-write coding-system)) + (save-buffer args))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'pces-20) (require 'apel-ver)) + +;;; pces-20.el ends here diff --git a/apel-10.7/pces-e20.el b/apel-10.7/pces-e20.el new file mode 100644 index 0000000..f289e7b --- /dev/null +++ b/apel-10.7/pces-e20.el @@ -0,0 +1,48 @@ +;;; pces-e20.el --- pces submodule for Emacs 20 + +;; Copyright (C) 1998,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'pces-20) + +(unless (and (fboundp 'set-buffer-multibyte) + (subrp (symbol-function 'set-buffer-multibyte))) + (require 'pces-e20_2) ; for Emacs 20.1 and 20.2 + ) + +(defsubst-maybe find-coding-system (obj) + "Return OBJ if it is a coding-system." + (if (coding-system-p obj) + obj)) + +(defalias 'set-process-input-coding-system 'set-process-coding-system) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'pces-e20) (require 'apel-ver)) + +;;; pces-e20.el ends here diff --git a/apel-10.7/pces-e20_2.el b/apel-10.7/pces-e20_2.el new file mode 100644 index 0000000..26aded1 --- /dev/null +++ b/apel-10.7/pces-e20_2.el @@ -0,0 +1,150 @@ +;;; -*-byte-compile-dynamic: t;-*- +;;; pces-e20_2.el --- pces implementation for Emacs 20.1 and 20.2 + +;; Copyright (C) 1996,1997,1998,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; 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 module requires Emacs 20.1 and 20.2. + +;;; Code: + +;;; @ without code-conversion +;;; + +(defun insert-file-contents-as-binary (filename + &optional visit beg end replace) + "Like `insert-file-contents', q.v., but don't code and format conversion. +Like `insert-file-contents-literary', but it allows find-file-hooks, +automatic uncompression, etc. + +Namely this function ensures that only format decoding and character +code conversion will not take place." + (let ((flag enable-multibyte-characters) + (coding-system-for-read 'binary) + format-alist) + (prog1 + ;; Returns list absolute file name and length of data inserted. + (insert-file-contents filename visit beg end replace) + ;; This operation does not change the length. + (set-buffer-multibyte flag)))) + +(defun insert-file-contents-as-raw-text (filename + &optional visit beg end replace) + "Like `insert-file-contents', q.v., but don't code and format conversion. +Like `insert-file-contents-literary', but it allows find-file-hooks, +automatic uncompression, etc. +Like `insert-file-contents-as-binary', but it converts line-break +code." + (let ((flag enable-multibyte-characters) + (coding-system-for-read 'raw-text) + format-alist) + (prog1 + ;; Returns list absolute file name and length of data inserted. + (insert-file-contents filename visit beg end replace) + ;; This operation does not change the length. + (set-buffer-multibyte flag)))) + +(defun insert-file-contents-as-raw-text-CRLF (filename + &optional visit beg end replace) + "Like `insert-file-contents', q.v., but don't code and format conversion. +Like `insert-file-contents-literary', but it allows find-file-hooks, +automatic uncompression, etc. +Like `insert-file-contents-as-binary', but it converts line-break code +from CRLF to LF." + (let ((flag enable-multibyte-characters) + (coding-system-for-read 'raw-text-dos) + format-alist) + (prog1 + ;; Returns list absolute file name and length of data inserted. + (insert-file-contents filename visit beg end replace) + ;; This operation does not change the length. + (set-buffer-multibyte flag)))) + +(defun find-file-noselect-as-binary (filename &optional nowarn rawfile) + "Like `find-file-noselect', q.v., but don't code and format conversion." + (let ((flag enable-multibyte-characters) + (coding-system-for-read 'binary) + format-alist) + (save-current-buffer + (prog1 + (set-buffer (find-file-noselect filename nowarn rawfile)) + (set-buffer-multibyte flag))))) + +(defun find-file-noselect-as-raw-text (filename &optional nowarn rawfile) + "Like `find-file-noselect', q.v., but it does not code and format conversion +except for line-break code." + (let ((flag enable-multibyte-characters) + (coding-system-for-read 'raw-text) + format-alist) + (save-current-buffer + (prog1 + (set-buffer (find-file-noselect filename nowarn rawfile)) + (set-buffer-multibyte flag))))) + +(defun find-file-noselect-as-raw-text-CRLF (filename &optional nowarn rawfile) + "Like `find-file-noselect', q.v., but it does not code and format conversion +except for line-break code." + (let ((flag enable-multibyte-characters) + (coding-system-for-read 'raw-text-dos) + format-alist) + (save-current-buffer + (prog1 + (set-buffer (find-file-noselect filename nowarn rawfile)) + (set-buffer-multibyte flag))))) + + +;;; @ with code-conversion +;;; + +(defun insert-file-contents-as-coding-system + (coding-system filename &optional visit beg end replace) + "Like `insert-file-contents', q.v., but CODING-SYSTEM the first arg will +be applied to `coding-system-for-read'." + (let ((flag enable-multibyte-characters) + (coding-system-for-read coding-system) + format-alist) + (prog1 + (insert-file-contents filename visit beg end replace) + (set-buffer-multibyte flag)))) + +(defun find-file-noselect-as-coding-system + (coding-system filename &optional nowarn rawfile) + "Like `find-file-noselect', q.v., but CODING-SYSTEM the first arg will +be applied to `coding-system-for-read'." + (let ((flag enable-multibyte-characters) + (coding-system-for-read coding-system) + format-alist) + (save-current-buffer + (prog1 + (set-buffer (find-file-noselect filename nowarn rawfile)) + (set-buffer-multibyte flag))))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'pces-e20_2) (require 'apel-ver)) + +;;; pces-e20_2.el ends here diff --git a/apel-10.7/pces-nemacs.el b/apel-10.7/pces-nemacs.el new file mode 100644 index 0000000..e2479e9 --- /dev/null +++ b/apel-10.7/pces-nemacs.el @@ -0,0 +1,276 @@ +;;; pces-nemacs.el --- pces implementation for Nemacs + +;; Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +;;; @ coding system +;;; + +(defvar coding-system-kanji-code-alist + '((binary . 0) + (raw-text . 0) + (shift_jis . 1) + (iso-2022-jp . 2) + (ctext . 2) + (euc-jp . 3) + )) + +(defun decode-coding-string (string coding-system) + "Decode the STRING which is encoded in CODING-SYSTEM. +\[emu-nemacs.el; EMACS 20 emulating function]" + (let ((code (if (integerp coding-system) + coding-system + (cdr (assq coding-system coding-system-kanji-code-alist))))) + (if (eq code 3) + string + (convert-string-kanji-code string code 3) + ))) + +(defun encode-coding-string (string coding-system) + "Encode the STRING to CODING-SYSTEM. +\[emu-nemacs.el; EMACS 20 emulating function]" + (let ((code (if (integerp coding-system) + coding-system + (cdr (assq coding-system coding-system-kanji-code-alist))))) + (if (eq code 3) + string + (convert-string-kanji-code string 3 code) + ))) + +(defun decode-coding-region (start end coding-system) + "Decode the text between START and END which is encoded in CODING-SYSTEM. +\[emu-nemacs.el; EMACS 20 emulating function]" + (let ((code (if (integerp coding-system) + coding-system + (cdr (assq coding-system coding-system-kanji-code-alist))))) + (save-excursion + (save-restriction + (narrow-to-region start end) + (convert-region-kanji-code start end code 3) + )))) + +(defun encode-coding-region (start end coding-system) + "Encode the text between START and END to CODING-SYSTEM. +\[emu-nemacs.el; EMACS 20 emulating function]" + (let ((code (if (integerp coding-system) + coding-system + (cdr (assq coding-system coding-system-kanji-code-alist))))) + (save-excursion + (save-restriction + (narrow-to-region start end) + (convert-region-kanji-code start end 3 code) + )))) + +(defun detect-coding-region (start end) + "Detect coding-system of the text in the region between START and END. +\[emu-nemacs.el; Emacs 20 emulating function]" + (if (save-excursion + (save-restriction + (narrow-to-region start end) + (goto-char start) + (re-search-forward "[\200-\377]" nil t))) + 'euc-jp + )) + +(defalias 'set-buffer-file-coding-system 'set-kanji-fileio-code) + + +;;; @ without code-conversion +;;; + +(defmacro as-binary-process (&rest body) + (` (let (selective-display ; Disable ^M to nl translation. + ;; Nemacs + kanji-flag + (default-kanji-process-code 0) + program-kanji-code-alist) + (,@ body)))) + +(defmacro as-binary-input-file (&rest body) + (` (let (kanji-flag default-kanji-flag) + (,@ body)))) + +(defmacro as-binary-output-file (&rest body) + (` (let (kanji-flag) + (,@ body)))) + +(defun write-region-as-binary (start end filename + &optional append visit lockname) + "Like `write-region', q.v., but don't code conversion. [emu-nemacs.el]" + (as-binary-output-file + (write-region start end filename append visit))) + +(defun insert-file-contents-as-binary (filename + &optional visit beg end replace) + "Like `insert-file-contents', q.v., but don't character code conversion. +\[emu-nemacs.el]" + (as-binary-input-file + ;; Returns list absolute file name and length of data inserted. + (insert-file-contents filename visit))) + +(defun insert-file-contents-as-raw-text (filename + &optional visit beg end replace) + "Like `insert-file-contents', q.v., but don't character code conversion. +It converts line-break code from CRLF to LF. [emu-nemacs.el]" + (save-restriction + (narrow-to-region (point) (point)) + (let ((return (as-binary-input-file + (insert-file-contents filename visit)))) + (while (search-forward "\r\n" nil t) + (replace-match "\n")) + (goto-char (point-min)) + ;; Returns list absolute file name and length of data inserted. + (list (car return) (- (point-max) (point-min)))))) + +(defalias 'insert-file-contents-as-raw-text-CRLF + 'insert-file-contents-as-raw-text) + +(defun write-region-as-raw-text-CRLF (start end filename + &optional append visit lockname) + "Like `write-region', q.v., but don't code conversion. [emu-nemacs.el]" + (let ((the-buf (current-buffer))) + (with-temp-buffer + (insert-buffer-substring the-buf start end) + (goto-char (point-min)) + (while (re-search-forward "\\(\\=\\|[^\r]\\)\n" nil t) + (replace-match "\\1\r\n")) + (write-region-as-binary (point-min)(point-max) + filename append visit)))) + +(defun find-file-noselect-as-binary (filename &optional nowarn rawfile) + "Like `find-file-noselect', q.v., but don't code conversion. +\[emu-nemacs.el]" + (as-binary-input-file (find-file-noselect filename nowarn))) + +(defun find-file-noselect-as-raw-text (filename &optional nowarn rawfile) + "Like `find-file-noselect', q.v., but it does not code conversion +except for line-break code. [emu-nemacs.el]" + (let ((buf (get-file-buffer filename)) + cur) + (if buf + (prog1 + buf + (or nowarn + (verify-visited-file-modtime buf) + (cond ((not (file-exists-p filename)) + (error "File %s no longer exists!" filename)) + ((yes-or-no-p + (if (buffer-modified-p buf) + "File has changed since last visited or saved. Flush your changes? " + "File has changed since last visited or saved. Read from disk? ")) + (setq cur (current-buffer)) + (set-buffer buf) + (revert-buffer t t) + (save-excursion + (goto-char (point-min)) + (while (search-forward "\r\n" nil t) + (replace-match "\n"))) + (set-buffer-modified-p nil) + (set-buffer cur))))) + (save-excursion + (prog1 + (set-buffer + (find-file-noselect-as-binary filename nowarn rawfile)) + (while (search-forward "\r\n" nil t) + (replace-match "\n")) + (goto-char (point-min)) + (set-buffer-modified-p nil)))))) + +(defalias 'find-file-noselect-as-raw-text-CRLF + 'find-file-noselect-as-raw-text) + +(defun open-network-stream-as-binary (name buffer host service) + "Like `open-network-stream', q.v., but don't code conversion. +\[emu-nemacs.el]" + (let ((process (open-network-stream name buffer host service))) + (set-process-kanji-code process 0) + process)) + +(defun save-buffer-as-binary (&optional args) + "Like `save-buffer', q.v., but don't encode. [emu-nemacs.el]" + (as-binary-output-file + (save-buffer args))) + +(defun save-buffer-as-raw-text-CRLF (&optional args) + "Like `save-buffer', q.v., but save as network representation. +\[emu-nemacs.el]" + (if (buffer-modified-p) + (save-restriction + (widen) + (let ((the-buf (current-buffer)) + (filename (buffer-file-name))) + (if filename + (prog1 + (with-temp-buffer + (insert-buffer the-buf) + (goto-char (point-min)) + (while (re-search-forward "\\(\\=\\|[^\r]\\)\n" nil t) + (replace-match "\\1\r\n")) + (setq buffer-file-name filename) + (save-buffer-as-binary args)) + (set-buffer-modified-p nil) + (clear-visited-file-modtime))))))) + + +;;; @ with code-conversion +;;; + +(defun insert-file-contents-as-coding-system + (coding-system filename &optional visit beg end replace) + "Like `insert-file-contents', q.v., but CODING-SYSTEM the first arg will +be applied to `kanji-fileio-code'. [emu-nemacs.el]" + (let ((kanji-fileio-code coding-system) + kanji-expected-code) + (insert-file-contents filename visit))) + +(defun write-region-as-coding-system + (coding-system start end filename &optional append visit lockname) + "Like `write-region', q.v., but CODING-SYSTEM the first arg will be +applied to `kanji-fileio-code'. [emu-nemacs.el]" + (let ((kanji-fileio-code coding-system) + jka-compr-compression-info-list jam-zcat-filename-list) + (write-region start end filename append visit))) + +(defun find-file-noselect-as-coding-system + (coding-system filename &optional nowarn rawfile) + "Like `find-file-noselect', q.v., but CODING-SYSTEM the first arg will +be applied to `kanji-fileio-code'. [emu-nemacs.el]" + (let ((default-kanji-fileio-code coding-system) + kanji-fileio-code kanji-expected-code) + (find-file-noselect filename nowarn))) + +(defun save-buffer-as-coding-system (coding-system &optional args) + "Like `save-buffer', q.v., but CODING-SYSTEM the first arg will be +applied to `kanji-fileio-code'. [emu-nemacs.el]" + (let ((kanji-fileio-code coding-system)) + (save-buffer args))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'pces-nemacs) (require 'apel-ver)) + +;;; pces-nemacs.el ends here diff --git a/apel-10.7/pces-om.el b/apel-10.7/pces-om.el new file mode 100644 index 0000000..54d4584 --- /dev/null +++ b/apel-10.7/pces-om.el @@ -0,0 +1,340 @@ +;;; pces-om.el --- pces implementation for Mule 1.* and Mule 2.* + +;; Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Katsumi Yamaoka +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'poe) + + +;;; @ version specific features +;;; + +(cond ((= emacs-major-version 19) + (define-ccl-program poem-ccl-decode-raw-text + '(1 + ((r2 = 0) + (read r0) + (loop + (if (r0 == ?\x0d) + ((r2 = 1) + (read-if (r1 == ?\x0a) + ((r0 = ?\x0a) + (r2 = 0) + (write-read-repeat r0)) + ((write r0) + (r0 = (r1 + 0)) + (repeat)))) + ((r2 = 0) + (write-read-repeat r0))))) + ;; This EOF BLOCK won't work out in practice. So the last datum + ;; might be lost if it's value is ?\x0d. + (if r2 + (write r0)) + ) + "Convert line-break code from CRLF to LF.") + + (define-ccl-program poem-ccl-encode-raw-text + '(1 + ((read r0) + (loop (write-read-repeat r0)))) + "Pass through without any conversions.") + + (define-ccl-program poem-ccl-encode-raw-text-CRLF + '(2 + ((loop + (read-if (r0 == ?\x0a) + (write "\x0d\x0a") + (write r0)) + (repeat)))) + "Convert line-break code from LF to CRLF.") + + (make-coding-system + 'raw-text 4 ?= + "No conversion" + nil + (cons poem-ccl-decode-raw-text poem-ccl-encode-raw-text)) + + (make-coding-system + 'raw-text-dos 4 ?= + "No conversion" + nil + (cons poem-ccl-decode-raw-text poem-ccl-encode-raw-text-CRLF)) + ) + (t + (defun poem-decode-raw-text (from to) + (save-restriction + (narrow-to-region from to) + (goto-char (point-min)) + (while (re-search-forward "\r$" nil t) + (replace-match "") + ))) + (defun poem-encode-raw-text-CRLF (from to) + (save-restriction + (narrow-to-region from to) + (goto-char (point-min)) + (while (re-search-forward "\\(\\=\\|[^\r]\\)\n" nil t) + (replace-match "\\1\r\n") + ))) + + (make-coding-system 'raw-text nil ?= "No conversion") + (put 'raw-text 'post-read-conversion 'poem-decode-raw-text) + + (make-coding-system 'raw-text-dos nil ?= "No conversion") + (put 'raw-text-dos 'post-read-conversion 'poem-decode-raw-text) + (put 'raw-text-dos 'pre-write-conversion 'poem-encode-raw-text-CRLF) + )) + + +;;; @ coding system +;;; + +(defun-maybe find-coding-system (obj) + "Return OBJ if it is a coding-system." + (if (coding-system-p obj) + obj)) + +(defun encode-coding-region (start end coding-system) + "Encode the text between START and END to CODING-SYSTEM. +\[EMACS 20 emulating function]" + ;; If `coding-system' is nil, do nothing. + (code-convert-region start end *internal* coding-system)) + +(defun decode-coding-region (start end coding-system) + "Decode the text between START and END which is encoded in CODING-SYSTEM. +\[EMACS 20 emulating function]" + ;; If `coding-system' is nil, do nothing. + (code-convert-region start end coding-system *internal*)) + +;; XXX: Should we support optional NOCOPY argument? (only in Emacs 20.x) +(defun encode-coding-string (str coding-system) + "Encode the STRING to CODING-SYSTEM. +\[EMACS 20 emulating function]" + (if coding-system + (code-convert-string str *internal* coding-system) + ;;(code-convert-string str *internal* nil) returns nil instead of str. + str)) + +;; XXX: Should we support optional NOCOPY argument? (only in Emacs 20.x) +(defun decode-coding-string (str coding-system) + "Decode the string STR which is encoded in CODING-SYSTEM. +\[EMACS 20 emulating function]" + (if coding-system + (let ((len (length str)) + ret) + (while (and (< 0 len) + (null (setq ret + (code-convert-string + (substring str 0 len) + coding-system *internal*)))) + (setq len (1- len))) + (concat ret (substring str len))) + str)) + +(defalias 'detect-coding-region 'code-detect-region) + +(defalias 'set-buffer-file-coding-system 'set-file-coding-system) + + +;;; @ with code-conversion +;;; + +(cond + ((and (>= emacs-major-version 19) (>= emacs-minor-version 23)) + ;; Mule 2.0 or later. + (defun insert-file-contents-as-coding-system + (coding-system filename &optional visit beg end replace) + "Like `insert-file-contents', q.v., but CODING-SYSTEM the first arg will +be applied to `file-coding-system-for-read'." + (let ((file-coding-system-for-read coding-system)) + (insert-file-contents filename visit beg end replace)))) + (t + ;; Mule 1.1 or earlier. + (defun insert-file-contents-as-coding-system + (coding-system filename &optional visit beg end replace) + "Like `insert-file-contents', q.v., but CODING-SYSTEM the first arg will +be applied to `file-coding-system-for-read'." + (let ((file-coding-system-for-read coding-system)) + (insert-file-contents filename visit))))) + +(cond + ((and (>= emacs-major-version 19) (>= emacs-minor-version 29)) + ;; for MULE 2.3 based on Emacs 19.34. + (defun write-region-as-coding-system + (coding-system start end filename &optional append visit lockname) + "Like `write-region', q.v., but CODING-SYSTEM the first arg will be +applied to `file-coding-system'." + (let ((file-coding-system coding-system) + jka-compr-compression-info-list jam-zcat-filename-list) + (write-region start end filename append visit lockname))) + + (defun find-file-noselect-as-coding-system + (coding-system filename &optional nowarn rawfile) + "Like `find-file-noselect', q.v., but CODING-SYSTEM the first arg will +be applied to `file-coding-system-for-read'." + (let ((file-coding-system-for-read coding-system)) + (find-file-noselect filename nowarn rawfile))) + ) + (t + ;; for MULE 2.3 based on Emacs 19.28 or MULE 1.*. + (defun write-region-as-coding-system + (coding-system start end filename &optional append visit lockname) + "Like `write-region', q.v., but CODING-SYSTEM the first arg will be +applied to `file-coding-system'." + (let ((file-coding-system coding-system) + jka-compr-compression-info-list jam-zcat-filename-list) + (write-region start end filename append visit))) + + (defun find-file-noselect-as-coding-system + (coding-system filename &optional nowarn rawfile) + "Like `find-file-noselect', q.v., but CODING-SYSTEM the first arg will +be applied to `file-coding-system-for-read'." + (let ((file-coding-system-for-read coding-system)) + (find-file-noselect filename nowarn))) + )) + +(defun save-buffer-as-coding-system (coding-system &optional args) + "Like `save-buffer', q.v., but CODING-SYSTEM the first arg will be +applied to `coding-system-for-write'." + (let ((file-coding-system coding-system)) + (save-buffer args))) + + +;;; @ without code-conversion +;;; + +(make-coding-system 'binary nil ?= "No conversion") + +(defmacro as-binary-process (&rest body) + (` (let (selective-display ; Disable ^M to nl translation. + ;; Mule + mc-flag + (default-process-coding-system (cons *noconv* *noconv*)) + program-coding-system-alist) + (,@ body)))) + +(defmacro as-binary-input-file (&rest body) + (` (let (mc-flag + (file-coding-system-for-read *noconv*) + ) + (,@ body)))) + +(defmacro as-binary-output-file (&rest body) + (` (let (mc-flag + (file-coding-system *noconv*) + ) + (,@ body)))) + +(defalias 'set-process-input-coding-system 'set-process-coding-system) + +(cond + ((and (>= emacs-major-version 19) (>= emacs-minor-version 23)) + ;; Mule 2.0 or later. + (defun insert-file-contents-as-binary (filename + &optional visit beg end replace) + "Like `insert-file-contents', q.v., but don't code and format conversion. +Like `insert-file-contents-literary', but it allows find-file-hooks, +automatic uncompression, etc. + +Namely this function ensures that only format decoding and character +code conversion will not take place." + (as-binary-input-file + ;; Returns list absolute file name and length of data inserted. + (insert-file-contents filename visit beg end replace)))) + (t + ;; Mule 1.1 or earlier. + (defun insert-file-contents-as-binary (filename + &optional visit beg end replace) + "Like `insert-file-contents', q.v., but don't code and format conversion. +Like `insert-file-contents-literary', but it allows find-file-hooks, +automatic uncompression, etc. + +Namely this function ensures that only format decoding and character +code conversion will not take place." + (as-binary-input-file + ;; Returns list absolute file name and length of data inserted. + (insert-file-contents filename visit))))) + +(defun insert-file-contents-as-raw-text (filename + &optional visit beg end replace) + "Like `insert-file-contents', q.v., but don't code and format conversion. +Like `insert-file-contents-literary', but it allows find-file-hooks, +automatic uncompression, etc. +Like `insert-file-contents-as-binary', but it converts line-break +code." + ;; Returns list absolute file name and length of data inserted. + (insert-file-contents-as-coding-system 'raw-text + filename visit beg end replace)) + +(defalias 'insert-file-contents-as-raw-text-CRLF + 'insert-file-contents-as-raw-text) + +(defun write-region-as-binary (start end filename + &optional append visit lockname) + "Like `write-region', q.v., but don't code conversion." + (write-region-as-coding-system 'binary + start end filename append visit lockname)) + +(defun write-region-as-raw-text-CRLF (start end filename + &optional append visit lockname) + "Like `write-region', q.v., but don't code conversion." + (write-region-as-coding-system 'raw-text-dos + start end filename append visit lockname)) + +(defun find-file-noselect-as-binary (filename &optional nowarn rawfile) + "Like `find-file-noselect', q.v., but don't code and format conversion." + (find-file-noselect-as-coding-system 'binary filename nowarn rawfile)) + +(defun find-file-noselect-as-raw-text (filename &optional nowarn rawfile) + "Like `find-file-noselect', q.v., but it does not code and format +conversion except for line-break code." + (find-file-noselect-as-coding-system 'raw-text filename nowarn rawfile)) + +(defalias 'find-file-noselect-as-raw-text-CRLF + 'find-file-noselect-as-raw-text) + +(defun save-buffer-as-binary (&optional args) + "Like `save-buffer', q.v., but don't encode." + (let ((file-coding-system 'binary)) + (save-buffer args))) + +(defun save-buffer-as-raw-text-CRLF (&optional args) + "Like `save-buffer', q.v., but save as network representation." + (let ((file-coding-system 'raw-text-dos)) + (save-buffer args))) + +(defun open-network-stream-as-binary (name buffer host service) + "Like `open-network-stream', q.v., but don't code conversion." + (let ((process (open-network-stream name buffer host service))) + (set-process-coding-system process *noconv* *noconv*) + process)) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'pces-om) (require 'apel-ver)) + +;;; pces-om.el ends here diff --git a/apel-10.7/pces-raw.el b/apel-10.7/pces-raw.el new file mode 100644 index 0000000..1a4bca8 --- /dev/null +++ b/apel-10.7/pces-raw.el @@ -0,0 +1,172 @@ +;;; pces-raw.el --- pces submodule for emacsen without coding-system features + +;; Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +;;; @ coding-system +;;; + +(defun decode-coding-string (string coding-system) + "Decode the STRING which is encoded in CODING-SYSTEM." + (copy-sequence string)) + +(defun encode-coding-string (string coding-system) + "Encode the STRING as CODING-SYSTEM." + (copy-sequence string)) + +(defun decode-coding-region (start end coding-system) + "Decode the text between START and END which is encoded in CODING-SYSTEM." + 0) + +(defun encode-coding-region (start end coding-system) + "Encode the text between START and END to CODING-SYSTEM." + 0) + +(defun detect-coding-region (start end) + "Detect coding-system of the text in the region between START and END." + ) + +(defun set-buffer-file-coding-system (coding-system &optional force) + "Set buffer-file-coding-system of the current buffer to CODING-SYSTEM." + ) + + +;;; @ without code-conversion +;;; + +(defmacro as-binary-process (&rest body) + (` (let (selective-display) ; Disable ^M to nl translation. + (,@ body)))) + +(defmacro as-binary-input-file (&rest body) + (` (let ((emx-binary-mode t)) ; Stop CRLF to LF conversion in OS/2 + (,@ body)))) + +(defmacro as-binary-output-file (&rest body) + (` (let ((emx-binary-mode t)) ; Stop CRLF to LF conversion in OS/2 + (,@ body)))) + +(defun write-region-as-binary (start end filename + &optional append visit lockname) + "Like `write-region', q.v., but don't code conversion." + (let ((emx-binary-mode t)) + (write-region start end filename append visit lockname))) + +(defun insert-file-contents-as-binary (filename + &optional visit beg end replace) + "Like `insert-file-contents', q.v., but don't code and format conversion. +Like `insert-file-contents-literary', but it allows find-file-hooks, +automatic uncompression, etc. + +Namely this function ensures that only format decoding and character +code conversion will not take place." + (let ((emx-binary-mode t)) + ;; Returns list of absolute file name and length of data inserted. + (insert-file-contents filename visit beg end replace))) + +(defun write-region-as-raw-text-CRLF (start end filename + &optional append visit lockname) + "Like `write-region', q.v., but write as network representation." + (let ((the-buf (current-buffer))) + (with-temp-buffer + (insert-buffer-substring the-buf start end) + (goto-char (point-min)) + (while (re-search-forward "\\(\\=\\|[^\r]\\)\n" nil t) + (replace-match "\\1\r\n")) + (write-region (point-min)(point-max) filename append visit lockname)))) + +(defalias 'insert-file-contents-as-raw-text 'insert-file-contents) + +(defalias 'insert-file-contents-as-raw-text-CRLF 'insert-file-contents) + +(defun find-file-noselect-as-binary (filename &optional nowarn rawfile) + "Like `find-file-noselect', q.v., but don't code and format conversion." + (let ((emx-binary-mode t)) + (find-file-noselect filename nowarn rawfile))) + +(defalias 'find-file-noselect-as-raw-text 'find-file-noselect) + +(defalias 'find-file-noselect-as-raw-text-CRLF 'find-file-noselect) + +(defun save-buffer-as-binary (&optional args) + "Like `save-buffer', q.v., but don't encode." + (let ((emx-binary-mode t)) + (save-buffer args))) + +(defun save-buffer-as-raw-text-CRLF (&optional args) + "Like `save-buffer', q.v., but save as network representation." + (if (buffer-modified-p) + (save-restriction + (widen) + (let ((the-buf (current-buffer)) + (filename (buffer-file-name))) + (if filename + (prog1 + (with-temp-buffer + (insert-buffer the-buf) + (goto-char (point-min)) + (while (re-search-forward "\\(\\=\\|[^\r]\\)\n" nil t) + (replace-match "\\1\r\n")) + (setq buffer-file-name filename) + (save-buffer args)) + (set-buffer-modified-p nil) + (clear-visited-file-modtime))))))) + +(defun open-network-stream-as-binary (name buffer host service) + "Like `open-network-stream', q.v., but don't code conversion." + (let ((emx-binary-mode t)) + (open-network-stream name buffer host service))) + + +;;; @ with code-conversion (but actually it might be not done) +;;; + +(defun insert-file-contents-as-coding-system + (coding-system filename &optional visit beg end replace) + "Like `insert-file-contents', q.v., but CODING-SYSTEM is used to decode." + (insert-file-contents filename visit beg end replace)) + +(defun write-region-as-coding-system + (coding-system start end filename &optional append visit lockname) + "Like `write-region', q.v., but CODING-SYSTEM is used to encode." + (let (jka-compr-compression-info-list jam-zcat-filename-list) + (write-region start end filename append visit lockname))) + +(defun find-file-noselect-as-coding-system + (coding-system filename &optional nowarn rawfile) + "Like `find-file-noselect', q.v., CODING-SYSTEM is used to decode." + (find-file-noselect filename nowarn rawfile)) + +(defun save-buffer-as-coding-system (coding-system &optional args) + "Like `save-buffer', q.v., CODING-SYSTEM is used to encode." + (save-buffer args)) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'pces-raw) (require 'apel-ver)) + +;;; pces-raw.el ends here diff --git a/apel-10.7/pces-xfc.el b/apel-10.7/pces-xfc.el new file mode 100644 index 0000000..b669032 --- /dev/null +++ b/apel-10.7/pces-xfc.el @@ -0,0 +1,48 @@ +;;; pces-xfc.el --- pces module for XEmacs with file coding + +;; Copyright (C) 1998,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +;; Redefine if -{dos|mac|unix} is not found. +(or (find-coding-system 'raw-text-dos) + (copy-coding-system 'no-conversion-dos 'raw-text-dos)) +(or (find-coding-system 'raw-text-mac) + (copy-coding-system 'no-conversion-mac 'raw-text-mac)) +(or (find-coding-system 'raw-text-unix) + (copy-coding-system 'no-conversion-unix 'raw-text-unix)) + +(if (featurep 'mule) + (require 'pces-xm) + ) + +(require 'pces-20) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'pces-xfc) (require 'apel-ver)) + +;;; pces-xfc.el ends here diff --git a/apel-10.7/pces-xm.el b/apel-10.7/pces-xm.el new file mode 100644 index 0000000..579f0e6 --- /dev/null +++ b/apel-10.7/pces-xm.el @@ -0,0 +1,78 @@ +;;; pces-xm.el --- pces module for XEmacs-mule + +;; Copyright (C) 1998,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +;;; @ fix coding-system definition +;;; + +;; It seems not bug, but I can not permit it... +(and (coding-system-property 'iso-2022-jp 'input-charset-conversion) + (copy-coding-system 'iso-2022-7bit 'iso-2022-jp)) + +(and (coding-system-property 'iso-2022-jp-dos 'input-charset-conversion) + (copy-coding-system 'iso-2022-7bit-dos 'iso-2022-jp-dos)) + +(or (find-coding-system 'ctext-dos) + (make-coding-system + 'ctext 'iso2022 + "Coding-system used in X as Compound Text Encoding." + '(charset-g0 ascii charset-g1 latin-iso8859-1 + eol-type nil + mnemonic "CText"))) + +(or (find-coding-system 'iso-2022-jp-2-dos) + (make-coding-system + 'iso-2022-jp-2 'iso2022 + "ISO-2022 coding system using SS2 for 96-charset in 7-bit code." + '(charset-g0 ascii + charset-g2 t ;; unspecified but can be used later. + seven t + short t + mnemonic "ISO7/SS2" + eol-type nil))) + +(or (find-coding-system 'gb2312-dos) + (copy-coding-system 'cn-gb-2312-dos 'gb2312-dos)) +(or (find-coding-system 'gb2312-mac) + (copy-coding-system 'cn-gb-2312-mac 'gb2312-mac)) +(or (find-coding-system 'gb2312-unix) + (copy-coding-system 'cn-gb-2312-unix 'gb2312-unix)) + +(or (find-coding-system 'euc-kr-dos) + (make-coding-system + 'euc-kr 'iso2022 + "Coding-system of Korean EUC (Extended Unix Code)." + '(charset-g0 ascii charset-g1 korean-ksc5601 + mnemonic "ko/EUC" + eol-type nil))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'pces-xm) (require 'apel-ver)) + +;;; pces-xm.el ends here diff --git a/apel-10.7/pces.el b/apel-10.7/pces.el new file mode 100644 index 0000000..1b1b36e --- /dev/null +++ b/apel-10.7/pces.el @@ -0,0 +1,59 @@ +;;; pces.el --- Portable Character Encoding Scheme (coding-system) features + +;; Copyright (C) 1998,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: coding-system, emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'poe) + +(eval-and-compile + (unless (fboundp 'open-network-stream) + (require 'tcp))) + +(cond ((featurep 'xemacs) + (if (featurep 'file-coding) + (require 'pces-xfc) + (require 'pces-raw) + )) + ((featurep 'mule) + (if (>= emacs-major-version 20) + (require 'pces-e20) + ;; for MULE 1.* and 2.* + (require 'pces-om) + )) + ((boundp 'NEMACS) + ;; for Nemacs and Nepoch + (require 'pces-nemacs) + ) + (t + (require 'pces-raw) + )) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'pces) (require 'apel-ver)) + +;;; pces.el ends here diff --git a/apel-10.7/pcustom.el b/apel-10.7/pcustom.el new file mode 100644 index 0000000..242ede6 --- /dev/null +++ b/apel-10.7/pcustom.el @@ -0,0 +1,65 @@ +;;; pcustom.el -- a portable custom.el. + +;; Copyright (C) 1999 Free Software Foundation, Inc. +;; Copyright (C) 1999 Mikio Nakajima + +;; Author: Mikio Nakajima +;; Shuhei KOBAYASHI +;; Keywords: emulating, custom + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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: + +;;; Code: + +(require 'poe) +(eval-when-compile (require 'static)) + +(static-if (condition-case nil + ;; compile-time check. + (if (and (require 'custom) + (fboundp 'custom-declare-variable)) + ;; you have "new custom". + t + ;; you have custom, but it is "old". + (message "\ + ** \"old custom\" is loaded. See README if you want to use \"new custom\".") + (sleep-for 1) + nil) + ;; you don't have custom. + (error nil)) + ;; you have "new custom". no load-time check. + (require 'custom) + ;; your custom is "old custom", + ;; or you don't have custom library at compile-time. + (or (condition-case nil + ;; load-time check. + ;; load "custom" if exists. + (and (require 'custom) + (fboundp 'custom-declare-variable)) + (error nil)) + ;; your custom is "old custom", + ;; or you don't have custom library. + ;; load emulation version of "new custom". + (require 'tinycustom))) + +(require 'product) +(product-provide (provide 'pcustom) (require 'apel-ver)) + +;;; pcustom.el ends here diff --git a/apel-10.7/poe-18.el b/apel-10.7/poe-18.el new file mode 100644 index 0000000..0dffa0e --- /dev/null +++ b/apel-10.7/poe-18.el @@ -0,0 +1,847 @@ +;;; poe-18.el --- poe API implementation for Emacs 18.* + +;; Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc. +;; Copyright (C) 1999 Yuuichi Teranishi + +;; Author: MORIOKA Tomohiko +;; Shuhei KOBAYASHI +;; Yuuichi Teranishi +;; Keywords: emulation, compatibility + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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: + +;; Note to APEL developers and APEL programmers: +;; +;; If old (v18) compiler is used, top-level macros are expanded at +;; *load-time*, not compile-time. Therefore, +;; +;; (1) Definitions with `*-maybe' won't be compiled. +;; +;; (2) you cannot use macros defined with `defmacro-maybe' within function +;; definitions in the same file. +;; (`defmacro-maybe' is evaluated at load-time, therefore byte-compiler +;; treats such use of macros as (unknown) functions and compiles them +;; into function calls, which will cause errors at run-time.) +;; +;; (3) `eval-when-compile' and `eval-and-compile' are evaluated at +;; load-time if used at top-level. + +;;; Code: + +(require 'pym) + + +;;; @ Compilation. +;;; +(defun defalias (sym newdef) + "Set SYMBOL's function definition to NEWVAL, and return NEWVAL." + (fset sym newdef)) + +(defun byte-code-function-p (object) + "Return t if OBJECT is a byte-compiled function object." + (and (consp object) (consp (cdr object)) + (let ((rest (cdr (cdr object))) + elt) + (if (stringp (car rest)) + (setq rest (cdr rest))) + (catch 'tag + (while rest + (setq elt (car rest)) + (if (and (consp elt) + (eq (car elt) 'byte-code)) + (throw 'tag t)) + (setq rest (cdr rest))))))) + +;; (symbol-plist 'cyclic-function-indirection) +(put 'cyclic-function-indirection + 'error-conditions + '(cyclic-function-indirection error)) +(put 'cyclic-function-indirection + 'error-message + "Symbol's chain of function indirections contains a loop") + +;; The following function definition is a direct translation of its +;; C definition in emacs-20.4/src/data.c. +(defun indirect-function (object) + "Return the function at the end of OBJECT's function chain. +If OBJECT is a symbol, follow all function indirections and return the final +function binding. +If OBJECT is not a symbol, just return it. +Signal a void-function error if the final symbol is unbound. +Signal a cyclic-function-indirection error if there is a loop in the +function chain of symbols." + (let* ((hare object) + (tortoise hare)) + (catch 'found + (while t + (or (symbolp hare) (throw 'found hare)) + (or (fboundp hare) (signal 'void-function (cons object nil))) + (setq hare (symbol-function hare)) + (or (symbolp hare) (throw 'found hare)) + (or (fboundp hare) (signal 'void-function (cons object nil))) + (setq hare (symbol-function hare)) + + (setq tortoise (symbol-function tortoise)) + + (if (eq hare tortoise) + (signal 'cyclic-function-indirection (cons object nil))))) + hare)) + +;;; Emulate all functions and macros of emacs-20.3/lisp/byte-run.el. +;;; (note: jwz's original compiler and XEmacs compiler have some more +;;; macros; they are "nuked" by rms in FSF version.) + +;; Use `*-maybe' here because new byte-compiler may be installed. +(put 'inline 'lisp-indent-hook 0) +(defmacro-maybe inline (&rest body) + "Eval BODY forms sequentially and return value of last one. + +This emulating macro does not support function inlining because old \(v18\) +compiler does not support inlining feature." + (cons 'progn body)) + +(put 'defsubst 'lisp-indent-hook 'defun) +(put 'defsubst 'edebug-form-spec 'defun) +(defmacro-maybe defsubst (name arglist &rest body) + "Define an inline function. The syntax is just like that of `defun'. + +This emulating macro does not support function inlining because old \(v18\) +compiler does not support inlining feature." + (cons 'defun (cons name (cons arglist body)))) + +(defun-maybe make-obsolete (fn new) + "Make the byte-compiler warn that FUNCTION is obsolete. +The warning will say that NEW should be used instead. +If NEW is a string, that is the `use instead' message. + +This emulating function does nothing because old \(v18\) compiler does not +support this feature." + (interactive "aMake function obsolete: \nxObsoletion replacement: ") + fn) + +(defun-maybe make-obsolete-variable (var new) + "Make the byte-compiler warn that VARIABLE is obsolete, +and NEW should be used instead. If NEW is a string, then that is the +`use instead' message. + +This emulating function does nothing because old \(v18\) compiler does not +support this feature." + (interactive "vMake variable obsolete: \nxObsoletion replacement: ") + var) + +(put 'dont-compile 'lisp-indent-hook 0) +(defmacro-maybe dont-compile (&rest body) + "Like `progn', but the body always runs interpreted \(not compiled\). +If you think you need this, you're probably making a mistake somewhere." + (list 'eval (list 'quote (if (cdr body) (cons 'progn body) (car body))))) + +(put 'eval-when-compile 'lisp-indent-hook 0) +(defmacro-maybe eval-when-compile (&rest body) + "Like progn, but evaluates the body at compile-time. + +This emulating macro does not do compile-time evaluation at all because +of the limitation of old \(v18\) compiler." + (cons 'progn body)) + +(put 'eval-and-compile 'lisp-indent-hook 0) +(defmacro-maybe eval-and-compile (&rest body) + "Like progn, but evaluates the body at compile-time as well as at load-time. + +This emulating macro does not do compile-time evaluation at all because +of the limitation of old \(v18\) compiler." + (cons 'progn body)) + + +;;; @ C primitives emulation. +;;; + +(defun member (elt list) + "Return non-nil if ELT is an element of LIST. Comparison done with EQUAL. +The value is actually the tail of LIST whose car is ELT." + (while (and list (not (equal elt (car list)))) + (setq list (cdr list))) + list) + +(defun delete (elt list) + "Delete by side effect any occurrences of ELT as a member of LIST. +The modified LIST is returned. Comparison is done with `equal'. +If the first member of LIST is ELT, deleting it is not a side effect; +it is simply using a different list. +Therefore, write `(setq foo (delete element foo))' +to be sure of changing the value of `foo'." + (if list + (if (equal elt (car list)) + (cdr list) + (let ((rest list) + (rrest (cdr list))) + (while (and rrest (not (equal elt (car rrest)))) + (setq rest rrest + rrest (cdr rrest))) + (setcdr rest (cdr rrest)) + list)))) + +(defun default-boundp (symbol) + "Return t if SYMBOL has a non-void default value. +This is the value that is seen in buffers that do not have their own values +for this variable." + (condition-case error + (progn + (default-value symbol) + t) + (void-variable nil))) + +;;; @@ current-time. +;;; + +(defvar current-time-world-timezones + '(("PST" . -800)("PDT" . -700)("MST" . -700) + ("MDT" . -600)("CST" . -600)("CDT" . -500) + ("EST" . -500)("EDT" . -400)("AST" . -400) + ("NST" . -330)("UT" . +000)("GMT" . +000) + ("BST" . +100)("MET" . +100)("EET" . +200) + ("JST" . +900)("GMT+1" . +100)("GMT+2" . +200) + ("GMT+3" . +300)("GMT+4" . +400)("GMT+5" . +500) + ("GMT+6" . +600)("GMT+7" . +700)("GMT+8" . +800) + ("GMT+9" . +900)("GMT+10" . +1000)("GMT+11" . +1100) + ("GMT+12" . +1200)("GMT+13" . +1300)("GMT-1" . -100) + ("GMT-2" . -200)("GMT-3" . -300)("GMT-4" . -400) + ("GMT-5" . -500)("GMT-6" . -600)("GMT-7" . -700) + ("GMT-8" . -800)("GMT-9" . -900)("GMT-10" . -1000) + ("GMT-11" . -1100) ("GMT-12" . -1200)) + "Time differentials of timezone from GMT in +-HHMM form. +Used in `current-time-zone' (Emacs 19 emulating function by APEL).") + +(defvar current-time-local-timezone nil + "*Local timezone name. +Used in `current-time-zone' (Emacs 19 emulating function by APEL).") + +(defun set-time-zone-rule (tz) + "Set the local time zone using TZ, a string specifying a time zone rule. +If TZ is nil, use implementation-defined default time zone information. +If TZ is t, use Universal Time." + (cond + ((stringp tz) + (setq current-time-local-timezone tz)) + (tz + (setq current-time-local-timezone "GMT")) + (t + (setq current-time-local-timezone + (with-temp-buffer + ;; We use `date' command to get timezone information. + (call-process "date" nil (current-buffer) t) + (goto-char (point-min)) + (if (looking-at + "^.*\\([A-Z][A-Z][A-Z]\\([^ \n\t]*\\)\\).*$") + (buffer-substring (match-beginning 1) + (match-end 1)))))))) + +(defun current-time-zone (&optional specified-time) + "Return the offset and name for the local time zone. +This returns a list of the form (OFFSET NAME). +OFFSET is an integer number of seconds ahead of UTC (east of Greenwich). + A negative value means west of Greenwich. +NAME is a string giving the name of the time zone. +Optional argument SPECIFIED-TIME is ignored in this implementation. +Some operating systems cannot provide all this information to Emacs; +in this case, `current-time-zone' returns a list containing nil for +the data it can't find." + (let ((local-timezone (or current-time-local-timezone + (progn + (set-time-zone-rule nil) + current-time-local-timezone))) + timezone abszone seconds) + (setq timezone + (or (cdr (assoc (upcase local-timezone) + current-time-world-timezones)) + ;; "+900" style or nil. + local-timezone)) + (when timezone + (if (stringp timezone) + (setq timezone (string-to-int timezone))) + ;; Taking account of minute in timezone. + ;; HHMM -> MM + (setq abszone (abs timezone)) + (setq seconds (* 60 (+ (* 60 (/ abszone 100)) (% abszone 100)))) + (list (if (< timezone 0) (- seconds) seconds) + local-timezone)))) + +(or (fboundp 'si:current-time-string) + (fset 'si:current-time-string (symbol-function 'current-time-string))) +(defun current-time-string (&optional specified-time) + "Return the current time, as a human-readable string. +Programs can use this function to decode a time, +since the number of columns in each field is fixed. +The format is `Sun Sep 16 01:03:52 1973'. +If an argument SPECIFIED-TIME is given, it specifies a time to format +instead of the current time. The argument should have the form: + (HIGH . LOW) +or the form: + (HIGH LOW . IGNORED). +Thus, you can use times obtained from `current-time' +and from `file-attributes'." + (if (null specified-time) + (si:current-time-string) + (or (consp specified-time) + (error "Wrong type argument %s" specified-time)) + (let ((high (car specified-time)) + (low (cdr specified-time)) + (offset (or (car (current-time-zone)) 0)) + (mdays '(31 28 31 30 31 30 31 31 30 31 30 31)) + (mnames '("Jan" "Feb" "Mar" "Apr" "May" "Jun" + "Jul" "Aug" "Sep" "Oct" "Nov" "Dec")) + (wnames '("Sun" "Mon" "Tue" "Wed" "Thu" "Fri" "Sat")) + days dd yyyy lyear mm HH MM SS) + (if (consp low) + (setq low (car low))) + (or (integerp high) + (error "Wrong type argument %s" high)) + (or (integerp low) + (error "Wrong type argument %s" low)) + (setq low (+ low offset)) + (while (> low 65535) + (setq high (1+ high) + low (- low 65536))) + (setq yyyy 1970) + (while (or (> high 481) + (and (= high 481) + (>= low 13184))) + (if (and (> high 0) + (< low 13184)) + (setq high (1- high) + low (+ 65536 low))) + (setq high (- high 481) + low (- low 13184)) + (if (and (zerop (% yyyy 4)) + (or (not (zerop (% yyyy 100))) + (zerop (% yyyy 400)))) + (progn + (if (and (> high 0) + (< low 20864)) + (setq high (1- high) + low (+ 65536 low))) + (setq high (- high 1) + low (- low 20864)))) + (setq yyyy (1+ yyyy))) + (setq dd 1) + (while (or (> high 1) + (and (= high 1) + (>= low 20864))) + (if (and (> high 0) + (< low 20864)) + (setq high (1- high) + low (+ 65536 low))) + (setq high (- high 1) + low (- low 20864) + dd (1+ dd))) + (setq days dd) + (if (= high 1) + (setq low (+ 65536 low))) + (setq mm 0) + (setq lyear (and (zerop (% yyyy 4)) + (or (not (zerop (% yyyy 100))) + (zerop (% yyyy 400))))) + (while (> (- dd (if (and lyear (= mm 1)) 29 (nth mm mdays))) 0) + (setq dd (- dd (if (and lyear (= mm 1)) 29 (nth mm mdays)))) + (setq mm (1+ mm))) + (setq HH (/ low 3600) + low (% low 3600) + MM (/ low 60) + SS (% low 60)) + (format "%s %s %2d %02d:%02d:%02d %4d" + (nth (% (+ days + (- (+ (* (1- yyyy) 365) (/ (1- yyyy) 400) + (/ (1- yyyy) 4)) (/ (1- yyyy) 100))) 7) + wnames) + (nth mm mnames) + dd HH MM SS yyyy)))) + +(defun current-time () + "Return the current time, as the number of seconds since 1970-01-01 00:00:00. +The time is returned as a list of three integers. The first has the +most significant 16 bits of the seconds, while the second has the +least significant 16 bits. The third integer gives the microsecond +count. + +The microsecond count is zero on systems that do not provide +resolution finer than a second." + (let* ((str (current-time-string)) + (yyyy (string-to-int (substring str 20 24))) + (mm (length (member (substring str 4 7) + '("Dec" "Nov" "Oct" "Sep" "Aug" "Jul" + "Jun" "May" "Apr" "Mar" "Feb" "Jan")))) + (dd (string-to-int (substring str 8 10))) + (HH (string-to-int (substring str 11 13))) + (MM (string-to-int (substring str 14 16))) + (SS (string-to-int (substring str 17 19))) + (offset (or (car (current-time-zone)) 0)) + dn ct1 ct2 i1 i2 + year uru) + (setq ct1 0 ct2 0 i1 0 i2 0) + (setq year (- yyyy 1970)) + (while (> year 0) + (setq year (1- year) + ct1 (+ ct1 481) + ct2 (+ ct2 13184)) + (while (> ct2 65535) + (setq ct1 (1+ ct1) + ct2 (- ct2 65536)))) + (setq year (- yyyy 1)) + (setq uru (- (+ (- (/ year 4) (/ year 100)) + (/ year 400)) 477)) + (while (> uru 0) + (setq uru (1- uru) + i1 (1+ i1) + i2 (+ i2 20864)) + (if (> i2 65535) + (setq i1 (1+ i1) + i2 (- i2 65536)))) + (setq ct1 (+ ct1 i1) + ct2 (+ ct2 i2)) + (while (> ct2 65535) + (setq ct1 (1+ ct1) + ct2 (- ct2 65536))) + (setq dn (+ dd (* 31 (1- mm)))) + (if (> mm 2) + (setq dn (+ (- dn (/ (+ 23 (* 4 mm)) 10)) + (if (and (zerop (% yyyy 4)) + (or (not (zerop (% yyyy 100))) + (zerop (% yyyy 400)))) + 1 0)))) + (setq dn (1- dn) + i1 0 + i2 0) + (while (> dn 0) + (setq dn (1- dn) + i1 (1+ i1) + i2 (+ i2 20864)) + (if (> i2 65535) + (setq i1 (1+ i1) + i2 (- i2 65536)))) + (setq ct1 (+ (+ (+ ct1 i1) (/ ct2 65536)) + (/ (+ (* HH 3600) (* MM 60) SS) + 65536)) + ct2 (+ (+ i2 (% ct2 65536)) + (% (+ (* HH 3600) (* MM 60) SS) + 65536))) + (while (< (- ct2 offset) 0) + (setq ct1 (1- ct1) + ct2 (+ ct2 65536))) + (setq ct2 (- ct2 offset)) + (while (> ct2 65535) + (setq ct1 (1+ ct1) + ct2 (- ct2 65536))) + (list ct1 ct2 0))) + +;;; @@ Floating point numbers. +;;; + +(defun abs (arg) + "Return the absolute value of ARG." + (if (< arg 0) (- arg) arg)) + +;;; @ Basic lisp subroutines. +;;; + +(defmacro lambda (&rest cdr) + "Return a lambda expression. +A call of the form (lambda ARGS DOCSTRING INTERACTIVE BODY) is +self-quoting; the result of evaluating the lambda expression is the +expression itself. The lambda expression may then be treated as a +function, i.e., stored as the function value of a symbol, passed to +funcall or mapcar, etc. + +ARGS should take the same form as an argument list for a `defun'. +DOCSTRING is an optional documentation string. + If present, it should describe how to call the function. + But documentation strings are usually not useful in nameless functions. +INTERACTIVE should be a call to the function `interactive', which see. +It may also be omitted. +BODY should be a list of lisp expressions." + ;; Note that this definition should not use backquotes; subr.el should not + ;; depend on backquote.el. + (list 'function (cons 'lambda cdr))) + +(defun force-mode-line-update (&optional all) + "Force the mode-line of the current buffer to be redisplayed. +With optional non-nil ALL, force redisplay of all mode-lines." + (if all (save-excursion (set-buffer (other-buffer)))) + (set-buffer-modified-p (buffer-modified-p))) + +(defalias 'set-match-data 'store-match-data) + +(defvar save-match-data-internal) + +;; We use save-match-data-internal as the local variable because +;; that works ok in practice (people should not use that variable elsewhere). +(defmacro save-match-data (&rest body) + "Execute the BODY forms, restoring the global value of the match data." + (` (let ((save-match-data-internal (match-data))) + (unwind-protect (progn (,@ body)) + (set-match-data save-match-data-internal))))) + + +;;; @ Basic editing commands. +;;; + +;; 18.55 does not have these variables. +(defvar-maybe buffer-undo-list nil + "List of undo entries in current buffer. +APEL provides this as dummy for a compatibility.") + +(defvar-maybe auto-fill-function nil + "Function called (if non-nil) to perform auto-fill. +APEL provides this as dummy for a compatibility.") + +(defvar-maybe unread-command-event nil + "APEL provides this as dummy for a compatibility.") +(defvar-maybe unread-command-events nil + "List of events to be read as the command input. +APEL provides this as dummy for a compatibility.") + +;; (defvar-maybe minibuffer-setup-hook nil +;; "Normal hook run just after entry to minibuffer.") +;; (defvar-maybe minibuffer-exit-hook nil +;; "Normal hook run just after exit from minibuffer.") + +(defvar-maybe minor-mode-map-alist nil + "Alist of keymaps to use for minor modes. +APEL provides this as dummy for a compatibility.") + +(defalias 'insert-and-inherit 'insert) +(defalias 'insert-before-markers-and-inherit 'insert-before-markers) +(defalias 'number-to-string 'int-to-string) + +(defun generate-new-buffer-name (name &optional ignore) + "Return a string that is the name of no existing buffer based on NAME. +If there is no live buffer named NAME, then return NAME. +Otherwise modify name by appending `', incrementing NUMBER +until an unused name is found, and then return that name. +Optional second argument IGNORE specifies a name that is okay to use +\(if it is in the sequence to be tried\) +even if a buffer with that name exists." + (if (get-buffer name) + (let ((n 2) new) + (while (get-buffer (setq new (format "%s<%d>" name n))) + (setq n (1+ n))) + new) + name)) + +(or (fboundp 'si:mark) + (fset 'si:mark (symbol-function 'mark))) +(defun mark (&optional force) + (si:mark)) + +(defun-maybe window-minibuffer-p (&optional window) +"Return non-nil if WINDOW is a minibuffer window." + (eq (or window (selected-window)) (minibuffer-window))) + +(defun-maybe window-live-p (obj) + "Returns t if OBJECT is a window which is currently visible." + (and (windowp obj) + (or (eq obj (minibuffer-window)) + (eq obj (get-buffer-window (window-buffer obj)))))) + +;; Add optinal argument `hist' +(or (fboundp 'si:read-from-minibuffer) + (progn + (fset 'si:read-from-minibuffer (symbol-function 'read-from-minibuffer)) + (defun read-from-minibuffer (prompt &optional + initial-contents keymap read hist) + + "Read a string from the minibuffer, prompting with string PROMPT. +If optional second arg INITIAL-CONTENTS is non-nil, it is a string + to be inserted into the minibuffer before reading input. + If INITIAL-CONTENTS is (STRING . POSITION), the initial input + is STRING, but point is placed at position POSITION in the minibuffer. +Third arg KEYMAP is a keymap to use whilst reading; + if omitted or nil, the default is `minibuffer-local-map'. +If fourth arg READ is non-nil, then interpret the result as a lisp object + and return that object: + in other words, do `(car (read-from-string INPUT-STRING))' +Fifth arg HIST is ignored in this implementation." + (si:read-from-minibuffer prompt initial-contents keymap read)))) + +;; Add optional argument `frame'. +(or (fboundp 'si:get-buffer-window) + (progn + (fset 'si:get-buffer-window (symbol-function 'get-buffer-window)) + (defun get-buffer-window (buffer &optional frame) + "Return a window currently displaying BUFFER, or nil if none. +Optional argument FRAME is ignored in this implementation." + (si:get-buffer-window buffer)))) + +(defun-maybe walk-windows (proc &optional minibuf all-frames) + "Cycle through all visible windows, calling PROC for each one. +PROC is called with a window as argument. + +Optional second arg MINIBUF t means count the minibuffer window even +if not active. MINIBUF nil or omitted means count the minibuffer iff +it is active. MINIBUF neither t nor nil means not to count the +minibuffer even if it is active. +Optional third argument ALL-FRAMES is ignored in this implementation." + (if (window-minibuffer-p (selected-window)) + (setq minibuf t)) + (let* ((walk-windows-start (selected-window)) + (walk-windows-current walk-windows-start)) + (unwind-protect + (while (progn + (setq walk-windows-current + (next-window walk-windows-current minibuf)) + (funcall proc walk-windows-current) + (not (eq walk-windows-current walk-windows-start)))) + (select-window walk-windows-start)))) + +(defun buffer-disable-undo (&optional buffer) + "Make BUFFER stop keeping undo information. +No argument or nil as argument means do this for the current buffer." + (buffer-flush-undo (or buffer (current-buffer)))) + + +;;; @@ Frame (Emacs 18 cannot make frame) +;;; +;; The following four are frequently used for manipulating the current frame. +;; frame.el has `screen-width', `screen-height', `set-screen-width' and +;; `set-screen-height' for backward compatibility and declare them as obsolete. +(defun frame-width (&optional frame) + "Return number of columns available for display on FRAME. +If FRAME is omitted, describe the currently selected frame." + (screen-width)) + +(defun frame-height (&optional frame) + "Return number of lines available for display on FRAME. +If FRAME is omitted, describe the currently selected frame." + (screen-height)) + +(defun set-frame-width (frame cols &optional pretend) + "Specify that the frame FRAME has COLS columns. +Optional third arg non-nil means that redisplay should use COLS columns +but that the idea of the actual width of the frame should not be changed." + (set-screen-width cols pretend)) + +(defun set-frame-height (frame lines &optional pretend) + "Specify that the frame FRAME has LINES lines. +Optional third arg non-nil means that redisplay should use LINES lines +but that the idea of the actual height of the frame should not be changed." + (set-screen-height lines pretend)) + +;;; @@ Environment variables. +;;; + +(autoload 'setenv "env" + "Set the value of the environment variable named VARIABLE to VALUE. +VARIABLE should be a string. VALUE is optional; if not provided or is +`nil', the environment variable VARIABLE will be removed. +This function works by modifying `process-environment'." + t) + + +;;; @ File input and output commands. +;;; + +(defvar data-directory exec-directory) + +;; In 18.55, `call-process' does not return exit status. +(defun file-executable-p (filename) + "Return t if FILENAME can be executed by you. +For a directory, this means you can access files in that directory." + (if (file-exists-p filename) + (let ((process (start-process "test" nil "test" "-x" filename))) + (while (eq 'run (process-status process))) + (zerop (process-exit-status process))))) + +(defun make-directory-internal (dirname) + "Create a directory. One argument, a file name string." + (let ((dir (expand-file-name dirname))) + (if (file-exists-p dir) + (signal 'file-already-exists + (list "Creating directory: %s already exists" dir)) + (let ((exit-status (call-process "mkdir" nil nil nil dir))) + (if (or (and (numberp exit-status) + (not (zerop exit-status))) + (stringp exit-status)) + (error "Create directory %s failed.") + ;; `make-directory' of v19 and later returns nil for success. + ))))) + +(defun make-directory (dir &optional parents) + "Create the directory DIR and any nonexistent parent dirs. +The second (optional) argument PARENTS says whether +to create parent directories if they don't exist." + (let ((len (length dir)) + (p 0) p1 path) + (catch 'tag + (while (and (< p len) (string-match "[^/]*/?" dir p)) + (setq p1 (match-end 0)) + (if (= p1 len) + (throw 'tag nil)) + (setq path (substring dir 0 p1)) + (if (not (file-directory-p path)) + (cond ((file-exists-p path) + (error "Creating directory: %s is not directory" path)) + ((null parents) + (error "Creating directory: %s is not exist" path)) + (t + (make-directory-internal path)))) + (setq p p1))) + (make-directory-internal dir))) + +(defun delete-directory (directory) + "Delete the directory named DIRECTORY. Does not follow symlinks." + (let ((exit-status (call-process "rmdir" nil nil nil directory))) + (when (or (and (numberp exit-status) (not (zerop exit-status))) + (stringp exit-status)) + (error "Delete directory %s failed.")))) + +(defun parse-colon-path (cd-path) + "Explode a colon-separated list of paths into a string list." + (and cd-path + (let (cd-prefix cd-list (cd-start 0) cd-colon) + (setq cd-path (concat cd-path path-separator)) + (while (setq cd-colon (string-match path-separator cd-path cd-start)) + (setq cd-list + (nconc cd-list + (list (if (= cd-start cd-colon) + nil + (substitute-in-file-name + (file-name-as-directory + (substring cd-path cd-start cd-colon))))))) + (setq cd-start (+ cd-colon 1))) + cd-list))) + +(defun file-relative-name (filename &optional directory) + "Convert FILENAME to be relative to DIRECTORY (default: default-directory)." + (setq filename (expand-file-name filename) + directory (file-name-as-directory (expand-file-name + (or directory default-directory)))) + (let ((ancestor "")) + (while (not (string-match (concat "^" (regexp-quote directory)) filename)) + (setq directory (file-name-directory (substring directory 0 -1)) + ancestor (concat "../" ancestor))) + (concat ancestor (substring filename (match-end 0))))) + +(or (fboundp 'si:directory-files) + (fset 'si:directory-files (symbol-function 'directory-files))) +(defun directory-files (directory &optional full match nosort) + "Return a list of names of files in DIRECTORY. +There are three optional arguments: +If FULL is non-nil, return absolute file names. Otherwise return names + that are relative to the specified directory. +If MATCH is non-nil, mention only file names that match the regexp MATCH. +If NOSORT is dummy for compatibility." + (si:directory-files directory full match)) + +(or (fboundp 'si:write-region) + (fset 'si:write-region (symbol-function 'write-region))) +(defun write-region (start end filename &optional append visit) + "Write current region into specified file. +When called from a program, requires three arguments: +START, END and FILENAME. START and END are normally buffer positions +specifying the part of the buffer to write. +If START is nil, that means to use the entire buffer contents. +If START is a string, then output that string to the file +instead of any buffer contents; END is ignored. + +Optional fourth argument APPEND if non-nil means + append to existing file contents (if any). If it is an integer, + seek to that offset in the file before writing. +Optional fifth argument VISIT if t means + set the last-save-file-modtime of buffer to this file's modtime + and mark buffer not modified. +If VISIT is a string, it is a second file name; + the output goes to FILENAME, but the buffer is marked as visiting VISIT. + VISIT is also the file name to lock and unlock for clash detection. +If VISIT is neither t nor nil nor a string, + that means do not display the \"Wrote file\" message." + (cond + ((null start) + (si:write-region (point-min) (point-max) filename append visit)) + ((stringp start) + (with-temp-buffer + (insert start) + (si:write-region (point-min) (point-max) filename append visit))) + (t + (si:write-region start end filename append visit)))) + +;;; @ Process. +;;; +(or (fboundp 'si:accept-process-output) + (progn + (fset 'si:accept-process-output (symbol-function 'accept-process-output)) + (defun accept-process-output (&optional process timeout timeout-msecs) + "Allow any pending output from subprocesses to be read by Emacs. +It is read into the process' buffers or given to their filter functions. +Non-nil arg PROCESS means do not return until some output has been received + from PROCESS. Nil arg PROCESS means do not return until some output has + been received from any process. +TIMEOUT and TIMEOUT-MSECS are ignored in this implementation." + (si:accept-process-output process)))) + +;;; @ Text property. +;;; + +;; In Emacs 20.4, these functions are defined in src/textprop.c. +(defun text-properties-at (position &optional object)) +(defun get-text-property (position prop &optional object)) +(defun get-char-property (position prop &optional object)) +(defun next-property-change (position &optional object limit)) +(defun next-single-property-change (position prop &optional object limit)) +(defun previous-property-change (position &optional object limit)) +(defun previous-single-property-change (position prop &optional object limit)) +(defun add-text-properties (start end properties &optional object)) +(defun put-text-property (start end property value &optional object)) +(defun set-text-properties (start end properties &optional object)) +(defun remove-text-properties (start end properties &optional object)) +(defun text-property-any (start end property value &optional object)) +(defun text-property-not-all (start end property value &optional object)) +;; the following two functions are new in v20. +(defun next-char-property-change (position &optional object)) +(defun previous-char-property-change (position &optional object)) +;; the following two functions are obsolete. +;; (defun erase-text-properties (start end &optional object) +;; (defun copy-text-properties (start end src pos dest &optional prop) + + +;;; @ Overlay. +;;; + +(defun overlayp (object)) +(defun make-overlay (beg end &optional buffer front-advance rear-advance)) +(defun move-overlay (overlay beg end &optional buffer)) +(defun delete-overlay (overlay)) +(defun overlay-start (overlay)) +(defun overlay-end (overlay)) +(defun overlay-buffer (overlay)) +(defun overlay-properties (overlay)) +(defun overlays-at (pos)) +(defun overlays-in (beg end)) +(defun next-overlay-change (pos)) +(defun previous-overlay-change (pos)) +(defun overlay-lists ()) +(defun overlay-recenter (pos)) +(defun overlay-get (overlay prop)) +(defun overlay-put (overlay prop value)) + +;;; @ End. +;;; + +(require 'product) +(product-provide (provide 'poe-18) (require 'apel-ver)) + +;;; poe-18.el ends here diff --git a/apel-10.7/poe-xemacs.el b/apel-10.7/poe-xemacs.el new file mode 100644 index 0000000..5ebf94f --- /dev/null +++ b/apel-10.7/poe-xemacs.el @@ -0,0 +1,239 @@ +;;; poe-xemacs.el --- poe submodule for XEmacs + +;; Copyright (C) 1995 Free Software Foundation, Inc. +;; Copyright (C) 1995,1996,1997,1998 MORIOKA Tomohiko + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, XEmacs + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 XEmacs; see the file COPYING. If not, write to the Free +;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. + +;;; Code: + +(require 'pym) + + +;;; @ color +;;; + +(defun-maybe set-cursor-color (color-name) + "Set the text cursor color of the selected frame to COLOR. +When called interactively, prompt for the name of the color to use." + (interactive "sColor: ") + (set-frame-property (selected-frame) 'cursor-color + (if (color-instance-p color-name) + color-name + (make-color-instance color-name)))) + + +;;; @ face +;;; + +(defalias-maybe 'face-list 'list-faces) + +(or (memq 'underline (face-list)) + (and (fboundp 'make-face) + (make-face 'underline))) + +(or (face-differs-from-default-p 'underline) + (set-face-underline-p 'underline t)) + + +;;; @ overlay +;;; + +(condition-case nil + (require 'overlay) + (error + (defalias 'make-overlay 'make-extent) + (defalias 'overlayp 'extentp) + (defalias 'overlay-put 'set-extent-property) + (defalias 'overlay-buffer 'extent-buffer) + (defun move-overlay (extent start end &optional buffer) + (set-extent-endpoints extent start end)) + (defalias 'delete-overlay 'detach-extent))) + + +;;; @ dired +;;; + +(defun-maybe dired-other-frame (dirname &optional switches) + "\"Edit\" directory DIRNAME. Like `dired' but makes a new frame." + (interactive (dired-read-dir-and-switches "in other frame ")) + (switch-to-buffer-other-frame (dired-noselect dirname switches))) + + +;;; @ timer +;;; + +(condition-case nil + (require 'timer-funcs) + (error nil)) +(condition-case nil + (require 'timer) + (error nil)) +(or + (or (featurep 'timer-funcs) (featurep 'timer)) + (progn + (require 'itimer) + (if (and (= emacs-major-version 19) (<= emacs-minor-version 14)) + (defun-maybe run-at-time (time repeat function &rest args) + (start-itimer (make-temp-name "rat") + `(lambda () + (,function ,@args)) + time repeat)) + (defun-maybe run-at-time (time repeat function &rest args) + "Function emulating the function of the same name of Emacs. +TIME should be nil meaning now, or a number of seconds from now. +Return an itimer object which can be used in either `delete-itimer' +or `cancel-timer'." + (apply #'start-itimer "run-at-time" + function (if time (max time 1e-9) 1e-9) + repeat nil t args))) + (defalias 'cancel-timer 'delete-itimer) + (defun with-timeout-handler (tag) + (throw tag 'timeout)) + (defmacro-maybe with-timeout (list &rest body) + (let ((seconds (car list)) + (timeout-forms (cdr list))) + `(let ((with-timeout-tag (cons nil nil)) + with-timeout-value with-timeout-timer) + (if (catch with-timeout-tag + (progn + (setq with-timeout-timer + (run-at-time ,seconds nil + 'with-timeout-handler + with-timeout-tag)) + (setq with-timeout-value (progn . ,body)) + nil)) + (progn . ,timeout-forms) + (cancel-timer with-timeout-timer) + with-timeout-value)))))) + +(require 'broken) + +(broken-facility run-at-time-tick-tock + "`run-at-time' is not punctual." + ;; Note that it doesn't support XEmacsen prior to the version 19.15 + ;; since `start-itimer' doesn't pass arguments to a timer function. + (or (and (= emacs-major-version 19) (<= emacs-minor-version 14)) + (condition-case nil + (progn + (unless (or itimer-process itimer-timer) + (itimer-driver-start)) + ;; Check whether there is a bug to which the difference of + ;; the present time and the time when the itimer driver was + ;; woken up is subtracted from the initial itimer value. + (let* ((inhibit-quit t) + (ctime (current-time)) + (itimer-timer-last-wakeup + (prog1 + ctime + (setcar ctime (1- (car ctime))))) + (itimer-list nil) + (itimer (start-itimer "run-at-time" 'ignore 5))) + (sleep-for 0.1) ;; Accept the timeout interrupt. + (prog1 + (> (itimer-value itimer) 0) + (delete-itimer itimer)))) + (error nil)))) + +(when-broken run-at-time-tick-tock + (defalias 'run-at-time + (lambda (time repeat function &rest args) + "Function emulating the function of the same name of Emacs. +It works correctly for TIME even if there is a bug in the XEmacs core. +TIME should be nil meaning now, or a number of seconds from now. +Return an itimer object which can be used in either `delete-itimer' +or `cancel-timer'." + (let ((itimers (list nil))) + (setcar + itimers + (apply #'start-itimer "fixed-run-at-time" + (lambda (itimers repeat function &rest args) + (let ((itimer (car itimers))) + (if repeat + (progn + (set-itimer-function + itimer + (lambda (itimer repeat function &rest args) + (set-itimer-restart itimer repeat) + (set-itimer-function itimer function) + (set-itimer-function-arguments itimer args) + (apply function args))) + (set-itimer-function-arguments + itimer + (append (list itimer repeat function) args))) + (set-itimer-function + itimer + (lambda (itimer function &rest args) + (delete-itimer itimer) + (apply function args))) + (set-itimer-function-arguments + itimer + (append (list itimer function) args))))) + 1e-9 (if time (max time 1e-9) 1e-9) + nil t itimers repeat function args)))))) + + +;;; @ to avoid bug of XEmacs 19.14 +;;; + +(or (string-match "^../" + (file-relative-name "/usr/local/share" "/usr/local/lib")) + ;; This function was imported from Emacs 19.33. + (defun file-relative-name (filename &optional directory) + "Convert FILENAME to be relative to DIRECTORY +(default: default-directory)." + (setq filename (expand-file-name filename) + directory (file-name-as-directory + (expand-file-name + (or directory default-directory)))) + (let ((ancestor "")) + (while (not (string-match (concat "^" (regexp-quote directory)) + filename)) + (setq directory (file-name-directory (substring directory 0 -1)) + ancestor (concat "../" ancestor))) + (concat ancestor (substring filename (match-end 0)))))) + + +;;; @ Emacs 20.3 emulation +;;; + +(defalias-maybe 'line-beginning-position 'point-at-bol) +(defalias-maybe 'line-end-position 'point-at-eol) + +;;; @ XEmacs 21 emulation +;;; + +;; XEmacs 20.5 and later: (set-extent-properties EXTENT PLIST) +(defun-maybe set-extent-properties (extent plist) + "Change some properties of EXTENT. +PLIST is a property list. +For a list of built-in properties, see `set-extent-property'." + (while plist + (set-extent-property extent (car plist) (cadr plist)) + (setq plist (cddr plist)))) + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'poe-xemacs) (require 'apel-ver)) + +;;; poe-xemacs.el ends here diff --git a/apel-10.7/poe.el b/apel-10.7/poe.el new file mode 100644 index 0000000..89c097e --- /dev/null +++ b/apel-10.7/poe.el @@ -0,0 +1,2031 @@ +;;; poe.el --- Portable Outfit for Emacsen + +;; Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Shuhei KOBAYASHI +;; Keywords: emulation, compatibility, Nemacs, MULE, Emacs/mule, XEmacs + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Commentary: + +;;; Code: + +(require 'product) +(product-provide (provide 'poe) (require 'apel-ver)) + +(require 'pym) + + +;;; @ Version information. +;;; + +(static-when (= emacs-major-version 18) + (require 'poe-18)) + +;; Some ancient version of XEmacs did not provide 'xemacs. +(static-when (string-match "XEmacs" emacs-version) + (provide 'xemacs)) + +;; `file-coding' was appeared in the spring of 1998, just before XEmacs +;; 21.0. Therefore it is not provided in XEmacs with MULE versions 20.4 +;; or earlier. +(static-when (featurep 'xemacs) + ;; must be load-time check to share .elc between w/ MULE and w/o MULE. + (when (featurep 'mule) + (provide 'file-coding))) + +(static-when (featurep 'xemacs) + (require 'poe-xemacs)) + +;; must be load-time check to share .elc between different systems. +(or (fboundp 'open-network-stream) + (require 'tcp)) + + +;;; @ C primitives emulation. +;;; + +;; Emacs 20.3 and earlier: (require FEATURE &optional FILENAME) +;; Emacs 20.4 and later: (require FEATURE &optional FILENAME NOERROR) +(static-condition-case nil + ;; compile-time check. + (progn + (require 'nofeature "nofile" 'noerror) + (if (get 'require 'defun-maybe) + (error "`require' is already redefined"))) + (error + ;; load-time check. + (or (fboundp 'si:require) + (progn + (fset 'si:require (symbol-function 'require)) + (defun require (feature &optional filename noerror) + "\ +If feature FEATURE is not loaded, load it from FILENAME. +If FEATURE is not a member of the list `features', then the feature +is not loaded; so load the file FILENAME. +If FILENAME is omitted, the printname of FEATURE is used as the file name, +but in this case `load' insists on adding the suffix `.el' or `.elc'. +If the optional third argument NOERROR is non-nil, +then return nil if the file is not found. +Normally the return value is FEATURE." + (if noerror + (condition-case nil + (si:require feature filename) + (file-error)) + (si:require feature filename))) + ;; for `load-history'. + (setq current-load-list (cons 'require current-load-list)) + (put 'require 'defun-maybe t))))) + +;; Emacs 19.29 and later: (plist-get PLIST PROP) +;; (defun-maybe plist-get (plist prop) +;; (while (and plist +;; (not (eq (car plist) prop))) +;; (setq plist (cdr (cdr plist)))) +;; (car (cdr plist))) +(static-unless (and (fboundp 'plist-get) + (not (get 'plist-get 'defun-maybe))) + (or (fboundp 'plist-get) + (progn + (defvar plist-get-internal-symbol) + (defun plist-get (plist prop) + "\ +Extract a value from a property list. +PLIST is a property list, which is a list of the form +\(PROP1 VALUE1 PROP2 VALUE2...\). This function returns the value +corresponding to the given PROP, or nil if PROP is not +one of the properties on the list." + (setplist 'plist-get-internal-symbol plist) + (get 'plist-get-internal-symbol prop)) + ;; for `load-history'. + (setq current-load-list (cons 'plist-get current-load-list)) + (put 'plist-get 'defun-maybe t)))) + +;; Emacs 19.29 and later: (plist-put PLIST PROP VAL) +;; (defun-maybe plist-put (plist prop val) +;; (catch 'found +;; (let ((tail plist) +;; (prev nil)) +;; (while (and tail (cdr tail)) +;; (if (eq (car tail) prop) +;; (progn +;; (setcar (cdr tail) val) +;; (throw 'found plist)) +;; (setq prev tail +;; tail (cdr (cdr tail))))) +;; (if prev +;; (progn +;; (setcdr (cdr prev) (list prop val)) +;; plist) +;; (list prop val))))) +(static-unless (and (fboundp 'plist-put) + (not (get 'plist-put 'defun-maybe))) + (or (fboundp 'plist-put) + (progn + (defvar plist-put-internal-symbol) + (defun plist-put (plist prop val) + "\ +Change value in PLIST of PROP to VAL. +PLIST is a property list, which is a list of the form +\(PROP1 VALUE1 PROP2 VALUE2 ...\). PROP is a symbol and VAL is any object. +If PROP is already a property on the list, its value is set to VAL, +otherwise the new PROP VAL pair is added. The new plist is returned; +use `\(setq x \(plist-put x prop val\)\)' to be sure to use the new value. +The PLIST is modified by side effects." + (setplist 'plist-put-internal-symbol plist) + (put 'plist-put-internal-symbol prop val) + (symbol-plist 'plist-put-internal-symbol)) + ;; for `load-history'. + (setq current-load-list (cons 'plist-put current-load-list)) + (put 'plist-put 'defun-maybe t)))) + +;; Emacs 19.23 and later: (minibuffer-prompt-width) +(defun-maybe minibuffer-prompt-width () + "Return the display width of the minibuffer prompt." + (save-excursion + (set-buffer (window-buffer (minibuffer-window))) + (current-column))) + +;; (read-string PROMPT &optional INITIAL-INPUT HISTORY) +;; Emacs 19.29/XEmacs 19.14(?) and later takes optional 3rd arg HISTORY. +(static-unless (or (featurep 'xemacs) + (>= emacs-major-version 20) + (and (= emacs-major-version 19) + (>= emacs-minor-version 29))) + (or (fboundp 'si:read-string) + (progn + (fset 'si:read-string (symbol-function 'read-string)) + (defun read-string (prompt &optional initial-input history) + "\ +Read a string from the minibuffer, prompting with string PROMPT. +If non-nil, second arg INITIAL-INPUT is a string to insert before reading. +The third arg HISTORY, is dummy for compatibility. +See `read-from-minibuffer' for details of HISTORY argument." + (si:read-string prompt initial-input))))) + +;; (completing-read prompt table &optional +;; FSF Emacs +;; --19.7 : predicate require-match init +;; 19.7 --19.34 : predicate require-match init hist +;; 20.1 -- : predicate require-match init hist def inherit-input-method +;; XEmacs +;; --19.(?): predicate require-match init +;; --21.2 : predicate require-match init hist +;; 21.2 -- : predicate require-match init hist def +;; ) + +;; We support following API. +;; (completing-read prompt table +;; &optional predicate require-match init hist def) +(static-cond + ;; add 'hist' and 'def' argument. + ((< emacs-major-version 19) + (or (fboundp 'si:completing-read) + (progn + (fset 'si:completing-read (symbol-function 'completing-read)) + (defun completing-read + (prompt table &optional predicate require-match init + hist def) + "Read a string in the minibuffer, with completion. +PROMPT is a string to prompt with; normally it ends in a colon and a space. +TABLE is an alist whose elements' cars are strings, or an obarray. +PREDICATE limits completion to a subset of TABLE. +See `try-completion' and `all-completions' for more details + on completion, TABLE, and PREDICATE. + +If REQUIRE-MATCH is non-nil, the user is not allowed to exit unless + the input is (or completes to) an element of TABLE or is null. + If it is also not t, Return does not exit if it does non-null completion. +If the input is null, `completing-read' returns an empty string, + regardless of the value of REQUIRE-MATCH. + +If INIT is non-nil, insert it in the minibuffer initially. + If it is (STRING . POSITION), the initial input + is STRING, but point is placed POSITION characters into the string. +HIST is ignored in this implementation. +DEF, if non-nil, is the default value. + +Completion ignores case if the ambient value of + `completion-ignore-case' is non-nil." + (let ((string (si:completing-read prompt table predicate + require-match init))) + (if (and (string= string "") def) + def string)))))) + ;; add 'def' argument. + ((or (and (featurep 'xemacs) + (or (and (eq emacs-major-version 21) + (< emacs-minor-version 2)) + (< emacs-major-version 21))) + (< emacs-major-version 20)) + (or (fboundp 'si:completing-read) + (progn + (fset 'si:completing-read (symbol-function 'completing-read)) + (defun completing-read + (prompt table &optional predicate require-match init + hist def) + "Read a string in the minibuffer, with completion. +PROMPT is a string to prompt with; normally it ends in a colon and a space. +TABLE is an alist whose elements' cars are strings, or an obarray. +PREDICATE limits completion to a subset of TABLE. +See `try-completion' and `all-completions' for more details + on completion, TABLE, and PREDICATE. + +If REQUIRE-MATCH is non-nil, the user is not allowed to exit unless + the input is (or completes to) an element of TABLE or is null. + If it is also not t, Return does not exit if it does non-null completion. +If the input is null, `completing-read' returns an empty string, + regardless of the value of REQUIRE-MATCH. + +If INIT is non-nil, insert it in the minibuffer initially. + If it is (STRING . POSITION), the initial input + is STRING, but point is placed POSITION characters into the string. +HIST, if non-nil, specifies a history list + and optionally the initial position in the list. + It can be a symbol, which is the history list variable to use, + or it can be a cons cell (HISTVAR . HISTPOS). + In that case, HISTVAR is the history list variable to use, + and HISTPOS is the initial position (the position in the list + which INIT corresponds to). + Positions are counted starting from 1 at the beginning of the list. +DEF, if non-nil, is the default value. + +Completion ignores case if the ambient value of + `completion-ignore-case' is non-nil." + (let ((string (si:completing-read prompt table predicate + require-match init hist))) + (if (and (string= string "") def) + def string))))))) + +;; v18: (string-to-int STRING) +;; v19: (string-to-number STRING) +;; v20: (string-to-number STRING &optional BASE) +;; +;; XXX: `string-to-number' of Emacs 20.3 and earlier is broken. +;; (string-to-number "1e1" 16) => 10.0, should be 481. +(static-condition-case nil + ;; compile-time check. + (if (= (string-to-number "1e1" 16) 481) + (if (get 'string-to-number 'defun-maybe) + (error "`string-to-number' is already redefined")) + (error "`string-to-number' is broken")) + (error + ;; load-time check. + (or (fboundp 'si:string-to-number) + (progn + (if (fboundp 'string-to-number) + (fset 'si:string-to-number (symbol-function 'string-to-number)) + (fset 'si:string-to-number (symbol-function 'string-to-int)) + ;; XXX: In v18, this causes infinite loop while byte-compiling. + ;; (defalias 'string-to-int 'string-to-number) + ) + (put 'string-to-number 'defun-maybe t) + (defun string-to-number (string &optional base) + "\ +Convert STRING to a number by parsing it as a decimal number. +This parses both integers and floating point numbers. +It ignores leading spaces and tabs. + +If BASE, interpret STRING as a number in that base. If BASE isn't +present, base 10 is used. BASE must be between 2 and 16 (inclusive). +If the base used is not 10, floating point is not recognized." + (if (or (null base) (= base 10)) + (si:string-to-number string) + (if (or (< base 2)(> base 16)) + (signal 'args-out-of-range (cons base nil))) + (let ((len (length string)) + (pos 0)) + ;; skip leading whitespace. + (while (and (< pos len) + (memq (aref string pos) '(?\ ?\t))) + (setq pos (1+ pos))) + (if (= pos len) + 0 + (let ((number 0)(negative 1) + chr num) + (if (eq (aref string pos) ?-) + (setq negative -1 + pos (1+ pos)) + (if (eq (aref string pos) ?+) + (setq pos (1+ pos)))) + (while (and (< pos len) + (setq chr (aref string pos) + num (cond + ((and (<= ?0 chr)(<= chr ?9)) + (- chr ?0)) + ((and (<= ?A chr)(<= chr ?F)) + (+ (- chr ?A) 10)) + ((and (<= ?a chr)(<= chr ?f)) + (+ (- chr ?a) 10)) + (t nil))) + (< num base)) + (setq number (+ (* number base) num) + pos (1+ pos))) + (* negative number)))))))))) + +;; Emacs 20.1 and 20.2: (concat-chars &rest CHARS) +;; Emacs 20.3/XEmacs 21.0 and later: (string &rest CHARS) +(static-cond + ((and (fboundp 'string) + (subrp (symbol-function 'string))) + ;; Emacs 20.3/XEmacs 21.0 and later. + ) + ((and (fboundp 'concat-chars) + (subrp (symbol-function 'concat-chars))) + ;; Emacs 20.1 and 20.2. + (defalias 'string 'concat-chars)) + (t + ;; Use `defun-maybe' to update `load-history'. + (defun-maybe string (&rest chars) + "Concatenate all the argument characters and make the result a string." + ;; We cannot use (apply 'concat chars) here because `concat' does not + ;; work with multibyte chars on Mule 1.* and 2.*. + (mapconcat (function char-to-string) chars "")))) + +;; Mule: (char-before POS) +;; v20: (char-before &optional POS) +(static-condition-case nil + ;; compile-time check. + (progn + (char-before) + (if (get 'char-before 'defun-maybe) + (error "`char-before' is already defined"))) + (wrong-number-of-arguments ; Mule. + ;; load-time check. + (or (fboundp 'si:char-before) + (progn + (fset 'si:char-before (symbol-function 'char-before)) + (put 'char-before 'defun-maybe t) + ;; takes IGNORED for backward compatibility. + (defun char-before (&optional pos ignored) + "\ +Return character in current buffer preceding position POS. +POS is an integer or a buffer pointer. +If POS is out of range, the value is nil." + (si:char-before (or pos (point))))))) + (void-function ; non-Mule. + ;; load-time check. + (defun-maybe char-before (&optional pos) + "\ +Return character in current buffer preceding position POS. +POS is an integer or a buffer pointer. +If POS is out of range, the value is nil." + (if pos + (save-excursion + (and (= (goto-char pos) (point)) + (not (bobp)) + (preceding-char))) + (and (not (bobp)) + (preceding-char))))) + (error ; found our definition at compile-time. + ;; load-time check. + (condition-case nil + (char-before) + (wrong-number-of-arguments ; Mule. + (or (fboundp 'si:char-before) + (progn + (fset 'si:char-before (symbol-function 'char-before)) + (put 'char-before 'defun-maybe t) + ;; takes IGNORED for backward compatibility. + (defun char-before (&optional pos ignored) + "\ +Return character in current buffer preceding position POS. +POS is an integer or a buffer pointer. +If POS is out of range, the value is nil." + (si:char-before (or pos (point))))))) + (void-function ; non-Mule. + (defun-maybe char-before (&optional pos) + "\ +Return character in current buffer preceding position POS. +POS is an integer or a buffer pointer. +If POS is out of range, the value is nil." + (if pos + (save-excursion + (and (= (goto-char pos) (point)) + (not (bobp)) + (preceding-char))) + (and (not (bobp)) + (preceding-char)))))))) + +;; v18, v19: (char-after POS) +;; v20: (char-after &optional POS) +(static-condition-case nil + ;; compile-time check. + (progn + (char-after) + (if (get 'char-after 'defun-maybe) + (error "`char-after' is already redefined"))) + (wrong-number-of-arguments ; v18, v19 + ;; load-time check. + (or (fboundp 'si:char-after) + (progn + (fset 'si:char-after (symbol-function 'char-after)) + (put 'char-after 'defun-maybe t) + (defun char-after (&optional pos) + "\ +Return character in current buffer at position POS. +POS is an integer or a buffer pointer. +If POS is out of range, the value is nil." + (si:char-after (or pos (point))))))) + (void-function ; NEVER happen? + ;; load-time check. + (defun-maybe char-after (&optional pos) + "\ +Return character in current buffer at position POS. +POS is an integer or a buffer pointer. +If POS is out of range, the value is nil." + (if pos + (save-excursion + (and (= (goto-char pos) (point)) + (not (eobp)) + (following-char))) + (and (not (eobp)) + (following-char))))) + (error ; found our definition at compile-time. + ;; load-time check. + (condition-case nil + (char-after) + (wrong-number-of-arguments ; v18, v19 + (or (fboundp 'si:char-after) + (progn + (fset 'si:char-after (symbol-function 'char-after)) + (put 'char-after 'defun-maybe t) + (defun char-after (&optional pos) + "\ +Return character in current buffer at position POS. +POS is an integer or a buffer pointer. +If POS is out of range, the value is nil." + (si:char-after (or pos (point))))))) + (void-function ; NEVER happen? + (defun-maybe char-after (&optional pos) + "\ +Return character in current buffer at position POS. +POS is an integer or a buffer pointer. +If POS is out of range, the value is nil." + (if pos + (save-excursion + (and (= (goto-char pos) (point)) + (not (eobp)) + (following-char))) + (and (not (eobp)) + (following-char)))))))) + +;; Emacs 19.29 and later: (buffer-substring-no-properties START END) +(defun-maybe buffer-substring-no-properties (start end) + "Return the characters of part of the buffer, without the text properties. +The two arguments START and END are character positions; +they can be in either order." + (let ((string (buffer-substring start end))) + (set-text-properties 0 (length string) nil string) + string)) + +;; Emacs 19.31 and later: (buffer-live-p OBJECT) +(defun-maybe buffer-live-p (object) + "Return non-nil if OBJECT is a buffer which has not been killed. +Value is nil if OBJECT is not a buffer or if it has been killed." + (and object + (get-buffer object) + (buffer-name (get-buffer object)) + t)) + +;; Emacs 20: (line-beginning-position &optional N) +(defun-maybe line-beginning-position (&optional n) + "Return the character position of the first character on the current line. +With argument N not nil or 1, move forward N - 1 lines first. +If scan reaches end of buffer, return that position. +This function does not move point." + (save-excursion + (forward-line (1- (or n 1))) + (point))) + +;; Emacs 20: (line-end-position &optional N) +(defun-maybe line-end-position (&optional n) + "Return the character position of the last character on the current line. +With argument N not nil or 1, move forward N - 1 lines first. +If scan reaches end of buffer, return that position. +This function does not move point." + (save-excursion + (end-of-line (or n 1)) + (point))) + +;; FSF Emacs 19.29 and later +;; (read-file-name PROMPT &optional DIR DEFAULT-FILENAME MUSTMATCH INITIAL) +;; XEmacs 19.14 and later: +;; (read-file-name (PROMPT &optional DIR DEFAULT MUST-MATCH INITIAL-CONTENTS +;; HISTORY) + +;; In FSF Emacs 19.28 and earlier (except for v18) or XEmacs 19.13 and +;; earlier, this function is incompatible with the other Emacsen. +;; For instance, if DEFAULT-FILENAME is nil, INITIAL is not and user +;; enters a null string, it returns the visited file name of the current +;; buffer if it is non-nil. + +;; It does not assimilate the different numbers of the optional arguments +;; on various Emacsen (yet). +(static-cond + ((and (not (featurep 'xemacs)) + (eq emacs-major-version 19) + (< emacs-minor-version 29)) + (if (fboundp 'si:read-file-name) + nil + (fset 'si:read-file-name (symbol-function 'read-file-name)) + (defun read-file-name (prompt &optional dir default-filename mustmatch + initial) + "Read file name, prompting with PROMPT and completing in directory DIR. +Value is not expanded---you must call `expand-file-name' yourself. +Default name to DEFAULT-FILENAME if user enters a null string. + (If DEFAULT-FILENAME is omitted, the visited file name is used, + except that if INITIAL is specified, that combined with DIR is used.) +Fourth arg MUSTMATCH non-nil means require existing file's name. + Non-nil and non-t means also require confirmation after completion. +Fifth arg INITIAL specifies text to start with. +DIR defaults to current buffer's directory default." + (si:read-file-name prompt dir + (or default-filename + (if initial + (expand-file-name initial dir))) + mustmatch initial)))) + ((and (featurep 'xemacs) + (eq emacs-major-version 19) + (< emacs-minor-version 14)) + (if (fboundp 'si:read-file-name) + nil + (fset 'si:read-file-name (symbol-function 'read-file-name)) + (defun read-file-name (prompt &optional dir default must-match + initial-contents history) + "Read file name, prompting with PROMPT and completing in directory DIR. +This will prompt with a dialog box if appropriate, according to + `should-use-dialog-box-p'. +Value is not expanded---you must call `expand-file-name' yourself. +Value is subject to interpreted by substitute-in-file-name however. +Default name to DEFAULT if user enters a null string. + (If DEFAULT is omitted, the visited file name is used, + except that if INITIAL-CONTENTS is specified, that combined with DIR is + used.) +Fourth arg MUST-MATCH non-nil means require existing file's name. + Non-nil and non-t means also require confirmation after completion. +Fifth arg INITIAL-CONTENTS specifies text to start with. +Sixth arg HISTORY specifies the history list to use. Default is + `file-name-history'. +DIR defaults to current buffer's directory default." + (si:read-file-name prompt dir + (or default + (if initial-contents + (expand-file-name initial-contents dir))) + must-match initial-contents history))))) + + +;;; @ Basic lisp subroutines emulation. (lisp/subr.el) +;;; + +;;; @@ Lisp language features. + +(defmacro-maybe push (newelt listname) + "Add NEWELT to the list stored in the symbol LISTNAME. +This is equivalent to (setq LISTNAME (cons NEWELT LISTNAME)). +LISTNAME must be a symbol." + (list 'setq listname + (list 'cons newelt listname))) + +(defmacro-maybe pop (listname) + "Return the first element of LISTNAME's value, and remove it from the list. +LISTNAME must be a symbol whose value is a list. +If the value is nil, `pop' returns nil but does not actually +change the list." + (list 'prog1 (list 'car listname) + (list 'setq listname (list 'cdr listname)))) + +(defmacro-maybe when (cond &rest body) + "If COND yields non-nil, do BODY, else return nil." + (list 'if cond (cons 'progn body))) +;; (def-edebug-spec when (&rest form)) + +(defmacro-maybe unless (cond &rest body) + "If COND yields nil, do BODY, else return nil." + (cons 'if (cons cond (cons nil body)))) +;; (def-edebug-spec unless (&rest form)) + +(defsubst-maybe caar (x) + "Return the car of the car of X." + (car (car x))) + +(defsubst-maybe cadr (x) + "Return the car of the cdr of X." + (car (cdr x))) + +(defsubst-maybe cdar (x) + "Return the cdr of the car of X." + (cdr (car x))) + +(defsubst-maybe cddr (x) + "Return the cdr of the cdr of X." + (cdr (cdr x))) + +(defun-maybe last (x &optional n) + "Return the last link of the list X. Its car is the last element. +If X is nil, return nil. +If N is non-nil, return the Nth-to-last link of X. +If N is bigger than the length of X, return X." + (if n + (let ((m 0) (p x)) + (while (consp p) + (setq m (1+ m) p (cdr p))) + (if (<= n 0) p + (if (< n m) (nthcdr (- m n) x) x))) + (while (cdr x) + (setq x (cdr x))) + x)) + +;; Actually, `butlast' and `nbutlast' are defined in lisp/cl.el. +(defun-maybe butlast (x &optional n) + "Returns a copy of LIST with the last N elements removed." + (if (and n (<= n 0)) x + (nbutlast (copy-sequence x) n))) + +(defun-maybe nbutlast (x &optional n) + "Modifies LIST to remove the last N elements." + (let ((m (length x))) + (or n (setq n 1)) + (and (< n m) + (progn + (if (> n 0) (setcdr (nthcdr (- (1- m) n) x) nil)) + x)))) + +;; Emacs 20.3 and later: (assoc-default KEY ALIST &optional TEST DEFAULT) +(defun-maybe assoc-default (key alist &optional test default) + "Find object KEY in a pseudo-alist ALIST. +ALIST is a list of conses or objects. Each element (or the element's car, +if it is a cons) is compared with KEY by evaluating (TEST (car elt) KEY). +If that is non-nil, the element matches; +then `assoc-default' returns the element's cdr, if it is a cons, +or DEFAULT if the element is not a cons. + +If no element matches, the value is nil. +If TEST is omitted or nil, `equal' is used." + (let (found (tail alist) value) + (while (and tail (not found)) + (let ((elt (car tail))) + (when (funcall (or test 'equal) (if (consp elt) (car elt) elt) key) + (setq found t value (if (consp elt) (cdr elt) default)))) + (setq tail (cdr tail))) + value)) + +;; The following two function use `compare-strings', which we don't +;; support yet. +;; (defun assoc-ignore-case (key alist)) +;; (defun assoc-ignore-representation (key alist)) + +;; Emacs 19.29/XEmacs 19.13 and later: (rassoc KEY LIST) +;; Actually, `rassoc' is defined in src/fns.c. +(defun-maybe rassoc (key list) + "Return non-nil if KEY is `equal' to the cdr of an element of LIST. +The value is actually the element of LIST whose cdr equals KEY. +Elements of LIST that are not conses are ignored." + (catch 'found + (while list + (cond ((not (consp (car list)))) + ((equal (cdr (car list)) key) + (throw 'found (car list)))) + (setq list (cdr list))))) + +;; XEmacs 19.13 and later: (remassoc KEY ALIST) +(defun-maybe remassoc (key alist) + "Delete by side effect any elements of ALIST whose car is `equal' to KEY. +The modified ALIST is returned. If the first member of ALIST has a car +that is `equal' to KEY, there is no way to remove it by side effect; +therefore, write `(setq foo (remassoc key foo))' to be sure of changing +the value of `foo'." + (while (and (consp alist) + (or (not (consp (car alist))) + (equal (car (car alist)) key))) + (setq alist (cdr alist))) + (if (consp alist) + (let ((prev alist) + (tail (cdr alist))) + (while (consp tail) + (if (and (consp (car alist)) + (equal (car (car tail)) key)) + ;; `(setcdr CELL NEWCDR)' returns NEWCDR. + (setq tail (setcdr prev (cdr tail))) + (setq prev (cdr prev) + tail (cdr tail)))))) + alist) + +;; XEmacs 19.13 and later: (remassq KEY ALIST) +(defun-maybe remassq (key alist) + "Delete by side effect any elements of ALIST whose car is `eq' to KEY. +The modified ALIST is returned. If the first member of ALIST has a car +that is `eq' to KEY, there is no way to remove it by side effect; +therefore, write `(setq foo (remassq key foo))' to be sure of changing +the value of `foo'." + (while (and (consp alist) + (or (not (consp (car alist))) + (eq (car (car alist)) key))) + (setq alist (cdr alist))) + (if (consp alist) + (let ((prev alist) + (tail (cdr alist))) + (while (consp tail) + (if (and (consp (car tail)) + (eq (car (car tail)) key)) + ;; `(setcdr CELL NEWCDR)' returns NEWCDR. + (setq tail (setcdr prev (cdr tail))) + (setq prev (cdr prev) + tail (cdr tail)))))) + alist) + +;; XEmacs 19.13 and later: (remrassoc VALUE ALIST) +(defun-maybe remrassoc (value alist) + "Delete by side effect any elements of ALIST whose cdr is `equal' to VALUE. +The modified ALIST is returned. If the first member of ALIST has a car +that is `equal' to VALUE, there is no way to remove it by side effect; +therefore, write `(setq foo (remrassoc value foo))' to be sure of changing +the value of `foo'." + (while (and (consp alist) + (or (not (consp (car alist))) + (equal (cdr (car alist)) value))) + (setq alist (cdr alist))) + (if (consp alist) + (let ((prev alist) + (tail (cdr alist))) + (while (consp tail) + (if (and (consp (car tail)) + (equal (cdr (car tail)) value)) + ;; `(setcdr CELL NEWCDR)' returns NEWCDR. + (setq tail (setcdr prev (cdr tail))) + (setq prev (cdr prev) + tail (cdr tail)))))) + alist) + +;; XEmacs 19.13 and later: (remrassq VALUE ALIST) +(defun-maybe remrassq (value alist) + "Delete by side effect any elements of ALIST whose cdr is `eq' to VALUE. +The modified ALIST is returned. If the first member of ALIST has a car +that is `eq' to VALUE, there is no way to remove it by side effect; +therefore, write `(setq foo (remrassq value foo))' to be sure of changing +the value of `foo'." + (while (and (consp alist) + (or (not (consp (car alist))) + (eq (cdr (car alist)) value))) + (setq alist (cdr alist))) + (if (consp alist) + (let ((prev alist) + (tail (cdr alist))) + (while (consp tail) + (if (and (consp (car tail)) + (eq (cdr (car tail)) value)) + ;; `(setcdr CELL NEWCDR)' returns NEWCDR. + (setq tail (setcdr prev (cdr tail))) + (setq prev (cdr prev) + tail (cdr tail)))))) + alist) + +;;; Define `functionp' here because "localhook" uses it. + +;; Emacs 20.1/XEmacs 20.3 (but first appeared in Epoch?): (functionp OBJECT) +(defun-maybe functionp (object) + "Non-nil if OBJECT is a type of object that can be called as a function." + (or (subrp object) (byte-code-function-p object) + (eq (car-safe object) 'lambda) + (and (symbolp object) (fboundp object)))) + +;;; @@ Hook manipulation functions. + +;; "localhook" package is written for Emacs 19.28 and earlier. +;; `run-hooks' was a lisp function in Emacs 19.29 and earlier. +;; So, in Emacs 19.29, `run-hooks' and others will be overrided. +;; But, who cares it? +(static-unless (subrp (symbol-function 'run-hooks)) + (require 'localhook)) + +;; Emacs 19.29/XEmacs 19.14(?) and later: (add-to-list LIST-VAR ELEMENT) +(defun-maybe add-to-list (list-var element) + "Add to the value of LIST-VAR the element ELEMENT if it isn't there yet. +The test for presence of ELEMENT is done with `equal'. +If you want to use `add-to-list' on a variable that is not defined +until a certain package is loaded, you should put the call to `add-to-list' +into a hook function that will be run only after loading the package. +`eval-after-load' provides one way to do this. In some cases +other hooks, such as major mode hooks, can do the job." + (or (member element (symbol-value list-var)) + (set list-var (cons element (symbol-value list-var))))) + +;; (eval-after-load FILE FORM) +;; Emacs 19.28 and earlier do not evaluate FORM if FILE is already loaded. +;; XEmacs 20.2 and earlier have `after-load-alist', but refuse to support +;; `eval-after-load'. (see comments in XEmacs/lisp/subr.el.) +(static-cond + ((featurep 'xemacs) + ;; for XEmacs 20.2 and earlier. + (defun-maybe eval-after-load (file form) + "Arrange that, if FILE is ever loaded, FORM will be run at that time. +This makes or adds to an entry on `after-load-alist'. +If FILE is already loaded, evaluate FORM right now. +It does nothing if FORM is already on the list for FILE. +FILE should be the name of a library, with no directory name." + ;; Make sure there is an element for FILE. + (or (assoc file after-load-alist) + (setq after-load-alist (cons (list file) after-load-alist))) + ;; Add FORM to the element if it isn't there. + (let ((elt (assoc file after-load-alist))) + (or (member form (cdr elt)) + (progn + (nconc elt (list form)) + ;; If the file has been loaded already, run FORM right away. + (and (assoc file load-history) + (eval form))))) + form)) + ((>= emacs-major-version 20)) + ((and (= emacs-major-version 19) + (< emacs-minor-version 29)) + ;; for Emacs 19.28 and earlier. + (defun eval-after-load (file form) + "Arrange that, if FILE is ever loaded, FORM will be run at that time. +This makes or adds to an entry on `after-load-alist'. +If FILE is already loaded, evaluate FORM right now. +It does nothing if FORM is already on the list for FILE. +FILE should be the name of a library, with no directory name." + ;; Make sure there is an element for FILE. + (or (assoc file after-load-alist) + (setq after-load-alist (cons (list file) after-load-alist))) + ;; Add FORM to the element if it isn't there. + (let ((elt (assoc file after-load-alist))) + (or (member form (cdr elt)) + (progn + (nconc elt (list form)) + ;; If the file has been loaded already, run FORM right away. + (and (assoc file load-history) + (eval form))))) + form)) + (t + ;; should emulate for v18? + )) + +(defun-maybe eval-next-after-load (file) + "Read the following input sexp, and run it whenever FILE is loaded. +This makes or adds to an entry on `after-load-alist'. +FILE should be the name of a library, with no directory name." + (eval-after-load file (read))) + +;;; @@ Input and display facilities. + +;; XXX: (defun read-passwd (prompt &optional confirm default)) + +;;; @@ Miscellanea. + +;; Avoid compiler warnings about this variable, +;; which has a special meaning on certain system types. +(defvar-maybe buffer-file-type nil + "Non-nil if the visited file is a binary file. +This variable is meaningful on MS-DOG and Windows NT. +On those systems, it is automatically local in every buffer. +On other systems, this variable is normally always nil.") + +;; Emacs 20.3 or later. +(defvar-maybe minor-mode-overriding-map-alist nil + "Alist of keymaps to use for minor modes, in current major mode. +APEL provides this as dummy for compatibility.") + +;; Emacs 20.1/XEmacs 20.3(?) and later: (save-current-buffer &rest BODY) +;; +;; v20 defines `save-current-buffer' as a C primitive (in src/editfns.c) +;; and introduces a new bytecode Bsave_current_buffer(_1), replacing an +;; obsolete bytecode Bread_char. To make things worse, Emacs 20.1 and +;; 20.2 have a bug that it will restore the current buffer without +;; confirming that it is alive. +;; +;; This is a source of incompatibility of .elc between v18/v19 and v20. +;; (XEmacs compiler takes care of it if compatibility mode is enabled.) +(defmacro-maybe save-current-buffer (&rest body) + "Save the current buffer; execute BODY; restore the current buffer. +Executes BODY just like `progn'." + (` (let ((orig-buffer (current-buffer))) + (unwind-protect + (progn (,@ body)) + (if (buffer-live-p orig-buffer) + (set-buffer orig-buffer)))))) + +;; Emacs 20.1/XEmacs 20.3(?) and later: (with-current-buffer BUFFER &rest BODY) +(defmacro-maybe with-current-buffer (buffer &rest body) + "Execute the forms in BODY with BUFFER as the current buffer. +The value returned is the value of the last form in BODY. +See also `with-temp-buffer'." + (` (save-current-buffer + (set-buffer (, buffer)) + (,@ body)))) + +;; Emacs 20.1/XEmacs 20.3(?) and later: (with-temp-file FILE &rest FORMS) +(defmacro-maybe with-temp-file (file &rest forms) + "Create a new buffer, evaluate FORMS there, and write the buffer to FILE. +The value of the last form in FORMS is returned, like `progn'. +See also `with-temp-buffer'." + (let ((temp-file (make-symbol "temp-file")) + (temp-buffer (make-symbol "temp-buffer"))) + (` (let (((, temp-file) (, file)) + ((, temp-buffer) + (get-buffer-create (generate-new-buffer-name " *temp file*")))) + (unwind-protect + (prog1 + (with-current-buffer (, temp-buffer) + (,@ forms)) + (with-current-buffer (, temp-buffer) + (widen) + (write-region (point-min) (point-max) (, temp-file) nil 0))) + (and (buffer-name (, temp-buffer)) + (kill-buffer (, temp-buffer)))))))) + +;; Emacs 20.4 and later: (with-temp-message MESSAGE &rest BODY) +;; This macro uses `current-message', which appears in v20. +(static-when (and (fboundp 'current-message) + (subrp (symbol-function 'current-message))) + (defmacro-maybe with-temp-message (message &rest body) + "\ +Display MESSAGE temporarily if non-nil while BODY is evaluated. +The original message is restored to the echo area after BODY has finished. +The value returned is the value of the last form in BODY. +MESSAGE is written to the message log buffer if `message-log-max' is non-nil. +If MESSAGE is nil, the echo area and message log buffer are unchanged. +Use a MESSAGE of \"\" to temporarily clear the echo area." + (let ((current-message (make-symbol "current-message")) + (temp-message (make-symbol "with-temp-message"))) + (` (let (((, temp-message) (, message)) + ((, current-message))) + (unwind-protect + (progn + (when (, temp-message) + (setq (, current-message) (current-message)) + (message "%s" (, temp-message)) + (,@ body)) + (and (, temp-message) (, current-message) + (message "%s" (, current-message)))))))))) + +;; Emacs 20.1/XEmacs 20.3(?) and later: (with-temp-buffer &rest FORMS) +(defmacro-maybe with-temp-buffer (&rest forms) + "Create a temporary buffer, and evaluate FORMS there like `progn'. +See also `with-temp-file' and `with-output-to-string'." + (let ((temp-buffer (make-symbol "temp-buffer"))) + (` (let (((, temp-buffer) + (get-buffer-create (generate-new-buffer-name " *temp*")))) + (unwind-protect + (with-current-buffer (, temp-buffer) + (,@ forms)) + (and (buffer-name (, temp-buffer)) + (kill-buffer (, temp-buffer)))))))) + +;; Emacs 20.1/XEmacs 20.3(?) and later: (with-output-to-string &rest BODY) +(defmacro-maybe with-output-to-string (&rest body) + "Execute BODY, return the text it sent to `standard-output', as a string." + (` (let ((standard-output + (get-buffer-create (generate-new-buffer-name " *string-output*")))) + (let ((standard-output standard-output)) + (,@ body)) + (with-current-buffer standard-output + (prog1 + (buffer-string) + (kill-buffer nil)))))) + +;; Emacs 20.1 and later: (combine-after-change-calls &rest BODY) +(defmacro-maybe combine-after-change-calls (&rest body) + "Execute BODY, but don't call the after-change functions till the end. +If BODY makes changes in the buffer, they are recorded +and the functions on `after-change-functions' are called several times +when BODY is finished. +The return value is the value of the last form in BODY. + +If `before-change-functions' is non-nil, then calls to the after-change +functions can't be deferred, so in that case this macro has no effect. + +Do not alter `after-change-functions' or `before-change-functions' +in BODY. + +This emulating macro does not support after-change functions at all, +just execute BODY." + (cons 'progn body)) + +;; Emacs 19.29/XEmacs 19.14(?) and later: (match-string NUM &optional STRING) +(defun-maybe match-string (num &optional string) + "Return string of text matched by last search. +NUM specifies which parenthesized expression in the last regexp. + Value is nil if NUMth pair didn't match, or there were less than NUM pairs. +Zero means the entire text matched by the whole regexp or whole string. +STRING should be given if the last search was by `string-match' on STRING." + (if (match-beginning num) + (if string + (substring string (match-beginning num) (match-end num)) + (buffer-substring (match-beginning num) (match-end num))))) + +;; Emacs 20.3 and later: (match-string-no-properties NUM &optional STRING) +(defun-maybe match-string-no-properties (num &optional string) + "Return string of text matched by last search, without text properties. +NUM specifies which parenthesized expression in the last regexp. + Value is nil if NUMth pair didn't match, or there were less than NUM pairs. +Zero means the entire text matched by the whole regexp or whole string. +STRING should be given if the last search was by `string-match' on STRING." + (if (match-beginning num) + (if string + (let ((result + (substring string (match-beginning num) (match-end num)))) + (set-text-properties 0 (length result) nil result) + result) + (buffer-substring-no-properties (match-beginning num) + (match-end num))))) + +;; Emacs 19.28 and earlier +;; (replace-match NEWTEXT &optional FIXEDCASE LITERAL) +;; Emacs 20.x (?) and later +;; (replace-match NEWTEXT &optional FIXEDCASE LITERAL STRING SUBEXP) +;; XEmacs 21: +;; (replace-match NEWTEXT &optional FIXEDCASE LITERAL STRING STRBUFFER) +;; We support following API. +;; (replace-match NEWTEXT &optional FIXEDCASE LITERAL STRING) +(static-condition-case nil + ;; compile-time check + (progn + (string-match "" "") + (replace-match "" nil nil "") + (if (get 'replace-match 'defun-maybe) + (error "`replace-match' is already defined"))) + (wrong-number-of-arguments ; Emacs 19.28 and earlier + ;; load-time check. + (or (fboundp 'si:replace-match) + (progn + (fset 'si:replace-match (symbol-function 'replace-match)) + (put 'replace-match 'defun-maybe t) + (defun replace-match (newtext &optional fixedcase literal string) + "Replace text matched by last search with NEWTEXT. +If second arg FIXEDCASE is non-nil, do not alter case of replacement text. +Otherwise maybe capitalize the whole text, or maybe just word initials, +based on the replaced text. +If the replaced text has only capital letters +and has at least one multiletter word, convert NEWTEXT to all caps. +If the replaced text has at least one word starting with a capital letter, +then capitalize each word in NEWTEXT. + +If third arg LITERAL is non-nil, insert NEWTEXT literally. +Otherwise treat `\' as special: + `\&' in NEWTEXT means substitute original matched text. + `\N' means substitute what matched the Nth `\(...\)'. + If Nth parens didn't match, substitute nothing. + `\\' means insert one `\'. +FIXEDCASE and LITERAL are optional arguments. +Leaves point at end of replacement text. + +The optional fourth argument STRING can be a string to modify. +In that case, this function creates and returns a new string +which is made by replacing the part of STRING that was matched." + (if string + (with-temp-buffer + (save-match-data + (insert string) + (let* ((matched (match-data)) + (beg (nth 0 matched)) + (end (nth 1 matched))) + (store-match-data + (list + (if (markerp beg) + (move-marker beg (1+ (match-beginning 0))) + (1+ (match-beginning 0))) + (if (markerp end) + (move-marker end (1+ (match-end 0))) + (1+ (match-end 0)))))) + (si:replace-match newtext fixedcase literal) + (buffer-string))) + (si:replace-match newtext fixedcase literal)))))) + (error ; found our definition at compile-time. + ;; load-time check. + (condition-case nil + (progn + (string-match "" "") + (replace-match "" nil nil "")) + (wrong-number-of-arguments ; Emacs 19.28 and earlier + ;; load-time check. + (or (fboundp 'si:replace-match) + (progn + (fset 'si:replace-match (symbol-function 'replace-match)) + (put 'replace-match 'defun-maybe t) + (defun replace-match (newtext &optional fixedcase literal string) + "Replace text matched by last search with NEWTEXT. +If second arg FIXEDCASE is non-nil, do not alter case of replacement text. +Otherwise maybe capitalize the whole text, or maybe just word initials, +based on the replaced text. +If the replaced text has only capital letters +and has at least one multiletter word, convert NEWTEXT to all caps. +If the replaced text has at least one word starting with a capital letter, +then capitalize each word in NEWTEXT. + +If third arg LITERAL is non-nil, insert NEWTEXT literally. +Otherwise treat `\' as special: + `\&' in NEWTEXT means substitute original matched text. + `\N' means substitute what matched the Nth `\(...\)'. + If Nth parens didn't match, substitute nothing. + `\\' means insert one `\'. +FIXEDCASE and LITERAL are optional arguments. +Leaves point at end of replacement text. + +The optional fourth argument STRING can be a string to modify. +In that case, this function creates and returns a new string +which is made by replacing the part of STRING that was matched." + (if string + (with-temp-buffer + (save-match-data + (insert string) + (let* ((matched (match-data)) + (beg (nth 0 matched)) + (end (nth 1 matched))) + (store-match-data + (list + (if (markerp beg) + (move-marker beg (1+ (match-beginning 0))) + (1+ (match-beginning 0))) + (if (markerp end) + (move-marker end (1+ (match-end 0))) + (1+ (match-end 0)))))) + (si:replace-match newtext fixedcase literal) + (buffer-string))) + (si:replace-match newtext fixedcase literal))))))))) + +;; Emacs 20: (format-time-string FORMAT &optional TIME UNIVERSAL) +;; Those format constructs are yet to be implemented. +;; %c, %C, %j, %U, %W, %x, %X +;; Not fully compatible especially when invalid format is specified. +(static-unless (and (fboundp 'format-time-string) + (not (get 'format-time-string 'defun-maybe))) + (or (fboundp 'format-time-string) + (progn + (defconst format-time-month-list + '(( "Zero" . ("Zero" . 0)) + ("Jan" . ("January" . 1)) ("Feb" . ("February" . 2)) + ("Mar" . ("March" . 3)) ("Apr" . ("April" . 4)) ("May" . ("May" . 5)) + ("Jun" . ("June" . 6))("Jul" . ("July" . 7)) ("Aug" . ("August" . 8)) + ("Sep" . ("September" . 9)) ("Oct" . ("October" . 10)) + ("Nov" . ("November" . 11)) ("Dec" . ("December" . 12))) + "Alist of months and their number.") + + (defconst format-time-week-list + '(("Sun" . ("Sunday" . 0)) ("Mon" . ("Monday" . 1)) + ("Tue" . ("Tuesday" . 2)) ("Wed" . ("Wednesday" . 3)) + ("Thu" . ("Thursday" . 4)) ("Fri" . ("Friday" . 5)) + ("Sat" . ("Saturday" . 6))) + "Alist of weeks and their number.") + + (defun format-time-string (format &optional time universal) + "Use FORMAT-STRING to format the time TIME, or now if omitted. +TIME is specified as (HIGH LOW . IGNORED) or (HIGH . LOW), as returned by +`current-time' or `file-attributes'. +The third, optional, argument UNIVERSAL, if non-nil, means describe TIME +as Universal Time; nil means describe TIME in the local time zone. +The value is a copy of FORMAT-STRING, but with certain constructs replaced +by text that describes the specified date and time in TIME: + +%Y is the year, %y within the century, %C the century. +%G is the year corresponding to the ISO week, %g within the century. +%m is the numeric month. +%b and %h are the locale's abbreviated month name, %B the full name. +%d is the day of the month, zero-padded, %e is blank-padded. +%u is the numeric day of week from 1 (Monday) to 7, %w from 0 (Sunday) to 6. +%a is the locale's abbreviated name of the day of week, %A the full name. +%U is the week number starting on Sunday, %W starting on Monday, + %V according to ISO 8601. +%j is the day of the year. + +%H is the hour on a 24-hour clock, %I is on a 12-hour clock, %k is like %H + only blank-padded, %l is like %I blank-padded. +%p is the locale's equivalent of either AM or PM. +%M is the minute. +%S is the second. +%Z is the time zone name, %z is the numeric form. +%s is the number of seconds since 1970-01-01 00:00:00 +0000. + +%c is the locale's date and time format. +%x is the locale's \"preferred\" date format. +%D is like \"%m/%d/%y\". + +%R is like \"%H:%M\", %T is like \"%H:%M:%S\", %r is like \"%I:%M:%S %p\". +%X is the locale's \"preferred\" time format. + +Finally, %n is a newline, %t is a tab, %% is a literal %. + +Certain flags and modifiers are available with some format controls. +The flags are `_' and `-'. For certain characters X, %_X is like %X, +but padded with blanks; %-X is like %X, but without padding. +%NX (where N stands for an integer) is like %X, +but takes up at least N (a number) positions. +The modifiers are `E' and `O'. For certain characters X, +%EX is a locale's alternative version of %X; +%OX is like %X, but uses the locale's number symbols. + +For example, to produce full ISO 8601 format, use \"%Y-%m-%dT%T%z\". + +Compatibility Note. + +Those format constructs are yet to be implemented. + %c, %C, %j, %U, %W, %x, %X +Not fully compatible especially when invalid format is specified." + (let ((fmt-len (length format)) + (ind 0) + prev-ind + cur-char + (prev-char nil) + strings-so-far + (result "") + field-width + field-result + pad-left change-case + (paren-level 0) + hour ms ls + (tz (car (current-time-zone))) + time-string) + (if universal + (progn + (or time + (setq time (current-time))) + (setq ms (car time) + ls (- (nth 1 time) tz)) + (cond ((< ls 0) + (setq ms (1- ms) + ls (+ ls 65536))) + ((>= ls 65536) + (setq ms (1+ ms) + ls (- ls 65536)))) + (setq time (append (list ms ls) (nth 2 time))))) + (setq time-string (current-time-string time) + hour (string-to-int (substring time-string 11 13))) + (while (< ind fmt-len) + (setq cur-char (aref format ind)) + (setq + result + (concat result + (cond + ((eq cur-char ?%) + ;; eat any additional args to allow for future expansion, not!! + (setq pad-left nil change-case nil field-width "" prev-ind ind + strings-so-far "") +; (catch 'invalid + (while (progn + (setq ind (1+ ind)) + (setq cur-char (if (< ind fmt-len) + (aref format ind) + ?\0)) + (or (eq ?- cur-char) ; pad on left + (eq ?# cur-char) ; case change + (if (and (string-equal field-width "") + (<= ?0 cur-char) (>= ?9 cur-char)) + ;; get format width + (let ((field-index ind)) + (while (progn + (setq ind (1+ ind)) + (setq cur-char (if (< ind fmt-len) + (aref format ind) + ?\0)) + (and (<= ?0 cur-char) (>= ?9 cur-char)))) + (setq field-width + (substring format field-index ind)) + (setq ind (1- ind) + cur-char nil) + t)))) + (setq prev-char cur-char + strings-so-far (concat strings-so-far + (if cur-char + (char-to-string cur-char) + field-width))) + ;; characters we actually use + (cond ((eq cur-char ?-) + ;; padding to left must be specified before field-width + (setq pad-left (string-equal field-width ""))) + ((eq cur-char ?#) + (setq change-case t)))) + (setq field-result + (cond + ((eq cur-char ?%) + "%") + ;; the abbreviated name of the day of week. + ((eq cur-char ?a) + (substring time-string 0 3)) + ;; the full name of the day of week + ((eq cur-char ?A) + (cadr (assoc (substring time-string 0 3) + format-time-week-list))) + ;; the abbreviated name of the month + ((eq cur-char ?b) + (substring time-string 4 7)) + ;; the full name of the month + ((eq cur-char ?B) + (cadr (assoc (substring time-string 4 7) + format-time-month-list))) + ;; a synonym for `%x %X' (yet to come) + ((eq cur-char ?c) + "") + ;; locale specific (yet to come) + ((eq cur-char ?C) + "") + ;; the day of month, zero-padded + ((eq cur-char ?d) + (format "%02d" (string-to-int (substring time-string 8 10)))) + ;; a synonym for `%m/%d/%y' + ((eq cur-char ?D) + (format "%02d/%02d/%s" + (cddr (assoc (substring time-string 4 7) + format-time-month-list)) + (string-to-int (substring time-string 8 10)) + (substring time-string -2))) + ;; the day of month, blank-padded + ((eq cur-char ?e) + (format "%2d" (string-to-int (substring time-string 8 10)))) + ;; a synonym for `%b' + ((eq cur-char ?h) + (substring time-string 4 7)) + ;; the hour (00-23) + ((eq cur-char ?H) + (substring time-string 11 13)) + ;; the hour (00-12) + ((eq cur-char ?I) + (format "%02d" (if (> hour 12) (- hour 12) hour))) + ;; the day of the year (001-366) (yet to come) + ((eq cur-char ?j) + "") + ;; the hour (0-23), blank padded + ((eq cur-char ?k) + (format "%2d" hour)) + ;; the hour (1-12), blank padded + ((eq cur-char ?l) + (format "%2d" (if (> hour 12) (- hour 12) hour))) + ;; the month (01-12) + ((eq cur-char ?m) + (format "%02d" (cddr (assoc (substring time-string 4 7) + format-time-month-list)))) + ;; the minute (00-59) + ((eq cur-char ?M) + (substring time-string 14 16)) + ;; a newline + ((eq cur-char ?n) + "\n") + ;; `AM' or `PM', as appropriate + ((eq cur-char ?p) + (setq change-case (not change-case)) + (if (> hour 12) "pm" "am")) + ;; a synonym for `%I:%M:%S %p' + ((eq cur-char ?r) + (format "%02d:%s:%s %s" + (if (> hour 12) (- hour 12) hour) + (substring time-string 14 16) + (substring time-string 17 19) + (if (> hour 12) "PM" "AM"))) + ;; a synonym for `%H:%M' + ((eq cur-char ?R) + (format "%s:%s" + (substring time-string 11 13) + (substring time-string 14 16))) + ;; the seconds (00-60) + ((eq cur-char ?S) + (substring time-string 17 19)) + ;; a tab character + ((eq cur-char ?t) + "\t") + ;; a synonym for `%H:%M:%S' + ((eq cur-char ?T) + (format "%s:%s:%s" + (substring time-string 11 13) + (substring time-string 14 16) + (substring time-string 17 19))) + ;; the week of the year (01-52), assuming that weeks + ;; start on Sunday (yet to come) + ((eq cur-char ?U) + "") + ;; the numeric day of week (0-6). Sunday is day 0 + ((eq cur-char ?w) + (format "%d" (cddr (assoc (substring time-string 0 3) + format-time-week-list)))) + ;; the week of the year (01-52), assuming that weeks + ;; start on Monday (yet to come) + ((eq cur-char ?W) + "") + ;; locale specific (yet to come) + ((eq cur-char ?x) + "") + ;; locale specific (yet to come) + ((eq cur-char ?X) + "") + ;; the year without century (00-99) + ((eq cur-char ?y) + (substring time-string -2)) + ;; the year with century + ((eq cur-char ?Y) + (substring time-string -4)) + ;; the time zone abbreviation + ((eq cur-char ?Z) + (if universal + "UTC" + (setq change-case (not change-case)) + (downcase (cadr (current-time-zone))))) + ((eq cur-char ?z) + (if universal + "+0000" + (if (< tz 0) + (format "-%02d%02d" + (/ (- tz) 3600) (/ (% (- tz) 3600) 60)) + (format "+%02d%02d" + (/ tz 3600) (/ (% tz 3600) 60))))) + (t + (concat + "%" + strings-so-far + (char-to-string cur-char))))) +; (setq ind prev-ind) +; (throw 'invalid "%")))) + (if (string-equal field-width "") + (if change-case (upcase field-result) field-result) + (let ((padded-result + (format (format "%%%s%s%c" + "" ; pad on left is ignored +; (if pad-left "-" "") + field-width + ?s) + (or field-result "")))) + (let ((initial-length (length padded-result)) + (desired-length (string-to-int field-width))) + (when (and (string-match "^0" field-width) + (string-match "^ +" padded-result)) + (setq padded-result + (replace-match + (make-string + (length (match-string 0 padded-result)) ?0) + nil nil padded-result))) + (if (> initial-length desired-length) + ;; truncate strings on right, years on left + (if (stringp field-result) + (substring padded-result 0 desired-length) + (if (eq cur-char ?y) + (substring padded-result (- desired-length)) + padded-result))) ;non-year numbers don't truncate + (if change-case (upcase padded-result) padded-result))))) ;) + (t + (char-to-string cur-char))))) + (setq ind (1+ ind))) + result)) + ;; for `load-history'. + (setq current-load-list (cons 'format-time-string current-load-list)) + (put 'format-time-string 'defun-maybe t)))) + +;; Emacs 19.29-19.34/XEmacs: `format-time-string' neither supports the +;; format string "%z" nor the third argument `universal'. +(unless (string-match "\\`[\\-\\+][0-9]+\\'" + (format-time-string "%z" (current-time))) + (defadvice format-time-string + (before support-timezone-in-numeric-form-and-3rd-arg + (format-string &optional time universal) activate compile) + "Advice to support the construct `%z' and the third argument `universal'." + (let ((tz (car (current-time-zone))) + case-fold-search ms ls) + (while (string-match "\\(\\(\\`\\|[^%]\\)\\(%%\\)*\\)%z" format-string) + (setq format-string + (concat (substring format-string 0 (match-end 1)) + (if universal + "+0000" + (if (< tz 0) + (format "-%02d%02d" + (/ (- tz) 3600) (/ (% (- tz) 3600) 60)) + (format "+%02d%02d" + (/ tz 3600) (/ (% tz 3600) 60)))) + (substring format-string (match-end 0))))) + (if universal + (progn + (while (string-match "\\(\\(\\`\\|[^%]\\)\\(%%\\)*\\)%Z" + format-string) + (setq format-string + (concat (substring format-string 0 (match-end 1)) + "UTC" + (substring format-string (match-end 0))))) + (or time + (setq time (current-time))) + (setq ms (car time) + ls (- (nth 1 time) tz)) + (cond ((< ls 0) + (setq ms (1- ms) + ls (+ ls 65536))) + ((>= ls 65536) + (setq ms (1+ ms) + ls (- ls 65536)))) + (setq time (append (list ms ls) (nth 2 time)))))))) + +(defconst-maybe split-string-default-separators "[ \f\t\n\r\v]+" + "The default value of separators for `split-string'. + +A regexp matching strings of whitespace. May be locale-dependent +\(as yet unimplemented). Should not match non-breaking spaces. + +Warning: binding this to a different value and using it as default is +likely to have undesired semantics.") + +;; Here is a Emacs 22 version. OMIT-NULLS +(defun-maybe split-string (string &optional separators omit-nulls) + "Split STRING into substrings bounded by matches for SEPARATORS. + +The beginning and end of STRING, and each match for SEPARATORS, are +splitting points. The substrings matching SEPARATORS are removed, and +the substrings between the splitting points are collected as a list, +which is returned. + +If SEPARATORS is non-nil, it should be a regular expression matching text +which separates, but is not part of, the substrings. If nil it defaults to +`split-string-default-separators', normally \"[ \\f\\t\\n\\r\\v]+\", and +OMIT-NULLS is forced to t. + +If OMIT-NULLS is t, zero-length substrings are omitted from the list \(so +that for the default value of SEPARATORS leading and trailing whitespace +are effectively trimmed). If nil, all zero-length substrings are retained, +which correctly parses CSV format, for example. + +Note that the effect of `(split-string STRING)' is the same as +`(split-string STRING split-string-default-separators t)'). In the rare +case that you wish to retain zero-length substrings when splitting on +whitespace, use `(split-string STRING split-string-default-separators)'. + +Modifies the match data; use `save-match-data' if necessary." + (let ((keep-nulls (not (if separators omit-nulls t))) + (rexp (or separators split-string-default-separators)) + (start 0) + notfirst + (list nil)) + (while (and (string-match rexp string + (if (and notfirst + (= start (match-beginning 0)) + (< start (length string))) + (1+ start) start)) + (< start (length string))) + (setq notfirst t) + (if (or keep-nulls (< start (match-beginning 0))) + (setq list + (cons (substring string start (match-beginning 0)) + list))) + (setq start (match-end 0))) + (if (or keep-nulls (< start (length string))) + (setq list + (cons (substring string start) + list))) + (nreverse list))) + + +;;; @ Window commands emulation. (lisp/window.el) +;;; + +(defmacro-maybe save-selected-window (&rest body) + "Execute BODY, then select the window that was selected before BODY." + (list 'let + '((save-selected-window-window (selected-window))) + (list 'unwind-protect + (cons 'progn body) + (list 'select-window 'save-selected-window-window)))) + +;; Emacs 19.31 and later: +;; (get-buffer-window-list &optional BUFFER MINIBUF FRAME) +(defun-maybe get-buffer-window-list (buffer &optional minibuf frame) + "Return windows currently displaying BUFFER, or nil if none. +See `walk-windows' for the meaning of MINIBUF and FRAME." + (let ((buffer (if (bufferp buffer) buffer (get-buffer buffer))) windows) + (walk-windows + (function (lambda (window) + (if (eq (window-buffer window) buffer) + (setq windows (cons window windows))))) + minibuf frame) + windows)) + + +;;; @ Frame commands emulation. (lisp/frame.el) +;;; + +;; XEmacs 21.0 and later: +;; (save-selected-frame &rest BODY) +(defmacro-maybe save-selected-frame (&rest body) + "Execute forms in BODY, then restore the selected frame." + (list 'let + '((save-selected-frame-frame (selected-frame))) + (list 'unwind-protect + (cons 'progn body) + (list 'select-frame 'save-selected-frame-frame)))) + + +;;; @ Basic editing commands emulation. (lisp/simple.el) +;;; + + +;;; @ File input and output commands emulation. (lisp/files.el) +;;; + +(defvar-maybe temporary-file-directory + (file-name-as-directory + (cond ((memq system-type '(ms-dos windows-nt)) + (or (getenv "TEMP") (getenv "TMPDIR") (getenv "TMP") "c:/temp")) + ((memq system-type '(vax-vms axp-vms)) + (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") "SYS$SCRATCH:")) + (t + (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") "/tmp")))) + "The directory for writing temporary files.") + +;; Emacs 21 CVS ; nothing to do. +;; (make-temp-file PREFIX &optional DIR-FLAG SUFFIX) +;; +;; Emacs 21.1-21.3 ; replace with CVS version of `make-temp-file'. +;; (make-temp-file PREFIX &optional DIR-FLAG) +;; +;; Emacs 20 and earlier ; install our version of `make-temp-file', for +;; or XEmacs ; single-user system or for multi-user system. +(eval-when-compile + (cond + ((get 'make-temp-file 'defun-maybe) + ;; this form is already evaluated during compilation. + ) + ((not (fboundp 'make-temp-file)) + ;; Emacs 20 and earlier, or XEmacs. + (put 'make-temp-file 'defun-maybe 'none)) + (t + (let* ((object (symbol-function 'make-temp-file)) + (arglist (cond + ((byte-code-function-p object) + (if (fboundp 'compiled-function-arglist) + (compiled-function-arglist object) + (aref object 0))) + ((eq (car-safe object) 'lambda) + (nth 1 object)) + ;; `make-temp-file' is a built-in. + ))) + ;; arglist: (prefix &optional dir-flag suffix) + (cond + ((not arglist) + ;; `make-temp-file' is a built-in; expects 3-args. + (put 'make-temp-file 'defun-maybe '3-args)) + ((> (length arglist) 3) + ;; Emacs 21 CVS. + (put 'make-temp-file 'defun-maybe '3-args)) + (t + ;; Emacs 21.1-21.3 + (put 'make-temp-file 'defun-maybe '2-args))))))) + +(static-cond + ((eq (get 'make-temp-file 'defun-maybe) '3-args) + (put 'make-temp-file 'defun-maybe '3-args)) + ((eq (get 'make-temp-file 'defun-maybe) '2-args) + (put 'make-temp-file 'defun-maybe '2-args) + (or (fboundp 'si:make-temp-file) + (fset 'si:make-temp-file (symbol-function 'make-temp-file))) + (setq current-load-list (cons 'make-temp-file current-load-list)) + (defun make-temp-file (prefix &optional dir-flag suffix) + "\ +Create a temporary file. +The returned file name (created by appending some random characters at the end +of PREFIX, and expanding against `temporary-file-directory' if necessary), +is guaranteed to point to a newly created empty file. +You can then use `write-region' to write new data into the file. + +If DIR-FLAG is non-nil, create a new empty directory instead of a file. + +If SUFFIX is non-nil, add that at the end of the file name." + (let ((umask (default-file-modes)) + file) + (unwind-protect + (progn + ;; Create temp files with strict access rights. + ;; It's easy toloosen them later, whereas it's impossible + ;; to close the time-window of loose permissions otherwise. + (set-default-file-modes 448) + (while (condition-case () + (progn + (setq file + (make-temp-name + (expand-file-name + prefix temporary-file-directory))) + (if suffix + (setq file (concat file suffix))) + (if dir-flag + (make-directory file) + (write-region "" nil file nil + 'silent nil 'excl)) + nil) + (file-already-exists t)) + ;; the file was somehow created by someone else between + ;; `make-temp-name' and `write-region', let's try again. + nil) + file) + ;; Reset the umask. + (set-default-file-modes umask))))) + ((eq (get 'make-temp-file 'defun-maybe) 'none) + (put 'make-temp-file 'defun-maybe 'none) + (setq current-load-list (cons 'make-temp-file current-load-list)) + ;; must be load-time check to share .elc between different systems. + (cond + ((memq system-type '(windows-nt ms-dos OS/2 emx)) + ;; for single-user systems. + (defun make-temp-file (prefix &optional dir-flag suffix) + "Create a temporary file. +The returned file name (created by appending some random characters at the end +of PREFIX, and expanding against `temporary-file-directory' if necessary), +is guaranteed to point to a newly created empty file. +You can then use `write-region' to write new data into the file. + +If DIR-FLAG is non-nil, create a new empty directory instead of a file. + +If SUFFIX is non-nil, add that at the end of the file name." + (let ((file (make-temp-name + (expand-file-name prefix temporary-file-directory)))) + (if suffix + (setq file (concat file suffix))) + (if dir-flag + (make-directory file) + (write-region "" nil file nil 'silent)) + file))) + (t + ;; for multi-user systems. + (defun make-temp-file (prefix &optional dir-flag suffix) + "Create a temporary file. +The returned file name (created by appending some random characters at the end +of PREFIX, and expanding against `temporary-file-directory' if necessary), +is guaranteed to point to a newly created empty file. +You can then use `write-region' to write new data into the file. + +If DIR-FLAG is non-nil, create a new empty directory instead of a file. + +If SUFFIX is non-nil, add that at the end of the file name." + (let ((prefix (expand-file-name prefix temporary-file-directory))) + (if dir-flag + ;; Create a new empty directory. + (let (dir) + (while (condition-case () + (progn + (setq dir (make-temp-name prefix)) + (if suffix + (setq dir (concat dir suffix))) + ;; `make-directory' returns nil for success, + ;; otherwise signals an error. + (make-directory dir)) + ;; the dir was somehow created by someone else + ;; between `make-temp-name' and `make-directory', + ;; let's try again. + (file-already-exists t))) + (set-file-modes dir 448) + dir) + ;; Create a new empty file. + (let (tempdir tempfile) + (unwind-protect + (let (file) + ;; First, create a temporary directory. + (while (condition-case () + (progn + (setq tempdir (make-temp-name + (concat + (file-name-directory prefix) + "DIR"))) + ;; return nil or signal an error. + (make-directory tempdir)) + ;; let's try again. + (file-already-exists t))) + (set-file-modes tempdir 448) + ;; Second, create a temporary file in the tempdir. + ;; There *is* a race condition between `make-temp-name' + ;; and `write-region', but we don't care it since we are + ;; in a private directory now. + (setq tempfile (make-temp-name (concat tempdir "/EMU"))) + (write-region "" nil tempfile nil 'silent) + (set-file-modes tempfile 384) + ;; Finally, make a hard-link from the tempfile. + (while (condition-case () + (progn + (setq file (make-temp-name prefix)) + (if suffix + (setq file (concat file suffix))) + ;; return nil or signal an error. + (add-name-to-file tempfile file)) + ;; let's try again. + (file-already-exists t))) + file) + ;; Cleanup the tempfile. + (and tempfile + (file-exists-p tempfile) + (delete-file tempfile)) + ;; Cleanup the tempdir. + (and tempdir + (file-directory-p tempdir) + (delete-directory tempdir))))))))))) + +;; Actually, `path-separator' is defined in src/emacs.c and overrided +;; in dos-w32.el. +(defvar-maybe path-separator ":" + "The directory separator in search paths, as a string.") + +;; `convert-standard-filename' is defined in lisp/files.el and overrided +;; in lisp/dos-fns.el and lisp/w32-fns.el for each environment. +(cond + ;; must be load-time check to share .elc between different systems. + ((fboundp 'convert-standard-filename)) + ((memq system-type '(windows-nt ms-dos)) + ;; should we do (require 'filename) at load-time ? + ;; (require 'filename) + ;; filename.el requires many modules, so we do not want to load it + ;; at compile-time. Instead, suppress warnings by these autoloads. + (eval-when-compile + (autoload 'filename-maybe-truncate-by-size "filename") + (autoload 'filename-special-filter "filename")) + (defun convert-standard-filename (filename) + "Convert a standard file's name to something suitable for the current OS. +This function's standard definition is trivial; it just returns the argument. +However, on some systems, the function is redefined +with a definition that really does change some file names. +Under `windows-nt' or `ms-dos', it refers `filename-replacement-alist' and +`filename-limit-length' for the basic filename and each parent directory name." + (require 'filename) + (let* ((names (split-string filename "/")) + (drive-name (car names)) + (filter (function + (lambda (string) + (filename-maybe-truncate-by-size + (filename-special-filter string)))))) + (cond + ((eq 1 (length names)) + (funcall filter drive-name)) + ((string-match "^[^/]:$" drive-name) + (concat drive-name "/" (mapconcat filter (cdr names) "/"))) + (t + (mapconcat filter names "/")))))) + (t + (defun convert-standard-filename (filename) + "Convert a standard file's name to something suitable for the current OS. +This function's standard definition is trivial; it just returns the argument. +However, on some systems, the function is redefined +with a definition that really does change some file names. +Under `windows-nt' or `ms-dos', it refers `filename-replacement-alist' and +`filename-limit-length' for the basic filename and each parent directory name." + filename))) + +(static-cond + ((fboundp 'insert-file-contents-literally)) + ((boundp 'file-name-handler-alist) + ;; Use `defun-maybe' to update `load-history'. + (defun-maybe insert-file-contents-literally (filename &optional visit + beg end replace) + "Like `insert-file-contents', q.v., but only reads in the file. +A buffer may be modified in several ways after reading into the buffer due +to advanced Emacs features, such as file-name-handlers, format decoding, +find-file-hooks, etc. + This function ensures that none of these modifications will take place." + (let (file-name-handler-alist) + (insert-file-contents filename visit beg end replace)))) + (t + (defalias 'insert-file-contents-literally 'insert-file-contents))) + +(defun-maybe file-name-sans-extension (filename) + "Return FILENAME sans final \"extension\". +The extension, in a file name, is the part that follows the last `.'." + (save-match-data + (let ((file (file-name-sans-versions (file-name-nondirectory filename))) + directory) + (if (string-match "\\.[^.]*\\'" file) + (if (setq directory (file-name-directory filename)) + (expand-file-name (substring file 0 (match-beginning 0)) + directory) + (substring file 0 (match-beginning 0))) + filename)))) + + +;;; @ Miscellanea. + +;; Emacs 19.29 and later: (current-fill-column) +(defun-maybe current-fill-column () + "Return the fill-column to use for this line." + fill-column) + +;; Emacs 19.29 and later: (current-left-margin) +(defun-maybe current-left-margin () + "Return the left margin to use for this line." + left-margin) + + +;;; @ XEmacs emulation. +;;; + +(defun-maybe find-face (face-or-name) + "Retrieve the face of the given name. +If FACE-OR-NAME is a face object, it is simply returned. +Otherwise, FACE-OR-NAME should be a symbol. If there is no such face, +nil is returned. Otherwise the associated face object is returned." + (car (memq face-or-name (face-list)))) + +;; Emacs 21.1 defines this as an alias for `line-beginning-position'. +;; Therefore, optional 2nd arg BUFFER is not portable. +(defun-maybe point-at-bol (&optional n buffer) + "Return the character position of the first character on the current line. +With argument N not nil or 1, move forward N - 1 lines first. +If scan reaches end of buffer, return that position. +This function does not move point." + (save-excursion + (if buffer (set-buffer buffer)) + (forward-line (1- (or n 1))) + (point))) + +;; Emacs 21.1 defines this as an alias for `line-end-position'. +;; Therefore, optional 2nd arg BUFFER is not portable. +(defun-maybe point-at-eol (&optional n buffer) + "Return the character position of the last character on the current line. +With argument N not nil or 1, move forward N - 1 lines first. +If scan reaches end of buffer, return that position. +This function does not move point." + (save-excursion + (if buffer (set-buffer buffer)) + (end-of-line (or n 1)) + (point))) + +(defsubst-maybe define-obsolete-function-alias (oldfun newfun) + "Define OLDFUN as an obsolete alias for function NEWFUN. +This makes calling OLDFUN equivalent to calling NEWFUN and marks OLDFUN +as obsolete." + (defalias oldfun newfun) + (make-obsolete oldfun newfun)) + +;; XEmacs 21: (character-to-event CH &optional EVENT DEVICE) +(defun-maybe character-to-event (ch) + "Convert keystroke CH into an event structure, replete with bucky bits. +Note that CH (the keystroke specifier) can be an integer, a character +or a symbol such as 'clear." + ch) + +;; XEmacs 21: (event-to-character EVENT +;; &optional ALLOW-EXTRA-MODIFIERS ALLOW-META ALLOW-NON-ASCII) +(defun-maybe-cond event-to-character (event) + "Return the character approximation to the given event object. +If the event isn't a keypress, this returns nil." + ((and (fboundp 'read-event) + (subrp (symbol-function 'read-event))) + ;; Emacs 19 and later. + (cond + ((symbolp event) + ;; mask is (BASE-TYPE MODIFIER-BITS) or nil. + (let ((mask (get event 'event-symbol-element-mask))) + (if mask + (let ((base (get (car mask) 'ascii-character))) + (if base + (logior base (car (cdr mask)))))))) + ((integerp event) event))) + (t + ;; v18. Is this correct? + event)) + +;; v18: no event; (read-char) +;; Emacs 19, 20.1 and 20.2: (read-event) +;; Emacs 20.3: (read-event &optional PROMPT SUPPRESS-INPUT-METHOD) +;; Emacs 20.4: (read-event &optional PROMPT INHERIT-INPUT-METHOD) +;; XEmacs: (next-event &optional EVENT PROMPT), +;; (next-command-event &optional EVENT PROMPT) +(defun-maybe-cond next-command-event (&optional event prompt) + "Read an event object from the input stream. +If EVENT is non-nil, it should be an event object and will be filled +in and returned; otherwise a new event object will be created and +returned. +If PROMPT is non-nil, it should be a string and will be displayed in +the echo area while this function is waiting for an event." + ((and (>= emacs-major-version 20) + (>= emacs-minor-version 4)) + ;; Emacs 20.4 and later. + (read-event prompt)) ; should specify 2nd arg? + ((and (= emacs-major-version 20) + (= emacs-minor-version 3)) + ;; Emacs 20.3. + (read-event prompt)) ; should specify 2nd arg? + ((and (fboundp 'read-event) + (subrp (symbol-function 'read-event))) + ;; Emacs 19, 20.1 and 20.2. + (if prompt (message "%s" prompt)) + (read-event)) + (t + (if prompt (message "%s" prompt)) + (read-char))) + + +;;; @ MULE 2 emulation. +;;; + +(defun-maybe-cond cancel-undo-boundary () + "Cancel undo boundary." + ((boundp 'buffer-undo-list) + ;; for Emacs 19 and later. + (if (and (consp buffer-undo-list) + (null (car buffer-undo-list))) + (setq buffer-undo-list (cdr buffer-undo-list))))) + + +;;; @ End. +;;; + +;;; poe.el ends here diff --git a/apel-10.7/poem-e20.el b/apel-10.7/poem-e20.el new file mode 100644 index 0000000..9422e4c --- /dev/null +++ b/apel-10.7/poem-e20.el @@ -0,0 +1,65 @@ +;;; poem-e20.el --- poem submodule for Emacs 20; -*-byte-compile-dynamic: t;-*- + +;; Copyright (C) 1998 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(defun fontset-pixel-size (fontset) + (let* ((info (fontset-info fontset)) + (height (aref info 1)) + ) + (cond ((> height 0) height) + ((string-match "-\\([0-9]+\\)-" fontset) + (string-to-number + (substring fontset (match-beginning 1)(match-end 1)))) + (t 0)))) + + +;;; @ character set +;;; + +;; (defalias 'charset-columns 'charset-width) + +(defun find-non-ascii-charset-string (string) + "Return a list of charsets in the STRING except ascii." + (delq 'ascii (find-charset-string string))) + +(defun find-non-ascii-charset-region (start end) + "Return a list of charsets except ascii +in the region between START and END." + (delq 'ascii (find-charset-string (buffer-substring start end)))) + + +;;; @ end +;;; + +(if (and (fboundp 'set-buffer-multibyte) + (subrp (symbol-function 'set-buffer-multibyte))) + (require 'poem-e20_3) ; for Emacs 20.3 + (require 'poem-e20_2) ; for Emacs 20.1 and 20.2 + ) + +(require 'product) +(product-provide (provide 'poem-e20) (require 'apel-ver)) + +;;; poem-e20.el ends here diff --git a/apel-10.7/poem-e20_2.el b/apel-10.7/poem-e20_2.el new file mode 100644 index 0000000..f998245 --- /dev/null +++ b/apel-10.7/poem-e20_2.el @@ -0,0 +1,93 @@ +;;; poem-e20_2.el --- poem implementation for Emacs 20.1 and 20.2 + +;; Copyright (C) 1996,1997,1998,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; 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 module requires Emacs 20.1 and 20.2. + +;;; Code: + +;;; @ buffer representation +;;; + +(defun-maybe set-buffer-multibyte (flag) + "Set the multibyte flag of the current buffer to FLAG. +If FLAG is t, this makes the buffer a multibyte buffer. +If FLAG is nil, this makes the buffer a single-byte buffer. +The buffer contents remain unchanged as a sequence of bytes +but the contents viewed as characters do change. +\[Emacs 20.3 emulating function]" + (setq enable-multibyte-characters flag) + ) + + +;;; @ character +;;; + +(defalias 'char-length 'char-bytes) + +(defmacro char-next-index (char index) + "Return index of character succeeding CHAR whose index is INDEX." + `(+ ,index (char-bytes ,char))) + + +;;; @ string +;;; + +(defalias 'sset 'store-substring) + +(defun string-to-char-list (string) + "Return a list of which elements are characters in the STRING." + (let* ((len (length string)) + (i 0) + l chr) + (while (< i len) + (setq chr (sref string i)) + (setq l (cons chr l)) + (setq i (+ i (char-bytes chr))) + ) + (nreverse l))) + +(defalias 'string-to-int-list 'string-to-char-list) + +(defun looking-at-as-unibyte (regexp) + "Like `looking-at', but string is regarded as unibyte sequence." + (let (enable-multibyte-characters) + (looking-at regexp))) + +;;; @@ obsoleted aliases +;;; +;;; You should not use them. + +(defalias 'string-columns 'string-width) +(make-obsolete 'string-columns 'string-width) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'poem-e20_2) (require 'apel-ver)) + +;;; poem-e20_2.el ends here diff --git a/apel-10.7/poem-e20_3.el b/apel-10.7/poem-e20_3.el new file mode 100644 index 0000000..ec08b80 --- /dev/null +++ b/apel-10.7/poem-e20_3.el @@ -0,0 +1,68 @@ +;;; -*-byte-compile-dynamic: t;-*- +;;; poem-e20_3.el --- poem submodule for Emacs 20.3 + +;; Copyright (C) 1998,1999,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; 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 module requires Emacs 20.2.91 or later. + +;;; Code: + +(require 'pym) + +;;; @ character +;;; + +(defsubst char-length (char) + "Return indexing length of multi-byte form of CHAR." + 1) + +(defmacro char-next-index (char index) + "Return index of character succeeding CHAR whose index is INDEX." + `(1+ ,index)) + +(defalias-maybe 'characterp 'char-valid-p) + + +;;; @ string +;;; + +(defalias 'sset 'store-substring) + +(defun string-to-char-list (string) + "Return a list of which elements are characters in the STRING." + (mapcar #'identity string)) + +(defalias 'string-to-int-list 'string-to-char-list) + +(defalias 'looking-at-as-unibyte 'looking-at) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'poem-e20_3) (require 'apel-ver)) + +;;; poem-e20_3.el ends here diff --git a/apel-10.7/poem-ltn1.el b/apel-10.7/poem-ltn1.el new file mode 100644 index 0000000..d71329d --- /dev/null +++ b/apel-10.7/poem-ltn1.el @@ -0,0 +1,154 @@ +;;; poem-ltn1.el --- poem implementation for Emacs 19 and XEmacs without MULE + +;; Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +;;; @ buffer representation +;;; + +(eval-when-compile + (require 'poe)) + +(defun-maybe set-buffer-multibyte (flag) + "Set the multibyte flag of the current buffer to FLAG. +If FLAG is t, this makes the buffer a multibyte buffer. +If FLAG is nil, this makes the buffer a single-byte buffer. +The buffer contents remain unchanged as a sequence of bytes +but the contents viewed as characters do change. +\[Emacs 20.3 emulating macro]" + ) + + +;;; @ character set +;;; + +(put 'ascii 'charset-description "Character set of ASCII") +(put 'ascii 'charset-registry "ASCII") + +(put 'latin-iso8859-1 'charset-description "Character set of ISO-8859-1") +(put 'latin-iso8859-1 'charset-registry "ISO8859-1") + +(defun charset-description (charset) + "Return description of CHARSET." + (get charset 'charset-description)) + +(defun charset-registry (charset) + "Return registry name of CHARSET." + (get charset 'charset-registry)) + +(defun charset-width (charset) + "Return number of columns a CHARSET occupies when displayed." + 1) + +(defun charset-direction (charset) + "Return the direction of a character of CHARSET by + 0 (left-to-right) or 1 (right-to-left)." + 0) + +(defun find-charset-string (str) + "Return a list of charsets in the string." + (if (string-match "[\200-\377]" str) + '(latin-iso8859-1) + )) + +(defalias 'find-non-ascii-charset-string 'find-charset-string) + +(defun find-charset-region (start end) + "Return a list of charsets in the region between START and END." + (if (save-excursion + (goto-char start) + (re-search-forward "[\200-\377]" end t)) + '(latin-iso8859-1) + )) + +(defalias 'find-non-ascii-charset-region 'find-charset-region) + + +;;; @ character +;;; + +(defun char-charset (char) + "Return the character set of char CHAR." + (if (< char 128) + 'ascii + 'latin-iso8859-1)) + +(defun char-bytes (char) + "Return number of bytes a character in CHAR occupies in a buffer." + 1) + +(defun char-width (char) + "Return number of columns a CHAR occupies when displayed." + 1) + +(defun split-char (character) + "Return list of charset and one or two position-codes of CHARACTER." + (cons (char-charset character) character)) + +(defalias 'char-length 'char-bytes) + +(defmacro char-next-index (char index) + "Return index of character succeeding CHAR whose index is INDEX." + (` (1+ (, index)))) + + +;;; @ string +;;; + +(defalias 'string-width 'length) + +(defun string-to-char-list (str) + (mapcar (function identity) str)) + +(defalias 'string-to-int-list 'string-to-char-list) + +(defalias 'sref 'aref) + +(defun truncate-string (str width &optional start-column) + "Truncate STR to fit in WIDTH columns. +Optional non-nil arg START-COLUMN specifies the starting column. +\[emu-latin1.el; MULE 2.3 emulating function]" + (or start-column + (setq start-column 0)) + (if (> (length str) width) + (substring str start-column width) + str)) + +(defalias 'looking-at-as-unibyte 'looking-at) + +;;; @@ obsoleted aliases +;;; +;;; You should not use them. + +(defalias 'string-columns 'length) +(make-obsolete 'string-columns 'string-width) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'poem-ltn1) (require 'apel-ver)) + +;;; poem-ltn1.el ends here diff --git a/apel-10.7/poem-nemacs.el b/apel-10.7/poem-nemacs.el new file mode 100644 index 0000000..8af6364 --- /dev/null +++ b/apel-10.7/poem-nemacs.el @@ -0,0 +1,219 @@ +;;; poem-nemacs.el --- poem implementation for Nemacs + +;; Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +;;; @ character set +;;; + +(put 'ascii + 'charset-description "Character set of ASCII") +(put 'ascii + 'charset-registry "ASCII") + +(put 'japanese-jisx0208 + 'charset-description "Character set of JIS X0208-1983") +(put 'japanese-jisx0208 + 'charset-registry "JISX0208.1983") + +(defun charset-description (charset) + "Return description of CHARSET. [emu-nemacs.el]" + (get charset 'charset-description)) + +(defun charset-registry (charset) + "Return registry name of CHARSET. [emu-nemacs.el]" + (get charset 'charset-registry)) + +(defun charset-width (charset) + "Return number of columns a CHARSET occupies when displayed. +\[emu-nemacs.el]" + (if (eq charset 'ascii) + 1 + 2)) + +(defun charset-direction (charset) + "Return the direction of a character of CHARSET by + 0 (left-to-right) or 1 (right-to-left). [emu-nemacs.el]" + 0) + +(defun find-charset-string (str) + "Return a list of charsets in the string. +\[emu-nemacs.el; Mule emulating function]" + (if (string-match "[\200-\377]" str) + '(japanese-jisx0208) + )) + +(defalias 'find-non-ascii-charset-string 'find-charset-string) + +(defun find-charset-region (start end) + "Return a list of charsets in the region between START and END. +\[emu-nemacs.el; Mule emulating function]" + (if (save-excursion + (save-restriction + (narrow-to-region start end) + (goto-char start) + (re-search-forward "[\200-\377]" nil t))) + '(japanese-jisx0208) + )) + +(defalias 'find-non-ascii-charset-region 'find-charset-region) + +(defun check-ASCII-string (str) + (let ((i 0) + len) + (setq len (length str)) + (catch 'label + (while (< i len) + (if (>= (elt str i) 128) + (throw 'label nil)) + (setq i (+ i 1))) + str))) + +;;; @@ for old MULE emulation +;;; + +;;(defconst lc-ascii 0) +;;(defconst lc-jp 146) + + +;;; @ buffer representation +;;; + +(defsubst-maybe set-buffer-multibyte (flag) + "Set the multibyte flag of the current buffer to FLAG. +If FLAG is t, this makes the buffer a multibyte buffer. +If FLAG is nil, this makes the buffer a single-byte buffer. +The buffer contents remain unchanged as a sequence of bytes +but the contents viewed as characters do change. +\[Emacs 20.3 emulating function]" + (setq kanji-flag flag) + ) + + +;;; @ character +;;; + +(defun char-charset (chr) + "Return the character set of char CHR. +\[emu-nemacs.el; MULE emulating function]" + (if (< chr 128) + 'ascii + 'japanese-jisx0208)) + +(defun char-bytes (chr) + "Return number of bytes CHAR will occupy in a buffer. +\[emu-nemacs.el; Mule emulating function]" + (if (< chr 128) + 1 + 2)) + +(defun char-width (char) + "Return number of columns a CHAR occupies when displayed. +\[emu-nemacs.el]" + (if (< char 128) + 1 + 2)) + +(defalias 'char-length 'char-bytes) + +(defmacro char-next-index (char index) + "Return index of character succeeding CHAR whose index is INDEX. +\[emu-nemacs.el]" + (` (+ (, index) (char-bytes (, char))))) + + +;;; @ string +;;; + +(defalias 'string-width 'length) + +(defun sref (str idx) + "Return the character in STR at index IDX. +\[emu-nemacs.el; Mule emulating function]" + (let ((chr (aref str idx))) + (if (< chr 128) + chr + (logior (lsh (aref str (1+ idx)) 8) chr)))) + +(defun string-to-char-list (str) + (let ((i 0)(len (length str)) dest chr) + (while (< i len) + (setq chr (aref str i)) + (if (>= chr 128) + (setq i (1+ i) + chr (+ (lsh chr 8) (aref str i))) + ) + (setq dest (cons chr dest)) + (setq i (1+ i))) + (reverse dest))) + +(fset 'string-to-int-list (symbol-function 'string-to-char-list)) + +;;; Imported from Mule-2.3 +(defun truncate-string (str width &optional start-column) + "Truncate STR to fit in WIDTH columns. +Optional non-nil arg START-COLUMN specifies the starting column. +\[emu-mule.el; Mule 2.3 emulating function]" + (or start-column + (setq start-column 0)) + (let ((max-width (string-width str)) + (len (length str)) + (from 0) + (column 0) + to-prev to ch) + (if (>= width max-width) + (setq width max-width)) + (if (>= start-column width) + "" + (while (< column start-column) + (setq ch (aref str from) + column (+ column (char-width ch)) + from (+ from (char-bytes ch)))) + (if (< width max-width) + (progn + (setq to from) + (while (<= column width) + (setq ch (aref str to) + column (+ column (char-width ch)) + to-prev to + to (+ to (char-bytes ch)))) + (setq to to-prev))) + (substring str from to)))) + +(defalias 'looking-at-as-unibyte 'looking-at) + +;;; @@ obsoleted aliases +;;; +;;; You should not use them. + +(defalias 'string-columns 'length) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'poem-nemacs) (require 'apel-ver)) + +;;; poem-nemacs.el ends here diff --git a/apel-10.7/poem-om.el b/apel-10.7/poem-om.el new file mode 100644 index 0000000..3b762e7 --- /dev/null +++ b/apel-10.7/poem-om.el @@ -0,0 +1,164 @@ +;;; poem-om.el --- poem implementation for Mule 1.* and Mule 2.* + +;; Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Katsumi Yamaoka +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'poe) + + +;;; @ version specific features +;;; + +(if (= emacs-major-version 19) + ;; Suggested by SASAKI Osamu + ;; (cf. [os2-emacs-ja:78]) + (defun fontset-pixel-size (fontset) + (let* ((font (get-font-info + (aref (cdr (get-fontset-info fontset)) 0))) + (open (aref font 4))) + (if (= open 1) + (aref font 5) + (if (= open 0) + (let ((pat (aref font 1))) + (if (string-match "-[0-9]+-" pat) + (string-to-number + (substring + pat (1+ (match-beginning 0)) (1- (match-end 0)))) + 0)) + )))) + ) + + +;;; @ character set +;;; + +(defalias 'make-char 'make-character) + +(defalias 'find-non-ascii-charset-string 'find-charset-string) +(defalias 'find-non-ascii-charset-region 'find-charset-region) + +(defalias 'charset-bytes 'char-bytes) +(defalias 'charset-description 'char-description) +(defalias 'charset-registry 'char-registry) +(defalias 'charset-columns 'char-width) +(defalias 'charset-direction 'char-direction) + +(defun charset-chars (charset) + "Return the number of characters per dimension of CHARSET." + (if (= (logand (nth 2 (character-set charset)) 1) 1) + 96 + 94)) + + +;;; @ buffer representation +;;; + +(defsubst-maybe set-buffer-multibyte (flag) + "Set the multibyte flag of the current buffer to FLAG. +If FLAG is t, this makes the buffer a multibyte buffer. +If FLAG is nil, this makes the buffer a single-byte buffer. +The buffer contents remain unchanged as a sequence of bytes +but the contents viewed as characters do change. +\[Emacs 20.3 emulating function]" + (setq mc-flag flag) + ) + + +;;; @ character +;;; + +(defalias 'char-charset 'char-leading-char) + +(defun split-char (character) + "Return list of charset and one or two position-codes of CHARACTER." + (let ((p (1- (char-bytes character))) + dest) + (while (>= p 1) + (setq dest (cons (- (char-component character p) 128) dest) + p (1- p))) + (cons (char-charset character) dest))) + +(defmacro char-next-index (char index) + "Return index of character succeeding CHAR whose index is INDEX." + (` (+ (, index) (char-bytes (, char))))) + + +;;; @@ obsoleted aliases +;;; +;;; You should not use them. + +(defalias 'char-length 'char-bytes) +;;(defalias 'char-columns 'char-width) + + +;;; @ string +;;; + +(defalias 'string-columns 'string-width) + +(defalias 'string-to-int-list 'string-to-char-list) + +;; Imported from Mule-2.3 +(defun-maybe truncate-string (str width &optional start-column) + "\ +Truncate STR to fit in WIDTH columns. +Optional non-nil arg START-COLUMN specifies the starting column. +\[emu-mule.el; Mule 2.3 emulating function]" + (or start-column + (setq start-column 0)) + (let ((max-width (string-width str)) + (len (length str)) + (from 0) + (column 0) + to-prev to ch) + (if (>= width max-width) + (setq width max-width)) + (if (>= start-column width) + "" + (while (< column start-column) + (setq ch (aref str from) + column (+ column (char-width ch)) + from (+ from (char-bytes ch)))) + (if (< width max-width) + (progn + (setq to from) + (while (<= column width) + (setq ch (aref str to) + column (+ column (char-width ch)) + to-prev to + to (+ to (char-bytes ch)))) + (setq to to-prev))) + (substring str from to)))) + +(defalias 'looking-at-as-unibyte 'looking-at) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'poem-om) (require 'apel-ver)) + +;;; poem-om.el ends here diff --git a/apel-10.7/poem-xm.el b/apel-10.7/poem-xm.el new file mode 100644 index 0000000..88cf388 --- /dev/null +++ b/apel-10.7/poem-xm.el @@ -0,0 +1,99 @@ +;;; poem-xm.el --- poem module for XEmacs-mule; -*-byte-compile-dynamic: t;-*- + +;; Copyright (C) 1998,1999,2002,2003,2005 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(eval-when-compile + (require 'poe)) + + +;;; @ buffer representation +;;; + +(defsubst-maybe set-buffer-multibyte (flag) + "Set the multibyte flag of the current buffer to FLAG. +If FLAG is t, this makes the buffer a multibyte buffer. +If FLAG is nil, this makes the buffer a single-byte buffer. +The buffer contents remain unchanged as a sequence of bytes +but the contents viewed as characters do change. +\[Emacs 20.3 emulating function]" + flag) + + +;;; @ character +;;; + +;; avoid bug of XEmacs +(or (integerp (car (cdr (split-char ?a)))) + (defun split-char (char) + "Return list of charset and one or two position-codes of CHAR." + (let ((charset (char-charset char))) + (if (eq charset 'ascii) + (list charset (char-int char)) + (let ((i 0) + (len (charset-dimension charset)) + (code (if (integerp char) + char + (char-int char))) + dest) + (while (< i len) + (setq dest (cons (logand code 127) dest) + code (lsh code -7) + i (1+ i))) + (cons charset dest))))) + ) + +(defmacro char-next-index (char index) + "Return index of character succeeding CHAR whose index is INDEX." + `(1+ ,index)) + +(if (not (fboundp 'char-length)) + (defalias 'char-length + (lambda (char) + "Return number of bytes a CHARACTER occupies in a string or buffer. +It always returns 1 in XEmacs. It is for compatibility with MULE 2.3." + 1))) + +(defalias-maybe 'char-valid-p 'characterp) + + +;;; @ string +;;; + +(defun-maybe string-to-int-list (str) + (mapcar #'char-int str)) + +(defun-maybe string-to-char-list (str) + (mapcar #'identity str)) + +(defalias 'looking-at-as-unibyte 'looking-at) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'poem-xm) (require 'apel-ver)) + +;;; poem-xm.el ends here diff --git a/apel-10.7/poem.el b/apel-10.7/poem.el new file mode 100644 index 0000000..70ef7be --- /dev/null +++ b/apel-10.7/poem.el @@ -0,0 +1,106 @@ +;;; poem.el --- Emulate latest MULE features; -*-byte-compile-dynamic: t;-*- + +;; Copyright (C) 1998,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'pces) + +(cond ((featurep 'mule) + (cond ((featurep 'xemacs) + (require 'poem-xm) + ) + ((>= emacs-major-version 20) + (require 'poem-e20) + ) + (t + ;; for MULE 1.* and 2.* + (require 'poem-om) + )) + ) + ((boundp 'NEMACS) + ;; for Nemacs and Nepoch + (require 'poem-nemacs) + ) + (t + (require 'poem-ltn1) + )) + + +;;; @ Emacs 20.3 emulation +;;; + +(defsubst-maybe string-as-unibyte (string) + "Return a unibyte string with the same individual bytes as STRING. +If STRING is unibyte, the result is STRING itself. +\[Emacs 20.3 emulating macro]" + string) + +(defsubst-maybe string-as-multibyte (string) + "Return a multibyte string with the same individual bytes as STRING. +If STRING is multibyte, the result is STRING itself. +\[Emacs 20.3 emulating macro]" + string) + +(defun-maybe charset-after (&optional pos) + "Return charset of a character in current buffer at position POS. +If POS is nil, it defaults to the current point. +If POS is out of range, the value is nil. +\[Emacs 20.3 emulating function]" + (char-charset (char-after pos)) + ) + +;;; @ XEmacs-mule emulation +;;; + +(defalias-maybe 'char-int 'identity) + +(defalias-maybe 'int-char 'identity) + +(defalias-maybe 'characterp + (cond + ((fboundp 'char-valid-p) 'char-valid-p) + (t 'integerp))) + +(defalias-maybe 'char-or-char-int-p + (cond + ((fboundp 'char-valid-p) 'char-valid-p) + (t 'integerp))) + +(defun-maybe char-octet (ch &optional n) + "Return the octet numbered N (should be 0 or 1) of char CH. +N defaults to 0 if omitted. [XEmacs-mule emulating function]" + (or (nth (if n + (1+ n) + 1) + (split-char ch)) + 0)) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'poem) (require 'apel-ver)) + +;;; poem.el ends here diff --git a/apel-10.7/product.el b/apel-10.7/product.el new file mode 100644 index 0000000..b49d698 --- /dev/null +++ b/apel-10.7/product.el @@ -0,0 +1,428 @@ +;;; product.el --- Functions for product version information. + +;; Copyright (C) 1999,2000 Free Software Foundation, Inc. + +;; Author: Shuhei KOBAYASHI +;; Keiichi Suzuki +;; Keywords: compatibility, User-Agent + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 module defines some utility functions for product information, +;; used for User-Agent header field. +;; +;; User-Agent header field first appeared in HTTP [RFC 1945, RFC 2616] +;; and adopted to News Article Format draft [USEFOR]. +;; +;; [RFC 1945] Hypertext Transfer Protocol -- HTTP/1.0. +;; T. Berners-Lee, R. Fielding & H. Frystyk. May 1996. +;; +;; [RFC 2616] Hypertext Transfer Protocol -- HTTP/1.1. +;; R. Fielding, J. Gettys, J. Mogul, H. Frystyk, L. Masinter, P. Leach, +;; T. Berners-Lee. June 1999. +;; +;; [USEFOR] News Article Format, . +;; USEFOR Working Group. March 1999. + +;;; Code: + +(defvar product-obarray (make-vector 13 0)) + +(defvar product-ignore-checkers nil) + +(defun product-define (name &optional family version code-name) + "Define a product as a set of NAME, FAMILY, VERSION, and CODE-NAME. +NAME is a string. Optional 2nd argument FAMILY is a string of +family product name. Optional 3rd argument VERSION is a list of +numbers. Optional 4th argument CODE-NAME is a string." + (and family + (product-add-to-family family name)) + (set (intern name product-obarray) + (vector name family version code-name nil nil nil nil))) + +(defun product-name (product) + "Return the name of PRODUCT, a string." + (aref product 0)) +(defun product-family (product) + "Return the family name of PRODUCT, a string." + (aref product 1)) +(defun product-version (product) + "Return the version of PRODUCT, a list of numbers." + (aref product 2)) +(defun product-code-name (product) + "Return the code-name of PRODUCT, a string." + (aref product 3)) +(defun product-checkers (product) + "Return the checkers of PRODUCT, a list of functions." + (aref product 4)) +(defun product-family-products (product) + "Return the family products of PRODUCT, a list of strings." + (aref product 5)) +(defun product-features (product) + "Return the features of PRODUCT, a list of feature." + (aref product 6)) +(defun product-version-string (product) + "Return the version string of PRODUCT, a string." + (aref product 7)) + +(defun product-set-name (product name) + "Set name of PRODUCT to NAME." + (aset product 0 name)) +(defun product-set-family (product family) + "Set family name of PRODUCT to FAMILY." + (aset product 1 family)) +(defun product-set-version (product version) + "Set version of PRODUCT to VERSION." + (aset product 2 version)) +;; Some people want to translate code-name. +(defun product-set-code-name (product code-name) + "Set code-name of PRODUCT to CODE-NAME." + (aset product 3 code-name)) +(defun product-set-checkers (product checkers) + "Set checker functions of PRODUCT to CHECKERS." + (aset product 4 checkers)) +(defun product-set-family-products (product products) + "Set family products of PRODUCT to PRODUCTS." + (aset product 5 products)) +(defun product-set-features (product features) + "Set features of PRODUCT to FEATURES." + (aset product 6 features)) +(defun product-set-version-string (product version-string) + "Set version string of PRODUCT to VERSION-STRING." + (aset product 7 version-string)) + +(defun product-add-to-family (family product-name) + "Add a product to a family. +FAMILY is a product structure which returned by `product-define'. +PRODUCT-NAME is a string of the product's name ." + (let ((family-product (product-find-by-name family))) + (if family-product + (let ((dest (product-family-products family-product))) + (or (member product-name dest) + (product-set-family-products + family-product (cons product-name dest)))) + (error "Family product `%s' is not defined" family)))) + +(defun product-remove-from-family (family product-name) + "Remove a product from a family. +FAMILY is a product string which returned by `product-define'. +PRODUCT-NAME is a string of the product's name." + (let ((family-product (product-find-by-name family))) + (if family-product + (product-set-family-products + family-product + (delete product-name (product-family-products family-product))) + (error "Family product `%s' is not defined" family)))) + +(defun product-add-checkers (product &rest checkers) + "Add checker function(s) to a product. +PRODUCT is a product structure which returned by `product-define'. +The rest arguments CHECKERS should be functions. These functions +are registered to the product's checkers list, and will be called by + `product-run-checkers'. +If a checker is `ignore' will be ignored all checkers after this." + (setq product (product-find product)) + (or product-ignore-checkers + (let ((dest (product-checkers product)) + checker) + (while checkers + (setq checker (car checkers) + checkers (cdr checkers)) + (or (memq checker dest) + (setq dest (cons checker dest)))) + (product-set-checkers product dest)))) + +(defun product-remove-checkers (product &rest checkers) + "Remove checker function(s) from a product. +PRODUCT is a product structure which returned by `product-define'. +The rest arguments CHECKERS should be functions. These functions removed +from the product's checkers list." + (setq product (product-find product)) + (let ((dest (product-checkers product))) + (while checkers + (setq checkers (cdr checkers) + dest (delq (car checkers) dest))) + (product-set-checkers product dest))) + +(defun product-add-feature (product feature) + "Add a feature to the features list of a product. +PRODUCT is a product structure which returned by `product-define'. +FEATURE is a feature in the PRODUCT's." + (setq product (product-find product)) + (let ((dest (product-features product))) + (or (memq feature dest) + (product-set-features product (cons feature dest))))) + +(defun product-remove-feature (product feature) + "Remove a feature from the features list of a product. +PRODUCT is a product structure which returned by `product-define'. +FEATURE is a feature which registered in the products list of PRODUCT." + (setq product (product-find product)) + (product-set-features product + (delq feature (product-features product)))) + +(defun product-run-checkers (product version &optional force) + "Run checker functions of product. +PRODUCT is a product structure which returned by `product-define'. +VERSION is target version. +If optional 3rd argument FORCE is non-nil then do not ignore +all checkers." + (let ((checkers (product-checkers product))) + (if (or force + (not (memq 'ignore checkers))) + (let ((version (or version + (product-version product)))) + (while checkers + (funcall (car checkers) version version) + (setq checkers (cdr checkers))))))) + +(defun product-find-by-name (name) + "Find product by name and return a product structure. +NAME is a string of the product's name." + (symbol-value (intern-soft name product-obarray))) + +(defun product-find-by-feature (feature) + "Get a product structure of a feature's product. +FEATURE is a symbol of the feature." + (get feature 'product)) + +(defun product-find (product) + "Find product information. +If PRODUCT is a product structure, then return PRODUCT itself. +If PRODUCT is a string, then find product by name and return a +product structure. If PRODUCT is symbol of feature, then return +the feature's product." + (cond + ((and (symbolp product) + (featurep product)) + (product-find-by-feature product)) + ((stringp product) + (product-find-by-name product)) + ((vectorp product) + product) + (t + (error "Invalid product %s" product)))) + +(put 'product-provide 'lisp-indent-function 1) +(defmacro product-provide (feature-def product-def) + "Declare a feature as a part of product. +FEATURE-DEF is a definition of the feature. +PRODUCT-DEF is a definition of the product." + (let* ((feature feature-def) + (product (product-find (eval product-def))) + (product-name (product-name product)) + (product-family (product-family product)) + (product-version (product-version product)) + (product-code-name (product-code-name product)) + (product-version-string (product-version-string product))) + (` (progn + (, product-def) + (put (, feature) 'product + (let ((product (product-find-by-name (, product-name)))) + (product-run-checkers product '(, product-version)) + (and (, product-family) + (product-add-to-family (, product-family) + (, product-name))) + (product-add-feature product (, feature)) + (if (equal '(, product-version) (product-version product)) + product + (vector (, product-name) (, product-family) + '(, product-version) (, product-code-name) + nil nil nil (, product-version-string))))) + (, feature-def))))) + +(defun product-version-as-string (product) + "Return version number of product as a string. +PRODUCT is a product structure which returned by `product-define'. +If optional argument UPDATE is non-nil, then regenerate +`product-version-string' from `product-version'." + (setq product (product-find product)) + (or (product-version-string product) + (and (product-version product) + (product-set-version-string product + (mapconcat (function int-to-string) + (product-version product) + "."))))) + +(defun product-string-1 (product &optional verbose) + "Return information of product as a string of \"NAME/VERSION\". +PRODUCT is a product structure which returned by `product-define'. +If optional argument VERBOSE is non-nil, then return string of +\"NAME/VERSION (CODE-NAME)\"." + (setq product (product-find product)) + (concat (product-name product) + (let ((version-string (product-version-as-string product))) + (and version-string + (concat "/" version-string))) + (and verbose (product-code-name product) + (concat " (" (product-code-name product) ")")))) + +(defun product-for-each (product all function &rest args) + "Apply a function to a product and the product's family with args. +PRODUCT is a product structure which returned by `product-define'. +If ALL is nil, apply function to only products which provided feature. +FUNCTION is a function. The function called with following arguments. +The 1st argument is a product structure. The rest arguments are ARGS." + (setq product (product-find product)) + (let ((family (product-family-products product))) + (and (or all (product-features product)) + (apply function product args)) + (while family + (apply 'product-for-each (car family) all function args) + (setq family (cdr family))))) + +(defun product-string (product) + "Return information of product as a string of \"NAME/VERSION\". +PRODUCT is a product structure which returned by `product-define'." + (let (dest) + (product-for-each product nil + (function + (lambda (product) + (let ((str (product-string-1 product nil))) + (if str + (setq dest (if dest + (concat dest " " str) + str))))))) + dest)) + +(defun product-string-verbose (product) + "Return information of product as a string of \"NAME/VERSION (CODE-NAME)\". +PRODUCT is a product structure which returned by `product-define'." + (let (dest) + (product-for-each product nil + (function + (lambda (product) + (let ((str (product-string-1 product t))) + (if str + (setq dest (if dest + (concat dest " " str) + str))))))) + dest)) + +(defun product-version-compare (v1 v2) + "Compare two versions. +Return an integer greater than, equal to, or less than 0, +according as the version V1 is greater than, equal to, or less +than the version V2. +Both V1 and V2 are a list of integer(s) respectively." + (while (and v1 v2 (= (car v1) (car v2))) + (setq v1 (cdr v1) + v2 (cdr v2))) + (if v1 (if v2 (- (car v1) (car v2)) 1) (if v2 -1 0))) + +(defun product-version>= (product require-version) + "Compare product version with required version. +PRODUCT is a product structure which returned by `product-define'. +REQUIRE-VERSION is a list of integer." + (>= (product-version-compare (product-version (product-find product)) + require-version) + 0)) + +(defun product-list-products () + "List all products information." + (let (dest) + (mapatoms + (function + (lambda (sym) + (setq dest (cons (symbol-value sym) dest)))) + product-obarray) + dest)) + +(defun product-parse-version-string (verstr) + "Parse version string \".*v1.v2... (CODE-NAME)\". +Return list of version, code-name, and version-string. +VERSTR is a string." + (let (version version-string code-name) + (and (string-match "\\(\\([0-9.]+\\)[^ ]*\\)[^(]*\\((\\(.+\\))\\)?" verstr) + (let ((temp (substring verstr (match-beginning 2) (match-end 2)))) + (setq version-string (substring verstr + (match-beginning 1) + (match-end 1)) + code-name (and (match-beginning 4) + (substring verstr + (match-beginning 4) + (match-end 4)))) + (while (string-match "^\\([0-9]+\\)\\.?" temp) + (setq version (cons (string-to-number + (substring temp + (match-beginning 1) + (match-end 1))) + version) + temp (substring temp (match-end 0)))))) + (list (nreverse version) code-name version-string))) + + +;;; @ End. +;;; + +(provide 'product) ; beware of circular dependency. +(require 'apel-ver) ; these two files depend on each other. +(product-provide 'product 'apel-ver) + + +;;; @ Define emacs versions. +;;; + +(require 'pym) + +(defconst-maybe emacs-major-version + (progn (string-match "^[0-9]+" emacs-version) + (string-to-int (substring emacs-version + (match-beginning 0)(match-end 0)))) + "Major version number of this version of Emacs.") +(defconst-maybe emacs-minor-version + (progn (string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version) + (string-to-int (substring emacs-version + (match-beginning 1)(match-end 1)))) + "Minor version number of this version of Emacs.") + +;;(or (product-find "emacs") +;; (progn +;; (product-define "emacs") +;; (cond +;; ((featurep 'meadow) +;; (let* ((info (product-parse-version-string (Meadow-version))) +;; (version (nth 0 info)) +;; (code-name (nth 1 info)) +;; (version-string (nth 2 info))) +;; (product-set-version-string +;; (product-define "Meadow" "emacs" version code-name) +;; version-string) +;; (product-provide 'Meadow "Meadow")) +;; (and (featurep 'mule) +;; (let* ((info (product-parse-version-string mule-version)) +;; (version (nth 0 info)) +;; (code-name (nth 1 info)) +;; (version-string (nth 2 info))) +;; (product-set-version-string +;; (product-define "MULE" "Meadow" version code-name) +;; version-string) +;; (product-provide 'mule "MULE"))) +;; (let* ((info (product-parse-version-string emacs-version)) +;; (version (nth 0 info)) +;; (code-name (nth 1 info)) +;; (version-string (nth 2 info))) +;; (product-set-version-string +;; (product-define "Emacs" "Meadow" version code-name) +;; version-string) +;; (product-provide 'emacs "Emacs"))) +;; ))) + +;;; product.el ends here diff --git a/apel-10.7/pym.el b/apel-10.7/pym.el new file mode 100644 index 0000000..46c85ef --- /dev/null +++ b/apel-10.7/pym.el @@ -0,0 +1,296 @@ +;;; pym.el --- Macros for Your Poe. + +;; Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Shuhei KOBAYASHI +;; Keywords: byte-compile, evaluation, edebug, internal + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; 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 module provides `def*-maybe' macros for conditional definition. +;; +;; Many APEL modules use these macros to provide the emulating version +;; of the Emacs builtins (both C primitives and lisp subroutines) for +;; backward compatibility. While compilation time, if `def*-maybe' +;; find that functions/variables being defined is already provided by +;; Emacs used for compilation, it does not leave the definitions in +;; compiled code and resulting .elc files will be highly specialized +;; for your environment. Lisp programmers should be aware that these +;; macros will never provide functions or variables at run-time if they +;; are defined for some reason (or by accident) at compilation time. + +;; For `find-function' lovers, the following definitions may work with +;; `def*-maybe'. +;; +;; (setq find-function-regexp +;; "^\\s-*(def[^cgvW]\\(\\w\\|-\\)+\\*?\\s-+'?%s\\(\\s-\\|$\\)") +;; (setq find-variable-regexp +;; "^\\s-*(def[^umaW]\\(\\w\\|-\\)+\\*?\\s-+%s\\(\\s-\\|$\\)") +;; +;; I'm too lazy to write better regexps, sorry. -- shuhei + +;;; Code: + +;; for `load-history'. +(or (boundp 'current-load-list) (setq current-load-list nil)) + +(require 'static) + + +;;; Conditional define. + +(put 'defun-maybe 'lisp-indent-function 'defun) +(defmacro defun-maybe (name &rest everything-else) + "Define NAME as a function if NAME is not defined. +See also the function `defun'." + (or (and (fboundp name) + (not (get name 'defun-maybe))) + (` (or (fboundp (quote (, name))) + (prog1 + (defun (, name) (,@ everything-else)) + ;; This `defun' will be compiled to `fset', + ;; which does not update `load-history'. + ;; We must update `current-load-list' explicitly. + (setq current-load-list + (cons (quote (, name)) current-load-list)) + (put (quote (, name)) 'defun-maybe t)))))) + +(put 'defmacro-maybe 'lisp-indent-function 'defun) +(defmacro defmacro-maybe (name &rest everything-else) + "Define NAME as a macro if NAME is not defined. +See also the function `defmacro'." + (or (and (fboundp name) + (not (get name 'defmacro-maybe))) + (` (or (fboundp (quote (, name))) + (prog1 + (defmacro (, name) (,@ everything-else)) + ;; This `defmacro' will be compiled to `fset', + ;; which does not update `load-history'. + ;; We must update `current-load-list' explicitly. + (setq current-load-list + (cons (quote (, name)) current-load-list)) + (put (quote (, name)) 'defmacro-maybe t)))))) + +(put 'defsubst-maybe 'lisp-indent-function 'defun) +(defmacro defsubst-maybe (name &rest everything-else) + "Define NAME as an inline function if NAME is not defined. +See also the macro `defsubst'." + (or (and (fboundp name) + (not (get name 'defsubst-maybe))) + (` (or (fboundp (quote (, name))) + (prog1 + (defsubst (, name) (,@ everything-else)) + ;; This `defsubst' will be compiled to `fset', + ;; which does not update `load-history'. + ;; We must update `current-load-list' explicitly. + (setq current-load-list + (cons (quote (, name)) current-load-list)) + (put (quote (, name)) 'defsubst-maybe t)))))) + +(defmacro defalias-maybe (symbol definition) + "Define SYMBOL as an alias for DEFINITION if SYMBOL is not defined. +See also the function `defalias'." + (setq symbol (eval symbol)) + (or (and (fboundp symbol) + (not (get symbol 'defalias-maybe))) + (` (or (fboundp (quote (, symbol))) + (prog1 + (defalias (quote (, symbol)) (, definition)) + ;; `defalias' updates `load-history' internally. + (put (quote (, symbol)) 'defalias-maybe t)))))) + +(defmacro defvar-maybe (name &rest everything-else) + "Define NAME as a variable if NAME is not defined. +See also the function `defvar'." + (or (and (boundp name) + (not (get name 'defvar-maybe))) + (` (or (boundp (quote (, name))) + (prog1 + (defvar (, name) (,@ everything-else)) + ;; byte-compiler will generate code to update + ;; `load-history'. + (put (quote (, name)) 'defvar-maybe t)))))) + +(defmacro defconst-maybe (name &rest everything-else) + "Define NAME as a constant variable if NAME is not defined. +See also the function `defconst'." + (or (and (boundp name) + (not (get name 'defconst-maybe))) + (` (or (boundp (quote (, name))) + (prog1 + (defconst (, name) (,@ everything-else)) + ;; byte-compiler will generate code to update + ;; `load-history'. + (put (quote (, name)) 'defconst-maybe t)))))) + +(defmacro defun-maybe-cond (name args &optional doc &rest clauses) + "Define NAME as a function if NAME is not defined. +CLAUSES are like those of `cond' expression, but each condition is evaluated +at compile-time and, if the value is non-nil, the body of the clause is used +for function definition of NAME. +See also the function `defun'." + (or (stringp doc) + (setq clauses (cons doc clauses) + doc nil)) + (or (and (fboundp name) + (not (get name 'defun-maybe))) + (` (or (fboundp (quote (, name))) + (prog1 + (static-cond + (,@ (mapcar + (function + (lambda (case) + (list (car case) + (if doc + (` (defun (, name) (, args) + (, doc) + (,@ (cdr case)))) + (` (defun (, name) (, args) + (,@ (cdr case)))))))) + clauses))) + ;; This `defun' will be compiled to `fset', + ;; which does not update `load-history'. + ;; We must update `current-load-list' explicitly. + (setq current-load-list + (cons (quote (, name)) current-load-list)) + (put (quote (, name)) 'defun-maybe t)))))) + +(defmacro defmacro-maybe-cond (name args &optional doc &rest clauses) + "Define NAME as a macro if NAME is not defined. +CLAUSES are like those of `cond' expression, but each condition is evaluated +at compile-time and, if the value is non-nil, the body of the clause is used +for macro definition of NAME. +See also the function `defmacro'." + (or (stringp doc) + (setq clauses (cons doc clauses) + doc nil)) + (or (and (fboundp name) + (not (get name 'defmacro-maybe))) + (` (or (fboundp (quote (, name))) + (prog1 + (static-cond + (,@ (mapcar + (function + (lambda (case) + (list (car case) + (if doc + (` (defmacro (, name) (, args) + (, doc) + (,@ (cdr case)))) + (` (defmacro (, name) (, args) + (,@ (cdr case)))))))) + clauses))) + ;; This `defmacro' will be compiled to `fset', + ;; which does not update `load-history'. + ;; We must update `current-load-list' explicitly. + (setq current-load-list + (cons (quote (, name)) current-load-list)) + (put (quote (, name)) 'defmacro-maybe t)))))) + +(defmacro defsubst-maybe-cond (name args &optional doc &rest clauses) + "Define NAME as an inline function if NAME is not defined. +CLAUSES are like those of `cond' expression, but each condition is evaluated +at compile-time and, if the value is non-nil, the body of the clause is used +for function definition of NAME. +See also the macro `defsubst'." + (or (stringp doc) + (setq clauses (cons doc clauses) + doc nil)) + (or (and (fboundp name) + (not (get name 'defsubst-maybe))) + (` (or (fboundp (quote (, name))) + (prog1 + (static-cond + (,@ (mapcar + (function + (lambda (case) + (list (car case) + (if doc + (` (defsubst (, name) (, args) + (, doc) + (,@ (cdr case)))) + (` (defsubst (, name) (, args) + (,@ (cdr case)))))))) + clauses))) + ;; This `defsubst' will be compiled to `fset', + ;; which does not update `load-history'. + ;; We must update `current-load-list' explicitly. + (setq current-load-list + (cons (quote (, name)) current-load-list)) + (put (quote (, name)) 'defsubst-maybe t)))))) + + +;;; Edebug spec. + +;; `def-edebug-spec' is an autoloaded macro in v19 and later. +;; (Note that recent XEmacs provides "edebug" as a separate package.) +(defmacro-maybe def-edebug-spec (symbol spec) + "Set the edebug-form-spec property of SYMBOL according to SPEC. +Both SYMBOL and SPEC are unevaluated. The SPEC can be 0, t, a symbol +\(naming a function\), or a list." + (` (put (quote (, symbol)) 'edebug-form-spec (quote (, spec))))) + +;; edebug-spec for `def*-maybe' macros. +(def-edebug-spec defun-maybe defun) +(def-edebug-spec defmacro-maybe defmacro) +(def-edebug-spec defsubst-maybe defun) +(def-edebug-spec defun-maybe-cond + (&define name lambda-list + [&optional stringp] + [&rest ([¬ eval] [&rest sexp])] + [&optional (eval [&optional ("interactive" interactive)] def-body)] + &rest (&rest sexp))) +(def-edebug-spec defmacro-maybe-cond + (&define name lambda-list + [&rest ([¬ eval] [&rest sexp])] + [&optional (eval def-body)] + &rest (&rest sexp))) +(def-edebug-spec defsubst-maybe-cond + (&define name lambda-list + [&optional stringp] + [&rest ([¬ eval] [&rest sexp])] + [&optional (eval [&optional ("interactive" interactive)] def-body)] + &rest (&rest sexp))) + +;; edebug-spec for `static-*' macros are also defined here. +(def-edebug-spec static-if t) +(def-edebug-spec static-when when) +(def-edebug-spec static-unless unless) +(def-edebug-spec static-condition-case condition-case) +(def-edebug-spec static-defconst defconst) +(def-edebug-spec static-cond cond) + + +;;; for backward compatibility. + +(defun subr-fboundp (symbol) + "Return t if SYMBOL's function definition is a built-in function." + (and (fboundp symbol) + (subrp (symbol-function symbol)))) +;; (make-obsolete 'subr-fboundp "don't use it.") + + +;;; End. + +(require 'product) +(product-provide (provide 'pym) (require 'apel-ver)) + +;;; pym.el ends here diff --git a/apel-10.7/richtext.el b/apel-10.7/richtext.el new file mode 100644 index 0000000..e136950 --- /dev/null +++ b/apel-10.7/richtext.el @@ -0,0 +1,185 @@ +;;; richtext.el -- read and save files in text/richtext format + +;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Created: 1995/7/15 +;; Version: $Id: richtext.el,v 3.6 1997/06/28 17:58:34 morioka Exp $ +;; Keywords: wp, faces, MIME, multimedia + +;; This file is not part of GNU Emacs yet. + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'enriched) + + +;;; @ variables +;;; + +(defconst richtext-initial-annotation + (lambda () + (format "Content-Type: text/richtext\nText-Width: %d\n\n" + (enriched-text-width))) + "What to insert at the start of a text/richtext file. +If this is a string, it is inserted. If it is a list, it should be a lambda +expression, which is evaluated to get the string to insert.") + +(defconst richtext-annotation-regexp + "[ \t\n]*\\(<\\(/\\)?\\([-A-za-z0-9]+\\)>\\)[ \t\n]*" + "Regular expression matching richtext annotations.") + +(defconst richtext-translations + '((face (bold-italic "bold" "italic") + (bold "bold") + (italic "italic") + (underline "underline") + (fixed "fixed") + (excerpt "excerpt") + (default ) + (nil enriched-encode-other-face)) + (invisible (t "comment")) + (left-margin (4 "indent")) + (right-margin (4 "indentright")) + (justification (right "flushright") + (left "flushleft") + (full "flushboth") + (center "center")) + ;; The following are not part of the standard: + (FUNCTION (enriched-decode-foreground "x-color") + (enriched-decode-background "x-bg-color")) + (read-only (t "x-read-only")) + (unknown (nil format-annotate-value)) +; (font-size (2 "bigger") ; unimplemented +; (-2 "smaller")) +) + "List of definitions of text/richtext annotations. +See `format-annotate-region' and `format-deannotate-region' for the definition +of this structure.") + + +;;; @ encoder +;;; + +;;;###autoload +(defun richtext-encode (from to) + (if enriched-verbose (message "Richtext: encoding document...")) + (save-restriction + (narrow-to-region from to) + (delete-to-left-margin) + (unjustify-region) + (goto-char from) + (format-replace-strings '(("<" . ""))) + (format-insert-annotations + (format-annotate-region from (point-max) richtext-translations + 'enriched-make-annotation enriched-ignore)) + (goto-char from) + (insert (if (stringp enriched-initial-annotation) + richtext-initial-annotation + (funcall richtext-initial-annotation))) + (enriched-map-property-regions 'hard + (lambda (v b e) + (goto-char b) + (if (eolp) + (while (search-forward "\n" nil t) + (replace-match "\n") + ))) + (point) nil) + (if enriched-verbose (message nil)) + ;; Return new end. + (point-max))) + + +;;; @ decoder +;;; + +(defun richtext-next-annotation () + "Find and return next text/richtext annotation. +Return value is \(begin end name positive-p), or nil if none was found." + (catch 'tag + (while (re-search-forward richtext-annotation-regexp nil t) + (let* ((beg0 (match-beginning 0)) + (end0 (match-end 0)) + (beg (match-beginning 1)) + (end (match-end 1)) + (name (downcase (buffer-substring + (match-beginning 3) (match-end 3)))) + (pos (not (match-beginning 2))) + ) + (cond ((equal name "lt") + (delete-region beg end) + (goto-char beg) + (insert "<") + ) + ((equal name "comment") + (if pos + (throw 'tag (list beg0 end name pos)) + (throw 'tag (list beg end0 name pos)) + ) + ) + (t + (throw 'tag (list beg end name pos)) + )) + )))) + +;;;###autoload +(defun richtext-decode (from to) + (if enriched-verbose (message "Richtext: decoding document...")) + (save-excursion + (save-restriction + (narrow-to-region from to) + (goto-char from) + (let ((file-width (enriched-get-file-width)) + (use-hard-newlines t)) + (enriched-remove-header) + + (goto-char from) + (while (re-search-forward "\n\n+" nil t) + (replace-match "\n") + ) + + ;; Deal with newlines + (goto-char from) + (while (re-search-forward "[ \t\n]*[ \t\n]*" nil t) + (replace-match "\n") + (put-text-property (match-beginning 0) (point) 'hard t) + (put-text-property (match-beginning 0) (point) 'front-sticky nil) + ) + + ;; Translate annotations + (format-deannotate-region from (point-max) richtext-translations + 'richtext-next-annotation) + + ;; Fill paragraphs + (if (and file-width ; possible reasons not to fill: + (= file-width (enriched-text-width))) ; correct wd. + ;; Minimally, we have to insert indentation and justification. + (enriched-insert-indentation) + (if enriched-verbose (message "Filling paragraphs...")) + (fill-region (point-min) (point-max)))) + (if enriched-verbose (message nil)) + (point-max)))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'richtext) (require 'apel-ver)) + +;;; richtext.el ends here diff --git a/apel-10.7/static.el b/apel-10.7/static.el new file mode 100644 index 0000000..34d6f1b --- /dev/null +++ b/apel-10.7/static.el @@ -0,0 +1,89 @@ +;;; static.el --- tools for static evaluation. + +;; Copyright (C) 1999 Tanaka Akira + +;; Author: Tanaka Akira +;; Keywords: byte compile, evaluation + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(put 'static-if 'lisp-indent-function 2) +(defmacro static-if (cond then &rest else) + "Like `if', but evaluate COND at compile time." + (if (eval cond) + then + (` (progn (,@ else))))) + +(put 'static-when 'lisp-indent-function 1) +(defmacro static-when (cond &rest body) + "Like `when', but evaluate COND at compile time." + (if (eval cond) + (` (progn (,@ body))))) + +(put 'static-unless 'lisp-indent-function 1) +(defmacro static-unless (cond &rest body) + "Like `unless', but evaluate COND at compile time." + (if (eval cond) + nil + (` (progn (,@ body))))) + +(put 'static-condition-case 'lisp-indent-function 2) +(defmacro static-condition-case (var bodyform &rest handlers) + "Like `condition-case', but evaluate BODYFORM at compile time." + (eval (` (condition-case (, var) + (list (quote quote) (, bodyform)) + (,@ (mapcar + (if var + (function + (lambda (h) + (` ((, (car h)) + (list (quote funcall) + (function (lambda ((, var)) (,@ (cdr h)))) + (list (quote quote) (, var))))))) + (function + (lambda (h) + (` ((, (car h)) (quote (progn (,@ (cdr h))))))))) + handlers)))))) + +(put 'static-defconst 'lisp-indent-function 'defun) +(defmacro static-defconst (symbol initvalue &optional docstring) + "Like `defconst', but evaluate INITVALUE at compile time. + +The variable SYMBOL can be referred at both compile time and run time." + (let ((value (eval initvalue))) + (eval (` (defconst (, symbol) (quote (, value)) (, docstring)))) + (` (defconst (, symbol) (quote (, value)) (, docstring))))) + +(defmacro static-cond (&rest clauses) + "Like `cond', but evaluate CONDITION part of each clause at compile time." + (while (and clauses + (not (eval (car (car clauses))))) + (setq clauses (cdr clauses))) + (if clauses + (cons 'progn (cdr (car clauses))))) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'static) (require 'apel-ver)) + +;;; static.el ends here diff --git a/apel-10.7/timezone.el b/apel-10.7/timezone.el new file mode 100644 index 0000000..5e24ab7 --- /dev/null +++ b/apel-10.7/timezone.el @@ -0,0 +1,516 @@ +;;; timezone.el --- time zone package for GNU Emacs + +;; Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc. + +;; Author: Masanobu Umeda +;; Maintainer: umerin@mse.kyutech.ac.jp +;; Keywords: news + +;; This file is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; This file 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 GNU Emacs; see the file COPYING. If not, write to +;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +;;; Commentary: + +;; Modified 1 February 1994 by Kyle Jones to fix broken +;; timezone-floor function. + +;; Modified 25 January 1994 by Kyle Jones so that it will +;; work under version 18 of Emacs. Provided timezone-floor +;; and timezone-abs functions. + +;; Modified 4 October 1999 by Yuuichi Teranishi so that it will +;; work with old GNUS 3.14.4 under version 18 of Emacs. + +;;; Code: + +(defvar timezone-world-timezones + '(("PST" . -800) + ("PDT" . -700) + ("MST" . -700) + ("MDT" . -600) + ("CST" . -600) + ("CDT" . -500) + ("EST" . -500) + ("EDT" . -400) + ("AST" . -400) ;by + ("NST" . -330) ;by + ("UT" . +000) + ("GMT" . +000) + ("BST" . +100) + ("MET" . +100) + ("EET" . +200) + ("JST" . +900) + ("GMT+1" . +100) ("GMT+2" . +200) ("GMT+3" . +300) + ("GMT+4" . +400) ("GMT+5" . +500) ("GMT+6" . +600) + ("GMT+7" . +700) ("GMT+8" . +800) ("GMT+9" . +900) + ("GMT+10" . +1000) ("GMT+11" . +1100) ("GMT+12" . +1200) ("GMT+13" . +1300) + ("GMT-1" . -100) ("GMT-2" . -200) ("GMT-3" . -300) + ("GMT-4" . -400) ("GMT-5" . -500) ("GMT-6" . -600) + ("GMT-7" . -700) ("GMT-8" . -800) ("GMT-9" . -900) + ("GMT-10" . -1000) ("GMT-11" . -1100) ("GMT-12" . -1200)) + "*Time differentials of timezone from GMT in +-HHMM form. +This list is obsolescent, and is present only for backwards compatibility, +because time zone names are ambiguous in practice. +Use `current-time-zone' instead.") + +(defvar timezone-months-assoc + '(("JAN" . 1)("FEB" . 2)("MAR" . 3) + ("APR" . 4)("MAY" . 5)("JUN" . 6) + ("JUL" . 7)("AUG" . 8)("SEP" . 9) + ("OCT" . 10)("NOV" . 11)("DEC" . 12)) + "Alist of first three letters of a month and its numerical representation.") + +(defun timezone-make-date-arpa-standard (date &optional local timezone) + "Convert DATE to an arpanet standard date. +Optional 2nd argument LOCAL specifies the default local timezone of the DATE; +if nil, GMT is assumed. +Optional 3rd argument TIMEZONE specifies a time zone to be represented in; +if nil, the local time zone is assumed." + (let ((new (timezone-fix-time date local timezone))) + (timezone-make-arpa-date (aref new 0) (aref new 1) (aref new 2) + (timezone-make-time-string + (aref new 3) (aref new 4) (aref new 5)) + (aref new 6)) + )) + +(defun timezone-make-date-sortable (date &optional local timezone) + "Convert DATE to a sortable date string. +Optional 2nd argument LOCAL specifies the default local timezone of the DATE; +if nil, GMT is assumed. +Optional 3rd argument TIMEZONE specifies a timezone to be represented in; +if nil, the local time zone is assumed." + (let ((new (timezone-fix-time date local timezone))) + (timezone-make-sortable-date (aref new 0) (aref new 1) (aref new 2) + (timezone-make-time-string + (aref new 3) (aref new 4) (aref new 5))) + )) + + +;; +;; Parsers and Constructors of Date and Time +;; + +(defun timezone-make-arpa-date (year month day time &optional timezone) + "Make arpanet standard date string from YEAR, MONTH, DAY, and TIME. +Optional argument TIMEZONE specifies a time zone." + (let ((zone + (if (listp timezone) + (let* ((m (timezone-zone-to-minute timezone)) + (absm (if (< m 0) (- m) m))) + (format "%c%02d%02d" + (if (< m 0) ?- ?+) (/ absm 60) (% absm 60))) + timezone))) + (format "%02d %s %04d %s %s" + day + (capitalize (car (rassq month timezone-months-assoc))) + year + time + zone))) + +(defun timezone-make-sortable-date (year month day time) + "Make sortable date string from YEAR, MONTH, DAY, and TIME." + (format "%4d%02d%02d%s" + year month day time)) + +(defun timezone-make-time-string (hour minute second) + "Make time string from HOUR, MINUTE, and SECOND." + (format "%02d:%02d:%02d" hour minute second)) + +(defun timezone-parse-date (date) + "Parse DATE and return a vector [YEAR MONTH DAY TIME TIMEZONE]. +19 is prepended to year if necessary. Timezone may be nil if nothing. +Understands the following styles: + (1) 14 Apr 89 03:20[:12] [GMT] + (2) Fri, 17 Mar 89 4:01[:33] [GMT] + (3) Mon Jan 16 16:12[:37] [GMT] 1989 + (4) 6 May 1992 1641-JST (Wednesday) + (5) 22-AUG-1993 10:59:12.82 + (6) Thu, 11 Apr 16:17:12 91 [MET] + (7) Mon, 6 Jul 16:47:20 T 1992 [MET] + (8) 1996-06-24 21:13:12 [GMT] + (9) 1996-06-24 21:13-ZONE" + ;; Get rid of any text properties. + (and (stringp date) + (or (text-properties-at 0 date) + (next-property-change 0 date)) + (setq date (copy-sequence date)) + (set-text-properties 0 (length date) nil date)) + (let ((date (or date "")) + (year nil) + (month nil) + (day nil) + (time nil) + (zone nil)) ;This may be nil. + (cond ((string-match + "\\([0-9]+\\)[ \t]+\\([^ \t,]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9:]+\\)[ \t]*\\([-+a-zA-Z0-9]+\\)" date) + ;; Styles: (1) and (2) with timezone and buggy timezone + ;; This is most common in mail and news, + ;; so it is worth trying first. + (setq year 3 month 2 day 1 time 4 zone 5)) + ((string-match + "\\([0-9]+\\)[ \t]+\\([^ \t,]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9:]+\\)[ \t]*\\'" date) + ;; Styles: (1) and (2) without timezone + (setq year 3 month 2 day 1 time 4 zone nil)) + ((string-match + "\\([^ \t,]+\\),[ \t]+\\([0-9]+\\)[ \t]+\\([^ \t,]+\\)[ \t]+\\([0-9]+:[0-9:]+\\)[ \t]+\\(T[ \t]+\\|\\)\\([0-9]+\\)[ \t]*\\'" date) + ;; Styles: (6) and (7) without timezone + (setq year 6 month 3 day 2 time 4 zone nil)) + ((string-match + "\\([^ \t,]+\\),[ \t]+\\([0-9]+\\)[ \t]+\\([^ \t,]+\\)[ \t]+\\([0-9]+:[0-9:]+\\)[ \t]+\\(T[ \t]+\\|\\)\\([0-9]+\\)[ \t]*\\([-+a-zA-Z0-9]+\\)" date) + ;; Styles: (6) and (7) with timezone and buggy timezone + (setq year 6 month 3 day 2 time 4 zone 7)) + ((string-match + "\\([^ \t,]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9:]+\\)[ \t]+\\([0-9]+\\)" date) + ;; Styles: (3) without timezone + (setq year 4 month 1 day 2 time 3 zone nil)) + ((string-match + "\\([^ \t,]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9:]+\\)[ \t]+\\([-+a-zA-Z0-9]+\\)[ \t]+\\([0-9]+\\)" date) + ;; Styles: (3) with timezone + (setq year 5 month 1 day 2 time 3 zone 4)) + ((string-match + "\\([0-9]+\\)[ \t]+\\([^ \t,]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+\\)[ \t]*\\([-+a-zA-Z0-9]+\\)" date) + ;; Styles: (4) with timezone + (setq year 3 month 2 day 1 time 4 zone 5)) + ((string-match + "\\([0-9]+\\)-\\([A-Za-z]+\\)-\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9]+:[0-9]+\\)\\(\\.[0-9]+\\)?[ \t]+\\([-+a-zA-Z0-9]+\\)" date) + ;; Styles: (5) with timezone. + (setq year 3 month 2 day 1 time 4 zone 6)) + ((string-match + "\\([0-9]+\\)-\\([A-Za-z]+\\)-\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9]+:[0-9]+\\)\\(\\.[0-9]+\\)?" date) + ;; Styles: (5) without timezone. + (setq year 3 month 2 day 1 time 4 zone nil)) + ((string-match + "\\([0-9]+\\)-\\([0-9]+\\)-\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9]+:[0-9]+\\)[ \t]*\\([-+a-zA-Z0-9]+\\)" date) + ;; Styles: (8) with timezone. + (setq year 1 month 2 day 3 time 4 zone 5)) + ((string-match + "\\([0-9]+\\)-\\([0-9]+\\)-\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9]+\\)[ \t]*\\([-+a-zA-Z0-9:]+\\)" date) + ;; Styles: (8) with timezone with a colon in it. + (setq year 1 month 2 day 3 time 4 zone 5)) + ((string-match + "\\([0-9]+\\)-\\([0-9]+\\)-\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9]+:[0-9]+\\)" date) + ;; Styles: (8) without timezone. + (setq year 1 month 2 day 3 time 4 zone nil)) + ) + (when year + (setq year (match-string year date)) + ;; Guess ambiguous years. Assume years < 69 don't predate the + ;; Unix Epoch, so are 2000+. Three-digit years are assumed to + ;; be relative to 1900. + (if (< (length year) 4) + (let ((y (string-to-int year))) + (if (< y 69) + (setq y (+ y 100))) + (setq year (int-to-string (+ 1900 y))))) + (setq month + (if (= (aref date (+ (match-beginning month) 2)) ?-) + ;; Handle numeric months, spanning exactly two digits. + (substring date + (match-beginning month) + (+ (match-beginning month) 2)) + (let* ((string (substring date + (match-beginning month) + (+ (match-beginning month) 3))) + (monthnum + (cdr (assoc (upcase string) timezone-months-assoc)))) + (if monthnum + (int-to-string monthnum))))) + (setq day (match-string day date)) + (setq time (match-string time date))) + (if zone (setq zone (match-string zone date))) + ;; Return a vector. + (if (and year month) + (vector year month day time zone) + (vector "0" "0" "0" "0" nil)))) + +(defun timezone-parse-time (time) + "Parse TIME (HH:MM:SS) and return a vector [hour minute second]. +Recognize HH:MM:SS, HH:MM, HHMMSS, HHMM." + (let ((time (or time "")) + (hour nil) + (minute nil) + (second nil)) + (cond ((string-match "\\`\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\)\\'" time) + ;; HH:MM:SS + (setq hour 1 minute 2 second 3)) + ((string-match "\\`\\([0-9]+\\):\\([0-9]+\\)\\'" time) + ;; HH:MM + (setq hour 1 minute 2 second nil)) + ((string-match "\\`\\([0-9][0-9]\\)\\([0-9][0-9]\\)\\([0-9][0-9]\\)\\'" time) + ;; HHMMSS + (setq hour 1 minute 2 second 3)) + ((string-match "\\`\\([0-9][0-9]\\)\\([0-9][0-9]\\)\\'" time) + ;; HHMM + (setq hour 1 minute 2 second nil)) + ) + ;; Return [hour minute second] + (vector + (if hour + (substring time (match-beginning hour) (match-end hour)) "0") + (if minute + (substring time (match-beginning minute) (match-end minute)) "0") + (if second + (substring time (match-beginning second) (match-end second)) "0")) + )) + + +;; Miscellaneous + +(defun timezone-zone-to-minute (timezone) + "Translate TIMEZONE to an integer minute offset from GMT. +TIMEZONE can be a cons cell containing the output of `current-time-zone', +or an integer of the form +-HHMM, or a time zone name." + (cond + ((consp timezone) + (/ (car timezone) 60)) + (timezone + (progn + (setq timezone + (or (and (stringp timezone) (cdr (assoc (upcase timezone) timezone-world-timezones))) + ;; +900 + timezone)) + (if (stringp timezone) + (setq timezone (string-to-int timezone))) + ;; Taking account of minute in timezone. + ;; HHMM -> MM + (let* ((abszone (abs timezone)) + (minutes (+ (* 60 (/ abszone 100)) (% abszone 100)))) + (if (< timezone 0) (- minutes) minutes)))) + (t 0))) + +(defun timezone-floor (arg &optional divisor) + "Return the largest integer no grater than ARG. +With optional DIVISOR, return the largest integer no greater than ARG/DIVISOR." + (if (null divisor) + (setq divisor 1)) + (if (< arg 0) + (- (/ (- divisor 1 arg) divisor)) + (/ arg divisor))) + +(defun timezone-time-from-absolute (date seconds) + "Compute the UTC time equivalent to DATE at time SECONDS after midnight. +Return a list suitable as an argument to `current-time-zone', +or nil if the date cannot be thus represented. +DATE is the number of days elapsed since the (imaginary) +Gregorian date Sunday, December 31, 1 BC." + (let* ((current-time-origin 719163) + ;; (timezone-absolute-from-gregorian 1 1 1970) + (days (- date current-time-origin)) + (days-1 (/ days 65536)) + (days-2 (% (/ days 256) 256)) + (days-3 (% days 256)) + ;; (seconds-per-day (float 86400)) + (seconds-per-day-1 1) + (seconds-per-day-2 81) + (seconds-per-day-3 128) + ;; (seconds (+ seconds (* days seconds-per-day))) + ;; (current-time-arithmetic-base (float 65536)) + ;; (hi (timezone-floor (/ seconds current-time-arithmetic-base))) + ;; (hibase (* hi current-time-arithmetic-base)) + ;; (lo (timezone-floor (- seconds hibase))) + (seconds-1 (/ seconds 65536)) + (seconds-2 (% (/ seconds 256) 256)) + (seconds-3 (% seconds 256)) + hi lo + r + seconds-per-day*days-1 + seconds-per-day*days-2 + seconds-per-day*days-3) + (setq r (* days-3 seconds-per-day-3) + seconds-per-day*days-3 (% r 256)) + (setq r (+ (/ r 256) + (* days-2 seconds-per-day-3) + (* days-3 seconds-per-day-2)) + seconds-per-day*days-2 (% r 256)) + (setq seconds-per-day*days-1 (+ (/ r 256) + (* days-1 seconds-per-day-3) + (* (/ days 256) seconds-per-day-2) + (* days seconds-per-day-1))) + (setq r (+ seconds-2 seconds-per-day*days-2) + seconds-2 (% r 256) + seconds-1 (+ seconds-1 (/ r 256))) + (setq lo (+ (* seconds-2 256) + seconds-3 seconds-per-day*days-3)) + (setq hi (+ seconds-1 seconds-per-day*days-1)) + ;; (and (< (abs (- seconds (+ hibase lo))) 2) ; Check for integer overflow. + ;; (cons hi lo)) + (cons hi lo) + )) + +(defun timezone-time-zone-from-absolute (date seconds) + "Compute the local time zone for DATE at time SECONDS after midnight. +Return a list in the same format as current-time-zone's result, +or nil if the local time zone could not be computed. +DATE is the number of days elapsed since the (imaginary) +Gregorian date Sunday, December 31, 1 BC." + (and (fboundp 'current-time-zone) + (let ((utc-time (timezone-time-from-absolute date seconds))) + (and utc-time + (let ((zone (current-time-zone utc-time))) + (and (car zone) zone)))))) + +(defsubst timezone-fix-time-1 (year month day hour minute second) + "Fix date and time. +For old `timezone-fix-time' function. +Arguments are YEAR, MONTH, DAY, HOUR, MINUTE and SECOND." + ;; MINUTE may be larger than 60 or smaller than -60. + (let ((hour-fix + (if (< minute 0) + ;;(/ (- minute 59) 60) (/ minute 60) + ;; ANSI C compliance about truncation of integer division + ;; by eggert@twinsun.com (Paul Eggert) + (- (/ (- 59 minute) 60)) (/ minute 60)))) + (setq hour (+ hour hour-fix)) + (setq minute (- minute (* 60 hour-fix)))) + ;; HOUR may be larger than 24 or smaller than 0. + (cond ((<= 24 hour) ;24 -> 00 + (setq hour (- hour 24)) + (setq day (1+ day)) + (if (< (timezone-last-day-of-month month year) day) + (progn + (setq month (1+ month)) + (setq day 1) + (if (< 12 month) + (progn + (setq month 1) + (setq year (1+ year)) + )) + ))) + ((> 0 hour) + (setq hour (+ hour 24)) + (setq day (1- day)) + (if (> 1 day) + (progn + (setq month (1- month)) + (if (> 1 month) + (progn + (setq month 12) + (setq year (1- year)) + )) + (setq day (timezone-last-day-of-month month year)) + ))) + ) + (vector year month day hour minute second)) + +(defsubst timezone-fix-time-2 (date local timezone) + "Convert DATE (default timezone LOCAL) to YYYY-MM-DD-HH-MM-SS-ZONE vector. +If LOCAL is nil, it is assumed to be GMT. +If TIMEZONE is nil, use the local time zone." + (let* ((date (timezone-parse-date date)) + (year (string-to-int (aref date 0))) + (year (cond ((< year 50) + (+ year 2000)) + ((< year 100) + (+ year 1900)) + (t year))) + (month (string-to-int (aref date 1))) + (day (string-to-int (aref date 2))) + (time (timezone-parse-time (aref date 3))) + (hour (string-to-int (aref time 0))) + (minute (string-to-int (aref time 1))) + (second (string-to-int (aref time 2))) + (local (or (aref date 4) local)) ;Use original if defined + (timezone + (or timezone + (timezone-time-zone-from-absolute + (timezone-absolute-from-gregorian month day year) + (+ second (* 60 (+ minute (* 60 hour))))))) + (diff (- (timezone-zone-to-minute timezone) + (timezone-zone-to-minute local))) + (minute (+ minute diff)) + (hour-fix (timezone-floor minute 60))) + (setq hour (+ hour hour-fix)) + (setq minute (- minute (* 60 hour-fix))) + ;; HOUR may be larger than 24 or smaller than 0. + (cond ((<= 24 hour) ;24 -> 00 + (setq hour (- hour 24)) + (setq day (1+ day)) + (if (< (timezone-last-day-of-month month year) day) + (progn + (setq month (1+ month)) + (setq day 1) + (if (< 12 month) + (progn + (setq month 1) + (setq year (1+ year)) + )) + ))) + ((> 0 hour) + (setq hour (+ hour 24)) + (setq day (1- day)) + (if (> 1 day) + (progn + (setq month (1- month)) + (if (> 1 month) + (progn + (setq month 12) + (setq year (1- year)) + )) + (setq day (timezone-last-day-of-month month year)) + ))) + ) + (vector year month day hour minute second timezone))) + +(defun timezone-fix-time (a1 a2 a3 &optional a4 a5 a6) + "Fix date and time. +(Old API: A1=YEAR A2=MONTH A3=DAY A4=HOUR A5=MINUTE A6=SECOND). +Convert DATE (default timezone LOCAL) to YYYY-MM-DD-HH-MM-SS-ZONE vector. +If LOCAL is nil, it is assumed to be GMT. +If TIMEZONE is nil, use the local time zone. +(New API: A1=DATE A2=LOCAL A3=TIMEZONE)" + (if a4 + (timezone-fix-time-1 a1 a2 a3 a4 a5 a6) + (timezone-fix-time-2 a1 a2 a3))) + +;; Partly copied from Calendar program by Edward M. Reingold. +;; Thanks a lot. + +(defun timezone-last-day-of-month (month year) + "The last day in MONTH during YEAR." + (if (and (= month 2) (timezone-leap-year-p year)) + 29 + (aref [31 28 31 30 31 30 31 31 30 31 30 31] (1- month)))) + +(defun timezone-leap-year-p (year) + "Return t if YEAR is a Gregorian leap year." + (or (and (zerop (% year 4)) + (not (zerop (% year 100)))) + (zerop (% year 400)))) + +(defun timezone-day-number (month day year) + "Return the day number within the year of the date MONTH/DAY/YEAR." + (let ((day-of-year (+ day (* 31 (1- month))))) + (if (> month 2) + (progn + (setq day-of-year (- day-of-year (/ (+ 23 (* 4 month)) 10))) + (if (timezone-leap-year-p year) + (setq day-of-year (1+ day-of-year))))) + day-of-year)) + +(defun timezone-absolute-from-gregorian (month day year) + "The number of days between the Gregorian date 12/31/1 BC and MONTH/DAY/YEAR. +The Gregorian date Sunday, December 31, 1 BC is imaginary." + (+ (timezone-day-number month day year);; Days this year + (* 365 (1- year));; + Days in prior years + (/ (1- year) 4);; + Julian leap years + (- (/ (1- year) 100));; - century years + (/ (1- year) 400)));; + Gregorian leap years + +;;; @ End. +;;; + +(require 'product) +(product-provide (provide 'timezone) (require 'apel-ver)) + +;;; timezone.el ends here diff --git a/apel-10.7/tinycustom.el b/apel-10.7/tinycustom.el new file mode 100644 index 0000000..9113768 --- /dev/null +++ b/apel-10.7/tinycustom.el @@ -0,0 +1,180 @@ +;; tinycustom.el -- a tiny custom.el for emulating purpose. + +;; Copyright (C) 1999 Mikio Nakajima + +;; Author: Mikio Nakajima +;; Katsumi Yamaoka +;; Keywords: emulating, custom + +;; This file is part of APEL (A Portable Emacs Library). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Commentary: + +;; Purpose of this program is emulating for who does not have "custom". +;; (custom.el bundled with v19 is old; does not have following macros.) +;; +;; DEFCUSTOM below has the same effect as the original DEFVAR has. +;; DEFFACE below interprets almost all arguments. +;; DEFGROUP and DEFINE-WIDGET below are just nop macro. + +;;; Code: + +(require 'poe) + +(defmacro-maybe defgroup (symbol members doc &rest args) + "Declare SYMBOL as a customization group containing MEMBERS. +SYMBOL does not need to be quoted. +Third arg DOC is the group documentation. + +This is a nop defgroup only for emulating purpose." + nil) + +(defmacro-maybe defcustom (symbol value doc &rest args) + "Declare SYMBOL as a customizable variable that defaults to VALUE. +DOC is the variable documentation. + +This is a defcustom only for emulating purpose. +Its effect is just as same as that of defvar." + (` (defvar (, symbol) (, value) (, doc)))) + +(defvar-maybe frame-background-mode nil + "*The brightness of the background. +Set this to the symbol dark if your background color is dark, light if +your background is light, or nil (default) if you want Emacs to +examine the brightness for you. However, the old Emacsen might not +examine the brightness, so you should set this value definitely.") + +(defun-maybe-cond custom-declare-face (face spec doc &rest args) + "Like `defface', but FACE is evaluated as a normal argument. +Note that this function does not have the full specification; DOC or +ARGS are ignored and some keywords are ignored in SPEC except for +`:foreground', `:background', `:bold', `:italic' and `:underline'. +It does nothing if FACE has been defined." + ((fboundp 'make-face) + (or (find-face face) + (let ((colorp (and window-system (x-display-color-p))) + display atts req item match done) + (make-face face) + (while (and spec (not done)) + (setq display (car (car spec)) + atts (car (cdr (car spec))) + spec (cdr spec)) + (cond ((consp display) + (setq match t) + (while (and display match) + (setq req (car (car display)) + item (car (cdr (car display))) + display (cdr display)) + (cond ((eq 'type req) + (setq match (or (eq window-system item) + (and (not window-system) + (eq 'tty item))))) + ((eq 'class req) + (setq match (or (and colorp + (eq 'color item)) + (and (not colorp) + (memq item + '(grayscale mono)))))) + ((eq 'background req) + (setq match (eq (or frame-background-mode 'light) + item))))) + (setq done match)) + ((eq t display) + (setq done t)))) + (if done + (let ((alist + '((:foreground . set-face-foreground) + (:background . set-face-background) + (:bold . set-face-bold-p) + (:italic . set-face-italic-p) + (:underline . set-face-underline-p))) + function) + (while atts + (if (setq function (cdr (assq (car atts) alist))) + (funcall function face (car (cdr atts)))) + (setq atts (cdr (cdr atts)))))) + face))) + (t + nil)) + +(defmacro-maybe defface (face spec doc &rest args) + "Declare FACE as a customizable face that defaults to SPEC. +FACE does not need to be quoted. + +Third argument DOC is the face documentation. + +If FACE has been set with `custom-set-face', set the face attributes +as specified by that function, otherwise set the face attributes +according to SPEC. + +The remaining arguments should have the form + + [KEYWORD VALUE]... + +The following KEYWORDs are defined: + +:group VALUE should be a customization group. + Add FACE to that group. + +SPEC should be an alist of the form ((DISPLAY ATTS)...). + +ATTS is a list of face attributes and their values. The possible +attributes are defined in the variable `custom-face-attributes'. + +The ATTS of the first entry in SPEC where the DISPLAY matches the +frame should take effect in that frame. DISPLAY can either be the +symbol t, which will match all frames, or an alist of the form +\((REQ ITEM...)...) + +For the DISPLAY to match a FRAME, the REQ property of the frame must +match one of the ITEM. The following REQ are defined: + +`type' (the value of `window-system') + Should be one of `x' or `tty'. + +`class' (the frame's color support) + Should be one of `color', `grayscale', or `mono'. + +`background' (what color is used for the background text) + Should be one of `light' or `dark'. + +Read the section about customization in the Emacs Lisp manual for more +information." + (nconc (list 'custom-declare-face (list 'quote face) spec doc) + ;; Quote colon keywords. + (let (rest) + (while args + (setq rest (cons (list 'quote (car args)) rest) + args (cdr args) + rest (cons (car args) rest) + args (cdr args))) + (nreverse rest)))) + +(defmacro-maybe define-widget (name class doc &rest args) + "Define a new widget type named NAME from CLASS. +The third argument DOC is a documentation string for the widget. + +This is a nop define-widget only for emulating purpose." + nil) + +(provide 'custom) + +(require 'product) +(product-provide (provide 'tinycustom) (require 'apel-ver)) + +;;; tinycustom.el ends here diff --git a/apel-10.7/tinyrich.el b/apel-10.7/tinyrich.el new file mode 100644 index 0000000..2cfee07 --- /dev/null +++ b/apel-10.7/tinyrich.el @@ -0,0 +1,169 @@ +;;; +;;; $Id: tinyrich.el,v 5.0 1995/09/20 14:45:56 morioka Exp $ +;;; +;;; by MORIOKA Tomohiko +;;; modified by YAMATE Keiichirou +;;; + +(defvar mime-viewer/face-list-for-text/enriched + (cond ((and (>= emacs-major-version 19) window-system) + '(bold italic fixed underline) + ) + ((and (boundp 'NEMACS) NEMACS) + '("bold" "italic" "underline") + ))) + +(defun enriched-decode (beg end) + (interactive "*r") + (save-excursion + (save-restriction + (narrow-to-region beg end) + (goto-char beg) + (while (re-search-forward "[ \t]*\\(\n+\\)[ \t]*" nil t) + (let ((str (buffer-substring (match-beginning 1) + (match-end 1)))) + (if (string= str "\n") + (replace-match " ") + (replace-match (substring str 1)) + ))) + (goto-char beg) + (let (cmd sym str (fb (point)) fe b e) + (while (re-search-forward "<\\(<\\|[^<>\n\r \t]+>\\)" nil t) + (setq b (match-beginning 0)) + (setq cmd (buffer-substring b (match-end 0))) + (if (string= cmd "<<") + (replace-match "<") + (replace-match "") + (setq cmd (downcase (substring cmd 1 (- (length cmd) 1)))) + ) + (setq sym (intern cmd)) + (cond ((eq sym 'param) + (setq b (point)) + (save-excursion + (save-restriction + (if (search-forward "" nil t) + (progn + (replace-match "") + (setq e (point)) + ) + (setq e end) + ))) + (delete-region b e) + ) + ((memq sym mime-viewer/face-list-for-text/enriched) + (setq b (point)) + (save-excursion + (save-restriction + (if (re-search-forward (concat "") nil t) + (progn + (replace-match "") + (setq e (point)) + ) + (setq e end) + ))) + (tm:set-face-region b e sym) + ))) + (goto-char (point-max)) + (if (not (eq (preceding-char) ?\n)) + (insert "\n") + ) + )))) + + +;;; @ text/richtext <-> text/enriched converter +;;; + +(defun richtext-to-enriched-region (beg end) + "Convert the region of text/richtext style to text/enriched style." + (save-excursion + (save-restriction + (narrow-to-region beg end) + (goto-char (point-min)) + (let (b e i) + (while (re-search-forward "[ \t]*" nil t) + (setq b (match-beginning 0)) + (delete-region b + (if (re-search-forward "[ \t]*" nil t) + (match-end 0) + (point-max) + )) + ) + (goto-char (point-min)) + (while (re-search-forward "\n\n+" nil t) + (replace-match "\n") + ) + (goto-char (point-min)) + (while (re-search-forward "[ \t\n]*[ \t\n]*" nil t) + (setq b (match-beginning 0)) + (setq e (match-end 0)) + (setq i 1) + (while (looking-at "[ \t\n]*[ \t\n]*") + (setq e (match-end 0)) + (setq i (1+ i)) + (goto-char e) + ) + (delete-region b e) + (while (>= i 0) + (insert "\n") + (setq i (1- i)) + )) + (goto-char (point-min)) + (while (search-forward "" nil t) + (replace-match "<<") + ) + )))) + +(defun enriched-to-richtext-region (beg end) + "Convert the region of text/enriched style to text/richtext style." + (save-excursion + (save-restriction + (goto-char beg) + (and (search-forward "text/enriched") + (replace-match "text/richtext")) + (search-forward "\n\n") + (narrow-to-region (match-end 0) end) + (let (str n) + (goto-char (point-min)) + (while (re-search-forward "\n\n+" nil t) + (setq str (buffer-substring (match-beginning 0) + (match-end 0))) + (setq n (1- (length str))) + (setq str "") + (while (> n 0) + (setq str (concat str "\n")) + (setq n (1- n)) + ) + (replace-match str) + ) + (goto-char (point-min)) + (while (search-forward "<<" nil t) + (replace-match "") + ) + )))) + + +;;; @ encoder and decoder +;;; + +(defun richtext-decode (beg end) + (save-restriction + (narrow-to-region beg end) + (richtext-to-enriched-region beg (point-max)) + (enriched-decode beg (point-max)) + )) + +;; (defun richtext-encode (beg end) +;; (save-restriction +;; (narrow-to-region beg end) +;; (enriched-encode beg (point-max)) +;; (enriched-to-richtext-region beg (point-max)) +;; )) + + +;;; @ end +;;; + +(require 'product) +(product-provide (provide 'tinyrich) (require 'apel-ver)) + +;; tinyrich.el ends here. diff --git a/flim-1.14.9/ChangeLog b/flim-1.14.9/ChangeLog new file mode 100644 index 0000000..d20dbd2 --- /dev/null +++ b/flim-1.14.9/ChangeLog @@ -0,0 +1,4512 @@ +2007-11-28 MORIOKA Tomohiko + + * FLIM: Version 1.14.9 (Goj-D) released.-A + +2006-12-20 MORIOKA Tomohiko + + * mime-def.el (mime-library-product): Update to 1.14.9. + +2007-06-18 Wencheng Fang + + * mel.el (mime-write-decoded-region): Define method function that + uses built-in base64-decode-region. [cf. ] + +2006-12-20 MORIOKA Tomohiko + + * README.ja, README.en (Installation): Update required version of + APEL to 10.7 or later. + + * FLIM-CFG (PACKAGEDIR): Use + `install-get-default-package-directory'. + +2006-12-13 Katsumi Yamaoka + + * FLIM-CFG (PACKAGEDIR): Avoid an error with Emacs. + +2006-12-12 Katsumi Yamaoka + + * FLIM-MK (compile-flim-package): Use + batch-update-directory-autoloads if it is available instead of + batch-update-directory. + +2006-12-11 Katsumi Yamaoka + + * FLIM-CFG (PACKAGEDIR): Check for + (early|late|last)-package-hierarchies and configure-package-path + as well as (early|late|last)-packages. + +2006-09-24 Daiki Ueno + + * smtp.el (smtp-progress-message-format): Abolished; reverted the + change 2004-08-11 Katsumi Yamaoka . + +2006-09-24 Daiki Ueno + + * smtp.el (smtp-end-of-line): Abolished; reverted the change + 2002-07-24 Katsumi Yamaoka . + +2006-06-15 Yoichi NAKAYAMA + + * smtp.el (smtp-submit-package): Ignore error in + `smtp-primitive-quit' where SMTP mail transaction is completed. + +2006-06-12 Hiroya Murata + + * mel-b-ccl.el (base64-ccl-insert-encoded-file): Use + `insert-file-contents-as-binary' instead of `insert-file-contents'. + + * mel-q-ccl.el (quoted-printable-ccl-insert-encoded-file): + Likewise. + +2006-02-18 Hiroya Murata + + * smtp.el (smtp-debug): New user option. + (smtp-read-response): Treat a line break code loosely. If + smtp-debug is non-nil, show an invalid response. + +2005-12-25 Katsumi Yamaoka + + * eword-decode.el: Change the way to decode successive + encoded-words: decode B- or Q-encoding in each encoded-word, + concatenate them, and decode it as charset. See the following + threads for more information: + http://news.gmane.org/group/gmane.emacs.pretest.bugs/thread=9541 + http://news.gmane.org/group/gmane.emacs.gnus.general/thread=61176 + (eword-decode-allow-incomplete-encoded-text): New variable. + (eword-decode-encoded-words): New function. + (eword-decode-string): Use it. + (eword-decode-region): Use it. + (eword-analyze-encoded-word): Use it. + (eword-decode-encoded-word): Abolish. + (eword-decode-encoded-text): Abolish. + (eword-decode-encoded-word-error-handler): Abolish. + (eword-warning-face): Abolish. + (eword-decode-encoded-word-default-error-handler): Abolish. + + +2005-12-25 MORIOKA Tomohiko + + * FLIM: Version 1.14.8 (Shij-D) released.-A + +2005-12-25 MORIOKA Tomohiko + + * mime-def.el (mime-library-product): Update to 1.14.8. + +2005-11-13 Yoichi NAKAYAMA + + * std11.el (std11-addr-to-string): Reconstruct domain literal. + From Yuuichi Teranishi [cf. ] + +2005-07-25 Daiki Ueno + + * smtp.el (smtp-read-response): Signal an error if connection is + closed while reading response. From Hiroya Murata + [cf. ] + +2004-11-20 Daiki Ueno + + * ntlm.el (ntlm-ascii2unicode): Don't apply zerop to a character. + (ntlm-smb-hash): Ditto. + + +2004-10-01 MORIOKA Tomohiko + + * FLIM: Version 1.14.7 (Sanj-D) released.-A + +2004-10-01 MORIOKA Tomohiko + + * mime-def.el (mime-library-product): Update to 1.14.7. + +2004-09-27 Katsumi Yamaoka + + * mime-en.sgml, mime-ja.sgml (CVS based development): Remove the + description about developers' pserver access. + +2004-09-02 Katsumi Yamaoka + + * sha1-dl.el: Don't provide the sha1-dl feature twice. + (sha1-region): Allow the optional argument `binary'. + (sha1): Ditto. + +2004-08-11 Katsumi Yamaoka + + * smtp.el (smtp-parse-progress-message-format): Fix regexp usage. + +2004-08-11 Katsumi Yamaoka + + * smtp.el (smtp-progress-message-format): New user option. + (smtp-primitive-data): Show progress message. + (smtp-parse-progress-message-format): New function. + (smtp-show-progress-message): New function. + (smtp-deduce-address-list): Use insert instead of insert-string. + +2004-07-27 Yoichi NAKAYAMA + + * mel-g.el (gzip64-external-encoder): Change default value to + cause more recognizable error. + (gzip64-external-decoder): Ditto. + +2004-06-09 Yoichi NAKAYAMA + + * std11.el (std11-parse-word-or-comment-or-period): Renamed from + `std11-parse-word-or-comment' and allow period. + (std11-parse-phrase): Allow parsing obs-phrase in rfc2822. + +2004-05-24 Len Trigg + + * mime-conf.el (mime-format-mailcap-command): Quote a file name + which may contain spaces using `shell-quote-argument' in order to + pass it to the shell safely. + +2004-05-10 Katsumi Yamaoka + + * eword-encode.el (mime-encode-header-in-buffer): Don't ignore a + space char at the beginning of a field body in order to honor the + 76-column rule which is described in RFC 2047 section 2. + +2004-04-15 MORIOKA Tomohiko + + * eword-decode.el (eword-decode-encoded-text): Fix bug when + `must-unfold' is specified; eliminate CR too when `must-unfold' is + specified. + +2004-04-13 Kenichi Okada + + * mel-u.el (mime-write-decoded-region): Use make-temp-file. + (uuencode-external-decode-region): Ditto. + +2004-04-12 Kenichi Okada + + * mel-u.el (mime-write-decoded-region): Use temporary filename. + +2004-03-05 Jesper Harder + + * sha1-el.el (sha1-maximum-internal-length): Doc fix. + +2004-02-23 TAKAHASHI Kaoru + + * lunit.el (lunit-make-test-suite-from-class): Fix regexp. + Use "^test" instead of "^test-". + +2004-02-19 TAKAHASHI Kaoru + + * lunit.el (lunit-assert): Avoid double-eval `condtion-expr'. + Use ,(not (not condition)) instead of ,condition. + +2004-02-18 TAKAHASHI Kaoru + + * lunit.el (lunit-make-test-suite-from-class): Restrict test + method name to test-*. + +2004-02-17 Daiki Ueno + + * smtp.el (smtp-starttls-program): New user option. + (smtp-starttls-extra-args): New user option. + (smtp-send-buffer): Bind starttls-program and starttls-extra-args. + +2004-01-27 Yuuichi Teranishi + + * mel-q.el (quoted-printable-external-decoder-option-to-specify-file): + Accept nil. + (mime-write-decoded-region): If the value of the variable + `quoted-printable-external-decoder-option-to-specify-file' is nil, + write stdout to the output file. + + * mel-b-el.el (base64-external-decoder-option-to-specify-file): + Accept nil. + (base64-write-decoded-region): If the value of the variable + `base64-external-decoder-option-to-specify-file' is nil, write + stdout to the output file. + +2004-01-12 Daiki Ueno + + * sasl.texi: Texinfo markup fixes. From Jesper Harder + . + +2004-01-07 Katsumi Yamaoka + + * sha1-el.el (sha1-string-external): Use with-temp-buffer. + +2004-01-07 Katsumi Yamaoka + + * sha1-el.el (sha1-string-external): Make it can return a string + in binary form. + (sha1-region-external): Ditto. + (sha1-string-internal): Ditto. + (sha1-region-internal): Ditto. + (sha1-region): Ditto. + (sha1-string): Ditto. + (sha1): Ditto. + +2003-12-16 Simon Josefsson + + * sha1-el.el (autoload): Don't use ignore-errors. + (sha1-use-external): Use condition-case. Suggested by Katsumi + Yamaoka . + +2003-12-15 Simon Josefsson + + * sha1-el.el (autoload): Ignore errors for + executable-find. (XEmacs ecrypto does not require sh-script where + executable.el is located.) + (sha1-use-external): Likewise. + + * sha1-el.el (sha1): Add defgroup. + (sha1-maximum-internal-length, sha1-program, sha1-use-external) + (sha1-program): Use 'sha1sum' from GNU CoreUtils instead of OpenSSL. + (sha1): Autoload. + +2001-12-29 ShengHuo ZHU + + * sha1-el.el (sha1-use-external): New variable. + (sha1-region): Use it. + (sha1-string): Ditto. + +2004-01-05 Katsumi Yamaoka + + * ntlm.el (ntlm-string-as-unibyte): New macro. + (ntlm-build-auth-response): Use it. + +2004-01-05 Simon Josefsson + + * ntlm.el: Fix namespace. Change smb-passwd-hash into + ntlm-smb-passwd-hash, smb-owf-encrypt into ntlm-smb-owf-encrypt, + smb-passwd-hash into ntlm-smb-passwd-hash, smbdes-e-p16 into + ntlm-smb-des-e-p16, smbdes-e-p24 into ntlm-smb-des-e-p24, smbhash + into ntlm-smb-hash, smb-sp8 into ntlm-smb-sp8, smb-str-to-key into + ntlm-smb-str-to-key, smb-dohash into ntlm-smb-dohash, smb-perm1 + into ntlm-smb-perm1, smb-perm2 into ntlm-smb-perm2, smb-perm3 into + ntlm-smb-perm3, smb-perm4 into ntlm-smb-perm4, smb-perm5 into + ntlm-smb-perm5, smb-perm6 into ntlm-smb-perm6, smb-sc into + ntlm-smb-sc, smb-sbox into ntlm-smb-sbox, string-permute into + ntlm-string-permute, string-lshift into ntlm-string-lshift, + string-xor into ntlm-string-xor. Suggested by + Jesper Harder . + + * ntlm.el: Don't include poem. + + * md4.el (print-int32, print-string-hexa): Remove. Suggested by + Jesper Harder . + + +2003-12-20 MORIOKA Tomohiko + + * FLIM: Version 1.14.6 (Marutamachi) released. + +2003-12-14 MORIOKA Tomohiko + + * mime-def.el (mime-header-accept-quoted-encoded-words): Change + default value to nil. + +2003-03-10 MORIOKA Tomohiko + + * eword-decode.el (eword-analyze-quoted-string): Decode + quoted-encoded-words when + `mime-header-accept-quoted-encoded-words' is not nil. + + * mime.el (mime-entity-filename): Decode quoted-encoded-words when + `mime-header-accept-quoted-encoded-words' is not nil. + + * mime-def.el (mime-header-accept-quoted-encoded-words): New user + option. + +2003-12-14 Tatsuya Kinoshita + + * eword-encode.el (mime-header-charset-encoding-alist): Add + entry for iso-8859-1[45]. + +2003-11-13 Yoichi NAKAYAMA + + * FLIM-ELS (flim-modules): Install mel-b-el also for + mel-b-builtin case. (from Tatsuya Kinoshita) + +2003-09-18 Yoichi NAKAYAMA + + * FLIM-ELS (flim-modules): Don't install smtpmail. + +2003-04-30 Yoichi NAKAYAMA + + * std11.el (std11-field-end): Return end of field correctly + even in case of existence of invisible header. + +2003-02-05 Yoichi NAKAYAMA + + * eword-encode.el (mime-encode-header-in-buffer): + Do not eliminate white spaces. + +2002-11-05 MORIOKA Tomohiko + + * eword-encode.el (tm-eword::words-to-ruled-words): New + implementation for UTF-2000 implementations. + + +2002-12-27 MORIOKA Tomohiko + + * FLIM: Version 1.14.5 (Demachiyanagi) released. + +2002-11-15 Katsumi Yamaoka + + * smtp.el (smtp-send-buffer): Error if `smtp-server' is nil. + +2002-11-15 Yoichi NAKAYAMA + + * FLIM-ELS (flim-version-specific-modules): Don't install mailcap.el. + * FLIM-MK (install-flim): Avoid creating empty directory. + +2002-11-06 Yoichi NAKAYAMA + + * mime-parse.el (mime-parse-buffer): Require mmbuffer. + +2002-09-26 TSUCHIYA Masatoshi + + * luna.el (luna-define-method): Clear method cache of child + classes. + +2002-09-24 TSUCHIYA Masatoshi + + * mime-ja.texi (CVS): Escape @. + + * luna.el (luna-define-method): Fix the bug that method cache is + not cleard. + +2002-09-14 KOSEKI Yoshinori + + * mime-en.texi (CVS): Fix Typo. (@ to @@). + mime-ja.texi (CVS): Ditto. + +2002-08-26 MORIOKA Tomohiko + + * std11.el: Update Copyright header. + +2002-07-30 MORIOKA Tomohiko + + * std11.el (std11-non-atom-regexp): New constant. + (std11-analyze-atom): New implementation to avoid error in current + XEmacs UTF-2000 [may be caused by a bug about regexp]. + +2002-07-26 Katsumi Yamaoka + + * smtp.el (smtp-open-connection-function): Add doc. + (smtp-end-of-line): Doc fix. + +2002-07-24 Katsumi Yamaoka + + * smtp.el (smtp-end-of-line): New variable. + (smtp-read-response): Use it. + (smtp-send-command): Use it. + (smtp-send-data): Use it. + + +2002-06-03 MORIOKA Tomohiko + + * FLIM: Version 1.14.4 (Kashiharajing-D-mae) released.-A + +2002-01-16 Hiroya Murata + + * luna.el (luna-class-find-member): Don't search parents' + method-spaces. + +2002-02-01 Kenichi OKADA + + * eword-encode.el (mime-header-encode-method-alist): New variable. + (mime-encode-field-body): Use `mime-header-encode-method-alist'. + (mime-encode-header-in-buffer): Error if cannot encode. + +2001-11-19 Kenichi OKADA + + * smtp.el (smtp-find-server): Fix. + +2001-11-18 Kenichi OKADA + + * smtp.el (smtp-send-by-myself): Fix. + +2001-11-18 Kenichi OKADA + + * smtp.el (smtp-send-by-myself): New variable. + (smtp-use-starttls-ignore-error): New variable. + (smtp-find-mx): New function. + (smtp-dig): New function. + (smtp-find-server): New function. + (smtp-send-buffer-by-myself): New funcion. + (smtp-send-buffer): Change for `smtp-send-buffer-by-myself'. + +2001-11-03 Shuhei KOBAYASHI + + * hmac-md5.el: Removed kludge for Emacs 21 prerelease versions. + +2001-09-21 Kenichi OKADA + + * smtp.el(smtp-submit-package): Check extensions for starttls. + +2001-07-16 Katsumi Yamaoka + + * smtpmail.el (smtpmail-send-it): Work even if the first line of + the subject field has no content (synch with Emacs 20.3). + +2001-07-30 AMAKAWA Shuhei + + * smtp.el (smtp-submit-package): Send EHLO after starttls. + + +2001-06-01 MORIOKA Tomohiko + + * FLIM: Version 1.14.3 (Unebigory-Dmae) released.-A + +2001-06-01 Katsumi Yamaoka + + * mel-b-el.el: Require `pces' for the macro `as-binary-process' + when compiling. + + * mel-q.el: Add a comment that the feature `poem' is also required + for the macro `as-binary-process'. + +2001-05-31 Shuhei KOBAYASHI + + Merged MIME Parameter Value decoder. + + * mime-parse.el (mime-decode-parameters): Renamed from + `mime-decode-parameter-plist'. + (mime-decode-parameter-alist): Removed. + (mime-decode-alist-to-plist): Ditto. + + * FLIM-API.en (mime-entity-encoding): Abolish optional argument + `default-encoding'. + (mime-parse-Content-Tranfer-Encoding): Ditto. + +2001-05-02 Shuhei KOBAYASHI + + * eword-decode.el (eword-decode-encoded-word): Don't use `let'. + + * mime-parse.el (mime-decode-parameter-plist): Modified + description of return value. + (mime-parse-Content-Type): Ditto. + (mime-read-Content-Type): Ditto. + (mime-parse-Content-Disposition): Ditto. + (mime-read-Content-Disposition): Ditto. + (mime-parse-Content-Transfer-Encoding): Ditto. + (mime-read-Content-Transfer-Encoding): Ditto. + +2001-05-01 Shuhei KOBAYASHI + + * mime-parse.el (mime-parse-parameters): Don't use `equal' for + strings. + (mime-parse-Content-Type): Ditto. + +2001-04-30 Shuhei KOBAYASHI + + * mime-parse.el (mime-decode-parameter-value): Use one temporary + buffer. + (mime-decode-parameter-plist): Changed internal data structure. + +2001-04-28 Shuhei KOBAYASHI + + * eword-decode.el (eword-encoded-word-regexp): Match for language. + (eword-decode-region): Refer the 7th parens, not 6th. + (eword-decode-encoded-word): Extract language information. + (eword-decode-encoded-text): New optional argument `language'. + + * mime-def.el (mime-charset-regexp): Updated for RFC2231. + + * mime-parse.el (mime-decode-parameter-plist): Fix regexp. + Use symbol for language information. + + * tests/test-rfc2231.el: Renamed all testcases. + +2001-04-27 Shuhei KOBAYASHI + + * mime-parse.el (mime-decode-parameter-value): Don't use + `int-char'. + +2001-04-27 Shuhei KOBAYASHI + + * mime.el (mime-entity-read-field): Would capitalize twice. + + * mmbuffer.el (mime-entity-fetch-field): Ditto. + + * mmexternal.el (mime-entity-fetch-field): Ditto. + + * mmgeneric.el (mime-entity-fetch-field): Ditto. + +2001-04-26 Shuhei KOBAYASHI + + * mime-parse.el (mime-decode-parameter-plist): Modified + description of return value. + (mime-parse-Content-Type): Ditto. + (mime-read-Content-Type): Ditto. + (mime-parse-Content-Disposition): Ditto. + (mime-read-Content-Disposition): Ditto. + (mime-read-Content-Transfer-Encoding): Ditto. + +2001-04-25 Shuhei KOBAYASHI + + * mime-parse.el (mime-lexical-analyze): Removed comments. + +2001-04-22 Shuhei KOBAYASHI + + * mime-parse.el (mime-decode-parameter-value): New + implementation; use temporary buffer for conversion. + (mime-decode-parameter-encode-segment): Ditto. + (mime-decode-parameter-plist): Would put empty language info. + + * test/test-rfc2231.el (test-rfc2231-10, test-rfc2231-11, + test-rfc2231-12): New testcases for language info. + +2001-04-22 Shuhei KOBAYASHI + + * mime-parse.el: Fixed comments. + + * test/test-rfc2231.el (test-rfc2231-9): New testcase. + +2001-04-22 Shuhei KOBAYASHI + + * test/test-rfc2231.el (test-rfc2231-7, test-rfc2231-8): + New testcases. + +2001-04-22 Shuhei KOBAYASHI + + * mime-def.el (mime-content-type-parameter): Expand + `mime-content-type-parameters'. + + * mime-parse.el (mime-parse-Content-Disposition): Add + description of return value to the docstring. + (mime-parse-Content-Transfer-Encoding): Ditto. + + * test/test-rfc2231.el: Made independent of internal + representation of Content-Type. + +2001-04-22 Shuhei KOBAYASHI + + * FLIM-MK (check-flim): Limit filename of test files. + + * test/test-rfc2231.el: New file. + +2001-04-19 Shuhei KOBAYASHI + + * mime-parse.el (mime-decode-parameter-plist): Shortcut for + parameters without extensions. + +2001-04-19 Shuhei KOBAYASHI + + * mime-def.el (make-mime-content-type): Don't reverse parameters. + (make-mime-content-disposition): New function. + + * mime-parse.el (mime-decode-parameter-value): Removed comments. + (mime-decode-parameter-encode-segment): New function. + (mime-decode-parameter-plist): New implementation. + Switched from decode-then-concat to concat-then-decode model. + (mime-parse-parameters): Strip quoted-pair in quoted-string. + (mime-parse-Content-Type): Use `make-mime-content-type'. + (mime-parse-Content-Disposition): Use + `make-mime-content-disposition'. + +2001-04-15 Shuhei KOBAYASHI + + * eword-decode.el (eword-lexical-analyze-internal): + Fix typo. [cf. ] + +2001-04-11 Shuhei KOBAYASHI + + * mime-parse.el (mime-decode-parameter-value): Allow lowercase. + (mime-decode-parameter-plist): Ditto. + +2001-04-10 Akihiro Arisawa + + * std11.el (std11-lexical-analyze): Fix typo. + +2001-04-01 Daiki Ueno + + * lunit.el (lunit-test-listener-*): Abolish generic interface. + (lunit-test-result-notify): New function. + (lunit-test-result-run): Use it. + (lunit-test-result-error): Use it. + (lunit-test-result-failure): Use it. + (lunit-create-index-function): New function. + (lunit-generate-template): New command. + +2001-03-19 Shuhei KOBAYASHI + + * hmac-md5.el, hmac-sha1.el: Revert to load-time check. + Don't require 'poe. + +2001-03-18 Shuhei KOBAYASHI + + * mel-b-dl.el: Don't do `dynamic-call' at compile-time. + (base64-dl-handle): Don't eval at compile-time. + +2001-03-18 Shuhei KOBAYASHI + + * hmac-md5.el, sha1.el: Update Copyright header. + +2001-03-18 Shuhei KOBAYASHI + + Support for built-in `md5' of Emacs 21. + + * md5.el (md5-dl-module): Moved from md5-dl.el. + Use it for test whether to require 'md5-dl. + + * md5-dl.el: Removed hack for compiler. + (md5-dl-handle): Do `dynamic-link' unconditionally. + (md5-region): Not interactive. + (md5): Removed autoload cookie. + + * sha1.el: Removed hack for compiler. + Use `sha1-dl-module' for test whether to require 'sha1-dl. + (sha1-encode, sha1-encode-binary): Removed compatibility code + for another sha1.el since it was broken. + + * sha1-dl.el: Removed hack for compiler. + (sha1-dl-handle): Do `dynamic-link' unconditionally. + +2001-03-18 Shuhei KOBAYASHI + + * hmac-md5.el: Require 'poe. + Provide 'md5 if built-in `md5' is found. + (md5-binary): Define with `defun-maybe-cond'. + (md5-binary) [v21]: Removed extra arguments. + (hmac-md5-96): New function. + + * hmac-sha1.el: Require 'poe. + (sha1-binary): Define with `defun-maybe'. + (hmac-sha1-96): New function. + +2001-03-11 Shuhei KOBAYASHI + + * mel-g.el: Update Copyright header. + +2001-03-09 Akihiro Arisawa + + * mime.el (mime-find-root-entity): Find root recursively. + +2001-02-26 Shuhei KOBAYASHI + + * hmac-md5.el, hmac-sha1.el: Modify comments. + +2001-02-25 Shuhei KOBAYASHI + + * hex-util.el, hmac-def.el, hmac-md5.el, hmac-sha1.el, + md5-dl.el, md5.el, sha1-dl.el, sha1-el.el, sha1.el: + Update Copyright header. + +2001-02-28 Shuhei KOBAYASHI + + * mime-parse.el (mime-decode-parameter-plist, + mime-decode-parameter-alist, mime-decode-parameters): + Add doc string. + +2001-02-28 Shuhei KOBAYASHI + + * mime-parse.el (mime-decode-parameter-value): Decode MIME charset + in multibyte buffer. [cf. ] + (mime-decode-parameter-plist): Downcase attributes. + [cf. ] + (mime-decode-parameters): Alias for `mime-decode-parameter-plist' + instead of `mime-decode-parameter-alist'. + Add autoload cookie. + (mime-parse-parameters-from-list): Make obsolete. + (mime-parse-parameters): Return results as a plist. + (mime-parse-Content-Type, mime-read-Content-Type): Moved type check + to the caller side. + (mime-parse-Content-Disposition, mime-read-Content-Disposition): + Ditto. + (mime-parse-Content-Transfer-Encoding, + mime-read-Content-Transfer-Encoding): Ditto. + +2001-02-27 Shuhei KOBAYASHI + + MIME Parameter Value decoder support. + + * mime-def.el (std11-quoted-pair-regexp, std11-non-qtext-char-list, + std11-qtext-regexp, std11-quoted-string-regexp): Removed. + (mime-media-type/subtype-regexp): Ditto. + (mime-attribute-char-regexp, mime-language-regexp, + mime-encoding-regexp): New constants. + + * mime-parse.el (mime-lexical-analyze): New function. + (mime/content-parameter-value-regexp, mime::parameter-regexp): + Removed. + (mime-parse-parameter): Ditto. + (mime-decode-parameter-value, mime-decode-parameter-plist, + mime-parse-alist-to-plist, mime-decode-parameter-alist): + New functions. + (mime-parse-parameters-from-list): New alias for + `mime-decode-parameter-plist'. + (mime-decode-parameters): New alias for + `mime-decode-parameter-alist'. + (mime-parse-parameters): New function. + (mime-disposition-type-regexp): Removed. + (mime-parse-Content-Type, mime-parse-Content-Disposition, + mime-parse-Content-Transfer-Encoding): New implementation. + (mime-read-Content-Type, mime-read-Content-Disposition, + mime-read-Content-Transfer-Encoding): Ditto. + +2001-02-26 Shuhei KOBAYASHI + + * hmac-md5.el, hmac-sha1.el: Modify comments. + +2001-02-25 Shuhei KOBAYASHI + + * hex-util.el, hmac-def.el, hmac-md5.el, hmac-sha1.el, + md5-dl.el, md5.el, sha1-dl.el, sha1-el.el, sha1.el: + Update Copyright header. + +2001-02-20 Kenichi OKADA + + * tests/test-sasl.el(test-sasl-ntlm-imap): Fix + `sasl-read-passphrase' + +2001-02-20 Kenichi OKADA + + * tests/test-sasl.el(test-sasl-ntlm-imap): Change name. + Delete wrong lines. + +2001-02-20 Taro Kawagishi + + * tests/test-sasl.el(test-sasl-digest-ntlm-imap): New test. + +2001-02-17 Kenichi OKADA + + * sasl-ntlm.el(sasl-ntlm-response): self-Hash. + +2001-02-17 Kenichi OKADA + + * ntlm.el(smb-passwd-hash): Fix `upcase' for XEmacs. + +2001-02-17 Kenichi OKADA + + * ntlm.el(TopLevel): Require `poem' + (ntlm-build-auth-request): Omit `request-bufIndex' + (ntlm-build-auth-response): Omit `response', `ident' and `msgType' + Use `string-as-unibyte' of `poem'. + +2001-02-17 Kenichi OKADA + + * sasl-scram.el(sasl-scram-md5-parse-server-msg-1): Error + if server's response cannot be parsed. + +2001-02-17 Kenichi OKADA + + * sasl-scram.el(sasl-scram-md5-server-salt): New function. + (sasl-scram-md5-response-2): Use `sasl-scram-md5-server-salt' + +2001-02-17 Kenichi OKADA + + * sasl-scram.el(sasl-scram-md5-make-unique-nonce): Rewrite. + +2001-02-17 Kenichi OKADA + + * sasl-scram.el: Add comment. + (sasl-scram-md5-steps): New variable. + (sasl-scram-md5-make-client-msg-1): Add optional nonce. + (sasl-scram-md5-make-client-msg-2): New function. + (sasl-scram-md5-make-server-msg-2): Rewrite. + (sasl-scram-md5-response-1): New function. + (sasl-scram-md5-response-2): New function. + (sasl-scram-md5-authenticate-server): New function. + * test/test-sasl.el(test-sasl-scram-md5-imap): New function. + +2001-02-16 Kenichi OKADA + + * sasl-scram.el: rename from scram-md5.el + (TopLevel): Provide `sasl-scram'. + Fix prefix. + Fix comments. + require `sasl'. + (sasl-scram-make-unique-nonce): use `sasl-unique-id'. + (sasl-scram-md5-unique-id-function): New variable. + * sasl.el(sasl-mechanisms): Add SCRAM-MD5. + (sasl-mechanism-alist): Ditto. + +2001-02-16 Kenichi OKADA + + * md4.el(md4-pack-int16): Taken form ntlm.el + (md4-pack-int32): Ditto. + (md4-unpack-int16): Ditto. + (md4-unpack-int32): Ditto. + * ntlm.el (pack-int16): Delete. + (pack-int32): Delete. + (unpack-int16): Delete. + (unpack-int32): Delete. + +2001-02-16 Kenichi OKADA + + * sasl.el(sasl-mechanisms): Add NTLM. + (sasl-mechanism-alist): Add NTLM. + +2001-02-16 Kenichi OKADA + + * test/test-sasl.el: New file. + +2001-02-16 Taro Kawagishi + + * md4.el: New file. + * ntlm.el: New file. + * sasl-ntlm.el: New file. + +2000-12-27 MORIOKA Tomohiko + + * mime-conf.el (mime-mailcap-file): Turn to non user option. + + +2000-12-25 MORIOKA Tomohiko + + * FLIM: Version 1.14.2 (Yagi-Nishiguchi) released. + +2000-12-23 MORIOKA Tomohiko + + * smtpmail.el (smtpmail-send-it): Use + `binary-write-decoded-region' instead of `binary-write-region'. + + * mmexternal.el (mmexternal-require-buffer): Use + `binary-insert-encoded-file' instead of + `binary-insert-file-contents'. + (mime-write-entity-body): Use `binary-write-decoded-region' + instead of `binary-write-region'. + + * mmbuffer.el (mime-write-entity-body): Use + `binary-write-decoded-region' instead of `binary-write-region'. + + * mel.el: - Don't require `raw-io'. + (8bit-insert-encoded-file): New function. + (8bit-write-decoded-region): New function. + (7bit-insert-encoded-file): New alias. + (7bit-write-decoded-region): New alias. + (binary-insert-encoded-file): New alias. + (binary-find-file-noselect): New function. + (binary-funcall): New function. + (binary-to-text-funcall): New function. + (mime-insert-encoded-file of "base64"): Use + `binary-insert-encoded-file' instead of + `binary-insert-file-contents'. + + * FLIM-API.en (base64-decode-string): New function. + (base64-encode-string): New function. + (ENCODING-write-decoded-region): New function. + (ENCODING-insert-encoded-file): New function. + + * raw-io.el: Deleted. + + * FLIM-ELS (flim-modules): Delete `raw-io'. + +2000-12-22 MORIOKA Tomohiko + + * smtp.el (smtp-open-connection-function): Revert initial value to + `open-network-stream'. + (qmtp-open-connection): Use `binary-funcall'. + + * qmtp.el (qmtp-open-connection-function): Revert initial value to + `open-network-stream'. + (qmtp-send-buffer): Use `binary-funcall'. + +2000-12-23 OKAZAKI Tetsurou + + * FLIM-ELS (flim-modules): Delete `mmdbuffer'. + + +2000-12-22 MORIOKA Tomohiko + + * FLIM: Version 1.14.1 (Yagi) released. + +2000-12-22 Keiichi Suzuki + + * mel-q.el: Require `poem' for `string-to-char-list' when + compiling. + +2000-12-22 MORIOKA Tomohiko + + * eword-decode.el (eword-decode-header): Revert to obsolete alias. + +2000-12-22 MORIOKA Tomohiko + + * mmgeneric.el: Add comment for eword-decode. + +2000-12-21 MORIOKA Tomohiko + + * mailcap.el: Require `poe' for `define-obsolete-function-alias'. + +2000-12-21 Daiki Ueno + + * smtp.el (smtp-send-buffer): Add DOC. + (smtp-via-smtp): Add DOC. + + * FLIM-API.en (QMTP): Remove section. + (smtp-send-buffer): Add description. + (smtp-via-smtp): Likewise. + + +2000-12-20 MORIOKA Tomohiko + + * FLIM: Version 1.14.0 (Ninokuchi) released. + + * mime.el (mime-entity-media-type): Add DOC. + (mime-entity-media-subtype): Add DOC. + (mime-entity-parameters): Add DOC. + (mime-entity-type/subtype): Add DOC. + + * FLIM-API.en: Add some usages. + (mime-entity-media-type): New description. + (mime-entity-media-subtype): Likewise. + (mime-entity-type/subtype): Likewise. + (mime-entity-parameters): Likewise. + +2000-12-20 MORIOKA Tomohiko + + * eword-encode.el (eword-encode-text): Specify `mode' of + `encoded-text-encode-string'. + + * mel.el (encoded-text-encode-string): Add optional argument + `mode'; use `base64-encode-string' directly for "B"-encoding. + +2000-12-20 MORIOKA Tomohiko + + * FLIM-API.en: Renamed from FLIM-1.14-API.en; reordered and add + some sections. + + * mime.el (mime-entity-set-content-type): Add DOC. + (mime-entity-set-encoding): Add DOC. + + * mime-def.el (mime-content-type-subtype): Fix DOC. + (mime-content-type-parameters): Fix DOC. + +2000-12-19 MORIOKA Tomohiko + + * FLIM-1.14-API.en: New file. + + * smtp.el (smtp-open-connection-function): Add autoload cookie. + + * qmtp.el (qmtp-open-connection-function): Add autoload cookie. + + * mime.el (mime-entity-children): Add DOC. + (mime-entity-node-id): Add DOC. + (mime-entity-content-type): Add DOC. + (mime-entity-content-disposition): Add DOC. + (mime-entity-encoding): Add DOC. + +2000-12-19 MORIOKA Tomohiko + + * mime.el (mime-encode-field-body): Add autoload setting. + + * eword-encode.el (mime-encode-field-body): Renamed from + `eword-encode-field-body'; declare `eword-encode-field-body' as + obsolete alias. + (mime-encode-header-in-buffer): Use `mime-encode-field-body' + instead of `eword-encode-field-body'. + +2000-12-19 MORIOKA Tomohiko + + * mime.el (mime-encode-header-in-buffer): Renamed from + `eword-encode-header'. + + * mmdbuffer.el: Deleted. + + * mime-def.el (mime-header): New group. + (mime-field-decoding-max-size): New user option [moved from + eword-decode.el]. + (mime-field-encoding-method-alist): New user option [moved from + eword-encode.el]. + + * eword-encode.el (eword-field-encoding-method-alist): Moved to + mime-def.el and renamed to `mime-field-encoding-method-alist'. + (mime-header-charset-encoding-alist): Renamed from + `eword-charset-encoding-alist'. + (mime-header-default-charset-encoding): New variable. + (ew-find-charset-rule): Use + `mime-header-default-charset-encoding'. + (eword-in-subject-p): Declare as obsolete function. + (mime-encode-header-in-buffer): Renamed from + `eword-encode-header'; declare `eword-encode-header' as obsolete + alias. + + * eword-decode.el (eword-max-size-to-decode): Moved to mime-def.el + and renamed to `mime-field-decoding-max-size'. + (mime-header-lexical-analyzer): Renamed from + `eword-lexical-analyzer'; switch to variable. + + * FLIM-ELS (flim-modules): Add `raw-io'. + +2000-12-19 MORIOKA Tomohiko + + * eword-encode.el (eword-encode-default-start-column): Switch to + variable. + +2000-12-19 MORIOKA Tomohiko + + * raw-io.el (start-process): New function. + (binary-start-process-shell-command): New function. + +2000-12-17 MORIOKA Tomohiko + + * mel-g.el (gzip64-external-encode-region): Don't use + `as-binary-process'; comment out code to regularize line break + code for OS/2 [if it is needed, it is better to implement by + coding-system]. + (gzip64-external-decode-region): Don't use `as-binary-process'. + (mime-write-decoded-region): Likewise. + + * mime-parse.el: Require `luna'. + +2000-12-16 MORIOKA Tomohiko + + * eword-encode.el (eword-encode-divide-into-charset-words): Use + `aref' instead of `sref'. + (ew-encode-rword-1): Use `1+' instead of `char-next-index'. + (eword-encode-phrase-to-rword-list): Use `find-charset-string' + instead of `find-non-ascii-charset-string'. + (eword-encode-addr-seq-to-rword-list): Don't use `butlast'. + (eword-encode-header): Use `find-charset-region' instead of + `find-non-ascii-charset-string'. + + * mel.el: Require `raw-io'. + + * mime-def.el (binary-insert-file-contents): Moved to raw-io.el. + (binary-write-region): Likewise. + + * mmbabyl.el (mime-write-entity): Use `raw-message-write-region' + instead of `write-region-as-raw-text-CRLF'. + + * raw-io.el: New file. + + * smtpmail.el: - Require `raw-io'. + - Delete definition of obsolete variable aliases for XEmacs. + (smtpmail-send-queued-mail): Use `binary-find-file-noselect' + instead of `find-file-noselect-as-binary'. + + * smtp.el (smtp-open-connection-function): Use + `binary-open-network-stream' instead of `open-network-stream' as + initial value. + (smtp-open-connection): Don't guard as `binary'. + + * qmtp.el (qmtp-open-connection-function): Use + `binary-open-network-stream' instead of `open-network-stream' as + initial value. + (qmtp-send-buffer): Don't guard as `binary'. + +2000-12-15 MORIOKA Tomohiko + + * mime/eword-decode.el: Don't use + `define-obsolete-function-alias'; so `eword-decode-header' is + deleted. + + * mime/mmexternal.el: Don't require `pces'. + +2000-12-15 TAKAHASHI Kaoru + + * Makefile (tar): Use `cvs tag -R' instead of `cvs tag -RF'. + +2000-12-15 MORIOKA Tomohiko + + * mime-def.el (char-int): New alias. + + * eword-encode.el (eword-encode-divide-into-charset-words): Don't + use `char-length' and `char-next-index'. + +2000-12-15 Katsumi Yamaoka + + * eword-decode.el: Fix typo in doc-string of + `mime-set-field-decoder'. + +2000-12-15 MORIOKA Tomohiko + + * mel.el: Don't require `path-util'. + +2000-12-15 MORIOKA Tomohiko + + * std11.el, smtpmail.el, mime-def.el: Don't require `poe'. + + * mel.el: Don't require `poem'. + +2000-12-14 MORIOKA Tomohiko + + * mmexternal.el (mime-write-entity): Don't use + `write-region-as-raw-text-CRLF'. + (mmexternal-require-buffer): Use `binary-insert-file-contents' + instead of `insert-file-contents-as-binary'. + (mime-write-entity-body): Use `binary-write-region' instead of + `write-region-as-binary'. + + * smtpmail.el (smtpmail-send-it): Use `binary-write-region' + instead of `write-region-as-binary'. + + * smtp.el (smtp-open-connection): Don't use `as-binary-process'. + + * mel.el (mime-insert-encoded-file of "base64"): Use + `binary-insert-file-contents' instead of + `insert-file-contents-as-binary'. + (mime-insert-encoded-file of "7bit"): Use + `binary-insert-file-contents' instead of + `insert-file-contents-as-binary'. + (mime-write-decoded-region of "7bit"): Use `binary-write-region' + instead of `write-region-as-binary'. + + * mmbuffer.el (mime-write-entity-body): Use `binary-write-region' + instead of `write-region-as-binary'. + (mime-write-entity): Don't use `write-region-as-raw-text-CRLF'. + + * mime-def.el: Don't require `poem'. + (binary-insert-file-contents): New function. + (binary-write-region): New function. + + * mel-u.el (uuencode-external-encode-region): Don't use + `as-binary-process'. + (uuencode-external-decode-region): Don't use `as-binary-process' + and `as-binary-input-file'. + (mime-write-decoded-region): Don't use `as-binary-process'. + + * mel-q-ccl.el (quoted-printable-ccl-insert-encoded-file): Don't + use `insert-file-contents-as-coding-system'. + (quoted-printable-ccl-write-decoded-region): Don't use + `write-region-as-coding-system'. + + * mel-b-ccl.el (base64-ccl-insert-encoded-file): Don't use + `insert-file-contents-as-coding-system'. + (base64-ccl-write-decoded-region): Don't use + `write-region-as-coding-system'. + + * std11.el: Don't require `poem'. + (std11-parse-ascii-token): Don't use + `find-non-ascii-charset-string'. + + * qmtp.el: Don't require `poem'. + (qmtp-send-buffer): Don't use `as-binary-process'. + +2000-12-14 MORIOKA Tomohiko + + * mime-def.el, qmtp.el, smtp.el, smtpmail.el, std11.el: Require + `custom' instead of `pcustom'. + +2000-12-12 Daiki Ueno + + * sasl.el: Rewrite with luna. + +2000-12-06 Daiki Ueno + + * FLIM-ELS: Don't install md5-dl.el, md5-el.el, sha1-dl.el and + sha1-el.el if the running emacs has builtin message digest + functions. + + * md5-dl.el, sha1-dl.el: Don't bind `dynamic-link' and + `dynamic-call'. + + * md5.el (md5-dl-module): Moved from md5-dl.el. + * sha1.el: Don't bind `sha1-string'. + +2000-12-04 Daiki Ueno + + * README.ja, README.en (load-path): Remove section. + (What's FLIM): Specify prerequisite version of Emacsen. + +2000-11-21 Daiki Ueno + + * sasl.el (sasl-client-set-encoder): New function. + (sasl-client-set-decoder): New function. + (sasl-client-encoder): New function. + (sasl-client-decoder): New function. + + * sasl-digest.el: Require 'cl' when compiling. + (sasl-digest-md5-signing-encode-magic): New constant. + (sasl-digest-md5-signing-decode-magic): New constant. + (sasl-digest-md5-htonl-string): New function. + (sasl-digest-md5-make-integrity-encoder): New function. + (sasl-digest-md5-make-integrity-decoder): New function. + (sasl-digest-md5-ha1): New function. + (sasl-digest-md5-response-value): Accept the 1st argument `ha1'. + (sasl-digest-md5-response): Use `sasl-digest-md5-ha1'. + - Set integrity encoder and decoder of the client. + + * smtp.el: Require `luna'. + (smtp-read-response): Accept `smtp-connection' object rather than + process-object. + (smtp-send-command): Likewise. + (smtp-send-data): Likewise. + +2000-11-10 Daiki Ueno + + * tests/test-sasl.el (test-sasl-digest-md5-imap): New testcase. + (test-sasl-digest-md5-acap): New testcase. + +2000-11-10 Daiki Ueno + + * lunit.el (lunit-make-test-suite-from-class): New function. + (lunit-class): Abolish. + (lunit-test-results-buffer): Abolish. + + * FLIM-ELS (check-flim): New function. + + * Makefile (check): New target. + + * tests: New directory. + +2000-11-09 Daiki Ueno + + * lunit.el (lunit-test-method-regexp): New variable. + (lunit-class): New function. + +2000-11-09 Daiki Ueno + + * lunit.el: New file. + +2000-12-13 Kenichi Handa + + * luna.el: Fix and add DOCs and comments; fix coding style. + +2000-12-09 MORIOKA Tomohiko + + * mmbuffer.el (mmbuffer-parse-multipart): Add new optional + argument `representation-type'. + (mmbuffer-parse-encapsulated): Likewise. + +2000-12-07 MORIOKA Tomohiko + + * mmexternal.el: Must require `mmgeneric'. + + * sha1.el: Don't use `defun-maybe'. + +2000-12-04 Daiki Ueno + + * luna.el (luna-class-find-functions): Don't quote colon keywords. + (luna-send): Ditto. + (luna-call-next-method): Ditto. + +2000-11-28 Daiki Ueno + + * luna.el: Don't require `static'. + (luna-define-class-function): Don't bind colon keywords. + (luna-class-find-functions): Quote colon keywords. + (luna-send): Likewise. + (luna-call-next-method): Likewise. + +2000-11-12 Daiki Ueno + + * luna.el (luna-define-method): Clear method cache. + (luna-apply-generic): New function. + (luna-define-generic): Use `luna-apply-generic' instead of + `luna-send'. + +2000-12-04 Daiki Ueno + + * smtpmail.el (smtpmail-send-it): Use `smtp-send-buffer' instead of + `smtp-via-smtp'. + (smtpmail-send-queued-mail): Ditto. + +2000-11-24 MORIOKA Tomohiko + + * FLIM-MK (compile-flim): Compile `flim-version-specific-modules'. + (install-flim): Install `flim-version-specific-modules' to + `FLIM_VERSION_SPECIFIC_DIR'. + (compile-flim-package): Compile `flim-version-specific-modules'. + (install-flim-package): Install `flim-version-specific-modules'. + + * FLIM-ELS (flim-modules): Add `mime-conf' instead of `mailcap'. + (flim-version-specific-modules): New variable; specify `mailcap'. + + * FLIM-CFG (FLIM_VERSION_SPECIFIC_DIR): New variable. + + * mailcap.el: Completely rewrote to use mime-conf.el. + + * mime-conf.el: New file. + +2000-11-16 Kenichi OKADA + + * sasl-digest.el (sasl-digest-md5-response): Fix typo. + +2000-11-12 Daiki Ueno + + * smtp.el (smtp-primitive-data): Use `beginning-of-line' instead of + `forward-char'. + (smtp-read-response): Don't bind `case-fold-search'. + (smtp-send-data): Don't save excursion. + +2000-11-10 Daiki Ueno + + * sasl-digest.el (sasl-digest-md5-challenge): Abolish. + (sasl-digest-md5-syntax-table): Rename from + `sasl-digest-md5-parse-digest-challenge-syntax-table'. + (sasl-digest-md5-parse-string): Rename from + `sasl-digest-md5-parse-digest-challenge'; only return a property + list. + (sasl-digest-md5-challenge): Abolish. + (sasl-digest-md5-build-response-value-1): Abolish. + (sasl-digest-md5-response-value): Define as function. + (sasl-digest-md5-response): Rewrite. + +2000-11-07 Kenichi OKADA + + * sasl.el (sasl-login-response-1): Fix. + (sasl-login-response-2): Fix. + +2000-11-07 Daiki Ueno + + * smtp.el (smtp-sasl-properties): New user option. + (smtp-sasl-user-realm): Abolish. + +2000-11-05 Daiki Ueno + + * qmtp.el (qmtp-send-package): Don't check "K" reply per recipient. + (qmtp-via-smtp): Mark as obsolete. + (qmtp-send-buffer): New function. + + * sasl.texi: New file. + +2000-11-05 Daiki Ueno + + * sasl.el (sasl-step-data): New function. + (sasl-step-set-data): New function. + +2000-11-04 Daiki Ueno + + * sasl.el: Don't require 'poe' + - Rename `sasl-*instantiator*' to `sasl-*client*'. + - Rename `sasl-*authenticator*' to `sasl-*mechanism*'. + - Rename `sasl-*continuations*' to `sasl-*steps*'. + (sasl-make-client): Accept 1st argument `mechanism'. + (sasl-next-step): Rename from `sasl-evaluate-challenge'. + +2000-11-04 Daiki Ueno + + * sasl.el (sasl-make-instantiator): Define as function. + (sasl-instantiator-name): Ditto. + (sasl-instantiator-service): Ditto. + (sasl-instantiator-server): Ditto. + (sasl-instantiator-set-properties): Ditto. + (sasl-instantiator-set-property): Ditto. + (sasl-instantiator-property): Ditto. + (sasl-instantiator-properties): Ditto. + (sasl-authenticator-mechanism): Ditto. + (sasl-authenticator-continuations): Ditto. + +2000-11-02 Daiki Ueno + + * sasl.el: Rename `sasl-*principal*' to `sasl-*instantiator*'. + (sasl-make-instantiator): Abolish optional 4th argument. + (sasl-instantiator-set-properties): New function. + (sasl-instantiator-put-property): New function. + (sasl-instantiator-property): New function. + (sasl-instantiator-properties): New function. + + * smtp.el (smtp-sasl-user-name): Rename from + `smtp-sasl-principal-user'. + (smtp-sasl-user-realm): Rename from `smtp-sasl-principal-realm'. + +2000-11-02 Daiki Ueno + + * sasl.el (sasl-mechanisms): Add `LOGIN' and `ANONYMOUS'. + (sasl-mechanism-alist): Likewise. + (sasl-error): Define. + (sasl-login-continuations): New variable. + (sasl-login-response-1): New function. + (sasl-login-response-2): New function. + (sasl-anonymous-continuations): New variable. + (sasl-anonymous-response): New function. + + * smtp.el (smtp-error): Define. + (smtp-via-smtp): Use it. + +2000-11-02 Daiki Ueno + + * smtp.el (smtp-via-smtp): Mark as obsolete. + (smtp-send-buffer): Rename from `smtp-via-smtp'. + +2000-11-02 Daiki Ueno + + * sasl.el (sasl-make-authenticator): Allocate a freshly generated + symbol for each continuation. + +2000-11-02 Daiki Ueno + + * sasl-digest.el (sasl-digest-md5-response-1): Rename from + `sasl-digest-md5-digest-response'. + (sasl-digest-md5-response-2): New alias. + (sasl-digest-md5-parse-digest-challenge): Save excursion. + + * sasl.el (sasl-mechanism-alist): Rename from `sasl-mechanisms'. + (sasl-mechanisms): New variable. + (sasl-find-authenticator): Check `sasl-mechanisms' rather than + `sasl-mechanism-alist'. + + * smtp.el (smtp-submit-package): Use `smtp-primitive-ehlo'. + (smtp-primitive-auth): Check authenticator. + +2000-11-02 Daiki Ueno + + * FLIM-ELS (hmac-modules): New variable. + (flim-modules): Move HMAC modules to `hmac-modules' + - Add `sasl-digest'. + + * smtp.el (smtp-sasl-principal-realm): New user option. + + * sasl.el (sasl-plain-response): New function. + (sasl-mechanisms): Add `DIGEST-MD5' and `PLAIN'. + (sasl-unique-id-function): New variable. + (sasl-plain-continuations): New variable. + (sasl-unique-id): New function. + (sasl-unique-id-char): New variable. + + * sasl-digest.el: New file. + +2000-11-01 Daiki Ueno + + * smtp.el: Bind `sasl-mechanisms'; add autoload settings for + `sasl-make-principal', `sasl-find-authenticator', + `sasl-authenticator-mechanism-internal' and + `sasl-evaluate-challenge'. + (smtp-use-sasl): New user option. + (smtp-sasl-principal-name): New user option. + (smtp-sasl-mechanisms): New user option. + (smtp-submit-package): Call `smtp-primitive-starttls' and + `smtp-primitive-auth'. + (smtp-primitive-ehlo): Don't modify the rest of a extension line. + (smtp-primitive-auth): New function. + (smtp-primitive-starttls): Check the response code. + + * sasl.el: New implementation. + + * sasl-cram.el: New file. + + * FLIM-ELS (flim-modules): Add `md5', `md5-el', `md5-dl', + `hex-util', `hmac-def', `hmac-md5', `sasl' and `sasl-cram'. + +2000-11-01 Daiki Ueno + + * smtp.el: Add autoload settings for `starttls-open-stream' and + `starttls-negotiate'. + (smtp-connection-set-extensions-internal): New macro. + (smtp-connection-extensions-internal): New macro. + (smtp-make-connection): Set the `extension' slot to nil. + (smtp-primitive-ehlo): New function. + (smtp-submit-package): Rename from `smtp-commit'. + (smtp-submit-package-function): Rename from `smtp-commit-function'. + (smtp-primitive-starttls): New function. + (smtp-extensions): New group. + (smtp-use-8bitmime): New variable. + (smtp-use-size): New variable. + (smtp-use-starttls): New variable. + (smtp-via-smtp): Bind `smtp-open-connection-function'. + +2000-10-31 Daiki Ueno + + * smtp.el: New implementation. + +2000-08-16 Daiki Ueno + + * FLIM-ELS (flim-modules): Add `qmtp'. + + * qmtp.el: New file. + +2000-08-28 Yuuichi Teranishi + + * eword-encode.el (eword-encode-mailboxes-to-rword-list): + New inline function. + (eword-encode-address-to-rword-list): Ditto. + (eword-encode-addresses-to-rword-list): + Use `eword-encode-address-to-rword-list' instead of + `eword-encode-mailbox-to-rword-list'. + + * std11.el (std11-address-string): Fix for group list. + +2000-08-10 MORIOKA Tomohiko + + * mmgeneric.el: Enclose definition of class `mime-entity' and its + internal accessors by `eval-and-compile'. + + * luna.el: Define `luna-class-name' before it is used in macros. + + +2000-07-12 MORIOKA Tomohiko + + * FLIM-Chao: Version 1.14.1 (Rokujiz-D) released.-A + +2000-07-10 MORIOKA Tomohiko + + * mmexternal.el (initialize-instance): Deleted. + (mmexternal-require-file-name): New function. + (mmexternal-require-buffer): Use `mmexternal-require-file-name'. + +2000-06-30 MORIOKA Tomohiko + + * mime.el (mime-entity-read-field): Fix a bug when FIELD-NAME is a + string. + +2000-06-23 MORIOKA Tomohiko + + * mmexternal.el (initialize-instance): New method. + (mime-entity-name): Fixed. + (mmexternal-require-buffer): New function. + (mime-insert-entity): New implementation. + (mime-write-entity): Likewise. + (mime-entity-body): New method. + (mime-insert-entity-body): New method. + (mime-write-entity-body): New implementation. + (mime-entity-content): Likewise. + (mime-insert-entity-content): Likewise. + (mime-write-entity-content): Likewise. + (mime-entity-fetch-field): Likewise. + (mime-insert-header): Likewise. + + * mmbuffer.el (initialize-instance): Store buffer instead of name + of buffer to `buffer' slot. + +2000-06-21 MORIOKA Tomohiko + + * mmgeneric.el (mime-entity-children): Deleted. + + * mmbuffer.el (mime-insert-entity-body): New method. + (mmbuffer-parse-multipart): New function. + (mmbuffer-parse-encapsulated): New function. + (mime-entity-children): New function. + +2000-06-21 MORIOKA Tomohiko + + * mime.el (mime-find-root-entity): New function. + (mime-entity-header-buffer): Comment out. + (mime-goto-header-start-point): Likewise. + (mime-entity-header-start-point): Likewise. + (mime-entity-header-end-point): Likewise. + (mime-entity-body-buffer): Likewise. + (mime-goto-body-start-point): Likewise. + (mime-goto-body-end-point): Likewise. + (mime-entity-body-start-point): Likewise. + (mime-entity-body-end-point): Likewise. + (mime-entity-body-start): Likewise. + (mime-entity-body-end): Likewise. + (mime-entity-buffer): Likewise. + (mime-entity-point-min): Likewise. + (mime-entity-point-max): Likewise. + (mime-insert-entity-body): New generic function. + (mime-entity-uu-filename): Use `mime-insert-entity-body'. + (mime-entity-set-content-type): New function. + (mime-entity-set-encoding): New function. + + * mime-parse.el (mime-parse-multipart): Comment out. + (mime-parse-encapsulated): Likewise. + (mime-parse-external): Likewise. + + * mmbuffer.el (mime-entity-header-buffer): Comment out. + (mime-goto-header-start-point): Likewise. + (mime-entity-header-start-point): Likewise. + (mime-entity-header-end-point): Likewise. + (mime-entity-body-buffer): Likewise. + (mime-goto-body-start-point): Likewise. + (mime-goto-body-end-point): Likewise. + (mime-entity-body-start-point): Likewise. + (mime-entity-body-end-point): Likewise. + (mime-entity-buffer): Likewise. + (mime-entity-point-min): Likewise. + (mime-entity-point-max): Likewise. + +2000-05-30 MORIOKA Tomohiko + + * eword-encode.el (eword-charset-encoding-alist): Add + `iso-2022-jp-3'. + +2000-05-25 Tanaka Akira + + * mime-en.sgml, mime-ja.sgml: Update for CVS via SSH. + +2000-05-09 Katsumi Yamaoka + + * smtp.el (smtp-deduce-address-list): Set `case-fold-search' to `t' + in the working buffer. + +2000-04-26 Yoshiki Hayashi + + * mime.el (mime-entity-body): New function. + * mmbuffer.el (mime-entity-body): Implement it. + +2000-03-03 Keiichi Suzuki + + * mime.el (mime-entity-node-id): Change to function. + +2000-03-03 MORIOKA Tomohiko + + * mmdbuffer.el, mmbuffer.el (initialize-instance): Don't setup + `mime-message-structure'. + + * mime-parse.el (mime-parse-buffer): Don't setup + `mime-message-structure'. + +2000-03-02 MORIOKA Tomohiko + + * mmgeneric.el (mime-visible-field-p): Moved from mmbuffer.el. + (mime-insert-header-from-buffer): Moved from mmbuffer.el. + + * mmexternal.el, mmdbuffer.el, mmbuffer.el (mime-visible-field-p): + Moved to mmgeneric.el. + (mime-insert-header-from-buffer): Moved to mmgeneric.el. + +2000-03-02 MORIOKA Tomohiko + + * FLIM-ELS (flim-modules): Add `mmgeneric'. + + * mmgeneric.el: New file. + + * mmbuffer.el: Require `mmgeneric'. + + * mime.el: Require `mmgeneric' when compiling. + + * mime-def.el: Move mime-entity related definitions to + mmgeneric.el. + +2000-03-01 MORIOKA Tomohiko + + * mime.el (mime-find-entity-from-number): Now second argument + `message' is not an optional argument. + (mime-find-entity-from-node-id): Likewise. + (mime-find-entity-from-content-id): Likewise. + (mime-fetch-field): Delete obsolete function. + (mime-read-field): Likewise. + +2000-03-01 MORIOKA Tomohiko + + * mime.el (mime-entity-header-buffer): Mark it as obsolete. + (mime-goto-header-start-point): Likewise. + (mime-entity-header-start-point): Likewise. + (mime-entity-header-end-point): Likewise. + (mime-entity-body-start): Use `defalias'; don't recommend to use + `mime-entity-body-start-point' instead. + (mime-entity-body-end): Use `defalias'; don't recommend to use + `mime-entity-body-end-point' instead. + (mime-entity-body-buffer): Mark it as obsolete. + (mime-goto-body-start-point): Likewise. + (mime-goto-body-end-point): Likewise. + (mime-entity-body-start-point): Likewise. + (mime-entity-body-end-point): Likewise. + (mime-entity-buffer): Don't recommend to use + `mime-entity-header-buffer' or `mime-entity-body-buffer' instead. + (mime-entity-point-min): Don't recommend to use + `mime-entity-header-start-point' instead. + (mime-entity-point-max): Don't recommend to use + `mime-entity-body-end-point' instead. + + * mime-def.el (mime-library-version): update to 1.14.1. + - Add autoload setting for `mime-parse-external'. + + +2000-03-01 MORIOKA Tomohiko + + * Chao: Version 1.14.0 (Momoyama) released. + +2000-01-05 Katsumi Yamaoka + + * Makefile, mime-en.sgml, mime-ja.sgml: Update for the new CVS + server. + +1999-12-20 Katsumi Yamaoka + + * mel-b-el.el (base64-encode-region): Allow the optional second arg + `no-line-break'. + (base64-external-encode-region): Likewise. + (base64-internal-encode-region): Likewise. + (base64-encode-string): Likewise. + +1999-12-16 MORIOKA Tomohiko + + * FLIM-ELS (flim-modules): Add `mmexternal'. + + * mime-parse.el (mime-parse-external): New function. + + * mime-def.el (mime-entity-children [mime-entity]): Use + `mime-parse-external' for message/external-body. + + * mmexternal.el: New module. + +1999-12-13 Katsumi Yamaoka + + * README.en, README.ja, mime-en.sgml, mime-ja.sgml: Update for the + recent ML address and ftp site. + +1999-10-17 Yoshiki Hayashi + + * FLIM-MK (install-flim-package): Delete auto-autoloads.el + and custom-load.el + +1999-09-20 Katsumi Yamaoka + + * mailcap.el (mailcap-look-at-schar): Protect against unexpected + eof. [cf. ] + +1999-09-13 Katsumi Yamaoka + + * smtpmail.el (smtpmail-send-it): Remove needless `concat'. + +1999-09-08 Yoshiki Hayashi + + * mime-ja.sgml, mime-en.sgml (Entity creation): Fix typo. + +1999-09-01 Katsumi Yamaoka + + * smtpmail.el (smtpmail-send-it): Make directory + `smtpmail-queue-dir' if it does not exist; convert filename of + queued mail using `convert-standard-filename'. + (smtpmail-queue-index): Treat `smtpmail-queue-dir' as a directory + name using `file-name-as-directory'. + (smtpmail-queue-dir, smtpmail-queue-mail): Remove "*" from doc + strings. + +1999-08-26 Katsumi Yamaoka + + * smtpmail.el (smtpmail-send-it): Use `time-stamp-yyyy-mm-dd' and + `time-stamp-hh:mm:ss' instead of `current-time'. + +1999-08-25 Katsumi Yamaoka + + * FLIM-ELS: Use `if' instead of `unless'. + + +1999-08-17 MORIOKA Tomohiko + + * FLIM: Version 1.13.2 (Kasanui) released. + +1999-08-03 Yuuichi Teranishi + + * smtp.el (smtp-notify-success): New option. + * (smtp-via-smtp): Request return receipt (defined in RFC1891) to + SMTP server if `smtp-notify-success' is non-nil. + [cf. ] + +1999-08-02 MORIOKA Tomohiko + + * mime.el (mime-entity-header-start-point): New generic function. + (mime-entity-header-end-point): New generic function. + + * mmbuffer.el (mime-entity-header-start-point): New method. + (mime-entity-header-end-point): New method. + +1999-08-09 MORIOKA Tomohiko + + * FLIM-ELS (flim-modules): Add `mmdbuffer'. + +1999-07-27 MORIOKA Tomohiko + + * mmdbuffer.el: New module. + +1999-07-28 MORIOKA Tomohiko + + * mime-parse.el: Add autoload setting for + `mime-entity-body-buffer', `mime-entity-body-start-point' and + `mime-entity-body-end-point'. + + * mime.el (mime-entity-point-min): Define as an obsolete function. + (mime-entity-point-max): Likewise. + +1999-07-27 MORIOKA Tomohiko + + * mmbuffer.el (entity-point-min): Deleted because it is + duplicated. + (entity-point-max): Deleted because it is duplicated. + +1999-07-24 MORIOKA Tomohiko + + * mmbuffer.el (mime-insert-text-content): Deleted [moved to + mime-def.el]. + + * mime-def.el: Add autoload settings for `mime-entity-content' [to + avoid warning]. + (mime-insert-text-content): New method of `mime-entity' [moved + from mmbuffer.el]. + +1999-07-24 MORIOKA Tomohiko + + * mmbuffer.el (mime-entity-children): Deleted [moved to + mime-def.el]. + + * mime-def.el: Add autoload settings for + `mime-entity-content-type', `mime-parse-multipart' and + `mime-parse-encapsulated' [to avoid warning]. + (mime-entity-children): New method of `mime-entity' [moved from + mmbuffer.el]. + + +1999-07-22 MORIOKA Tomohiko + + * FLIM: Version 1.13.1 (Tawaramoto) released. + +1999-07-21 MORIOKA Tomohiko + + * mime-parse.el (mime-parse-buffer): Fixed. + + +1999-07-16 MORIOKA Tomohiko + + * FLIM: Version 1.13.0 (Iwami) released. + +1999-07-09 Nakagawa, Makoto + + * smtpmail.el (smtpmail-send-it): Use current-time to get rid of + time-stamp-strftime. + (smtpmail-send-it): Use write-region-as-binary instead of + write-file. + (smtpmail-send-queued-mail); Use find-file-noselect-as-binary + instead of find-file-noselect. + +1999-06-23 MORIOKA Tomohiko + + * FLIM-CFG: Delete code to detect APEL 7.3 or later. + +1999-06-16 Katsumi Yamaoka + + * smtpmail.el (smtpmail-send-it): Extend the search bound to the + end of the field for fetching the recipients from Resent-To. + +1999-06-11 Katsumi Yamaoka + + * luna.el (luna-define-class-function): Check for the improbable + name of variable beginning with colon whether we should bind the + sort of symbol or not. + (TopLevel): Likewise. + +1999-06-10 Katsumi Yamaoka + + * luna.el (luna-define-class-function): Bind member variables + statically for old Emacsen. + (TopLevel): Require `static'; bind `:before', `:after' and + `:around' statically for old Emacsen. [cf. ] + + +1999-06-01 MORIOKA Tomohiko + + * Chao: Version 1.13.0 (JR Fujinomori) released. + +1999-05-29 MORIOKA Tomohiko + + * mmbuffer.el (mime-entity-fetch-field): New implementation. + + * mime-def.el (mime-entity-fetch-field): New method of luna-class + `mime-entity'. + + * luna.el (luna-define-method): Allow `:around' qualifier. + (luna-class-find-functions): Likewise. + (luna-send): Likewise. + (luna-call-next-method): New function. + +1999-05-26 MORIOKA Tomohiko + + * mime-def.el (eval-module-depended-macro): Abolished. + Use `def-edebug-spec' directly. + + * luna.el (luna-define-method): Allow `:before' qualifier. + (luna-class-find-functions): Likewise. + + * mime-def.el (mime-message-structure): Define as obsolete + variable. + +1999-05-26 MORIOKA Tomohiko + + * mime-parse.el (mime-parse-encapsulated): Use + `mime-entity-body-start-point' and `mime-entity-body-end-point'. + + * mime.el (mime-parse-buffer): Revert to auto-load from + "mime-parse". + + * mime-parse.el (mime-parse-multipart): Move from mime-parse.el + again. + (mime-parse-encapsulated): Likewise. + (mime-parse-message): Likewise. + (mime-parse-buffer): Likewise. + + * mmbuffer.el (mime-parse-multipart): Move to mime-parse.el again. + (mime-parse-encapsulated): Likewise. + (mime-parse-message): Likewise. + (mime-parse-buffer): Likewise. + + * mmbuffer.el (mime-parse-encapsulated): Run in body-buffer of an + entity. + +1999-05-26 MORIOKA Tomohiko + + * mmbuffer.el (initialize-instance): Don't initialize slots if + they are initialized. + (mime-parse-multipart): Run in body-buffer of an entity. + (mime-entity-body-start-point): New method. + +1999-05-25 MORIOKA Tomohiko + + * mmbuffer.el (mime-entity-body-end-point): New method. + (mime-goto-header-start-point): New method. + (mime-goto-body-start-point): New method. + (mime-goto-body-end-point): New method. + + * mime.el (mime-goto-body-end-point): New generic function. + + * mel.el (Q-encoded-text-length): Fixed. + +1999-05-24 MORIOKA Tomohiko + + * mmbuffer.el (mime-parse-multipart): Refer body-start instead of + header-end. + + * mmcooked.el (mime-insert-header): Fix typo. + +1999-05-23 MORIOKA Tomohiko + + * mmcooked.el (mime-insert-header): Use + `luna-class-find-functions'. + + * mime.el (mime-entity-buffer): Define as obsolete function. + (mime-entity-body-end-point): New generic function; define + `mime-entity-body-end' as obsolete function. + (mime-goto-body-start-point): New generic function. + (mime-entity-uu-filename): Use `mime-goto-body-start-point' and + `mime-entity-body-end-point'. + + * mmbuffer.el (initialize-instance): Define as after method; + return initialized instance. + + * luna.el (luna-define-class): Add `standard-object' as a parent. + (luna-define-method): Allow `:after' qualifier. + (luna-class-find-parents-functions): New function. + (luna-class-find-functions): New function [abolish + `luna-class-find-function']. + (luna-find-functions): New function [abolish + `luna-find-function']. + (luna-send): Modify for new method dispatch mechanism. + (luna-make-entity): New implementation. + (standard-object): New class. + (initialize-instance): New method. + +1999-05-22 MORIOKA Tomohiko + + * Delete mmgeneric.el. + + * mmcooked.el: Modify for mmbuffer.el. + + * mmbuffer.el: + - Don't require `mmgeneric' and `mime-parse'. + - Require mime. + - Use `luna'. + (mime-buffer-entity-buffer-internal): Renamed from + `mime-entity-set-buffer-internal'. + (mime-buffer-entity-set-buffer-internal): Likewise. + (mime-buffer-entity-header-start-internal): Likewise. + (mime-buffer-entity-set-header-start-internal): Likewise. + (mime-buffer-entity-header-end-internal): Likewise. + (mime-buffer-entity-set-header-end-internal): Likewise. + (mime-buffer-entity-body-start-internal): Likewise. + (mime-buffer-entity-set-body-start-internal): Likewise. + (mime-buffer-entity-body-end-internal): Likewise. + (mime-buffer-entity-set-body-end-internal): Likewise. + (mime-entity-name): New method. + (mime-parse-multipart): New function [moved from mime-parse.el]. + (mime-parse-encapsulated): Likewise. + (mime-parse-message): Likewise. + (mime-entity-children): New method. + (mime-goto-header-start-point): New method. + (mime-visible-field-p): New function [moved from mmgeneric.el]. + (mime-insert-header-from-buffer): Likewise. + (mime-insert-header): New method. + (mime-entity-content): Use `luna-define-method'. + (mime-insert-text-content): New method. + ((mime-entity-fetch-field): Use `luna-define-method'. + (mime-entity-header-buffer): New method. + (mime-entity-body-buffer): Likewise. + (mime-entity-buffer): Likewise. + (mime-entity-point-min): Use `luna-define-method'. + (mime-entity-point-max): Use `luna-define-method'. + (mime-parse-buffer): New function [moved from mmgeneric.el]. + + * mime-parse.el (mime-parse-multipart): Moved to mmbuffer.el. + (mime-parse-encapsulated): Likewise. + (mime-parse-message): Likewise. + (mime-parse-buffer): Likewise. + + * mime.el (mime-parse-buffer): Auto-loaded from "mmbufer". + (mime-find-function): Abolished. + (mime-entity-function): Abolished. + (mime-entity-send): Use `luna-send'. + (mime-open-entity): Use `luna-make-entity' and + `mm-expand-class-name'. + (mime-entity-cooked-p): Use `luna-define-generic'. + (mime-entity-children): Use `luna-send'. + (mime-find-entity-from-content-id): Use `mime-entity-read-field'. + (mime-entity-buffer): Change to generic function. + (mime-entity-header-buffer): New generic function. + (mime-entity-body-buffer): Likewise. + (mime-entity-point-min): Use `luna-define-generic'. + (mime-entity-point-max): Likewise. + (mime-entity-header-start): Abolished. + (mime-entity-header-end): Abolished. + (mime-entity-body-start): Abolished. + (mime-entity-body-end): Abolished. + (mime-goto-header-start-point): New generic function. + (mime-entity-fetch-field): New generic function. + (mime-fetch-field): Use `mime-entity-fetch-field'; declare as + obsolete function. + (mime-entity-content-type): Use `mime-entity-fetch-field'. + (mime-entity-content-disposition): Likewise. + (mime-entity-encoding): Likewise. + (mime-entity-read-field): New function. + (mime-read-field): Use `mime-entity-read-field'; declare as + obsolete function. + (mime-insert-header): Use `luna-define-generic'; abolish obsolete + alias `mime-insert-decoded-header'. + (mime-entity-name): New generic function. + (mime-entity-content): Use `luna-define-generic'. + (mime-insert-entity-content): Likewise. + (mime-write-entity-content): Likewise. + (mime-insert-text-content): Likewise. + (mime-insert-entity): Likewise. + (mime-write-entity): Likewise. + (mime-write-entity-body): Likewise. + + * mime-def.el: + - Use `luna'. + (make-mime-entity-internal): Abolished. + (mime-entity-representation-type-internal): Change to alias for + `luna-class-name'. + (mime-entity-set-representation-type-internal): Change to alias + for `luna-set-class-name'. + (mime-entity-location-internal): Defined by + `luna-define-internal-accessors'. + (mime-entity-set-location-internal): Likewise. + (mime-entity-content-type-internal): Likewise. + (mime-entity-set-content-type-internal): Likewise. + (mime-entity-content-disposition-internal): Likewise. + (mime-entity-set-content-disposition-internal): Likewise. + (mime-entity-encoding-internal): Likewise. + (mime-entity-set-encoding-internal): Likewise. + (mime-entity-children-internal): Likewise. + (mime-entity-set-children-internal): Likewise. + (mime-entity-parent-internal): Likewise. + (mime-entity-set-parent-internal): Likewise. + (mime-entity-node-id-internal): Likewise. + (mime-entity-decoded-subject-internal): Abolished. + (mime-entity-set-decoded-subject-internal): Abolished. + (mime-entity-decoded-from-internal): Abolished. + (mime-entity-set-decoded-from-internal): Abolished. + (mime-entity-date-internal): Abolished. + (mime-entity-set-date-internal): Abolished. + (mime-entity-message-id-internal): Abolished. + (mime-entity-set-message-id-internal): Abolished. + (mime-entity-references-internal): Abolished. + (mime-entity-set-references-internal): Abolished. + (mime-entity-chars-internal): Abolished. + (mime-entity-set-chars-internal): Abolished. + (mime-entity-lines-internal): Abolished. + (mime-entity-set-lines-internal): Abolished. + (mime-entity-xref-internal): Abolished. + (mime-entity-set-xref-internal): Abolished. + (mime-entity-original-header-internal): Defined by + `luna-define-internal-accessors'. + (mime-entity-set-original-header-internal): Likewise. + (mime-entity-parsed-header-internal): Likewise. + (mime-entity-set-parsed-header-internal): Likewise. + (mime-entity-buffer-internal): Abolished. + (mime-entity-set-buffer-internal): Abolished. + (mime-entity-header-start-internal): Abolished. + (mime-entity-set-header-start-internal): Abolished. + (mime-entity-header-end-internal): Abolished. + (mime-entity-set-header-end-internal): Abolished. + (mime-entity-body-start-internal): Abolished. + (mime-entity-set-body-start-internal): Abolished. + (mime-entity-body-end-internal): Abolished. + (mime-entity-set-body-end-internal): Abolished. + (mm-expand-class-name): New macro. + (mm-define-backend): Use `luna-define-class' and + `mm-expand-class-name'. + (mm-define-method): Use `luna-define-method' and + `mm-expand-class-name'. + (mm-arglist-to-arguments): Abolished. + (mel-define-service): Use `luna-arglist-to-arguments' instead of + `mm-arglist-to-arguments'. + + * mel.el: Require `alist'. + + * FLIM-ELS (flim-modules): Add `luna' and delete `mmgeneric'. + + * luna.el: + - Rename property `luna-member-index' to `luna-slot-index'. + - Rearrangement to avoid byte-compiling problem. + (luna-define-class-function): New function. + (luna-define-class): Use `luna-define-class-function'. + (luna-define-generic): Fixed. + (luna-define-internal-accessors): New function. + +1999-05-15 MORIOKA Tomohiko + + * luna.el (luna-make-entity-function): Send `initialize-instance'. + +1999-05-14 MORIOKA Tomohiko + + * luna.el: New module. + + +1999-05-31 MORIOKA Tomohiko + + * FLIM: Version 1.12.7 (Y-Dzaki) released.-A + +1999-05-31 MORIOKA Tomohiko + + * mime-en.sgml (Network representation of header): Translate. + +1999-05-27 Shuhei KOBAYASHI + + * mel-b-el.el (pack-sequence): Eliminate local variable `i'. + (base64-encode-1): Avoid concat. + (base64-encode-string): Fixed last change; extra padding. + +1999-05-26 MORIOKA Tomohiko + + * smtpmail.el (smtpmail-default-smtp-server): Define obsolete + variable alias for XEmacs. + (smtpmail-smtp-server): Likewise. + (smtpmail-smtp-service): Likewise. + (smtpmail-local-domain): Likewise. + (smtpmail-debug-info): Likewise. + (smtpmail-send-it): Check function `expand-mail-aliases' is + defined. + +1999-05-26 MORIOKA Tomohiko + + * smtp.el (smtp-debug-info): Now a user option. + +1999-05-25 Yoshiki Hayashi + + * README.ja: Modify URL and required version of APEL. + +1999-05-24 Tanaka Akira + + * mel-b-ccl.el (base64-encode-string): New alias. + (base64-encode-region): Ditto. + (base64-decode-string): Ditto. + (base64-decode-region): Ditto. + +1999-05-24 Tanaka Akira + + * mel-b-ccl.el, mel-q-ccl.el: Sync up with doodle-1.12.5. + +1999-05-24 MORIOKA Tomohiko + + * eword-encode.el (ew-space-process): Renamed from + `tm-eword::space-process'. + +1999-05-24 MORIOKA Tomohiko + + * eword-encode.el (tm-eword::space-process): Don't concatenate + `special's. + (ew-encode-rword-1): Renamed from `tm-eword::encode-string-1'; add + new optional argument `must-output'; return nil if it can't encode + literally. + (eword-encode-rword-list): Fold SPACE or TAB in the encoded string + if `ew-encode-rword-1' can't encode literally and it is possible + to encode the rest literally with the folding. + (eword-encode-phrase-to-rword-list): Add `special' flag to + brackets of comments. + +1999-05-22 Shuhei KOBAYASHI + + * smtpmail.el: Require 'poe and 'pcustom. + +1999-05-22 Shuhei KOBAYASHI + + * mel.el: Update header. + Require 'path-util and don't require 'poem. + (mel-use-module): Eliminate local variable `encoding'. + (mime-insert-encoded-file for mel-b-builtin): + Use built-in `interactive' spec. + (encoded-text-decode-string): Anchor regexp with "\\`" and "\\'". + (mime-encode-region): Capitalize prompt string. + (mime-decode-region): Ditto. + (mime-insert-encoded-file): Ditto. + (mime-write-decoded-region): Ditto. + + * mel-b-ccl.el: Update header. + (base64-ccl-encode-region): Use read-only `interactive' spec. + (base64-ccl-decode-region): Ditto. + (base64-ccl-insert-encoded-file): Use built-in `interactive' spec. + (base64-ccl-write-decoded-region): Ditto. + (encoded-text-decode-string): Anchor regexp with "\\`" and "\\'". + + * mel-b-dl.el: Update header. + Don't require 'poe; it is required implicitly via 'mime-def. + (base64-dl-handle): Chech whether `base64-dl-module' is string. + Defalias `base64-encode-string' and `base64-decode-string' just + after `dynamic-call'ing "emacs_base64_init". + (base64-encode-region): Use read-only `interactive' spec. + Use `base64-encode-string'. + Changed order of evaluation to "encode, delete, then insert". + (base64-decode-region): Renamed from `decode-base64-region'. + Use read-only `interactive' spec. + Use `base64-decode-string'. + Changed order of evaluation to "decode, delete, then insert". + (mime-encode-string): Use `base64-encode-string'. + (mime-decode-string): Use `base64-decode-string'. + (mime-decode-region): Use `base64-decode-region'. + (encoded-text-encode-string): Use `base64-encode-string'. + (encoded-text-decode-string): Anchor regexp with "\\`" and "\\'". + (mime-insert-encoded-file): Use built-in `interactive' spec. + (mime-write-decoded-region in comment): Ditto. + + * mel-b-el.el: Update header. + Don't require 'poe; it is required implicitly via 'mime-def. + (pack-sequence): Moved to top of the function definitions. + (base64-encode-string): Calculate padding first. + (base64-internal-encode-region): Changed order of evaluation to + "encode, delete, then insert". + (base64-internal-decode-string): Changed order of evaluation to + "decode, delete, then insert". + (base64-encode-region): Use read-only `interactive' spec. + (base64-decode-region): Ditto. + (base64-decode-string): Not interactive. + (encoded-text-decode-string): Anchor regexp with "\\`" and "\\'". + (base64-insert-encoded-file): Use built-in `interactive' spec. + (base64-write-decoded-region): Ditto. + + * mel-g.el: Update header. + Require 'mime-def instead of 'poem and 'mel. + (mime-insert-encoded-file): Use built-in `interactive' spec. + (mime-write-decoded-region): Ditto. + + * mel-q-ccl.el: Update header. + (quoted-printable-ccl-encode-region): + Use read-only `interactive' spec. + (quoted-printable-ccl-decode-region): Ditto. + (quoted-printable-ccl-insert-encoded-file): + Use built-in `interactive' spec. + (quoted-printable-ccl-write-decoded-region): Ditto. + (encoded-text-decode-string): Anchor regexp with "\\`" and "\\'". + + * mel-q.el: Update header. + Require 'path-util instead of 'emu. + (quoted-printable-internal-encode-region): Rewrite without regexp. + (quoted-printable-internal-decode-region): Ditto. + (quoted-printable-encode-region): Use read-only `interactive' spec. + (quoted-printable-decode-region): Ditto. + (mime-insert-encoded-file): Use built-in `interactive' spec. + (mime-write-decoded-region): Ditto. + (encoded-text-decode-string): Anchor regexp with "\\`" and "\\'". + + * mel-u.el: Update header. + Require 'path-util instead of 'emu. + (mime-insert-encoded-file): Use built-in `interactive' spec. + (mime-write-decoded-region): Ditto. + +1999-05-22 Shuhei KOBAYASHI + + * mime-def.el: Require 'poe, 'poem, and 'pcustom. + (mime): Declare `default-mime-charset' as an initial member. + + * mime-parse.el: Don't require 'cl at compile-time. + + * mailcap.el (mailcap-look-at-qchar): Use `char-after'. + + * std11.el: Require 'poe, 'poem, and 'pcustom. + + * smtp.el: Update header. + Require 'poe, 'poem, and 'pcustom. + Require 'cl at compile-time. + +1999-05-21 MORIOKA Tomohiko + + * README.en (Installation): Modify URL and required version of + APEL. + + * eword-encode.el (ew-find-charset-rule): Renamed from + `tm-eword::find-charset-rule'; use + `find-mime-charset-by-charsets'. + + +1999-05-11 MORIOKA Tomohiko + + * FLIM: Version 1.12.6 (Family-K-Denmae) released.-A + +1999-04-27 Shuhei KOBAYASHI + + * mel-b-ccl.el (TopLevel): Suppress warning. + mel-q-ccl.el (TopLevel): Ditto. + mime.el (TopLevel): Ditto. + +1999-04-26 Shuhei KOBAYASHI + + * eword-decode.el (eword-encoded-word-regexp): Accept "b" and "q" + for "encoding". + + * mime-def.el (std11-qtext-regexp): Don't use `string'. + (mime-tspecial-char-list): Eval at compile time. + +1999-04-22 Katsumi Yamaoka + + * mime.el: Delete autoload setting for `eword-encode-field'. + +1999-04-22 MORIOKA Tomohiko + + * eword-encode.el: Require `poem' instead of `emu'. + Don't use `cl' for `caar'. + +1999-04-09 Katsumi Yamaoka + + * smtp.el (smtp-via-smtp): Funcall `smtp-server' if it is a + function. + (smtp-server): Make it can also be a function called from + `smtp-via-smtp' with arguments SENDER and RECIPIENTS. + +1999-04-05 Shuhei KOBAYASHI + + * FLIM-CFG: Make easier to install in VERSION_SPECIFIC_LISPDIR. + +1999-03-29 Shuhei KOBAYASHI + + * mime.el (mime-read-field): Correct argument of + `mime-decode-field-body'; 'native -> 'plain. + +1999-03-27 Shuhei KOBAYASHI + + * eword-encode.el (TopLevel): Require 'cl when compiling. + (eword-encode-rword-list): Suppress insertion of extra spaces. + (eword-encode-msg-id-to-rword-list): Treat surrounding angle + brackets atomically. + ([tm-ja:4244] by Kazuhiro Ohta ) + +1999-03-11 MORIOKA Tomohiko + + * eword-encode.el (eword-charset-encoding-alist): Add `tis-620'. + +1999-03-01 MORIOKA Tomohiko + + * mel.el (mime-decode-string): Return STRING if return value of + `(mel-find-function 'mime-decode-string encoding)' is nil. + +1999-02-10 MORIOKA Tomohiko + + * mime-def.el (mel-define-service): Change size of obarray to 7. + +1999-02-01 Yoshiki Hayashi + + * mime-ja.sgml: Tranlate all untranslated parts. + + +1999-01-27 MORIOKA Tomohiko + + * FLIM: Version 1.12.5 (Hirahata) released. + + * mime-ja.sgml, mime-en.sgml: Sync with FLIM API 1.12. + +1999-01-26 MORIOKA Tomohiko + + * NEWS (New optional argument of `std11-field-end'): New + subsection. + + * std11.el (std11-field-end): Add new optional argument `bound'. + + +1999-01-24 MORIOKA Tomohiko + + * FLIM: Version 1.12.4 (Tsutsui) released. + +1999-01-24 MORIOKA Tomohiko + + * README.en: Sync with latest FLIM. + + * README.ja: fixed. + +1999-01-24 MORIOKA Tomohiko + + * mmbuffer.el, mmgeneric.el (insert-entity-content): New method. + + * mime.el (mime-insert-entity-content): New generic function. + +1999-01-24 MORIOKA Tomohiko + + * NEWS (New function `mime-find-entity-from-content-id'): New + subsection. + (New function `mime-parse-msg-id'): New subsection. + (New function `mime-uri-parse-cid'): New subsection. + +1999-01-24 MORIOKA Tomohiko + + * mime.el (mime-find-entity-from-content-id): New function. + (mime-field-parser-alist): Use `mime-parse-msg-id' instead of + `std11-parse-msg-id' to parse `Message-Id', `Recent-Message-Id' + and `Content-Id' field. + + * mime-parse.el (mime-parse-msg-id): New function. + (mime-uri-parse-cid): New function. + + +1999-01-23 MORIOKA Tomohiko + + * FLIM: Version 1.12.3 (Kintetsu-K-Driyama) released.-A + +1999-01-23 MORIOKA Tomohiko + + * NEWS (Function `std11-parse-in-reply-to'): New subsection. + (New function `std11-parse-msg-id-string'): Likewise. + (New function `std11-parse-msg-ids-string'): Likewise. + (New generic function `mime-insert-entity'): Likewise. + +1999-01-23 MORIOKA Tomohiko + + * mime.el (mime-field-parser-alist): Change to set parser for + tokens instead of parser for string. + (mime-read-field): Use `eword-lexical-analyze' before parsing. + + * eword-encode.el (eword-encode-in-reply-to): Use + `std11-parse-msg-ids-string' instead of `std11-parse-in-reply-to' + and `std11-lexical-analyze'. + + * std11.el (std11-parse-msg-ids): Renamed from + `std11-parse-in-reply-to'; define `std11-parse-in-reply-to' as + obsolete alias. + (std11-parse-msg-id-string): New function. + (std11-parse-msg-ids-string): New function. + +1999-01-23 MORIOKA Tomohiko + + * mime.el (mime-field-parser-alist): New variable. + (mime-read-field): Refer `mime-field-parser-alist'. + +1999-01-23 MORIOKA Tomohiko + + * mmbuffer.el, mmgeneric.el (insert-entity): New method. + + * mime.el (mime-insert-entity): New generic function. + +1999-01-22 Katsumi Yamaoka + + * std11.el (TopLevel): Require `custom'. + + +1999-01-21 MORIOKA Tomohiko + + * FLIM: Version 1.12.2 (Kuj-D) released.-A + +1999-01-16 MORIOKA Tomohiko + + * mime-parse.el (mime-lexical-analyzer): New user option. + (mime-analyze-tspecial): New function. + (mime-analyze-token): New function. + (mime-parse-Content-Transfer-Encoding): Use + `std11-lexical-analyze' with `mime-lexical-analyzer'. + + * mime-def.el (mime-tspecial-char-list): Renamed from + `mime-tspecials'; changed from string to list. + (mime-token-regexp): Use `eval-when-compile'. + +1999-01-16 MORIOKA Tomohiko + + * eword-decode.el (eword-lexical-analyzer): Modify DOC-string + about interface change. + (eword-analyze-comment): Renamed from `eword-parse-comment'; + change second argument `from' to required argument; abolish alias + `eword-analyze-comment' of `eword-parse-comment'. + +1999-01-16 MORIOKA Tomohiko + + * NEWS (User option `eword-lexical-analyzers' -> + `eword-lexical-analyzer'): New subsection. + + * eword-decode.el (eword-lexical-analyzer): Renamed from user + option `eword-lexical-analyzers'. + +1999-01-16 MORIOKA Tomohiko + + * NEWS (New user option `std11-lexical-analyzer'): New subsection. + + * std11.el (std11-lexical-analyzer): Renamed from user option + `std11-lexical-analyzers'. + +1999-01-16 MORIOKA Tomohiko + + * std11.el (std11-lexical-analyze): Change interface to add new + optional argument `analyzers'. + +1999-01-16 MORIOKA Tomohiko + + * std11.el (std11-lexical-analyzers): New user option. + (std11-lexical-analyze): New implementation; refer + `std11-lexical-analyzers'. + +1999-01-16 MORIOKA Tomohiko + + * NEWS (Change interface of lexical-analyzers): New subsection. + +1999-01-16 MORIOKA Tomohiko + + * eword-decode.el (eword-encoded-word-regexp): Must define when + this module is compiled. + (eword-decode-structured-field-body): Add new optional argument + `start'. + (eword-decode-and-unfold-structured-field-body): Likewise. + (eword-decode-and-fold-structured-field-body): Likewise. + (eword-analyze-quoted-string): Add new argument `start'; return + `( . )' instead of `( + . )'. + (std11-analyze-domain-literal): Likewise. + (eword-analyze-domain-literal): Likewise. + (eword-analyze-comment): Changed to alias of + `eword-parse-comment'. + (eword-analyze-spaces): Add new argument `start'; return `( . )' instead of `( . )'. + (std11-analyze-domain-literal): Likewise. + (eword-analyze-special): Likewise. + (eword-analyze-encoded-word): Likewise. + (eword-analyze-atom): Likewise. + (eword-lexical-analyze-internal): Add new argument `start'. + (eword-lexical-analyze): Change interface to add new optional + argument `start'. + (eword-extract-address-components): Add new optional argument + `start'. + + * std11.el (std11-atom-regexp): Modify to match non-top atom. + (std11-analyze-spaces): Add new argument `start'; return `( . )' instead of `( . )'. + (std11-analyze-special): Likewise. + (std11-analyze-atom): Likewise. + (std11-analyze-quoted-string): Likewise. + (std11-analyze-domain-literal): Likewise. + (std11-analyze-comment): Likewise. + (std11-lexical-analyze): Add new optional argument `start'. + +1999-01-15 MORIOKA Tomohiko + + * std11.el (std11-fetch-field): Add autoload cookie. + (std11-narrow-to-header): Likewise. + (std11-field-body): Likewise. + (std11-unfold-string): Likewise. + (std11-lexical-analyze): Add DOC-string; add autoload cookie. + + * std11.el (std11-space-char-list): Renamed from + `std11-space-chars'; changed from string to list. + +1999-01-15 MORIOKA Tomohiko + + * std11.el (std11-fetch-field): Don't define as inline function. + (std11-field-body): Enclose `std11-narrow-to-header' and + `std11-fetch-field' by `inline'. + +1999-01-15 MORIOKA Tomohiko + + * std11.el (std11-special-char-list): Evaluate when it is + compiled. + (std11-atom-regexp): Use `eval-when-compile'. + +1999-01-15 MORIOKA Tomohiko + + * std11.el (std11-space-chars): Must evaluate when it is compiled. + (std11-analyze-spaces): Don't use `std11-spaces-regexp'; abolist + constant `std11-spaces-regexp'. + + * mime-parse.el (mime-disposition-type-regexp): Must evaluate when + it is compiled. + + * mime-parse.el: Don't require emu. + + * mime-parse.el (mime-parse-Content-Disposition): Use + `eval-when-compile'. + + * mime-parse.el (mime-parse-Content-Transfer-Encoding): New + implementation. + +1998-12-22 Katsumi Yamaoka + + * README.en (Installation): Modify for APEL 9.12. + * README.ja (Installation): Likewise. + +1998-12-14 Katsumi Yamaoka + + * mel-b-ccl.el (base64-ccl-insert-encoded-file): Call + `insert-file-contents-as-coding-system' with CODING-SYSTEM as the + 1st arg. + * mel-q-ccl.el (quoted-printable-ccl-insert-encoded-file): + Likewise. + + * mel-b-ccl.el (base64-ccl-write-decoded-region): Call + `write-region-as-coding-system' with CODING-SYSTEM as the 1st arg. + * mel-q-ccl.el (quoted-printable-ccl-write-decoded-region): + Likewise. + +1998-12-14 Katsumi Yamaoka + + * mel-b-ccl.el (base64-ccl-insert-encoded-file): Use + `insert-file-contents-as-coding-system' (renamed from + `insert-file-contents-as-specified-coding-system'). + * mel-q-ccl.el (quoted-printable-ccl-insert-encoded-file): + Likewise. + + * mel-b-ccl.el (base64-ccl-write-decoded-region): Use + `write-region-as-coding-system' (renamed from + `write-region-as-specified-coding-system'). + * mel-q-ccl.el (quoted-printable-ccl-write-decoded-region): + Likewise. + +1998-12-08 Katsumi Yamaoka + + * smtp.el (smtp-coding-system): Abolished. + (smtp-via-smtp): Use `open-network-stream-as-binary' instead of + `open-network-stream'. + +1998-12-04 Katsumi Yamaoka + + * mel-b-ccl.el (base64-ccl-insert-encoded-file): Use + `insert-file-contents-as-specified-coding-system' instead of + `insert-file-contents'. + * mel-q-ccl.el (quoted-printable-ccl-insert-encoded-file): + Likewise. + + * mel-b-ccl.el (base64-ccl-write-decoded-region): Use + `write-region-as-specified-coding-system' instead of + `write-region'. + * mel-q-ccl.el (quoted-printable-ccl-write-decoded-region): + Likewise. + + +1998-12-02 MORIOKA Tomohiko + + * FLIM: Version 1.12.1 (Nishinoky-D) released.-A + +1998-11-30 MORIOKA Tomohiko + + * smtpmail.el (smtpmail-send-it): Add autoload cookie; use + `smtpmail-do-bcc' instead of `smtp-do-bcc'; modify for interface + change of `smtp-via-smtp'. + (smtpmail-do-bcc): New function (moved and renamed from + `smtp-do-bcc' of smtp.el). + +1998-08-06 Katsumi Yamaoka + + * lisp/smtp.el: Do not insert empty line at the end of message. + +1998-06-18 Shuhei KOBAYASHI + + * lisp/smtp.el (smtp-use-8bitmime): New variable. + (smtp-debug-info): Internal variable, now. + (smtp-make-fqdn): Renamed from `smtp-fqdn'. + (smtp-via-smtp): New implementation. + (smtp-send-command): Treat "PASS" as usual. + (smtp-do-bcc): Removed. + +1998-11-30 MORIOKA Tomohiko + + * smtpmail.el: New module (copied from Semi-gnus 6.8). + + * smtp.el: New module (copied from Semi-gnus 6.8). + + * FLIM-ELS: Add smtp.el and smtpmail.el. + +1998-11-30 MORIOKA Tomohiko + + * mime-def.el: Abolish function `eliminate-top-spaces' because it + is not used in FLIM. + +1998-11-29 MORIOKA Tomohiko + + * eword-encode.el (eword-encode-mailbox-to-rword-list): Fix + problem in `eword-encode-addresses-to-rword-list'. + +1998-11-26 MORIOKA Tomohiko + + * std11.el (std11-full-name-string): fixed. + + * std11.el (std11-comment-value-to-string): fixed. + +1998-11-25 MORIOKA Tomohiko + + * NEWS (Changes in FLIM 1.12): New section. + +1998-11-25 MORIOKA Tomohiko + + * std11.el (std11-comment-value-to-string): New function. + (std11-full-name-string): Use `std11-comment-value-to-string'. + + * eword-decode.el (eword-parse-comment): New function. + (eword-analyze-comment): New implementation; use + `eword-parse-comment'; change representation. + (eword-decode-token): Modify for representation change of comment. + + +1998-11-16 MORIOKA Tomohiko + + * FLIM: Version 1.12.0 (Amagatsuji) was released. + +1998-11-14 Tanaka Akira + + * mel-b-ccl.el (ccl-cascading-read): Check consistency. + +1998-11-13 MORIOKA Tomohiko + + * eword-decode.el (eword-decode-structured-field-body): Abolish + non-used local variable. + +1998-11-12 Tanaka Akira + + * mel-b-ccl.el (mel-ccl-decode-b): Check `ccl-cascading-read' to + select implementation. + +1998-11-12 Tanaka Akira + + * mel-q-ccl.el (mel-ccl-encode-quoted-printable-generic): workaround + for mule-2.3@19.34. + +1998-11-12 Tanaka Akira + + * mel.el (mel-b-builtin): New variable. + +1998-11-10 Tanaka Akira + + * FLIM-ELS: require 'pccl. + (flim-modules): Check CCL availability by broken facility. + +1998-11-08 MORIOKA Tomohiko + + * eword-decode.el (eword-decode-structured-field-body): New + implementation; abolish optional argument `must-unfold'; delete + DOC-string. + (eword-decode-and-unfold-structured-field-body): Renamed from + `eword-decode-and-unfold-structured-field'; delete DOC-string. + (eword-decode-and-fold-structured-field-body): Renamed from + `eword-decode-and-fold-structured-field'; abolish optional + argument `must-unfold'; delete DOC-string. + (eword-decode-unstructured-field-body): Abolish optional argument + `must-unfold'; delete DOC-string. + (eword-decode-and-unfold-unstructured-field-body): Renamed from + `eword-decode-and-unfold-unstructured-field'; delete DOC-string. + (eword-decode-unfolded-unstructured-field-body): New function. + +1998-11-08 MORIOKA Tomohiko + + * mmgeneric.el (mime-insert-header-from-buffer): Use + `mime-find-field-presentation-method' and + `mime-find-field-decoder-internal'. + + * eword-decode.el (mime-find-field-presentation-method): New + macro. + (mime-find-field-decoder-internal): New function. + (mime-find-field-decoder): New implementation (use + mime-find-field-decoder-internal). + (mime-decode-header-in-region): Use + `mime-find-field-presentation-method' and + `mime-find-field-decoder-internal'. + +1998-11-08 MORIOKA Tomohiko + + * mmgeneric.el (mime-insert-header-from-buffer): Rename + field-presentation-mode `folding' to `wide'. + + * eword-decode.el: Rename field-presentation-modes from `native', + `folding', `unfolding', `unfolding-xover' to `plain', `wide', + `summary', `nov'. + +1998-11-07 Tanaka Akira + + * eword-decode.el (mime-set-field-decoder): Add mode `unfolding-xover'. + (mime-find-field-decoder): Ditto. + +1998-11-04 MORIOKA Tomohiko + + * eword-encode.el (eword-encode-phrase-route-addr-to-rword-list): + Don't delete the front spaces. + (eword-encode-addresses-to-rword-list): Don't supplement space; + use `nconc' instead of `append'. + (eword-encode-msg-id-to-rword-list): Supplement the front space; + use `nconc' instead of `append'. + +1998-11-02 Tanaka Akira + + * eword-decode.el (mime-field-decoder-cache): New variable. + (mime-find-field-decoder): Use `mime-field-decoder-cache'. + (mime-update-field-decoder-cache): New variable. + (mime-update-field-decoder-cache): New function. + (mime-decode-header-in-region): Use `mime-field-decoder-cache'. + + * mmgeneric.el (mime-insert-header-from-buffer): Use + `mime-field-decoder-cache'. + +1998-11-02 MORIOKA Tomohiko + + * eword-decode.el (mime-decode-header-in-region): New function. + (mime-decode-header-in-buffer): Use function + `mime-decode-header-in-region'. + +1998-10-28 MORIOKA Tomohiko + + * mmgeneric.el (mime-insert-header-from-buffer): Refer + `mime-field-decoder-alist' instead of hard-coding. + + * mime.el (mime-read-field): Use `mime-decode-field-body'. + + * eword-decode.el (eword-decode-and-unfold-structured-field): Add + optional dummy argument `start-column' and `max-column'. + (eword-decode-structured-field-body): Change interface. + (eword-decode-unstructured-field-body): Change interface to add + optional dummy argument `start-column' and `max-column'. + (eword-decode-and-unfold-unstructured-field): Add optional dummy + argument `start-column' and `max-column'. + (mime-field-decoder-alist): New variable; abolish user option + `eword-decode-ignored-field-list' and + `eword-decode-structured-field-list'. + (mime-set-field-decoder): New function. + (mime-find-field-decoder): New function. + (mime-decode-field-body): New function; abolish function + `eword-decode-field-body'. + (mime-decode-header-in-buffer): Renamed from + `eword-decode-header'; refer `mime-field-decoder-alist' instead of + hard-coding; add obsolete alias `eword-decode-header'. + +1998-10-28 MORIOKA Tomohiko + + * mime-def.el: Avoid compile error when edebug is missing. + + +1998-10-28 MORIOKA Tomohiko + + * FLIM: Version 1.11.3 (Saidaiji) was released. + +1998-10-27 MORIOKA Tomohiko + + * VERSION: New file (Renamed from FLIM-VERSION). + +1998-10-27 MORIOKA Tomohiko + + * eword-encode.el (eword-encode-char-type): Return nil for ?\n. + +1998-10-27 Tanaka Akira + + * eword-encode.el (eword-encode-field-body): Unfold `field-body'. + +1998-10-27 Yoshiki Hayashi + + * README.ja: Update. + + +1998-10-26 MORIOKA Tomohiko + + * FLIM: Version 1.11.2 (Heij-D) was released.-A + + * NEWS (Abolish variable `mime-temp-directory'): New subsection. + + * README.en (Installation): Modify for APEL 9.6. + +1998-10-26 MORIOKA Tomohiko + + * eword-encode.el (eword-encode-field-body): Don't eliminate + top-spaces. + +1998-10-25 MORIOKA Tomohiko + + * FLIM-ELS (flim-modules): Don't install mel-b-el for Emacs 20.4. + +1998-10-25 Tanaka Akira + + * eword-decode.el (eword-decode-field-body): Refine implementation. + +1998-10-24 Tanaka Akira + + * mel-b-ccl.el, mel-q-ccl.el, mel.el, FLIM-ELS: Divide mel-ccl.el + into mel-b-ccl.el and mel-q-ccl.el. + +1998-09-11 Tanaka Akira + + * mel.el (base64-encoded-length): New implementation. + +1998-10-25 Tanaka Akira + + * eword-decode.el (eword-decode-field-body): New function. + +1998-10-25 MORIOKA Tomohiko + + * eword-encode.el (eword-encode-field-body): Change interface. + (eword-encode-header): Use `eword-encode-field-body'; abolish + function `eword-encode-field'. + +1998-10-25 Tanaka Akira + + * eword-encode.el (eword-encode-field-body): New function. + (eword-encode-field): Use `eword-encode-field-body'. + +1998-10-24 MORIOKA Tomohiko + + * mel.el, mel-b-el.el, FLIM-ELS: Rename mel-b.el -> mel-b-el.el. + +1998-10-24 MORIOKA Tomohiko + + * mel-u.el (uuencode-external-decode-region): Use + `temporary-file-directory' instead of `mime-temp-directory'. + (mime-write-decoded-region): Likewise. + + * mime-def.el: Abolish variable `mime-temp-directory'. + +1998-10-24 MORIOKA Tomohiko + + * mmgeneric.el (mime-insert-header-from-buffer): New function. + (insert-header): Use `mime-insert-header-from-buffer'. + +1998-10-24 MORIOKA Tomohiko + + * FLIM-ELS: Don't install mel-b-dl.el if the running emacs has + builtin base64 encoder/decoder. + + * mel.el: Set up builtin base64 encoder/decoder if they are + available. + + * mime-def.el (base64-dl-module): Set nil as initial value if the + running emacs has builtin base64 encoder/decoder. + + * mel-b.el: Require `poe' instead of `emu'. + (base64-encode-string): Use `defun-maybe'. + (base64-encode-region): Likewise. + (base64-decode-region): Likewise. + (base64-decode-string): Likewise. + + * mel-b-dl.el: Require `poe' instead of `emu'. + + +1998-10-23 MORIOKA Tomohiko + + * FLIM: Version 1.11.1 (Takanohara) was released. + +1998-10-22 Yoshiki Hayashi + + * README.ja: New file. + +1998-10-20 MORIOKA Tomohiko + + * mime-def.el: Require mcharset. + +1998-10-20 Katsumi Yamaoka + + * mel-u.el (mime-write-decoded-region): Fix typo. + + * mime-def.el: Enclose defining procedure for the constants + `std11-quoted-pair-regexp', `std11-non-qtext-char-list' and + `std11-qtext-regexp' with `eval-and-compile'. + +1998-10-19 MORIOKA Tomohiko + + * NEWS (Behavior change of `mime-insert-header'): New subsection. + + * mmgeneric.el (insert-header): Include `:' in field-name. + +1998-10-19 MORIOKA Tomohiko + + * mime-def.el (std11-qtext-regexp): Use `eval-when-compile'; don't + use `char-list-to-string'. + (std11-quoted-string-regexp): Use `eval-when-compile'. + - Use `def-edebug-spec' to define edebug-form-spec of + mm-define-method; fix definition of edebug-form-spec of + mm-define-method. + +1998-10-18 MORIOKA Tomohiko + + * mime-en.sgml, mime-ja.sgml (Header encoder/decoder): Add + description about `eword-field-encoding-method-alist'. + + * mime-en.sgml (Header encoder/decoder): Modify description about + `eword-encode-header'. + + * mime-ja.sgml (Header encoder/decoder): Translate. + +1998-10-18 MORIOKA Tomohiko + + * mime-en.sgml (entity formatting): Fix typo in description of + `default-mime-charset'. + + * mime-en.sgml (Header encoder/decoder): Modify description of + `eword-decode-header'. + + * mime-ja.sgml, mime-en.sgml (Header encoder/decoder): fix typo. + + * mime-en.sgml (encoder/decoder): Translate description of + `mime-decode-string'. + +1998-10-18 MORIOKA Tomohiko + + * mime-en.sgml (Content-Disposition parser): Modify description. + + * mime-en.sgml (Content-Type parser): Modify description. + +1998-10-18 MORIOKA Tomohiko + + * mime-en.sgml (Content-Transfer-Encoding parser): Translate. + + +1998-10-18 MORIOKA Tomohiko + + * FLIM: Version 1.11.0 (Yamadagawa) was released. + +1998-10-17 MORIOKA Tomohiko + + * mime-ja.sgml, mime-en.sgml (entity formatting): Add description + about `mime-insert-text-content'. + +1998-10-17 MORIOKA Tomohiko + + * mime-ja.sgml, mime-en.sgml (entity formatting): New node; move + `mime-insert-header' from `Entity-header'; move + `default-mime-charset' from `custom'. + +1998-10-17 MORIOKA Tomohiko + + * mime-en.sgml, mime-ja.sgml (Entity-header): Generic function + `mime-insert-decoded-header' was renamed to `mime-insert-header'. + +1998-10-17 MORIOKA Tomohiko + + * NEWS: New file. + +1998-10-16 MORIOKA Tomohiko + + * mime.el (mime-insert-header): Renamed from + `mime-insert-decoded-header'; define `mime-insert-decoded-header' + as an obsolete alias. + + * mmgeneric.el, mmcooked.el (insert-header): Renamed from + `insert-decoded-header'. + + * README.en (Installation): Add required version of APEL. + +1998-10-16 MORIOKA Tomohiko + + * mel-g.el: Require mel. + + * mel-g.el: Require poem instead of emu. + +1998-10-16 MORIOKA Tomohiko + + * mime.el (mime-insert-text-content): New generic function. + + * mmcooked.el, mmgeneric.el (insert-text-content): New method. + +1998-10-02 MORIOKA Tomohiko + + * std11.el (std11-unfold-string): New implementation. + +1998-10-02 MORIOKA Tomohiko + + * mmgeneric.el: New module. + + * mmbuffer.el: Use `generic' as mother backend. + + * FLIM-ELS (flim-modules): Add mmgeneric. + +1998-10-01 MORIOKA Tomohiko + + * mime-parse.el (mime-parse-message): Modify for + `make-mime-entity-internal'. + + * mime-def.el (make-mime-entity-internal): Change interface to be + able to specify original-header and parsed-header. + +1998-09-30 MORIOKA Tomohiko + + * eword-decode.el (eword-decode-and-unfold-unstructured-field): + New function. + +1998-09-30 MORIOKA Tomohiko + + * mime.el (mime-entity-content-type): New implementation. + (mime-entity-content-disposition): New implementation. + (mime-entity-encoding): New implementation. + + * mime.el (mime-fetch-field): Refer internal slots for Date, + Message-Id and References fields. + + * mime-parse.el (mime-parse-message): Modify for + `make-mime-entity-internal'. + + * mime-def.el: Change `mime-entity-*-internal' and + `mime-entity-set-*-internal' to macro. + (make-mime-entity-internal): Change interface and data format for + NOV data; changed to macro. + (mime-entity-set-location-internal): New macro. + (mime-entity-decoded-subject-internal): New macro. + (mime-entity-set-decoded-subject-internal): New macro. + (mime-entity-decoded-from-internal): New macro. + (mime-entity-set-decoded-from-internal): New macro. + (mime-entity-date-internal): New macro. + (mime-entity-set-date-internal): New macro. + (mime-entity-message-id-internal): New macro. + (mime-entity-set-message-id-internal): New macro. + (mime-entity-references-internal): New macro. + (mime-entity-set-references-internal): New macro. + (mime-entity-chars-internal): New macro. + (mime-entity-set-chars-internal): New macro. + (mime-entity-lines-internal): New macro. + (mime-entity-set-lines-internal): New macro. + (mime-entity-xref-internal): New macro. + (mime-entity-set-xref-internal): New macro. + (mime-entity-original-header-internal): Modify for new structure; + changed to macro. + (mime-entity-set-original-header-internal): Likewise. + (mime-entity-parsed-header-internal): Likewise. + (mime-entity-set-parsed-header-internal): Likewise. + (mime-entity-buffer-internal): Likewise. + (mime-entity-set-buffer-internal): Likewise. + (mime-entity-header-start-internal): Likewise. + (mime-entity-set-header-start-internal): Likewise. + (mime-entity-header-end-internal): Likewise. + (mime-entity-set-header-end-internal): Likewise. + (mime-entity-body-start-internal): Likewise. + (mime-entity-set-body-start-internal): Likewise. + (mime-entity-body-end-internal): Likewise. + (mime-entity-set-body-end-internal): Likewise. + + +1998-10-14 MORIOKA Tomohiko + + * FLIM: Version 1.10.5 (Kizugawadai) was released. + + * mel.el: Must require poem. + + +1998-10-12 MORIOKA Tomohiko + + * FLIM: Version 1.10.4 (Shin-H-Dsono) was released.-A + +1998-10-12 Katsumi Yamaoka + + * README.en: Add explanation about `VERSION_SPECIFIC_LISPDIR'. + + * Makefile (install): Add new arg `VERSION_SPECIFIC_LISPDIR'. + (elc): Likewise. + + * FLIM-MK (config-flim): Refer to `VERSION_SPECIFIC_LISPDIR'. + + * FLIM-CFG (VERSION_SPECIFIC_LISPDIR): New variable. + +1998-10-12 MORIOKA Tomohiko + + * mel.el (mel-ccl-module): Require path-util when the running + emacs has MULE. + + * mel.el: Don't require emu. + +1998-10-11 MORIOKA Tomohiko + + * FLIM-ELS: Don't install mel-ccl in anything older than XEmacs 21 + with MULE. + + +1998-10-10 MORIOKA Tomohiko + + * FLIM: Version 1.10.3 (Komada) was released. + + * mel-ccl.el (base64-ccl-write-decoded-region): bind + `jka-compr-compression-info-list' with nil. + + * mel-b.el (base64-internal-decoding-limit): Switch default value + between XEmacs-mule and other emacsen. + Abolish function `base64-decode-string!'. + (base64-internal-decode-region): New implementation. + (base64-insert-encoded-file): New function. + (mime-insert-encoded-file): Use `base64-insert-encoded-file'. + (base64-write-decoded-region): New function. + (mime-write-decoded-region): Use `base64-write-decoded-region'. + + * mel-b-dl.el (decode-base64-region): Renamed from + `base64-decode-region'. + (mime-insert-encoded-file): Change temporary-buffer to unibyte + representation. Abolish method `mime-write-decoded-region' + because it is slower than CCL based implementation. + +1998-10-09 Tanaka Akira + + * mel-ccl.el: Check `ccl-execute-eof-block-on-decoding-some' + facility instead of `ccl-execute-eof-block-on-encoding-some'. + +1998-10-09 MORIOKA Tomohiko + + * mel-b.el (base64-characters): Enclose with `eval-and-compile'. + + * eword-decode.el (eword-encoded-text-regexp): Enclose with + `eval-and-compile'. + (eword-encoded-word-regexp): Use `eval-when-compile'. + +1998-10-09 MORIOKA Tomohiko + + * eword-decode.el (eword-max-size-to-decode): New user option. + (eword-decode-and-fold-structured-field): Do nothing if size of + input is bigger than `eword-max-size-to-decode'. + +1998-10-08 MORIOKA Tomohiko + + * mel-b.el (base64-numbers): Use `eval-when-compile'. + +1998-10-09 Katsumi Yamaoka + + * FLIM-CFG: Use `add-latest-path' instead of `add-path' for adding + "custom" to load-path. + +1998-10-09 Katsumi Yamaoka + + * mime-def.el (mime-library-product): Enclose with + `eval-and-compile'. + + * FLIM-CFG: Add "custom" to load-path. + + +1998-10-08 MORIOKA Tomohiko + + * FLIM: Version 1.10.2 (Kintetsu-Miyazu) was released. + + * mime-def.el, mel.el, mel-b-dl.el: Move variable + `base64-dl-module' from mel-b-dl.el and mel.el to mime-def.el. + +1998-10-08 MORIOKA Tomohiko + + * mel.el (mel-ccl-module): New variable; use it to check mel-ccl + is available. + + * FLIM-ELS: Don't install mel-ccl for anything older than MULE + 2.3. + +1998-10-08 MORIOKA Tomohiko + + * mel-u.el: Use `mel-define-backend' to define "x-uue". + Define "x-uuencode" as a clone of "x-uue". + + * Move variable `mel-encoding-module-alist' from mel.el to + mime-def.el. + + * mel.el (mel-find-function): Use function + `mel-find-function-from-obarray'. + Use `mel-define-backend' to define "7bit", "8bit" and "binary"; + don't define methods of "8bit" and "binary"; inherit methods from + "7bit". + + * mime-def.el (mel-service-list): New variable. + (mel-define-service): New implementation. + (mel-find-function-from-obarray): New inline function. + (mel-copy-method): New inline function. + (mel-copy-backend): New inline function. + (mel-define-backend): New macro. + +1998-10-08 MORIOKA Tomohiko + + * mel-u.el: Define method functions of mel. + (mime-encode-region): Use `mel-define-method-function'; abolish + `uuencode-encode-region'. + (mime-decode-region): Use `mel-define-method-function'; abolish + `uuencode-decode-region'. + (mime-encode-string): New method. + (mime-decode-string): New method. + (mime-insert-encoded-file): Use `mel-define-method'; abolish + `uuencode-insert-encoded-file'. + (mime-write-decoded-region): Use `mel-define-method'; abolish + `uuencode-write-decoded-region'. + +1998-10-07 MORIOKA Tomohiko + + * mime-def.el (mel-define-service): Add DOC. + (mel-define-method): Add DOC. + (mel-define-method-function): Add DOC. + + * mime-en.sgml, mime-ja.sgml: Modify for FLIM 1.10. + + +1998-10-07 MORIOKA Tomohiko + + * FLIM: Version 1.10.1 (Miyamaki) was released. + +1998-10-06 MORIOKA Tomohiko + + * mel-g.el: Define method functions of mel. + (mime-encode-region): Use `mel-define-method-function'; abolish + `gzip64-encode-region'. + (mime-decode-region): Use `mel-define-method-function'; abolish + `gzip64-decode-region'. + (mime-encode-string): New method. + (mime-decode-string): New method. + (mime-insert-encoded-file): Use `mel-define-method'; abolish + `gzip64-insert-encoded-file'. + (mime-write-decoded-region): Use `mel-define-method'; abolish + `gzip64-write-decoded-region'. + + * mime-def.el (mime-library-product): New variable; abolish + `mime-library-version'. + (mime-product-name): New macro. + (mime-product-version): New macro. + (mime-product-code-name): New macro. + (mime-library-version): Renamed from + `mime-library-version-string'; use `mime-library-product', + `mime-product-name', `mime-product-version' and + `mime-product-code-name'. + + * mime-def.el (mm-define-backend): Add DOC. + (mm-define-method): Add DOC. + + * mel.el (mime-encoding-list): Modify DOC to add description about + optional argument SERVICE. + +1998-10-04 MORIOKA Tomohiko + + * mime-ja.sgml, mime-en.sgml (mm-backend module): Write + description of `mm-define-backend' and `mm-define-method'. + + +1998-09-29 MORIOKA Tomohiko + + * FLIM: Version 1.10.0 (K-Ddo) was released.-A + + * README.en (What's FLIM): Add mel-ccl.el. + +1998-09-21 Tanaka Akira + + * mel-ccl.el: + - Require 'pccl instead of 'emu. + - Use `unless-broken' to check facility. + +1998-09-27 MORIOKA Tomohiko + + * mel.el (mime-encoding-list): New user option (renamed from + `mime-content-transfer-encoding-list'). + (mime-encoding-list): New function. + (mime-encoding-alist): New function. + (mime-encode-region): Use `mime-encoding-alist' for completion. + (mime-decode-region): Likewise. + (mime-insert-encoded-file): Likewise. + (mime-write-decoded-region): Likewise. + +1998-09-24 MORIOKA Tomohiko + + * eword-decode.el (eword-decode-structured-field-list): Add + Mail-Followup-To field. + +1998-09-20 MORIOKA Tomohiko + + * eword-encode.el (eword-charset-encoding-alist): Add utf-8. + +1998-09-20 MORIOKA Tomohiko + + * mel.el (mime-content-transfer-encoding-list): New user option. + (mime-encode-region): Use `mime-content-transfer-encoding-list' + for completion. + (mime-decode-region): Likewise. + (mime-insert-encoded-file): Likewise. + (mime-write-decoded-region): Likewise. + + * mel.el (mime-write-decoded-region): fix typo. + +1998-09-20 MORIOKA Tomohiko + + * mime-def.el (mel-define-method-function): Don't override. + +1998-09-20 MORIOKA Tomohiko + + * mel.el, mel-ccl.el, FLIM-ELS: Add mel-ccl.el. + +1998-09-20 MORIOKA Tomohiko + + * mel-dl.el, README.en, FLIM-ELS: Rename mel-dl.el to mel-b-dl.el. + + * mel.el: - Rename mel-dl.el to mel-b-dl.el. + - Move `mel-define-service' to mime-def.el. + + * mime-def.el (mel-define-service): New macro (moved from mel.el); + fixed problem in Emacs. + (mel-define-method): Use `mel-define-service'. + (mel-define-method-function): Use `mel-define-service'. + +1998-09-20 MORIOKA Tomohiko + + * mel.el (mime-encode-region): Don't regard nil encoding as + "7bit". + +1998-09-19 MORIOKA Tomohiko + + * eword-encode.el (eword-encode-text): Use + `encoded-text-encode-string'. + (tm-eword::encoded-word-length): `q-encoding-encoded-length' was + renamed to `Q-encoded-text-length'. + + * eword-decode.el: Move `base64-token-regexp', + `base64-token-padding-regexp', `eword-B-encoded-text-regexp' and + `eword-Q-encoded-text-regexp' to mime-def.el. + (eword-decode-encoded-text): Use `encoded-text-decode-string'. + + * mel-q.el: Define method functions of mel. + (mime-insert-encoded-file): Use `mel-define-method'; abolish + `quoted-printable-insert-encoded-file'. + (mime-write-decoded-region): Use `mel-define-method'; abolish + `quoted-printable-write-decoded-region'. + - Move `q-encoding-printable-char-p' and + `q-encoding-encoded-length' to mel.el. + + * mel-b.el: Define method functions of mel. + (mime-insert-encoded-file): Use `mel-define-method'; abolish + `base64-insert-encoded-file'. + (mime-write-decoded-region): Use `mel-define-method'; abolish + `base64-write-decoded-region'. + - Move `base64-encoded-length' to mel.el. + + * mel-dl.el (base64-encode-region): Define directly (abolish + `base64-dl-encode-region'). + (base64-decode-region): Define directly (abolish + `base64-dl-decode-region'). Define method functions of mel. + (mime-insert-encoded-file): Use `mel-define-method'; abolish + `base64-insert-encoded-file'; don't use external encoder. + (mime-write-decoded-region): Use `mel-define-method'; abolish + `base64-write-decoded-region'; don't use external decoder. + - Move `base64-encoded-length' to mel.el. + + * mime.el: Move `mm-arglist-to-arguments' to mime-def.el. + + * mime-def.el (base64-token-regexp): New constant (moved from + eword-decode.el). + (base64-token-padding-regexp): Likewise. + (B-encoded-text-regexp): New constant (moved from eword-decode.el, + and renamed from `eword-B-encoded-text-regexp'). + (Q-encoded-text-regexp): New constant (moved from eword-decode.el, + and renamed from `eword-Q-encoded-text-regexp'. + (mm-arglist-to-arguments): New function (moved from mime.el). + (mel-define-method): New macro. + (mel-define-method-function): New macro. + (mel-define-function): New macro. + + * mel.el (mel-encoding-module-alist): New variable. + (mel-use-module): New function. + (mel-find-function): New function. + (mel-define-service): New macro. + (mime-encode-region): Use `mel-find-function'; abolish variable + `mime-encoding-method-alist'. + (mime-decode-region): Use `mel-find-function'; abolish variable + `mime-decoding-method-alist'. + (mime-decode-string): Use `mel-find-function'; abolish variable + `mime-string-decoding-method-alist'. + (encoded-text-encode-string): New function. + (encoded-text-decode-string): New function. + (base64-encoded-length): New function (moved from mel-b.el and + mel-dl.el). + (Q-encoding-printable-char-p): New function (moved from mel-q.el, + and renamed from `q-encoding-printable-char-p'). + (Q-encoded-text-length): New function (moved from mel-q.el, and + renamed from `q-encoding-encoded-length'). + (mime-insert-encoded-file): Use `mel-find-function'; abolish + variable `mime-file-encoding-method-alist'. + (mime-write-decoded-region): Use `mel-find-function'; abolish + variable `mime-file-decoding-method-alist'. + +1998-09-16 MORIOKA Tomohiko + + * mel-b.el (base64-internal-encoding-limit): modify :type. + (base64-internal-decoding-limit): Change initial value to 70000; + modify :type. + + * mel-b.el (base64-decode-string!): Renamed from + `base64-internal-decode-string!'. + +1998-09-16 MORIOKA Tomohiko + + * mel-b.el (base64-characters): New constant. + (base64-num-to-char): Use `base64-characters'. + (base64-numbers): Use `base64-characters'. + (base64-internal-decode): Modify calculation third byte. + + * mel-dl.el (base64-dl-encode-string): New alias. + (base64-dl-decode-string): New alias. + (base64-dl-encode-region): Renamed from `base64-encode-region'; + don't save-excursion and save-restriction. + (base64-dl-decode-region): Renamed from `base64-decode-region'; + don't save-excursion and save-restriction; convert all at once. + (base64-encode-region): New alias. + (base64-decode-region): New alias. + + * mel-b.el (base64-internal-decode): New function. + (base64-internal-decode-string): Use `base64-internal-decode'. + (base64-internal-decode-string!): New function. + (base64-internal-decode-region): Use + `base64-internal-decode-string!' instead of + `base64-internal-decode-string'. + +1998-09-15 Tanaka Akira + + * mel-b.el (base64-numbers): Fix a position of 63. + +1998-09-15 MORIOKA Tomohiko + + * mel-b.el (base64-numbers): New constant. + (base64-char-to-num): New macro. + (base64-internal-decode-string): Don't use memq. + +1998-09-15 MORIOKA Tomohiko + + * mel-b.el (base64): New group. + (base64-external-encoder): Now a user option. + (base64-external-decoder): Now a user option. + (base64-external-decoder-option-to-specify-file): Now a user + option. + (base64-internal-encoding-limit): Now a user option. + (base64-internal-decoding-limit): Now a user option. + + * mel-b.el (base64-internal-decode-string): New implementation; + abolish function `base64-decode-unit'. + +1998-09-15 MORIOKA Tomohiko + + * README.en (Installation): Fix typo. + + +1998-09-15 MORIOKA Tomohiko + + * FLIM: Version 1.9.2 (Shin-Tanabe) was released. + + * README.en (Installation): Add `install as a XEmacs package'. + +1998-09-15 MORIOKA Tomohiko + + * mime-en.sgml (Encoding Method): Translate. + +1998-09-15 MORIOKA Tomohiko + + * eword-encode.el (eword-encode-msg-id-to-rword-list): New + function. + (eword-encode-in-reply-to-to-rword-list): New function. + (eword-encode-in-reply-to): New function. + (eword-encode-field): Use `eword-encode-in-reply-to' for + `In-Reply-To' field. + + * std11.el (std11-parse-in-reply-to): New function. + +1998-09-14 MORIOKA Tomohiko + + * eword-decode.el (eword-decode-structured-field-list): Add + `User-Agent'. + +1998-09-11 MORIOKA Tomohiko + + * Makefile (package): Don't update auto-autoloads.el and + custom-load.el. + + * FLIM-MK (compile-flim-package): Update auto-autoloads.el and + custom-load.el. + +1998-09-11 MORIOKA Tomohiko + + * mime-def.el: Abolish function `butlast' and `nbutlast'. + + * mime-def.el (mime-library-version): New constant. + (mime-library-version-string): Refer `mime-library-version'. + +1998-09-11 MORIOKA Tomohiko + + * Makefile (XEMACS): New variable. + (PACKAGEDIR): New variable. + (package): New target. + (install-package): New target. + + * FLIM-CFG (PACKAGEDIR): New variable. + + * FLIM-MK (config-flim-package): New function. + (compile-flim-package): New function. + (install-flim-package): New function. + +1998-09-10 MORIOKA Tomohiko + + * mime-en.sgml (Content-Type field): Translate. + (mime-content-type): Translate. + (Content-Type parser): Translate. + (Content-Disposition): Translate. + (mime-content-disposition): Translate. + (Content-Disposition parser): Translate. + +1998-09-10 MORIOKA Tomohiko + + * Makefile (GOMI): Add Texinfo related garbages. + (clean): Delete historical setting. + +1998-09-03 MORIOKA Tomohiko + + * mime-en.sgml (mm-backend): Translate. + (Request for entity): Likewise. + (mm-backend module): Likewise. + + * mime.el (mime-entity-send): Add DOC-string. + +1998-09-01 MORIOKA Tomohiko + + * mime-en.sgml (Entity hierarchy): Translate. + +1998-09-01 MORIOKA Tomohiko + + * mime-en.sgml, mime-ja.sgml (Entity): Rearrangement. + + +1998-08-31 MORIOKA Tomohiko + + * FLIM: Version 1.9.1 (Tonosh-D) was released.-A + + * mime-en.sgml (mm-backend): Translate a little. + +1998-08-31 MORIOKA Tomohiko + + * eword-encode.el (eword-encode-default-start-column): New user + option. + (eword-encode-string): Use `eword-encode-default-start-column'. + (eword-encode-address-list): Likewise. + (eword-encode-structured-field-body): Likewise. + (eword-encode-unstructured-field-body): Likewise. + +1998-08-31 MORIOKA Tomohiko + + * eword-encode.el (eword-encode): New group. + (eword-field-encoding-method-alist): Now a user option (was: + variable). + +1998-08-31 MORIOKA Tomohiko + + * eword-encode.el: Rename `tm-eword::mailbox-to-rwl' -> + `eword-encode-mailbox-to-rword-list'. + + * eword-encode.el: Rename `tm-eword::phrase-to-rwl' -> + `eword-encode-phrase-to-rword-list'. + + * eword-encode.el: Rename `eword-addr-spec-to-rwl' -> + `eword-encode-addr-spec-to-rword-list'. + + * eword-encode.el: Rename `eword-phrase-route-addr-to-rwl' -> + `eword-encode-phrase-route-addr-to-rword-list'. + + * eword-encode.el: Rename `eword-addr-seq-to-rwl' -> + `eword-encode-addr-seq-to-rword-list'. + + * eword-encode.el: Rename `tm-eword::split-string' -> + `eword-encode-split-string'. + + * eword-encode.el: Rename `tm-eword::addresses-to-rwl' -> + `eword-encode-addresses-to-rword-list'. + + * eword-encode.el: Rename `tm-eword::encode-rwl' -> + `eword-encode-rword-list'. + + * eword-encode.el (eword-encode-unstructured-field-body): New + function. + (eword-encode-field): Use `eword-encode-unstructured-field-body'. + +1998-08-31 MORIOKA Tomohiko + + * eword-encode.el (eword-encode-string): Add DOC-string. + (eword-encode-address-list): Likewise. + (eword-encode-structured-field-body): Likewise. + + * eword-encode.el (eword-encode-field): Regard `In-Reply-To' as a + structured field. + +1998-08-28 MORIOKA Tomohiko + + * eword-encode.el (eword-encode-field): Use `capitalize' instead + of `downcase' for `field-name'. + + * eword-encode.el (eword-encode-structured-field-body): New + function. + (eword-encode-field): Use `eword-encode-structured-field-body' for + "MIME-Version" and "User-Agent" field. + +1998-08-26 Shuhei KOBAYASHI + + * mime-def.el (mm-define-method): Put `edebug-form-spec'. + +1998-08-28 MORIOKA Tomohiko + + * eword-encode.el (eword-encode-address-list): New function. + (eword-encode-field): Use `eword-encode-address-list' instead of + `tm-eword::encode-address-list'; abolish + `tm-eword::encode-address-list'. + + * eword-encode.el (eword-encode-field): Use `eword-encode-string' + instead of `tm-eword::encode-string'; abolish + `tm-eword::encode-string'. + + * eword-encode.el: Rename `tm-eword::make-rword' -> + `make-ew-rword'; rename `tm-eword::rword-' -> `ew-rword-'. + +1998-08-26 Shuhei KOBAYASHI + + * mel-b.el (base64-insert-encoded-file): Conditionally use + internal converter. (cf. [tm-ja:3320]) + (base64-write-decoded-region): Ditto. + +1998-08-25 MORIOKA Tomohiko + + * FLIM-ELS (flim-modules): Don't add `mel-dl' unconditionally. + +1998-08-25 MORIOKA Tomohiko + + * Delete mime-lib.el. + +1998-08-10 MORIOKA Tomohiko + + * mmbuffer.el (write-entity): `write-region-as-CRLF' was renamed + to `write-region-as-raw-text-CRLF'. + +1998-08-07 MORIOKA Tomohiko + + * mmbuffer.el (write-entity): Use `write-region-as-CRLF' instead + of `write-region-as-binary'. + + +1998-07-15 MORIOKA Tomohiko + + * FLIM: Version 1.9.0 (Terada) was released. + +1998-07-10 MORIOKA Tomohiko + + * mime-parse.el (mime-parse-multipart): Set message/x-broken if + parsing is failed. + +1998-07-10 MORIOKA Tomohiko + + * mmbuffer.el (entity-children): Don't use + `mime-entity-children-internal'. + + * mime-parse.el (mime-parse-multipart): Modify for + `mime-parse-message'; return children. + (mime-parse-encapsulated): Likewise. + (mime-parse-message): Change interface; delete DOC-string; don't + parse children instantly. + (mime-parse-buffer): Modify for `mime-parse-message'. + + * mime-parse.el (mime-parse-message): Delete autoload cookie. + + * mime.el: Delete autoload setting for `mime-parse-message'. + + * mime-en.sgml, mime-ja.sgml (Entity creation): Delete description + of `mime-parse-message'; modify description of `mime-parse-buffer' + to add `representation-type'. + + +1998-07-07 MORIOKA Tomohiko + + * FLIM-Chao: Version 1.8.0 (Shij-D) was released.-A + +1998-07-07 MORIOKA Tomohiko + + * mmcooked.el: Abolish method `open'. + + * mmbuffer.el (initialize-instance): New method; abolish `open'. + (entity-children): New method. + + * mime.el (mime-open-entity): Send `initialize-instance' to + created message. + (mime-entity-children): New implementation. + (mime-entity-parent): New implementation. + (mime-root-entity-p): New implementation. + + * mime-parse.el (mime-parse-multipart): Specify current entity as + parent. + (mime-parse-encapsulated): Likewise. + (mime-parse-message): Change interface to specify parent; modify + for `make-mime-entity-internal'. + (mime-parse-buffer): Modify for `mime-parse-message'. + + * mime-def.el (make-mime-entity-internal): Change interface; add + format of `mime-entity' to add `parent'. + +1998-07-07 MORIOKA Tomohiko + + * mmbuffer.el (mime-visible-field-p): Renamed from + `eword-visible-field-p'. + +1998-07-07 MORIOKA Tomohiko + + * mime.el (mm-arglist-to-arguments): New function. + (mm-define-generic): New macro. + (mime-entity-cooked-p): Use `mm-define-generic'. + (mime-entity-point-min): Use `mm-define-generic'. + (mime-insert-decoded-header): Use `mm-define-generic'. + (mime-entity-content): Use `mm-define-generic'. + (mime-write-entity-content): Use `mm-define-generic'. + (mime-write-entity): Use `mm-define-generic'. + (mime-write-entity-body): Use `mm-define-generic'. + +1998-07-07 MORIOKA Tomohiko + + * mmbuffer.el (eword-visible-field-p): Moved from mime.el. + + * mime.el: Move `eword-visible-field-p' to mmbuffer.el. + (mime-write-entity-body): Change message to `write-body'. + +1998-07-07 MORIOKA Tomohiko + + * mmcooked.el, mmbuffer.el (open): Renamed from `open-entity'. + + * mime.el (mime-open-entity): Change message to `open'. + + * mime-def.el (mm-define-backend): Must `copy-alist'. + +1998-07-07 MORIOKA Tomohiko + + * mmcooked.el, mmbuffer.el: Use `mm-define-backend' and + `mm-define-method'. + + * mime.el: Move `mime-entity-implementation-alist' to mime-def.el. + (mime-find-function): New implementation. + (mime-entity-cooked-p): Use `mime-entity-send'. + + * mime-def.el (mime-entity-implementation-alist): Moved from + mime.el. + (mm-define-backend): New macro. + (mm-define-method): New macro. + + +1998-07-05 MORIOKA Tomohiko + + * FLIM: Version 1.8.1 (Kutsukawa) was released. + +1998-07-04 MORIOKA Tomohiko + + * mime-en.sgml, mime-ja.sgml (Entity Attributes): Add description + about `default-encoding' of `mime-entity-encoding'. + + * mime-en.texi, mime-en.sgml: New files. + + * mime-ja.sgml (media-type): Fix typo. + + * mime-ja.sgml (Glossary): Fix order. + + * mime-ja.sgml (Entity Attributes): Use tag for nil. + + * mime-ja.sgml (Entity Attributes): Fix typo. + +1998-07-03 MORIOKA Tomohiko + + * mime.el (mime-entity-encoding): Add new optional argument + `default-encoding'; set default encoding if + Content-Transfer-Encoding field is not found. + +1998-07-03 MORIOKA Tomohiko + + * mmbuffer.el (mmbuffer-write-entity): Use + `mime-entity-buffer-internal', `mmbuffer-entity-point-min' and + `mmbuffer-entity-point-max'. + (mmbuffer-write-entity-body): Use `mime-entity-buffer-internal', + `mime-entity-body-start-internal' and + `mime-entity-body-end-internal'. + (mmbuffer-insert-decoded-header): Use + `mime-entity-buffer-internal', `mime-entity-header-start-internal' + and `mime-entity-header-end-internal'. + + +1998-07-01 MORIOKA Tomohiko + + * FLIM: Version 1.8.0 (-Dkubo) was released.-A + + * README.en: Delete `How to use'. + +1998-07-01 MORIOKA Tomohiko + + * mime-ja.sgml (Entity creation): Add reference for `mm-backend' + in description of `mime-open-entity'. + + * mime-ja.sgml (mm-backend): New section. + +1998-07-01 MORIOKA Tomohiko + + * mime-ja.sgml (Entity-header): Modify description about + `mime-insert-decoded-header'. + + * mmcooked.el (mmcooked-insert-decoded-header): New function. + + * mmbuffer.el (mmbuffer-insert-decoded-header): New function. + + * mime.el (mime-insert-decoded-header): Use implementation of + mm-backend; abolish optional argument `code-conversion'. + +1998-06-30 MORIOKA Tomohiko + + * eword-decode.el (eword-decode-encoded-text): Use + `decode-mime-charset-string'. + +1998-06-30 MORIOKA Tomohiko + + * mmcooked.el (mmcooked-write-entity-body): New function. + + * mmbuffer.el (mmbuffer-write-entity-body): New function. + + * mime.el (mime-write-entity-body): Use implementation of + mm-backend. + +1998-06-30 MORIOKA Tomohiko + + * mmcooked.el (mmcooked-write-entity): New function. + + * mmbuffer.el (mmbuffer-write-entity): New function. + + * mime.el (mime-write-entity): Use implementation of mm-backend. + +1998-06-30 MORIOKA Tomohiko + + * mmcooked.el (mmcooked-entity-content): New alias for + `mmbuffer-entity-content'. + (mmcooked-write-entity-content): New function. + + * mmbuffer.el (mmbuffer-entity-content): New function. + (mmbuffer-write-entity-content): New function. + + * mime.el (mime-entity-send): New function. + (mime-entity-buffer): Use `mime-entity-send'. + (mime-entity-point-min): Likewise. + (mime-entity-point-max): Likewise. + (mime-entity-header-start): Likewise. + (mime-entity-header-end): Likewise. + (mime-entity-body-start): Likewise. + (mime-entity-body-end): Likewise. + (mime-fetch-field): Likewise. + (mime-entity-content): Use implementation of mm-backend. + (mime-write-entity-content): Likewise. + + +1998-06-30 MORIOKA Tomohiko + + * FLIM: Version 1.7.0 (Iseda) was released. + + * mime-ja.sgml (Entity creation): Add description of + `mime-open-entity'. + (Entity Attributes): Add description of `mime-entity-cooked-p'. + (Entity-content): Add description of `mime-write-entity-content', + `mime-write-entity' and `mime-write-entity-body'. + +1998-06-29 MORIOKA Tomohiko + + * mime.el (mime-write-entity-content): New function. + +1998-06-28 MORIOKA Tomohiko + + * mime.el (mime-write-entity-body): New function. + + * mime.el (mime-write-entity): New function. + +1998-06-28 MORIOKA Tomohiko + + * mime-parse.el (mime-parse-multipart): Change media-type of + entity to application/octet-stream if the first delimiter is not + found. + +1998-06-28 MORIOKA Tomohiko + + * FLIM-ELS (flim-modules): Add `mmbuffer' and `mmcooked'. + + * mmcooked.el: New file. + + * mmbuffer.el: New file. + + * mime.el (mime-entity-implementation-alist): New variable. + (mime-find-function): New function. + (mime-open-entity): New function. + (mime-entity-function): New function. + (mime-entity-cooked-p): New function. + (mime-entity-buffer): Use backend-module. + (mime-entity-point-min): Likewise. + (mime-entity-point-max): Likewise. + (mime-entity-header-start): Likewise. + (mime-entity-header-end): Likewise. + (mime-entity-body-start): Likewise. + (mime-entity-body-end): Likewise. + (mime-fetch-field): Likewise. + + * mime-parse.el (mime-parse-message): New optional argument + `representation-type'. + (mime-parse-buffer): Likewise. + + * mime-def.el: Change format of mime-entity-internal to add + `representation-type' and `location'. + + +1998-06-28 MORIOKA Tomohiko + + * FLIM-Chao: Version 1.7.0 (Goj-D) was released.-A + +1998-06-26 MORIOKA Tomohiko + + * mime-ja.sgml: Modify for FLIM 1.7. + + * mime.el (mime-entity-number): Add DOC. + +1998-06-26 MORIOKA Tomohiko + + * mime.el (mime-entity-encoding): New implementation. + + * mime-parse.el (mime-parse-message): Abolish argument `encoding'. + + * mime-def.el (make-mime-entity-internal): Abolish argument + `encoding'. + (mime-entity-set-encoding-internal): New function. + +1998-06-26 MORIOKA Tomohiko + + * mime.el (mime-entity-content-disposition): New implementation. + + * mime-parse.el (mime-parse-message): Don't parse + Content-Disposition. + + * mime-def.el (make-mime-entity-internal): Delete argument + `content-disposition'. + (mime-entity-set-content-disposition-internal): New function. + +1998-06-25 MORIOKA Tomohiko + + * eword-decode.el: Move function `eword-visible-field-p' and + `mime-insert-decoded-header' to mime.el. + + * mime-parse.el: Use internal functions of mime-entity. + + * mime.el (mime-entity-children): Moved from mime-def.el; use + `mime-entity-children-internal'. + (mime-entity-node-id): Moved from mime-def.el; use + `mime-entity-node-id-internal'. + (mime-entity-number): Moved from mime-def.el; use + `mime-entity-node-id-internal'. + (mime-entity-buffer): Moved from mime-def.el; use + `mime-entity-buffer-internal'. + (mime-entity-point-min): Moved from mime-def.el; use + `mime-entity-header-start-internal'. + (mime-entity-point-max): Moved from mime-def.el; use + `mime-entity-body-end-internal'. + (mime-entity-header-start): Moved from mime-def.el; use + `mime-entity-header-start-internal'. + (mime-entity-header-end): Moved from mime-def.el; use + `mime-entity-header-end-internal'. + (mime-entity-content-type): Moved from mime-def.el; use + `mime-entity-content-type-internal'. + (mime-entity-content-disposition): Moved from mime-def.el; use + `mime-entity-content-disposition-internal'. + (mime-entity-encoding): Moved from mime-def.el; use + `mime-entity-encoding-internal'. + (mime-fetch-field): Use `mime-entity-original-header-internal' and + `mime-entity-set-original-header-internal'. + (mime-read-field): Use `mime-entity-parsed-header-internal' and + `mime-entity-set-parsed-header-internal'. + (eword-visible-field-p): Moved from eword-decode.el. + (mime-insert-decoded-header): Moved from eword-decode.el. + (mime-entity-body-start): Moved from mime-def.el; use + `mime-entity-body-start-internal'. + (mime-entity-body-end): Moved from mime-def.el; use + `mime-entity-body-end-internal'. + (mime-entity-media-type): Moved from mime-def.el. + (mime-entity-media-subtype): Moved from mime-def.el. + (mime-entity-parameters): Moved from mime-def.el. + (mime-entity-type/subtype): Moved from mime-def.el. + + * mime-def.el (make-mime-entity-internal): Renamed from + `make-mime-entity'. + (mime-entity-buffer-internal): New function. + (mime-entity-header-start-internal): New function. + (mime-entity-header-end-internal): New function. + (mime-entity-body-start-internal): New function. + (mime-entity-body-end-internal): New function. + (mime-entity-node-id-internal): New function. + (mime-entity-content-type-internal): New function. + (mime-entity-content-disposition-internal): New function. + (mime-entity-encoding-internal): New function. + (mime-entity-original-header-internal): New function. + (mime-entity-children-internal): New function. + (mime-entity-parsed-header-internal): New function. + (mime-entity-set-original-header-internal): Renamed from + `mime-entity-set-original-header'. + (mime-entity-set-children-internal): Renamed from + `mime-entity-set-children'. + (mime-entity-set-parsed-header-internal): Renamed from + `mime-entity-set-parsed-header'. Move `mime-entity-SLOT' + functions to mime.el. + +1998-06-25 MORIOKA Tomohiko + + * mime-ja.sgml (CVS): Fix typo. + +1998-06-24 MORIOKA Tomohiko + + * mime-parse.el (mime-parse-encapsulated): New function. + (mime-parse-message): Use `mime-parse-encapsulated'. + +1998-06-24 MORIOKA Tomohiko + + * mime-def.el (mime-entity-set-children): New function. + + * mime-parse.el (mime-parse-multipart): Change interface. + (mime-parse-message): Use `mime-entity-set-children'. + +1998-06-24 Shuhei KOBAYASHI + + * mime.el (mime-read-field): Fix typo. + + +1998-06-24 MORIOKA Tomohiko + + * FLIM: Version 1.6.0 (Ogura) was released. + + * mime-ja.sgml (Entity Attributes): New section. + + * mime-ja.sgml (Entity as node in message): Add description of + `mime-find-entity-from-number' and + `mime-find-entity-from-node-id'. + + * mime.el (mime-find-entity-from-number): New function. + (mime-find-entity-from-node-id): New function. + (mime-entity-parent): New function (moved from SEMI MIME-View). + (mime-entity-uu-filename): New function (moved from SEMI + MIME-View). + (mime-entity-filename): New function (moved from SEMI MIME-View). + + * mime-def.el (mime-uuencode-encoding-name-list): New variable. + +1998-06-24 MORIOKA Tomohiko + + * mime-ja.sgml: Modify for FLIM 1.6. + + * mime.el (mime-fetch-field): New function; abolish + `mime-entity-fetch-field'. + (mime-read-field): New function; abolish `mime-entity-read-field'. + +1998-06-23 MORIOKA Tomohiko + + * mime-ja.sgml, mime-ja.texi: New files. + +1998-06-22 Shuhei KOBAYASHI + + * mime-parse.el (mime-parse-message): Would error if empty body. + + +1998-06-22 MORIOKA Tomohiko + + * FLIM: Version 1.5.0 (Mukaijima) was released. + +1998-06-21 MORIOKA Tomohiko + + * README.en (What's FLIM): Modify for mime.el. + + * FLIM-ELS (flim-modules): Add `mime'. + + * mime-lib.el: Move every definitions to mime.el. + + * mime.el: New module (renamed from mime-lib.el). + +1998-06-21 MORIOKA Tomohiko + + * mime-lib.el: Add autoload setting for eword-encode.el. + + * mime-lib.el (mime-entity-content): New function. + +1998-06-20 MORIOKA Tomohiko + + * mel.el: Abolish constant `mel-version'. + + * mel.el (mime-string-decoding-method-alist): New variable. + (mime-decode-string): New function. + +1998-06-20 MORIOKA Tomohiko + + * mel-b.el (base64-external-decode-string): New function. + (base64-decode-string): New function. + +1998-06-20 MORIOKA Tomohiko + + * mel-q.el (quoted-printable-decode-string): New implementation. + +1998-06-20 MORIOKA Tomohiko + + * mel-q.el (quoted-printable-internal-decode-region): New + implementation. + +1998-06-20 MORIOKA Tomohiko + + * mel-q.el (q-encoding-decode-string): Use + `quoted-printable-hex-char-to-num'. + + * mel-q.el (quoted-printable-hex-char-to-num): New function. + (quoted-printable-decode-string): Use + `quoted-printable-hex-char-to-num'. + +1998-06-19 MORIOKA Tomohiko + + * mime-def.el, mime-parse.el: Move `mime-message-structure' from + mime-parse.el to mime-def.el. + +1998-06-19 MORIOKA Tomohiko + + * mime-lib.el, mime-parse.el: Move `mime-root-entity-p' from + mime-parse.el to mime-lib.el. + + * mime-lib.el: Add autoload setting for mime-parse.el. + +1998-06-19 MORIOKA Tomohiko + + * mime-parse.el, mime-def.el: Move `mime-entity-point-min', + `mime-entity-point-max', `mime-entity-media-type', + `mime-entity-media-subtype', `mime-entity-parameters' and + `mime-entity-type/subtype' from mime-parse.el to mime-def.el. + + * mime-parse.el, mime-def.el: Move `mime-content-disposition' + reference functions from mime-parse.el to mime-def.el. + + * mime-parse.el, mime-def.el: Move structure `mime-content-type' + from mime-parse.el to mime-def.el. + +1998-06-19 MORIOKA Tomohiko + + * mel-b.el (base64-internal-decode-string): Renamed from + `base64-decode-string'. + (base64-decode-string): New alias for + `base64-internal-decode-string'. + +1998-06-19 MORIOKA Tomohiko + + * mel-b.el (base64-decode-unit): New function; abolish + `base64-decode-1'. + (base64-decode-string): New implementation. + (base64-internal-decode-region): New implementation. + +1998-06-19 MORIOKA Tomohiko + + * mime-parse.el (mime-message-structure): New variable. + (mime-parse-buffer): New function. + +1998-06-19 Shuhei KOBAYASHI + + * mime-def.el: Require 'cl when it is compiled. + + * mime-lib.el (mime-entity-read-field): Fix typo. + Use `eword-decode-ignored-field-list'. + + * mime-parse.el (mime-parse-multipart): Fix typo. + (mime-parse-message): Parse message/external-body. + + +1998-06-19 MORIOKA Tomohiko + + * FLIM: Version 1.4.1 (Momoyama-Gory-Dmae) was released.-A + +1998-06-18 MORIOKA Tomohiko + + * eword-decode.el (mime-insert-decoded-header): Fix typo. + + +1998-06-18 MORIOKA Tomohiko + + * FLIM: Version 1.4.0 (Kintetsu-Tanbabashi) was released. + +1998-06-18 MORIOKA Tomohiko + + * README.en (What's FLIM): Add description about mime-lib.el and + mime-parse.el. + +1998-06-17 MORIOKA Tomohiko + + * mime-parse.el: Require 'cl when it is compiled. + + * eword-decode.el (eword-visible-field-p): New function. + (mime-insert-decoded-header): Use `eword-visible-field-p'. + +1998-06-17 MORIOKA Tomohiko + + * mime-def.el (mime-library-version-string): Renamed from + `mime-spadework-module-version-string'. + + * mime-parse.el: New file; moved from SEMI layer. + + * FLIM-ELS (flim-modules): Add `mime-parse'. + +1998-06-17 MORIOKA Tomohiko + + * FLIM-ELS (flim-modules): Add `mime-lib'. + + * mime-lib.el: New module. + + * mime-def.el (mime-entity): Add new slots for original-header and + parsed-header. + (mime-entity-set-original-header): New function. + (mime-entity-set-parsed-header): New function. + +1998-06-16 MORIOKA Tomohiko + + * mime-def.el (mime-entity-number): New function (moved from SEMI + layer). + +1998-06-16 MORIOKA Tomohiko + + * mime-def.el: Move definition of structure `mime-entity' from + SEMI layer. + +1998-06-16 MORIOKA Tomohiko + + * eword-decode.el (eword-decode-ignored-field-list): Capitalize + default value. + (eword-decode-structured-field-list): Capitalize default value. + (eword-decode-header): Regularize field name by `capitalize'. + (mime-insert-decoded-header): New function. + +1998-06-15 MORIOKA Tomohiko + + * mailcap.el (mailcap-file): Use `defcustom'. + + +1998-06-01 MORIOKA Tomohiko + + * FLIM: Version 1.3.0 (Fushimi) was released. + +1998-05-28 MORIOKA Tomohiko + + * std11.el (std11-fetch-field): New function. + (std11-field-body): Use 'std11-fetch-field. + +1998-05-28 MORIOKA Tomohiko + + * mime-def.el (regexp-*): New function (moved from mime-parse.el + of SEMI (REMI)). + (regexp-or): New function (moved from mime-parse.el of + SEMI (REMI)). + + (std11-quoted-pair-regexp): New constant (moved from mime-parse.el + of SEMI (REMI)). + (std11-non-qtext-char-list): New constant (copied from std11.el). + (std11-qtext-regexp): New constant (moved from mime-parse.el of + SEMI (REMI)). + (std11-quoted-string-regexp): New constant (moved from + mime-parse.el of SEMI (REMI)). + + +1998-05-17 MORIOKA Tomohiko + + * FLIM: Version 1.2.2 (Takeda) was released. + + * FLIM-VERSION: New file. + +1998-05-15 MORIOKA Tomohiko + + * mel-q.el (quoted-printable-internal-encode-region): Use + 'looking-at-as-unibyte instead of local binding for + enable-multibyte-characters. + + +1998-05-09 MORIOKA Tomohiko + + * FLIM: Version 1.2.1 (Kamitobaguchi) was released. + +1998-05-09 MORIOKA Tomohiko + + * mel-q.el (quoted-printable-internal-decode-region): Use + 'string-as-multibyte to avoid problem in Emacs 20.3. + +1998-05-08 Katsumi Yamaoka + + * mel-u.el: Use mime-temp-directory instead of TMP. + + +1998-05-06 MORIOKA Tomohiko + + * FLIM: Version 1.2.0 (J-Dj) was released.-A + + * README.en (What's FLIM): Delete description about + std11-parse.el; add description about mailcap.el. + +1998-05-06 MORIOKA Tomohiko + + * eword-decode.el (eword-decode-encoded-word-error-handler): New + variable. + (eword-decode-encoded-word-default-error-handler): New function. + (eword-decode-encoded-word): Use + 'eword-decode-encoded-word-error-handler. + +1998-05-06 MORIOKA Tomohiko + + * mailcap.el: Require 'mime-def. + + * mime-def.el (mime-type/subtype-string): New function (moved from + semi/mime-parse.el). + +1998-05-06 MORIOKA Tomohiko + + * std11-parse.el: Abolish std11-parse.el. + + * FLIM-ELS (flim-modules): Abolish 'std11-parse. + + * eword-decode.el: Require 'std11 instead of 'std11-parse. + + * std11.el: Merge std11-parse.el. + +1998-05-06 MORIOKA Tomohiko + + * mime-def.el (mime-temp-directory): Use 'defcustom. + + * mel-u.el: Require 'mime-def instead of 'mel. + + * mime-def.el (mime-temp-directory): New variable (moved from + mel.el). + + * mel.el: Move definition of 'mime-temp-directory to mime-def.el. + +1998-05-06 MORIOKA Tomohiko + + * mailcap.el (mailcap-format-command): New function. + + * mailcap.el (mailcap-look-at-mtext): Don't strip quoted character + again. + + +1998-05-05 MORIOKA Tomohiko + + * FLIM: Version 1.1.0 (T-Dji) was released.-A + +1998-05-04 MORIOKA Tomohiko + + * mime-def.el (quoted-printable-hex-chars): New constant. + (quoted-printable-octet-regexp): New constant. + + * mel-q.el, eword-decode.el: Move definition of constant + 'quoted-printable-hex-chars and 'quoted-printable-octet-regexp to + mime-def.el. + +1998-05-03 MORIOKA Tomohiko + + * mailcap.el (mailcap-look-at-mtext): Strip quoted character. + +1998-05-03 MORIOKA Tomohiko + + * mailcap.el (mailcap-look-at-mtext): Fix typo. + +1998-05-03 MORIOKA Tomohiko + + * FLIM-ELS (flim-modules): Add mailcap. + + * mailcap.el: New file (copied from SEMI). + +1998-04-23 Shuhei KOBAYASHI + + * eword-decode.el (eword-decode-ignored-field-list): Add + `received'. + + * mel.el (mime-temp-directory): Use TMPDIR, TMP, or TEMP + environment variables. + + +1998-04-17 MORIOKA Tomohiko + + * FLIM: Version 1.0.1 (Ky-Dto) was released.-A + + * mime-def.el (mime-spadework-module-version-string): New + constant. + + * eword-encode.el: Abolish constant 'eword-encode-version. + + * eword-decode.el: Abolish constant 'eword-decode-version. + +1998-04-17 MORIOKA Tomohiko + + * eword-encode.el (eword-encode-divide-into-charset-words): Use + 'char-length or 'char-next-index instead of 'char-bytes. + (tm-eword::encode-string-1): Use 'char-next-index instead of + 'char-bytes. + +1998-04-17 MORIOKA Tomohiko + + * mel.el (base64-dl-module): Must check base64.so actually exists. + + +1998-04-13 MORIOKA Tomohiko + + * FLIM: Version 1.0.0 was released. + + * README.en: Modify for FLIM. + + * ChangeLog: New file. + +1998-04-13 MORIOKA Tomohiko + + * FLIM-CFG, FLIM-ELS, FLIM-MK: New files. + + * Makefile: Modify for FLIM. + +1998-04-10 MORIOKA Tomohiko + + * Makefile: New file. + + * mime-def.el, std11-parse.el, std11.el, eword-decode.el, + eword-encode.el: Copied from MEL, SEMI (mime-def.el + eword-decode.el eword-encode.el) and APEL (std11-parse.el + std11.el). diff --git a/flim-1.14.9/FLIM-API.en b/flim-1.14.9/FLIM-API.en new file mode 100644 index 0000000..533ce5d --- /dev/null +++ b/flim-1.14.9/FLIM-API.en @@ -0,0 +1,1053 @@ + FLIM (Faithful Library about Internet Message) API + Version 1.14 + Draft Release 3 + +* Notation + +Each function is described by following notation: + +[Function] NAME-OF-FUNCTION (SIGNATURE) + DESCRIPTIONS + [ILEVEL] + +Each inline function is described by following notation: + +[Inline function] NAME-OF-FUNCTION (SIGNATURE) + DESCRIPTIONS + [ILEVEL] + +Each macro is described by following notation: + +[Macro] NAME-OF-MACRO (SIGNATURE) + DESCRIPTIONS + [ILEVEL] + +Each variable is described by following notation: + +[Variable] NAME-OF-VARIABLE + DESCRIPTIONS + [ILEVEL] + +ILEVEL specifies implementation level: + + Required: Must implement + Suggest: Should implement + Optional: Optional + +ULEVEL specifies implementation level: + + Suggest: Should use + Not Suggest: Should not use + Obsolete: Should not use (historical) + + +* MIME entity + +** How to use + +(require 'mime) + + +** MIME-Entity Creation + +[Function] mime-open-entity (type location) + Open an entity and return it. + + TYPE is representation-type. + + LOCATION is location of entity. Specification of it is depended on + representation-type. + + [Required] + (Usage: SEMI 1.14 MIME-View) + + +[Function] mime-parse-buffer (&optional buffer representation-type) + Parse BUFFER as a MIME message. + + If buffer is omitted, it parses current-buffer. + + [Optional] + + +** MIME-Entity Hierarchy + +[Function] mime-entity-children (entity) + Return list of entities included in the ENTITY. + + [Required] + (Usage: SEMI 1.14 MIME-View, MIME-PGP) + + +[Function] mime-entity-parent (entity &optional message) + Return mother entity of ENTITY. + + If MESSAGE is specified, it is regarded as root entity. + + [Suggest] + (Usage: SEMI 1.14 MIME-View, MIME-PGP) + + +[Function] mime-find-root-entity (entity) + Return root entity of ENTITY. + + [Suggest] + + +[Function] mime-root-entity-p (entity &optional message) + Return t if ENTITY is root-entity (message). + + If MESSAGE is specified, it is regarded as root entity. + + [Suggest] + + +[Function] mime-entity-node-id (entity) + Return node-id of ENTITY. + + [Suggest] + (Usage: SEMI 1.14 MIME-View, MIME-PGP) + + +[Function] mime-entity-number (entity) + Return entity-number of ENTITY. + + [Optional] + (Usage: SEMI 1.14 MIME-View, MIME-PGP) + + +** MIME-Entity Search + +[Function] mime-find-entity-from-node-id (entity-node-id message) + Return entity from ENTITY-NODE-ID in MESSAGE. + + [Suggest] + + +[Function] mime-find-entity-from-number (entity-number message) + Return entity from ENTITY-NUMBER in MESSAGE. + + [Optional] + + +[Function] mime-find-entity-from-content-id (cid message) + Return entity from CID in MESSAGE. + + [Suggest] + + +** MIME-Entity Attributes + +[Function] mime-entity-content-type (entity) + Return content-type of ENTITY. + + (cf. <** Content-Type>) + + [Suggest] + (Usage: SEMI 1.14 MIME-View) + + +[Inline function] mime-entity-media-type (entity) + Return primary media-type of ENTITY. + + [Suggest] + (Usage: SEMI 1.14 MIME-View) + + +[Inline function] mime-entity-media-subtype (entity) + Return media-subtype of ENTITY. + + [Suggest] + (Usage: SEMI 1.14 MIME-View) + + +[Inline function] mime-entity-type/subtype (entity) + Return media-type/subtype of ENTITY. + + [Suggest] + (Usage: SEMI 1.14 MIME-W3) + + +[Inline function] mime-entity-parameters (entity) + Return parameters of Content-Type of ENTITY. + + [Suggest] + (Usage: SEMI 1.14 MIME-View) + + +[Function] mime-entity-set-content-type (entity content-type) + Set ENTITY's content-type to CONTENT-TYPE. + + (cf. <** Content-Type>) + + [Suggest] + (Usage: SEMI 1.14 MIME-View) + + +[Function] mime-entity-content-disposition (entity) + Return content-disposition of ENTITY. + + (cf. <** Content-Disposition>) + + [Suggest] + (Usage: SEMI 1.14 MIME-View) + + +[Function] mime-entity-filename (entity) + Return filename of ENTITY. + + [Suggest] + (Usage: SEMI 1.14 MIME-View) + + +[Function] mime-entity-encoding (entity) + Return content-transfer-encoding of ENTITY. + + If the ENTITY does not have valid Content-Transfer-Encoding field, + return nil. + + [Suggest] + (Usage: SEMI 1.14 MIME-View) + + +[Function] mime-entity-set-encoding (entity encoding) + Set ENTITY's content-transfer-encoding to ENCODING. + + [Suggest] + (Usage: SEMI 1.14 MIME-View) + + +[Function] mime-entity-cooked-p (entity) + Return non-nil if contents of ENTITY has been already + code-converted. + + [Suggest] + (Usage: SEMI 1.14 MIME-PGP) + + +[Function] mime-entity-name (entity) + Return unique name of the ENTITY. + + [Suggest] + (Usage: SEMI 1.14 MIME-View) + + +** MIME-Entity Header + +[Function] mime-entity-fetch-field (entity field-name) + Return the value of the ENTITY's header field whose type is + FIELD-NAME. + + The results is network representation. + + If FIELD-NAME field is not found, this function returns nil. + + [Required] + (Usage: SEMI 1.14 MIME-View, MIME-BBDB) + + +[Function] mime-entity-read-field (entity field-name) + Parse FIELD-NAME field in header of ENTITY, and return the result. + + Format of result is depended on kind of field. For non-structured + field, this function returns string. For structured field, it + returns list corresponding with structure of the field. + + Strings in the result will be converted to internal representation + of Emacs. + + If FIELD-NAME field is not found, this function returns nil. + + [Suggest] + (Usage: SEMI 1.14 MIME-View, MIME-BBDB) + + +** Text Presentation of MIME-Entity Content + +[Function] mime-insert-header (entity &optional invisible-fields + visible-fields) + Insert before point a decoded header of ENTITY. + + INVISIBLE-FIELDS is list of regexps to match field-name to hide. + VISIBLE-FIELDS is list of regexps to match field-name to hide. + + If a field-name is matched with some elements of INVISIBLE-FIELDS + and matched with none of VISIBLE-FIELDS, this function don't insert + the field. + + Each encoded-word in the header is decoded. ``Raw non us-ascii + characters'' are also decoded as `default-mime-charset'. + + [Suggest] + + +[Function] mime-insert-text-content (entity) + Insert before point a contents of ENTITY as text entity. + + Contents of the ENTITY are decoded as MIME charset. If the ENTITY + does not have charset parameter of Content-Type field, + `default-mime-charset' is used as default value. + + [Required] + + +[Variable] default-mime-charset + Symbol to indicate default value of MIME charset. + + It is used when MIME charset is not specified. + + It is originally variable of APEL. + + [Required] + + +** Bytes Representation of MIME-Entity Content + +[Function] mime-entity-content (entity) + Return content of ENTITY as byte sequence (string). + + [Required] + (Usage: SEMI 1.14 MIME-View, Postpet) + + +[Function] mime-insert-entity-content (entity) + Insert content of ENTITY (byte sequence) at point. + + [Suggest] + + +[Function] mime-write-entity-content (entity filename) + Write content of ENTITY (byte sequence) into FILENAME. + + [Required] + + +** Network Representation of MIME-Entity + +[Function] mime-entity-string (entity) + Return header and body of ENTITY (string). + + [Optional] + + +[Function] mime-insert-entity (entity) + Insert header and body of ENTITY at point. + + [Required] + + +[Function] mime-write-entity (entity filename) + Write header and body of ENTITY into FILENAME. + + [Required] + + +[Function] mime-entity-header (entity) + Return network representation of ENTITY header (string). + + [Optional] + + +[Function] mime-insert-entity-header (entity) + Insert network representation of ENTITY header at point. + + [Optional] + + +[Function] mime-write-entity-header (entity filename) + Write network representation of ENTITY header FILENAME. + + [Optional] + + +[Function] mime-entity-body (entity) + Return network representation of ENTITY body (string). + + [Optional] + + +[Function] mime-insert-entity-body (entity) + Insert network representation of ENTITY body at point. + + [Required] + + +[Function] mime-write-entity-body (entity filename) + Write body of ENTITY into FILENAME. + + [Required] + + +* MIME content information + +** How to use + +(require 'mime) + + +** Content-Type + +[Function] mime-parse-Content-Type (string) + Parse STRING as field-body of Content-Type field, and + return the result as `mime-content-type' structure. + + [Suggest] + + +[Function] mime-read-Content-Type () + Read field-body of Content-Type field from current-buffer, + and return the parsed result. + + Format of return value is as same as `mime-parse-Content-Type'. + + Return `nil' if Content-Type field is not found. + + [Suggest] + + +[Inline function] mime-content-type-primary-type (content-type) + Return primary-type of CONTENT-TYPE. + + [Required] + + +[Inline function] mime-content-type-subtype (content-type) + Return subtype of CONTENT-TYPE. + + [Required] + + +[Inline function] mime-content-type-parameter (content-type parameter) + Return PARAMETER value of CONTENT-TYPE. + + [Required] + + +[Inline function] mime-content-type-parameters (content-type) + Return parameters of CONTENT-TYPE. + + [Suggest] + + +[Inline function] mime-type/subtype-string (type &optional subtype) + Return type/subtype string from TYPE and SUBTYPE. + + [Suggest] + + +** Content-Disposition + +[Function] mime-parse-Content-Disposition (string) + Parse STRING as field-body of Content-Disposition field. + + [Suggest] + + +[Function] mime-read-Content-Disposition () + Read field-body of Content-Disposition field from current-buffer, +and return parsed it. + + [Suggest] + + +[Inline function] mime-content-disposition-type (content-disposition) + Return disposition-type of CONTENT-DISPOSITION. + + [Required] + + +[Inline function] mime-content-disposition-parameter + (content-disposition parameter) + Return PARAMETER value of CONTENT-DISPOSITION. + + [Required] + + +[Inline function] mime-content-disposition-filename (content-disposition) + Return filename of CONTENT-DISPOSITION. + + [Suggest] + + +[Inline function] mime-content-disposition-parameters (content-disposition) + Return disposition-parameters of CONTENT-DISPOSITION. + + [Suggest] + + +* encoded-word + +** How to use + +(require 'mime) + + +** decoder + +[Function] mime-decode-header-in-buffer (&optional code-conversion + separator) + Decode MIME encoded-words in header fields. + + If CODE-CONVERSION is nil, it decodes only encoded-words. If it is + mime-charset, it decodes non-ASCII bit patterns as the mime-charset. + Otherwise it decodes non-ASCII bit patterns as the + default-mime-charset. + + If SEPARATOR is not nil, it is used as header separator. + + [Suggest] + + +[Function] eword-decode-header (&optional code-conversion separator) + As same as `mime-decode-header-in-buffer', q.v. + + Note that + + (require 'eword-decode) + + is necessary to use this function. + + [Optional] (Usage: cmail 2.61) + + +[Function] mime-decode-header-in-region (start end + &optional code-conversion) + Decode MIME encoded-words in region between START and END. + + If CODE-CONVERSION is nil, it decodes only encoded-words. If it is + mime-charset, it decodes non-ASCII bit patterns as the mime-charset. + Otherwise it decodes non-ASCII bit patterns as the + default-mime-charset. + + [Suggest] + + +[Function] mime-decode-field-body (field-body field-name + &optional mode max-column) + Decode FIELD-BODY as FIELD-NAME in MODE, and return the result. + + Optional argument MODE must be `plain', `wide', `summary' or `nov'. + Default mode is `summary'. + + If MODE is `wide' and MAX-COLUMN is non-nil, the result is folded + with MAX-COLUMN. + + Non MIME encoded-word part in FILED-BODY is decoded with + `default-mime-charset'. + + [Required] + + +[Function] mime-set-field-decoder (field &rest specs) + Set decoder of FIELD. + + SPECS must be like `MODE1 DECODER1 MODE2 DECODER2 ...'. + + Each mode must be `nil', `plain', `wide', `summary' or `nov'. If + mode is `nil', corresponding decoder is set up for every modes. + + [Suggest] + + +[Macro] mime-find-field-presentation-method (name) + Return field-presentation-method from NAME. + + NAME must be `plain', `wide', `summary' or `nov'. + + [Suggest] + + +[Function] mime-find-field-decoder (field &optional mode) + Return function to decode field-body of FIELD in MODE. + + Optional argument MODE must be object or name of + field-presentation-method. Name of field-presentation-method must + be `plain', `wide', `summary' or `nov'. Default value of MODE is + `summary'. + + [Suggest] + + +[Function] mime-update-field-decoder-cache (field mode &optional function) + Update field decoder cache `mime-field-decoder-cache'. + + [Suggest] + + +** encoder + +[Function] mime-encode-header-in-buffer (&optional code-conversion) + Encode header fields to network representation, such as MIME + encoded-word. + + It refer variable `mime-field-encoding-method-alist'. + + [Suggest] + + +[Function] mime-encode-field-body (field-body field-name) + Encode FIELD-BODY as FIELD-NAME, and return the result. + + A lexical token includes non-ASCII character is encoded as MIME + encoded-word. ASCII token is not encoded. + + [Required] + + +* Content-Transfer-Encoding + +** How to use + +(require 'mel) + + +** Encoding Name + +[Variable] mime-encoding-list + List of Content-Transfer-Encoding. Each encoding must be string. + + [Suggest] + + +[Function] mime-encoding-list (&optional service) + Return list of Content-Transfer-Encoding. + + If SERVICE is specified, it returns available list of + Content-Transfer-Encoding for it. + + [Required] + + +[Function] mime-encoding-alist (&optional service) + Return table of Content-Transfer-Encoding for completion. + + [Suggest] + + +** String + +[Function] mime-decode-string (string encoding) + Decode STRING using ENCODING. + + ENCODING must be string. If ENCODING is found in + `mime-encoding-list', this function decodes the STRING by its value. + + [Required] + + +[Function] mime-encode-string (string encoding) + Encode STRING using ENCODING. + + ENCODING must be string. + + [Required] + + +[Function] base64-decode-string (STRING) + Base64-decode STRING and return the result. + + [Required] + + +[Function] base64-encode-string (STRING &optional NO-LINE-BREAK) + Base64-encode STRING and return the result. + + Optional second argument NO-LINE-BREAK means do not break long lines + into shorter lines. + + [Required] + + +** File + +[Command] mime-write-decoded-region (start end filename encoding) + Decode and write current region encoded by ENCODING into FILENAME. + + START and END are buffer positions. + + [Required] + + +[Command] mime-insert-encoded-file (filename encoding) + Insert file FILENAME encoded by ENCODING format. + + [Required] + + +[Command] 7bit-write-decoded-region (start end filename) + Decode and write current region encoded by "7bit" into FILENAME. + + START and END are buffer positions. + + [Optional] + + +[Command] 7bit-insert-encoded-file (filename) + Insert file FILENAME encoded by "7bit" format. + + [Optional] + + +[Command] 8bit-write-decoded-region (start end filename) + Decode and write current region encoded by "8bit" into FILENAME. + + START and END are buffer positions. + + [Optional] + + +[Command] 8bit-insert-encoded-file (filename) + Insert file FILENAME encoded by "8bit" format. + + [Optional] + + +[Command] binary-write-decoded-region (start end filename) + Decode and write current region encoded by "binary" into FILENAME. + + START and END are buffer positions. + + [Required] + + +[Command] binary-insert-encoded-file (filename) + Insert file FILENAME encoded by "binary" format. + + [Required] + + +[Command] base64-write-decoded-region (start end filename) + Decode and write current region encoded by "base64" into FILENAME. + + START and END are buffer positions. + + [Optional] + + +[Command] base64-insert-encoded-file (filename) + Insert file FILENAME encoded by "base64" format. + + [Optional] + + +[Command] quoted-printable-write-decoded-region (start end filename) + Decode and write current region encoded by "quoted-printable" into + FILENAME. + + START and END are buffer positions. + + [Optional] + + +[Command] quoted-printable-insert-encoded-file (filename) + Insert file FILENAME encoded by "quoted-printable" format. + + [Optional] + + +** Region + +[Command] mime-decode-region (start end encoding) + Decode region START to END of current buffer using ENCODING. + + ENCODING must be string. + + [Suggest] + + +[Command] mime-encode-region (start end encoding) + Encode region START to END of current buffer using ENCODING. + + ENCODING must be string. + + [Suggest] + + +[Command] base64-decode-region (BEG END) + Base64-decode the region between BEG and END. + + Return the length of the decoded text. + + If the region can't be decoded, return nil and don't modify the + buffer. + + [Suggest] + + +[Command] base64-encode-region (BEG END &optional NO-LINE-BREAK) + Base64-encode the region between BEG and END. + + Return the length of the encoded text. + + Optional third argument NO-LINE-BREAK means do not break long lines + into shorter lines. + + [Suggest] + + +** encoded-text + +[Function] encoded-text-decode-string (string encoding) + Decode STRING as encoded-text using ENCODING. + + ENCODING must be string. + + [Suggest] + + +[Function] encoded-text-encode-string (string encoding &optional mode) + Encode STRING as encoded-text using ENCODING. + + ENCODING must be string. + + MODE allows `text', `comment', `phrase' or nil. Default value is + `phrase'. + + [Suggest] + + +[Function] base64-encoded-length (string) + Return length of B-encoded STRING. + + [Suggest] + + +[Function] Q-encoded-text-length (string &optional mode) + Return length of Q-encoded STRING. + + MODE allows `text', `comment', `phrase' or nil. Default value is + `phrase'. + + [Suggest] + + +* Mailcap + +** How to use + +(require 'mime-conf) + + +** Parsing + +[Function] mime-parse-mailcap-buffer (&optional buffer order) + Parse BUFFER as a mailcap, and return the result. + + If optional argument ORDER is a function, result is sorted by it. + If optional argument ORDER is not specified, result is sorted + original order. Otherwise result is not sorted. + + [Required] + + +[Variable] mime-mailcap-file + File name of user's mailcap file. + + [Required] (default value may be "~/.mailcap") + + +[Function] mime-parse-mailcap-file (&optional filename order) + Parse FILENAME as a mailcap, and return the result. + + If optional argument ORDER is a function, result is sorted by it. + If optional argument ORDER is not specified, result is sorted + original order. Otherwise result is not sorted. + + [Required] + + +** Apply + +[Function] mime-format-mailcap-command (mtext situation) + Return formated command string from MTEXT and SITUATION. + + MTEXT is a command text of mailcap specification, such as + view-command. + + SITUATION is an association-list about information of entity. Its + key may be: + + 'type primary media-type + 'subtype media-subtype + 'filename filename + STRING parameter of Content-Type field + + [Required] + + +* MIME Field + +** How to use + +(require 'mime) + + +** Parsing + +[Variable] mime-field-parser-alist + Alist to specify field parser. + + [Suggest] + + +[Function] mime-parse-msg-id (tokens) + Parse TOKENS as msg-id of Content-Id or Message-Id field. + + [Suggest] + + +[Function] mime-uri-parse-cid (string) + Parse STRING as cid URI. + + [Suggest] + + +[Function] mime-parse-Content-Transfer-Encoding (string) + Parse STRING as field-body of Content-Transfer-Encoding field. + If STRING is not a valid Content-Transfer-Encoding field, + return nil. + + [Suggest] + + +[Function] mime-read-Content-Transfer-Encoding () + Read field-body of Content-Transfer-Encoding field from + current-buffer, and return it. + + [Suggest] + + +* STD 11 + +** How to use + +(require 'std11) + + +** Header + +[Function] std11-narrow-to-header (&optional boundary) + Narrow to the message header. + + If BOUNDARY is not nil, it is used as message header separator. + + [Required] + + +** Field + +[Function] std11-fetch-field (name) + Return the value of the header field NAME. + + The buffer is expected to be narrowed to just the headers of the + message. + + [Required] + + +[Function] std11-field-body (name &optional boundary) + Return the value of the header field NAME. + + If BOUNDARY is not nil, it is used as message header separator. + + [Required] + + +[Function] std11-unfold-string (string) + Unfold STRING as message header field. + + [Required] + + +** Lexical Analysis + +[Function] std11-lexical-analyze (string &optional analyzer start) + Analyze STRING as lexical tokens of STD 11. + + [Suggest] + + +** Address + +[Function] std11-address-string (address) + Return string of address part from parsed ADDRESS of RFC 822. + + [Suggest] + + +[Function] std11-full-name-string (address) + Return string of full-name part from parsed ADDRESS of RFC 822. + + [Suggest] + + +[Function] std11-parse-address-string (string) + Parse STRING as mail address. + + [Suggest] + + +[Function] std11-parse-addresses-string (string) + Parse STRING as mail address list. + + [Suggest] + + +[Function] std11-extract-address-components (string) + Extract full name and canonical address from STRING. + + Returns a list of the form (FULL-NAME CANONICAL-ADDRESS). If no + name can be extracted, FULL-NAME will be nil. + + [Suggest] + + +** Message-ID + +[Function] std11-msg-id-string (msg-id) + Return string from parsed MSG-ID of RFC 822. + + [Suggest] + + +[Function] std11-parse-msg-id-string (string) + Parse STRING as msg-id. + + [Suggest] + + +[Function] std11-parse-msg-ids-string (string) + Parse STRING as `*(phrase / msg-id)'. + + [Suggest] + + +[Function] std11-fill-msg-id-list-string (string &optional column) + Fill list of msg-id in STRING, and return the result. + + [Suggest] + + +* SMTP + +** How to use + +(require 'smtp) + + +** Features + +[Function] smtp-send-buffer (sender recipients buffer) + Send a message. + + SENDER is an envelope sender address. + RECIPIENTS is a list of envelope recipient addresses. + BUFFER may be a buffer or a buffer name which contains mail message. + + [Suggest] + + +[Function] smtp-via-smtp (sender recipients buffer) + Like `smtp-send-buffer', but sucks in any errors. + + [Optional] diff --git a/flim-1.14.9/FLIM-CFG b/flim-1.14.9/FLIM-CFG new file mode 100644 index 0000000..5808168 --- /dev/null +++ b/flim-1.14.9/FLIM-CFG @@ -0,0 +1,68 @@ +;;; -*-Emacs-Lisp-*- + +;; FLIM-CFG: installation setting about FLIM. + +;;; Code: + +(defvar default-load-path load-path) + +(add-to-list 'load-path + (expand-file-name "lisp/apel" user-emacs-directory)) +(add-to-list 'load-path + (expand-file-name "lisp/emu" user-emacs-directory)) + +(if (boundp 'LISPDIR) + (progn + (add-to-list 'default-load-path LISPDIR) + (add-to-list 'load-path LISPDIR) + (add-to-list 'load-path (expand-file-name "apel" LISPDIR)))) + +(if (boundp 'VERSION_SPECIFIC_LISPDIR) + (add-to-list 'load-path VERSION_SPECIFIC_LISPDIR)) + +(require 'install) + +(add-latest-path "custom") + +(add-path default-directory) + +;; (or (fboundp 'write-region-as-binary) +;; (error "Please install latest APEL 7.3 or later.")) +;; (or (fboundp 'insert-file-contents-as-binary) +;; (error "Please install latest APEL 7.3 or later.")) + + +;;; @ Please specify prefix of install directory. +;;; + +;; Please specify install path prefix. +;; If it is omitted, shared directory (maybe /usr/local is used). +(defvar PREFIX install-prefix) +;;(setq PREFIX "~/") + +;; Please specify prefix for ``FLIM'' [optional] +(setq FLIM_PREFIX "flim") + + + +;;; @ optional settings +;;; + +;; It is generated by automatically. Please set variable `PREFIX'. +;; If you don't like default directory tree, please set it. +(defvar LISPDIR (install-detect-elisp-directory PREFIX)) +;; (setq install-default-elisp-directory "~/lib/emacs/lisp") + +(defvar VERSION_SPECIFIC_LISPDIR + (install-detect-elisp-directory PREFIX nil 'version-specific)) + +;; (setq FLIM_DIR (expand-file-name FLIM_PREFIX VERSION_SPECIFIC_LISPDIR)) +(setq FLIM_DIR (expand-file-name FLIM_PREFIX LISPDIR)) + +(setq FLIM_VERSION_SPECIFIC_DIR + (expand-file-name FLIM_PREFIX VERSION_SPECIFIC_LISPDIR)) + +(defvar PACKAGEDIR + (install-get-default-package-directory)) + +;;; FLIM-CFG ends here diff --git a/flim-1.14.9/FLIM-ELS b/flim-1.14.9/FLIM-ELS new file mode 100644 index 0000000..6a9c5bd --- /dev/null +++ b/flim-1.14.9/FLIM-ELS @@ -0,0 +1,48 @@ +;;; -*-Emacs-Lisp-*- + +;; FLIM-ELS: list of FLIM modules to install + +;;; Code: + +(setq flim-modules '(std11 + luna lunit mime-def + mel mel-q mel-u mel-g + eword-decode eword-encode + mime mime-parse mmgeneric + mmbuffer mmcooked mmexternal + mime-conf + sasl sasl-cram sasl-digest + md4 ntlm sasl-ntlm 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)) + +(require 'pccl) +(unless-broken ccl-usable + (setq flim-modules (cons 'mel-b-ccl (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))) + +(setq flim-modules (nconc hmac-modules flim-modules)) + +;;; FLIM-ELS ends here diff --git a/flim-1.14.9/FLIM-MK b/flim-1.14.9/FLIM-MK new file mode 100644 index 0000000..6af7c49 --- /dev/null +++ b/flim-1.14.9/FLIM-MK @@ -0,0 +1,99 @@ +;;; -*-Emacs-Lisp-*- + +;; FLIM-MK: installer for FLIM. + +;;; Code: + +(defun config-flim () + (let (prefix lisp-dir version-specific-lisp-dir) + (and (setq prefix (car command-line-args-left)) + (or (string-equal "NONE" prefix) + (defvar PREFIX prefix))) + (setq command-line-args-left (cdr command-line-args-left)) + (and (setq lisp-dir (car command-line-args-left)) + (or (string-equal "NONE" lisp-dir) + (defvar LISPDIR lisp-dir))) + (setq command-line-args-left (cdr command-line-args-left)) + (and (setq version-specific-lisp-dir (car command-line-args-left)) + (or (string-equal "NONE" version-specific-lisp-dir) + (progn + (defvar VERSION_SPECIFIC_LISPDIR version-specific-lisp-dir) + (princ (format "VERSION_SPECIFIC_LISPDIR=%s\n" + VERSION_SPECIFIC_LISPDIR))))) + (setq command-line-args-left (cdr command-line-args-left)) + (load-file "FLIM-CFG") + (load-file "FLIM-ELS") + (princ (format "PREFIX=%s +LISPDIR=%s\n" PREFIX LISPDIR)))) + +(defun compile-flim () + (config-flim) + (compile-elisp-modules flim-version-specific-modules ".") + (compile-elisp-modules flim-modules ".")) + +(defun install-flim () + (config-flim) + (if flim-version-specific-modules + (install-elisp-modules flim-version-specific-modules "./" + FLIM_VERSION_SPECIFIC_DIR)) + (install-elisp-modules flim-modules "./" FLIM_DIR)) + +(defun check-flim () + (config-flim) + (require 'lunit) + (let ((files (directory-files "tests" t "^test-.*\\.el$")) + (suite (lunit-make-test-suite))) + (while files + (if (file-regular-p (car files)) + (progn + (load-file (car files)) + (lunit-test-suite-add-test + suite (lunit-make-test-suite-from-class + (intern (file-name-sans-extension + (file-name-nondirectory (car files)))))))) + (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 diff --git a/flim-1.14.9/Makefile b/flim-1.14.9/Makefile new file mode 100644 index 0000000..61a04dc --- /dev/null +++ b/flim-1.14.9/Makefile @@ -0,0 +1,75 @@ +# +# Makefile for FLIM. +# + +PACKAGE = flim +API = 1.14 +RELEASE = 9 + +TAR = tar +RM = /bin/rm -f +CP = /bin/cp -p + +EMACS = emacs +XEMACS = xemacs +FLAGS = -batch -q -no-site-file -l FLIM-MK + +PREFIX = NONE +LISPDIR = NONE +PACKAGEDIR = NONE +VERSION_SPECIFIC_LISPDIR = NONE + +GOMI = *.elc \ + *.cp *.cps *.ky *.kys *.fn *.fns *.vr *.vrs \ + *.pg *.pgs *.tp *.tps *.toc *.aux *.log +FILES = README.?? Makefile FLIM-MK FLIM-CFG FLIM-ELS *.el ChangeLog + +VERSION = $(API).$(RELEASE) +ARC_DIR_PREFIX = /home/kanji/tomo/public_html/lemi/dist +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) + +check: + $(EMACS) $(FLAGS) -f check-flim $(PREFIX) $(LISPDIR) \ + $(VERSION_SPECIFIC_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) + +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) + cd $(SEMI_ARC_DIR) ; \ + ln -s ../../flim/flim-$(API)/$(PACKAGE)-$(VERSION).tar.gz . diff --git a/flim-1.14.9/NEWS b/flim-1.14.9/NEWS new file mode 100644 index 0000000..79e5e60 --- /dev/null +++ b/flim-1.14.9/NEWS @@ -0,0 +1,164 @@ +FLIM NEWS --- history of major-changes. +Copyright (C) 1998,1999 Free Software Foundation, Inc. + +* Changes in FLIM 1.12 + +** Restructure of field decoding features + +Introduce backend mechanism of field-decoder and +field-presentation-method to restructure field decoding features. + +Field-decoder is registered into variable `mime-field-decoder-alist'. +Each decoding function uses decoding method found from variable +`mime-field-decoder-alist'. + +New function `mime-set-field-decoder' is added to register field +decoding method. + +New function `mime-find-field-presentation-method' is added to get +`field-presentation-method' object corresponding with specified +field-presentation-mode. Field-presentation-mode must be `plain', +`wide', `summary' or `nov'. + +New function `mime-find-field-decoder' is added to find field decoding +method corresponding with field-name and field-presentation-mode. + +New function `mime-decode-field-body' is added. It is general field +decoder. + + +** Function `mime-decode-header-in-buffer' + +Renamed from `eword-decode-header'. `eword-decode-header' is defined +as obsolete alias. + + +** New function `mime-decode-header-in-region' + + +** Changes about lexical-analyzers + +*** New user option `std11-lexical-analyzer' + +Now function `std11-lexical-analyze' refers user option +`std11-lexical-analyzer'. + + +*** User option `eword-lexical-analyzers' -> `eword-lexical-analyzer' + +User option `eword-lexical-analyzers' was renamed to +`eword-lexical-analyzer'. + + +*** Change interface of lexical-analyzers + +Interface of function `eword-lexical-analyze' was changed from +`(string &optional must-unfold)' to `(string &optional start +must-unfold)'. Interface of lexical analyzer specified by user option +`eword-lexical-analyzer' was changed likewise. + +Function `eword-extract-address-components' was added new optional +argument `START' to specify start position of `STRING' to parse. + +Function `std11-lexical-analyze' was added new optional arguments +`ANALYZER' to specify lexical-analyzer and `START' to specify start +position of `STRING' to analyze. + +Interface of lexical analyzers for STD 11 was changed from `(string)' +to `(string &optional start)'. + + +** Function `std11-parse-in-reply-to' -> `std11-parse-msg-ids' + +Rename function `std11-parse-in-reply-to' to `std11-parse-msg-ids'. +Function `std11-parse-in-reply-to' was defined as obsolete alias. + + +** New function `std11-parse-msg-id-string' + + +** New function `std11-parse-msg-ids-string' + + +** New function `mime-find-entity-from-content-id' + + +** New function `mime-parse-msg-id' + + +** New function `mime-uri-parse-cid' + + +** New generic function `mime-insert-entity' + +Add new generic function `mime-insert-entity' to insert header and +body of ENTITY at point. + +Each mm-backend must have new method `insert-entity'. + + +** New optional argument of `std11-field-end' + +Now `std11-field-end' can accept new optional argument BOUND. Thus +current interface is: + + std11-field-end (&optional BOUND) + +If the optional argument BOUND is specified, it bounds the search; it +is a buffer position. + + +* Changes in FLIM 1.11 + +** New function `mime-insert-text-content' + +Add new generic function `mime-insert-text-content' and new mm-service +`insert-text-content'. + + +** `insert-decoded-header' -> `insert-header' + +mm-service `insert-decoded-header' was renamed to `insert-header'. +Similarly generic function `mime-insert-decoded-header' was renamed to +`mime-insert-header'. However `mime-insert-decoded-header' was left +as an obsolete alias. + + +** Behavior change of `mime-insert-header' + +Each field-name of second and third argument of function +`mime-insert-header' can include `:'. + + +** Abolish variable `mime-temp-directory' + +Now FLIM uses `temporary-file-directory' instead of +`mime-temp-directory'. So environment variable "MIME_TMP_DIR" and +"TM_TMP_DIR" are not effective to specify temporary directory of FLIM. + + +** Add new function `eword-decode-and-unfold-unstructured-field' + + +** Add new mm-backend `generic' + +Add new mm-backend `generic'. mm-backend `buffer' inherits the +mm-backend `generic'. + + +** Change internal representation of `mime-entity' structure + +Internal representation of `mime-entity' structure was changed to add +NOV entries. + + +** `mime-entity-*-internal' and `mime-entity-set-*-internal' + +Change `mime-entity-*-internal' and `mime-entity-set-*-internal' to +macro. + + +Local variables: +mode: outline +paragraph-separate: "[ ]*$" +end: diff --git a/flim-1.14.9/README.en b/flim-1.14.9/README.en new file mode 100644 index 0000000..c3c0d3f --- /dev/null +++ b/flim-1.14.9/README.en @@ -0,0 +1,149 @@ +[README for FLIM (English Version)] +by MORIOKA Tomohiko + +What's FLIM +=========== + + FLIM is a library to provide basic features about message + representation or encoding. It consists of following + modules: + + std11.el --- STD 11 (RFC 822) parser and utility + + mime.el --- to provide various services about MIME-entities + + mime-def.el --- Definitions about MIME format + + mime-parse.el --- MIME parser + + mel.el --- MIME encoder/decoder + mel-b-dl.el --- base64 (B-encoding) encoder/decoder + (for Emacs 20 with dynamic loading support) + mel-b-ccl.el --- base64 (B-encoding) encoder/decoder + (using CCL) + mel-b-en.el --- base64 (B-encoding) encoder/decoder + (for other emacsen) + mel-q-ccl.el --- quoted-printable and Q-encoding + encoder/decoder (using CCL) + mel-q.el --- quoted-printable and Q-encoding + encoder/decoder + mel-u.el --- unofficial backend for uuencode + mel-g.el --- unofficial backend for gzip64 + + 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 + XEmacs 21.1 and up + + +Installation +============ + +(0) before installing it, please install APEL (10.7 or later) package. + APEL package is available at: + + ftp://ftp.m17n.org/pub/mule/apel/ + +(1-a) run in expanded place + + If you don't want to install other directories, please do only + following: + + % make + + You can specify the emacs command name, for example + + % make EMACS=xemacs + + If `EMACS=...' is omitted, EMACS=emacs is used. + +(1-b) make install + + If you want to install other directories, please do following: + + % make install + + You can specify the emacs command name, for example + + % make install EMACS=xemacs + + If `EMACS=...' is omitted, EMACS=emacs is used. + + You can specify the prefix of the directory tree for Emacs Lisp + programs, for example: + + % make install PREFIX=~/ + + If `PREFIX=...' is omitted, the prefix of the directory tree of the + specified emacs command is used (perhaps /usr/local). + + For example, if PREFIX=/usr/local and EMACS 19.34 is specified, it + will create the following directory tree: + + /usr/local/share/emacs/site-lisp/flim/ --- FLIM + + You can specify site-lisp directory, for example + + % make install LISPDIR=~/share/emacs/lisp + + If `LISPDIR=...' is omitted, site-lisp directory of the specified + emacs command is used (perhaps /usr/local/share/emacs/site-lisp or + /usr/local/lib/xemacs/site-lisp). + + If the emu modules (included in APEL package) have been installed in + the non-standard directory, you should specify where they will be + found, for example: + + % make install VERSION_SPECIFIC_LISPDIR=~/elisp + + Following make target is available to find what files are parts of + emu / APEL package, and where are directories to install them: + + % make what-where LISPDIR=~/elisp VERSION_SPECIFIC_LISPDIR=~/elisp + + You can specify other optional settings by editing the file + FLIM-CFG. Please read comments in it. + +(1-c) install as a XEmacs package + + If you want to install to XEmacs package directory, please do + following: + + % make install-package + + You can specify the XEmacs command name, for example + + % make install-package XEMACS=xemacs-21 + + If `XEMACS=...' is omitted, XEMACS=xemacs is used. + + You can specify the package directory, for example: + + % make install PACKAGEDIR=~/.xemacs + + If `PACKAGEDIR=...' is omitted, the first existing package + directory is used. + + Notice that XEmacs package system requires XEmacs 21.0 or later. + + +Bug reports +=========== + + If you write bug-reports and/or suggestions for improvement, please + send them to the EMACS-MIME Mailing List: + + emacs-mime-en@m17n.org (English) + emacs-mime-ja@m17n.org (Japanese) + + 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 + + emacs-mime-en-ctl@m17n.org (English) + emacs-mime-ja-ctl@m17n.org (Japanese) diff --git a/flim-1.14.9/README.ja b/flim-1.14.9/README.ja new file mode 100644 index 0000000..619a3e0 --- /dev/null +++ b/flim-1.14.9/README.ja @@ -0,0 +1,159 @@ +[FLIM $B$N(B README ($BF|K\8lHG(B)] + +FLIM $B$H$O!)(B +=========== + + 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: + + std11.el --- STD 11 (RFC 822) $B7A<0$K4p$E$/2r@O=hM}Ey(B + + mime.el --- MIME-entity $B$K4X$9$k=t5!G=$NDs6!(B + + mime-def.el --- MIME $B7A<0$K4X$9$kDj5A(B + + mime-parse.el --- MIME $B2r@O4o(B + + 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-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-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 + + eword-decode.el --- encoded-word $BI|9f4o(B + eword-encode.el --- encoded-word $BId9f4o(B + + mailcap.el --- mailcap $B$N2r@O=hM}Ey(B + + $B0J2<$N4D6-$GF0:n$7$^$9!'(B + + Emacs 20.4 $B0J9_(B + XEmacs 21.1 $B0J9_(B + + +$BF3F~(B (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$Gl=j$X$NF3F~(B + + $BE83+$7$?>l=j$H$O0[$J$k>l=j$KF3F~$7$?$/$J$$$J$i!"(B + + % make + + $B$@$1$r$r;XDj$9$k$3$H$,$G$-$^$9!#Nc$($P!"(B + + % make EMACS=xemacs + + `EMACS=...' $B$,>JN,$5$l$k$H!"(BEmacs=emacs $B$,;H$o$l$^$9!#(B + +(b) make install + + $BE83+$7$?>l=j$H$O0[$J$k>l=j$KF3F~$7$?$$$J$i!"(B + + % make install + + $B$r$r;XDj$9$k$3$H$,$G$-$^$9!#Nc$($P!"(B + + % make install EMACS=xemacs + + `EMACS=...' $B$,>JN,$5$l$k$H!"(BEmacs=emacs $B$,;H$o$l$^$9!#(B + + Emacs Lisp $B%W%m%0%i%`$N$?$a$N%G%#%l%/%H%j!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 + + $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!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 + + % 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!"$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$NCml9g$O!"(B + + % make install-package + + $B$r$r;XDj$9$k$3$H$,$G$-$^$9!#Nc!'(B + + % make install-package XEMACS=xemacs-21 + + `XEMACS=...' $B$,>JN,$5$l$k$H!"(BXEMACS=xemacs $B$,;HMQ$5$l$^$9!#(B + + $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 + + $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 + + +$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 ($B1Q8l(B) + emacs-mime-ja@m17n.org ($BF|K\8l(B) + + 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-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-en-ctl@m17n.org ($B1Q8l(B) + emacs-mime-ja-ctl@m17n.org ($BF|K\8l(B) + + $B$KAw$C$F$/$@$5$$!#(B diff --git a/flim-1.14.9/VERSION b/flim-1.14.9/VERSION new file mode 100644 index 0000000..ff85efe --- /dev/null +++ b/flim-1.14.9/VERSION @@ -0,0 +1,108 @@ +[FLIM Version names] + +1.0.0 ----- + +;;------------------------------------------------------------------------- +;; Kinki Nippon Railway $(B6a5&F|K\E4F;(B http://www.kintetsu.co.jp/ +;; Ky-Dto Line $(B5~ET@~(B-A +;;------------------------------------------------------------------------- +1.0.1 Ky-Dto $(B5~ET(B ; <=> JR, $(B5~ET;T8rDL6I(B-A +1.1.0 T-Dji $(BEl;{(B-A +1.2.0 J-Dj $(B==>r(B-A +1.2.1 Kamitobaguchi $(B>eD;1)8}(B +1.2.2 Takeda $(BC]ED(B ; = $(B5~ET;T8rDL6I(B $(B1(4]@~(B +1.3.0 Fushimi $(BIz8+(B +1.4.0 Kintetsu-Tambabashi $(B6aE4C0GH66(B ; <=> $(B5~:e(B $(BC0GH66(B +1.4.1 Momoyama-Gory-Dmae $(BEm;38fNMA0(B-A +1.5.0 Mukaijima $(B8~Eg(B +1.6.0 Ogura $(B>.AR(B +1.7.0 Iseda $(B0K@*ED(B +1.8.0 -Dkubo $(BBg5WJ](B-A +1.8.1 Kutsukawa $(B5WDE@n(B +1.9.0 Terada $(B;{ED(B +1.9.1 Tonosh-D $(BIYLnAq(B-A +1.9.2 Shin-Tanabe $(B?7EDJU(B +1.10.0 K-Ddo $(B6=8M(B-A +1.10.1 Miyamaki $(B;0;3LZ(B +1.10.2 Kintetsu-Miyazu $(B6aE45\DE(B +1.10.3 Komada $(B9}ED(B +1.10.4 Shin-H-Dsono $(B?7=K1`(B ; <=> JR $(BJRD.@~(B $(B=K1`(B-A +1.10.5 Kizugawadai $(BLZDE@nBf(B +1.11.0 Yamadagawa $(B;3ED@n(B +1.11.1 Takanohara $(B9b$N86(B +1.11.2 Heij-D $(BJ?>k(B-A +1.11.3 Saidaiji $(B@>Bg;{(B ; = $(B6aE4(B $(BF`NI@~(B +;;------------------------------------------------------------------------- +;; Kinki Nippon Railway $(B6a5&F|K\E4F;(B http://www.kintetsu.co.jp/ +;; Ky-Dto Line $(B3`86@~(B-A +;;------------------------------------------------------------------------- + (Saidaiji) ($(B@>Bg;{(B) +1.12.0 Amagatsuji $(BFt%vDT(B +1.12.1 Nishinoky-D $(B@>$N5~(B-A +1.12.2 Kuj-D $(B6e>r(B-A +1.12.3 Kintetsu-K-Driyama $(B6aE474;3(B-A +1.12.4 Tsutsui $(BE{0f(B +1.12.5 Hirahata $(BJ?C<(B ; = $(B6aE4(B $(BE7M}@~(B +1.12.6 Family-K-Denmae $(B%U%!%_%j!<8x1`A0(B-A +1.12.7 Y-Dzaki $(B7k:j(B-A +1.13.0 Iwami $(B@P8+(B +1.13.1 Tawaramoto $(BED86K\(B ; <=> $(B6aE4(B $(B@>ED86K\(B +1.13.2 Kasanui $(B3^K%(B +1.14.0 Ninokuchi $(B?7%N8}(B +1.14.1 Yagi $(BH,LZ(B ; = $(B6aE4(B $(BBg:e@~(B +1.14.2 Yagi-Nishiguchi $(BH,LZ@>8}(B +1.14.3 Unebigory-Dmae $(B@&K58fNMA0(B-A +1.14.4 Kashiharajing-D-mae $(B3`86?@5\A0(B ; = $(B6aE4(B $(BFnBg:e@~!"5HLn@~(B-A + + +;;------------------------------------------------------------------------- +;; Keihan Electric Railway $(B5~:eEE5$E4F;(B http://www.keihan.co.jp/ +;; -Dt Line $(B3{El@~(B-A +;;------------------------------------------------------------------------- +1.14.5 Demachiyanagi $(B=PD.Lx(B ; <=> $(B1CEE(B +1.14.6 Marutamachi $(B4]B@D.(B +1.14.7 Sanj-D $(B;0>r(B ; = $(B5~ET;T8rDL6I(B $(BEl@>@~(B-A +;;------------------------------------------------------------------------- +;; Keihan Electric Railway $(B5~:eEE5$E4F;(B http://www.keihan.co.jp/ +;; Main Line $(BK\@~(B +;;------------------------------------------------------------------------- + (Sanj-D) ($(B;0>r(B)-A +1.14.8 Shij-D $(B;M>r(B-A +1.14.9 Goj-D $(B8^>r(B-A + + +[Chao Version names] + +;;------------------------------------------------------------------------- +;; Kyoto Municipal Transfer Bureau +;; $(B5~ET;T8rDL6I(B +;; http://www.city.kyoto.jp/kotsu/main.htm +;; Karasuma Line $(B1(4]@~(B +;;------------------------------------------------------------------------- +1.2.0 Takeda $(BC]ED(B ; = $(B6aE4(B $(B5~ET@~(B +1.3.0 Kuinabashi $(B$/$$$J66(B +1.4.0 J-Dj $(B==>r(B-A +1.6.0 Kuj-D $(B6e>r(B-A +1.6.1 Ky-Dto $(B5~ET(B ; <=> JR, $(B6aE4(B-A +1.7.0 Goj-D $(B8^>r(B-A +1.8.0 Shij-D $(B;M>r(B ; <=> $(B:e5^(B $(B5~ET@~(B-A +1.9.0 Karasuma Oike $(B1(4]8fCS(B ; = $(B5~ET;T8rDL6I(B $(BEl@>@~(B +1.10.0 Marutamach $(B4]B@D.(B +1.11.0 Imadegawa $(B:#=P@n(B +1.11.1 Kuramaguchi $(B0HGO8}(B +1.11.2 Kita-Dji $(BKLBgO)(B-A +1.11.3 Kitayama $(BKL;3(B +1.11.4 Matugasaki $(B>>%v:j(B +1.11.5 Kokusaikaikan $(B9q:]2q4[(B + +;;------------------------------------------------------------------------- +;; West Japan Railway $(B@>F|K\N95RE4F;(B http://www.westjr.co.jp/ +;; Nara Line $(BF`NI@~(B +;;------------------------------------------------------------------------- +1.12.0 [JR] Ky-Dto $(B5~ET(B ; <=> $(B6aE4(B, $(B5~ET;T8rDL6I(B-A +1.12.1 T-Dfukuji $(BElJ!;{(B ; <=> $(B5~:e(B-A +1.12.2 Inari $(B0p2Y(B +1.13.0 JR Fujinomori JR $(BF#?9(B +1.14.0 Momoyama $(BEm;3(B +1.14.1 Rokujiz-D $(BO;COB"(B-A +------ Kohata $(BLZH((B diff --git a/flim-1.14.9/eword-decode.el b/flim-1.14.9/eword-decode.el new file mode 100644 index 0000000..ff38088 --- /dev/null +++ b/flim-1.14.9/eword-decode.el @@ -0,0 +1,823 @@ +;;; eword-decode.el --- RFC 2047 based encoded-word decoder for GNU Emacs + +;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, +;; 2005 Free Software Foundation, Inc. + +;; Author: ENAMI Tsugutomo +;; MORIOKA Tomohiko +;; TANAKA Akira +;; Created: 1995/10/03 +;; Original: 1992/07/20 ENAMI Tsugutomo's `mime.el'. +;; Renamed: 1993/06/03 to tiny-mime.el by MORIOKA Tomohiko +;; Renamed: 1995/10/03 to tm-ew-d.el (split off encoder) +;; by MORIOKA Tomohiko +;; Renamed: 1997/02/22 from tm-ew-d.el by MORIOKA Tomohiko +;; Keywords: encoded-word, MIME, multilingual, header, mail, news + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'mime-def) +(require 'mel) +(require 'std11) + +(eval-when-compile (require 'cl)) ; list*, pop + + +;;; @ Variables +;;; + +;; User options are defined in mime-def.el. + + +;;; @ MIME encoded-word definition +;;; + +(eval-and-compile + (defconst eword-encoded-text-regexp "[!->@-~]+") + + (defconst eword-encoded-word-regexp + (eval-when-compile + (concat (regexp-quote "=?") + "\\(" + mime-charset-regexp ; 1 + "\\)" + "\\(" + (regexp-quote "*") + mime-language-regexp ; 2 + "\\)?" + (regexp-quote "?") + "\\(" + mime-encoding-regexp ; 3 + "\\)" + (regexp-quote "?") + "\\(" + eword-encoded-text-regexp ; 4 + "\\)" + (regexp-quote "?=")))) + ) + + +;;; @ for string +;;; + +(defun eword-decode-string (string &optional must-unfold) + "Decode MIME encoded-words in STRING. + +STRING is unfolded before decoding. + +If an encoded-word is broken or your emacs implementation can not +decode the charset included in it, it is not decoded. + +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)." + (setq string (std11-unfold-string string)) + (let ((regexp (concat "[\n\t ]*\\(" eword-encoded-word-regexp "\\)")) + (next 0) + match start words) + (while (setq match (string-match regexp string next)) + (setq start (match-beginning 1) + words nil) + (while match + (setq next (match-end 0)) + (push (list (match-string 2 string) ;; charset + (match-string 3 string) ;; language + (match-string 4 string) ;; encoding + (match-string 5 string) ;; encoded-text + (match-string 1 string)) ;; encoded-word + words) + (setq match (and (string-match regexp string next) + (= next (match-beginning 0))))) + (setq words (eword-decode-encoded-words (nreverse words) must-unfold) + string (concat (substring string 0 start) + words + (substring string next)) + next (+ start (length words))))) + string) + +(defun eword-decode-structured-field-body (string + &optional start-column max-column + start) + (let ((tokens (eword-lexical-analyze string start 'must-unfold)) + (result "") + token) + (while tokens + (setq token (car tokens)) + (setq result (concat result (eword-decode-token token))) + (setq tokens (cdr tokens))) + result)) + +(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 +characters are regarded as variable `default-mime-charset'. + +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 "")) + (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)) + +(defun eword-decode-and-fold-structured-field-body (string + start-column + &optional max-column + start) + (if (and mime-field-decoding-max-size + (> (length string) mime-field-decoding-max-size)) + string + (or max-column + (setq max-column fill-column)) + (let ((c start-column) + (tokens (eword-lexical-analyze string start 'must-unfold)) + (result "") + token) + (while (and (setq token (car tokens)) + (setq tokens (cdr tokens))) + (let* ((type (car token))) + (if (eq type 'spaces) + (let* ((next-token (car tokens)) + (next-str (eword-decode-token next-token)) + (next-len (string-width next-str)) + (next-c (+ c next-len 1))) + (if (< next-c max-column) + (setq result (concat result " " next-str) + c next-c) + (setq result (concat result "\n " next-str) + c (1+ next-len))) + (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)))) + +(defun eword-decode-unstructured-field-body (string &optional start-column + max-column) + (eword-decode-string + (decode-mime-charset-string string default-mime-charset))) + +(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) + default-mime-charset) + 'must-unfold)) + +(defun eword-decode-unfolded-unstructured-field-body (string + &optional start-column + max-column) + (eword-decode-string + (decode-mime-charset-string string default-mime-charset) + 'must-unfold)) + + +;;; @ for region +;;; + +(defun eword-decode-region (start end &optional unfolding must-unfold) + "Decode MIME encoded-words in region between START and END. + +If UNFOLDING is not nil, it unfolds before decoding. + +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)." + (interactive "*r") + (save-excursion + (save-restriction + (narrow-to-region start end) + (if unfolding + (eword-decode-unfold)) + (goto-char (point-min)) + (let ((regexp (concat "[\n\t ]*\\(" eword-encoded-word-regexp "\\)")) + match words) + (while (setq match (re-search-forward regexp nil t)) + (setq start (match-beginning 1) + words nil) + (while match + (goto-char (setq end (match-end 0))) + (push (list (match-string 2) ;; charset + (match-string 3) ;; language + (match-string 4) ;; encoding + (match-string 5) ;; encoded-text + (match-string 1)) ;; encoded-word + words) + (setq match (looking-at regexp))) + (delete-region start end) + (insert + (eword-decode-encoded-words (nreverse words) must-unfold))))))) + +(defun eword-decode-unfold () + (goto-char (point-min)) + (let (field beg end) + (while (re-search-forward std11-field-head-regexp nil t) + (setq beg (match-beginning 0) + end (std11-field-end)) + (setq field (buffer-substring beg end)) + (if (string-match eword-encoded-word-regexp field) + (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)) + )) + ))) + + +;;; @ for message header +;;; + +(defvar mime-field-decoder-alist nil) + +(defvar mime-field-decoder-cache nil) + +(defvar mime-update-field-decoder-cache 'mime-update-field-decoder-cache + "*Field decoder cache update function.") + +;;;###autoload +(defun mime-set-field-decoder (field &rest specs) + "Set decoder of FIELD. +SPECS must be like `MODE1 DECODER1 MODE2 DECODER2 ...'. +Each mode must be `nil', `plain', `wide', `summary' or `nov'. +If mode is `nil', corresponding decoder is set up for every modes." + (when specs + (let ((mode (pop specs)) + (function (pop specs))) + (if mode + (progn + (let ((cell (assq mode mime-field-decoder-alist))) + (if cell + (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-set-field-decoder field + 'plain function + 'wide function + 'summary function + 'nov function) + )))) + +;;;###autoload +(defmacro mime-find-field-presentation-method (name) + "Return field-presentation-method from NAME. +NAME must be `plain', `wide', `summary' or `nov'." + (cond ((eq name nil) + `(or (assq 'summary mime-field-decoder-cache) + '(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)) + ) + (t + `(or (assq (or ,name 'summary) mime-field-decoder-cache) + (cons (or ,name 'summary) nil)) + ))) + +(defun mime-find-field-decoder-internal (field &optional mode) + "Return function to decode field-body of FIELD in MODE. +Optional argument MODE must be object of field-presentation-method." + (cdr (or (assq field (cdr mode)) + (prog1 + (funcall mime-update-field-decoder-cache + field (car mode)) + (setcdr mode + (cdr (assq (car mode) mime-field-decoder-cache))) + )))) + +;;;###autoload +(defun mime-find-field-decoder (field &optional mode) + "Return function to decode field-body of FIELD in MODE. +Optional argument MODE must be object or name of +field-presentation-method. Name of field-presentation-method must be +`plain', `wide', `summary' or `nov'. +Default value of MODE is `summary'." + (if (symbolp mode) + (let ((p (cdr (mime-find-field-presentation-method mode)))) + (if (and p (setq p (assq field p))) + (cdr p) + (cdr (funcall mime-update-field-decoder-cache + field (or mode 'summary))))) + (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) + ) + ((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))))) + )) + (let ((cell (assq mode mime-field-decoder-cache)) + ret) + (if cell + (if (setq ret (assq field (cdr cell))) + (setcdr ret function) + (setcdr cell (cons (setq ret (cons field function)) (cdr cell)))) + (setq mime-field-decoder-cache + (cons (cons mode (list (setq ret (cons field function)))) + mime-field-decoder-cache))) + ret)) + +;; ignored fields +(mime-set-field-decoder 'Archive nil nil) +(mime-set-field-decoder 'Content-Md5 nil nil) +(mime-set-field-decoder 'Control nil nil) +(mime-set-field-decoder 'Date nil nil) +(mime-set-field-decoder 'Distribution nil nil) +(mime-set-field-decoder 'Followup-Host nil nil) +(mime-set-field-decoder 'Followup-To nil nil) +(mime-set-field-decoder 'Lines nil nil) +(mime-set-field-decoder 'Message-Id nil nil) +(mime-set-field-decoder 'Newsgroups nil nil) +(mime-set-field-decoder 'Nntp-Posting-Host nil nil) +(mime-set-field-decoder 'Path nil nil) +(mime-set-field-decoder 'Posted-And-Mailed nil nil) +(mime-set-field-decoder 'Received nil nil) +(mime-set-field-decoder 'Status nil nil) +(mime-set-field-decoder 'X-Face nil nil) +(mime-set-field-decoder 'X-Face-Version nil nil) +(mime-set-field-decoder 'X-Info nil nil) +(mime-set-field-decoder 'X-Pgp-Key-Info nil nil) +(mime-set-field-decoder 'X-Pgp-Sig nil nil) +(mime-set-field-decoder 'X-Pgp-Sig-Version nil nil) +(mime-set-field-decoder 'Xref nil nil) + +;; structured fields +(let ((fields + '(Reply-To Resent-Reply-To From Resent-From Sender Resent-Sender + To Resent-To Cc Resent-Cc Bcc Resent-Bcc Dcc + Mail-Followup-To + Mime-Version Content-Type Content-Transfer-Encoding + Content-Disposition User-Agent)) + field) + (while fields + (setq field (pop fields)) + (mime-set-field-decoder + field + '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) + )) + +;; unstructured fields (default) +(mime-set-field-decoder + t + 'plain #'eword-decode-unstructured-field-body + 'wide #'eword-decode-unstructured-field-body + 'summary #'eword-decode-and-unfold-unstructured-field-body + 'nov #'eword-decode-unfolded-unstructured-field-body) + +;;;###autoload +(defun mime-decode-field-body (field-body field-name + &optional mode max-column) + "Decode FIELD-BODY as FIELD-NAME in MODE, and return the result. +Optional argument MODE must be `plain', `wide', `summary' or `nov'. +Default mode is `summary'. + +If MODE is `wide' and MAX-COLUMN is non-nil, the result is folded with +MAX-COLUMN. + +Non MIME encoded-word part in FILED-BODY is decoded with +`default-mime-charset'." + (let (field-name-symbol len decoder) + (if (symbolp field-name) + (setq field-name-symbol field-name + len (1+ (string-width (symbol-name field-name)))) + (setq field-name-symbol (intern (capitalize field-name)) + len (1+ (string-width field-name)))) + (setq decoder (mime-find-field-decoder field-name-symbol mode)) + (if decoder + (funcall decoder field-body len max-column) + ;; Don't decode + (if (eq mode 'summary) + (std11-unfold-string field-body) + field-body) + ))) + +;;;###autoload +(defun mime-decode-header-in-region (start end + &optional code-conversion) + "Decode MIME encoded-words in region between START and END. +If CODE-CONVERSION is nil, it decodes only encoded-words. If it is +mime-charset, it decodes non-ASCII bit patterns as the mime-charset. +Otherwise it decodes non-ASCII bit patterns as the +default-mime-charset." + (interactive "*r") + (save-excursion + (save-restriction + (narrow-to-region start end) + (let ((default-charset + (if code-conversion + (if (mime-charset-to-coding-system code-conversion) + code-conversion + default-mime-charset)))) + (if default-charset + (let ((mode-obj (mime-find-field-presentation-method 'wide)) + beg p end field-name len field-decoder) + (goto-char (point-min)) + (while (re-search-forward std11-field-head-regexp nil t) + (setq beg (match-beginning 0) + p (match-end 0) + field-name (buffer-substring beg (1- p)) + len (string-width field-name) + field-name (intern (capitalize field-name)) + field-decoder (inline + (mime-find-field-decoder-internal + field-name mode-obj))) + (when field-decoder + (setq end (std11-field-end)) + (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) + ))))) + +;;;###autoload +(defun mime-decode-header-in-buffer (&optional code-conversion separator) + "Decode MIME encoded-words in header fields. +If CODE-CONVERSION is nil, it decodes only encoded-words. If it is +mime-charset, it decodes non-ASCII bit patterns as the mime-charset. +Otherwise it decodes non-ASCII bit patterns as the +default-mime-charset. +If SEPARATOR is not nil, it is used as header separator." + (interactive "*") + (mime-decode-header-in-region + (point-min) + (save-excursion + (goto-char (point-min)) + (if (re-search-forward + (concat "^\\(" (regexp-quote (or separator "")) "\\)?$") + nil t) + (match-beginning 0) + (point-max) + )) + code-conversion)) + +(defalias 'eword-decode-header 'mime-decode-header-in-buffer) +(make-obsolete 'eword-decode-header 'mime-decode-header-in-buffer) + + +;;; @ encoded-words decoder +;;; + +(defvar eword-decode-allow-incomplete-encoded-text t + "*Non-nil means allow incomplete encoded-text in successive encoded-words. +Dividing of encoded-text in the place other than character boundaries +violates RFC2047 section 5, while we have a capability to decode it. +If it is non-nil, the decoder will decode B- or Q-encoding in each +encoded-word, concatenate them, and decode it by charset. Otherwise, +the decoder will fully decode each encoded-word before concatenating +them.") + +(defun eword-decode-encoded-words (words must-unfold) + "Decode successive encoded-words in WORDS and return a decoded string. +Each element of WORDS looks like (CHARSET LANGUAGE ENCODING ENCODED-TEXT +ENCODED-WORD). + +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)." + (let (word language charset encoding text rest) + (while words + (setq word (pop words) + language (nth 1 word)) + (if (and (or (mime-charset-to-coding-system (setq charset (car word))) + (progn + (message "Unknown charset: %s" charset) + nil)) + (cond ((member (setq encoding (nth 2 word)) '("B" "Q")) + t) + ((member encoding '("b" "q")) + (setq encoding (upcase encoding))) + (t + (message "Invalid encoding: %s" encoding) + nil)) + (condition-case err + (setq text + (encoded-text-decode-string (nth 3 word) encoding)) + (error + (message "%s" (error-message-string err)) + nil))) + (if (and eword-decode-allow-incomplete-encoded-text + rest + (caaar rest) + (string-equal (downcase charset) (downcase (caaar rest))) + (equal language (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)) + (condition-case err + (decode-mime-charset-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) ? ))) + " ")))) + (when must-unfold + (setq word (mapconcat (lambda (chr) + (cond ((eq chr ?\n) "") + ((eq chr ?\r) "") + ((eq chr ?\t) " ") + (t (char-to-string chr)))) + (std11-unfold-string word) + ""))) + (when (setq language (cdaar rest)) + (put-text-property 0 (length word) 'mime-language language word)) + (setq words (concat word words) + rest (cdr rest))) + words)) + +;;; @ lexical analyze +;;; + +(defvar eword-lexical-analyze-cache nil) +(defvar eword-lexical-analyze-cache-max 299 + "*Max position of eword-lexical-analyze-cache. +It is max size of eword-lexical-analyze-cache - 1.") + +(defvar mime-header-lexical-analyzer + '(eword-analyze-quoted-string + eword-analyze-domain-literal + eword-analyze-comment + eword-analyze-spaces + eword-analyze-special + eword-analyze-encoded-word + eword-analyze-atom) + "*List of functions to return result of lexical analyze. +Each function must have three arguments: STRING, START and MUST-UNFOLD. +STRING is the target string to be analyzed. +START is start position of STRING to analyze. +If MUST-UNFOLD is not nil, each function must unfold and eliminate +bare-CR and bare-LF from the result even if they are included in +content of the encoded-word. +Each function must return nil if it can not analyze STRING as its +format. + +Previous function is preferred to next function. If a function +returns nil, next function is used. Otherwise the return value will +be the result.") + +(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 + (std11-strip-quoted-pair + (substring string (1+ start) (1- p))) + default-mime-charset)) + (if mime-header-accept-quoted-encoded-words + (setq ret (eword-decode-string ret))) + (cons (cons 'quoted-string ret) + p)))) + +(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) + (let ((len (length string)) + (i (or from 0)) + dest last-str + chr ret) + (when (and (> len i) + (eq (aref string i) ?\()) + (setq i (1+ i) + from i) + (catch 'tag + (while (< i len) + (setq chr (aref string i)) + (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))) + i (1+ i) + from i) + ) + ((eq chr ?\)) + (setq ret (concat last-str + (substring string from i))) + (throw 'tag (cons + (cons 'comment + (nreverse + (if (string= ret "") + dest + (cons + (eword-decode-string + (decode-mime-charset-string + ret default-mime-charset) + must-unfold) + 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)) + dest + (if (string= last-str "") + (cons (car ret) dest) + (list* (car ret) + (eword-decode-string + (decode-mime-charset-string + last-str default-mime-charset) + must-unfold) + dest) + ) + i (cdr ret) + from i + last-str "") + (throw 'tag nil) + )) + (t + (setq i (1+ i)) + )) + ))))) + +(defun eword-analyze-spaces (string start &optional must-unfold) + (std11-analyze-spaces string start)) + +(defun eword-analyze-special (string start &optional must-unfold) + (std11-analyze-special string start)) + +(defun eword-analyze-encoded-word (string start &optional must-unfold) + (let* ((regexp (concat "[\n\t ]*\\(" eword-encoded-word-regexp "\\)")) + (match (and (string-match regexp string start) + (= start (match-beginning 0)))) + next words) + (while match + (setq next (match-end 0)) + (push (list (match-string 2 string) ;; charset + (match-string 3 string) ;; language + (match-string 4 string) ;; encoding + (match-string 5 string) ;; encoded-text + (match-string 1 string)) ;; encoded-word + words) + (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)))) + +(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 + (substring string start end) + default-mime-charset)) + ;;(substring string end) + end) + ))) + +(defun eword-lexical-analyze-internal (string start must-unfold) + (let ((len (length string)) + dest ret) + (while (< start len) + (setq ret + (let ((rest mime-header-lexical-analyzer) + func r) + (while (and (setq func (car rest)) + (null + (setq r (funcall func string start must-unfold))) + ) + (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) + )) + +(defun eword-lexical-analyze (string &optional start must-unfold) + "Return lexical analyzed list corresponding STRING. +It is like std11-lexical-analyze, but it decodes non us-ascii +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))) + 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 + (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)) + ret))) + +(defun eword-decode-token (token) + (let ((type (car token)) + (value (cdr token))) + (cond ((eq type 'quoted-string) + (std11-wrap-as-quoted-string value)) + ((eq type 'comment) + (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 ")") + )) + (t value)))) + +(defun eword-extract-address-components (string &optional start) + "Extract full name and canonical address from STRING. +Returns a list of the form (FULL-NAME CANONICAL-ADDRESS). +If no name can be extracted, FULL-NAME will be nil. +It decodes non us-ascii characters in FULL-NAME encoded as +encoded-words or invalid \"raw\" string. \"Raw\" non us-ascii +characters are regarded as variable `default-mime-charset'." + (let* ((structure (car (std11-parse-address + (eword-lexical-analyze + (std11-unfold-string string) start + 'must-unfold)))) + (phrase (std11-full-name-string structure)) + (address (std11-address-string structure)) + ) + (list phrase address) + )) + + +;;; @ end +;;; + +(provide 'eword-decode) + +;;; eword-decode.el ends here diff --git a/flim-1.14.9/eword-encode.el b/flim-1.14.9/eword-encode.el new file mode 100644 index 0000000..1efb97d --- /dev/null +++ b/flim-1.14.9/eword-encode.el @@ -0,0 +1,726 @@ +;;; eword-encode.el --- RFC 2047 based encoded-word encoder for GNU Emacs + +;; Copyright (C) 1995,1996,1997,1998,1999,2000,2002,2003,2004 Free +;; Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: encoded-word, MIME, multilingual, header, mail, news + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'mime-def) +(require 'mel) +(require 'std11) +(require 'eword-decode) + + +;;; @ variables +;;; + +;; User options are defined in mime-def.el. + +(defvar mime-header-charset-encoding-alist + '((us-ascii . nil) + (iso-8859-1 . "Q") + (iso-8859-2 . "Q") + (iso-8859-3 . "Q") + (iso-8859-4 . "Q") + (iso-8859-5 . "Q") + (koi8-r . "Q") + (iso-8859-7 . "Q") + (iso-8859-8 . "Q") + (iso-8859-9 . "Q") + (iso-8859-14 . "Q") + (iso-8859-15 . "Q") + (iso-2022-jp . "B") + (iso-2022-jp-3 . "B") + (iso-2022-kr . "B") + (gb2312 . "B") + (cn-gb . "B") + (cn-gb-2312 . "B") + (euc-kr . "B") + (tis-620 . "B") + (iso-2022-jp-2 . "B") + (iso-2022-int-1 . "B") + (utf-8 . "B") + )) + +(defvar mime-header-default-charset-encoding "Q") + +(defvar mime-header-encode-method-alist + '((eword-encode-address-list + . (Reply-To + From Sender + Resent-Reply-To Resent-From + Resent-Sender To Resent-To + Cc Resent-Cc Bcc Resent-Bcc + Dcc)) + (eword-encode-in-reply-to . (In-Reply-To)) + (eword-encode-structured-field-body . (Mime-Version User-Agent)) + (eword-encode-unstructured-field-body))) + +;;; @ encoded-text encoder +;;; + +(defun eword-encode-text (charset encoding string &optional mode) + "Encode STRING as an encoded-word, and return the result. +CHARSET is a symbol to indicate MIME charset of the encoded-word. +ENCODING allows \"B\" or \"Q\". +MODE is allows `text', `comment', `phrase' or nil. Default value is +`phrase'." + (let ((text (encoded-text-encode-string string encoding mode))) + (if text + (concat "=?" (upcase (symbol-name charset)) "?" + 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)))) +(defmacro ew-rword-text (rword) + (` (car (, rword)))) +(defmacro ew-rword-charset (rword) + (` (car (cdr (, rword))))) +(defmacro ew-rword-encoding (rword) + (` (car (cdr (cdr (, rword)))))) +(defmacro ew-rword-type (rword) + (` (car (cdr (cdr (cdr (, rword))))))) + +(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 ew-space-process (seq) + (let (prev a ac b c cc) + (while seq + (setq b (car seq)) + (setq seq (cdr seq)) + (setq c (car seq)) + (setq cc (ew-rword-charset c)) + (if (and (null (ew-rword-charset b)) + (not (eq (ew-rword-type b) 'special))) + (progn + (setq a (car prev)) + (setq ac (ew-rword-charset a)) + (if (and (ew-rword-encoding a) + (ew-rword-encoding c)) + (cond ((eq ac cc) + (setq prev (cons + (cons (concat (car a)(car b)(car c)) + (cdr a)) + (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) + )) + +(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))) + + +;;; @ length +;;; + +(defun tm-eword::encoded-word-length (rword) + (let ((string (ew-rword-text rword)) + (charset (ew-rword-charset rword)) + (encoding (ew-rword-encoding rword)) + ret) + (setq ret + (cond ((string-equal encoding "B") + (setq string (encode-mime-charset-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)) + ))) + (if ret + (cons (+ 7 (length (symbol-name charset)) ret) string) + ))) + + +;;; @ encode-string +;;; + +(defun ew-encode-rword-1 (column rwl &optional must-output) + (catch 'can-not-output + (let* ((rword (car rwl)) + (ret (tm-eword::encoded-word-length rword)) + string len) + (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)) + (setq string (concat "\n" string) + len (length string) + rwl (cdr rwl)) + ) + (must-output + (setq string "\n " + len 1) + ) + (t + (throw 'can-not-output nil) + )) + (cond ((and (setq len (car ret)) + (<= (+ column len) 76) + ) + (setq string + (eword-encode-text + (ew-rword-charset rword) + (ew-rword-encoding rword) + (cdr ret) + (ew-rword-type rword) + )) + (setq len (+ (length string) column)) + (setq rwl (cdr rwl)) + ) + (t + (setq string (car rword)) + (let* ((p 0) np + (str "") nstr) + (while (and (< p len) + (progn + (setq np (1+ p)) + ;;(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)) + )) + (setq nstr (cdr ret)) + (setq len (+ (car ret) column)) + (<= len 76) + )) + (setq str nstr + p np)) + (if (string-equal str "") + (if must-output + (setq string "\n " + len 1) + (throw 'can-not-output nil)) + (setq rwl (cons (cons (substring string p) (cdr rword)) + (cdr rwl))) + (setq string + (eword-encode-text + (ew-rword-charset rword) + (ew-rword-encoding rword) + str + (ew-rword-type rword))) + (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) + (while rwl + (setq ew-f (nth 2 (car rwl))) + (if (and pew-f ew-f) + (setq rwl (cons '(" ") rwl) + pew-f nil) + (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)) + (if (memq i folded-points) + (throw 'found nil) + (setq folded-points (cons i folded-points)) + (throw 'found i)) + ) + ((eq c ?\n) + (throw 'found nil) + )) + (setq i (1- i)))) + (setq s (substring dest i) + r-column (length s) + r-dest (concat (substring dest 0 i) "\n" s)) + (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)) + ))) + (setq str (car ret)) + (setq dest (concat dest str)) + (setq column (nth 1 ret) + rwl (nth 2 ret)) + ) + (list dest column) + )) + + +;;; @ converter +;;; + +(defun eword-encode-phrase-to-rword-list (phrase) + (let (token type dest str) + (while phrase + (setq token (car phrase)) + (setq type (car token)) + (cond ((eq type 'quoted-string) + (setq str (concat "\"" (cdr token) "\"")) + (setq dest + (append dest + (list + (let ((ret (ew-find-charset-rule + (find-charset-string str)))) + (make-ew-rword + 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)) + )) + ) + (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) + )) + +(defun eword-encode-addr-seq-to-rword-list (seq) + (let (dest pname) + (while seq + (let* ((token (car seq)) + (name (car token)) + ) + (cond ((eq name 'spaces) + (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)) + )) + ) + ((eq name 'quoted-string) + (setq dest + (nconc + dest + (list + (list (concat "\"" (cdr token) "\"") nil nil) + ))) + ) + (t + (setq dest + (if (or (eq pname 'spaces) + (eq pname 'comment)) + (nconc dest (list (list (cdr token) nil nil))) + (nconc (nreverse (cdr (reverse dest))) + ;; (butlast dest) + (list + (list (concat (car (car (last dest))) + (cdr token)) + nil nil))))) + )) + (setq seq (cdr seq) + pname name)) + ) + dest)) + +(defun eword-encode-phrase-route-addr-to-rword-list (phrase-route-addr) + (if (eq (car phrase-route-addr) 'phrase-route-addr) + (let ((phrase (nth 1 phrase-route-addr)) + (route (nth 2 phrase-route-addr)) + dest) + ;; (if (eq (car (car phrase)) 'spaces) + ;; (setq phrase (cdr phrase)) + ;; ) + (setq dest (eword-encode-phrase-to-rword-list phrase)) + (if dest + (setq dest (append dest '((" " nil nil)))) + ) + (append + dest + (eword-encode-addr-seq-to-rword-list + (append '((specials . "<")) + route + '((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)) + )) + +(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) + )) + (if comment + (setq dest + (append dest + '((" " nil nil) + ("(" nil nil)) + (eword-encode-split-string comment 'comment) + (list '(")" nil nil)) + ))) + dest)) + +(defsubst eword-encode-mailboxes-to-rword-list (mboxes) + (let ((dest (eword-encode-mailbox-to-rword-list (car mboxes)))) + (if dest + (while (setq mboxes (cdr mboxes)) + (setq dest + (nconc dest + (list '("," nil nil)) + (eword-encode-mailbox-to-rword-list + (car mboxes)))))) + dest)) + +(defsubst eword-encode-address-to-rword-list (address) + (cond + ((eq (car address) 'mailbox) + (eword-encode-mailbox-to-rword-list address)) + ((eq (car address) 'group) + (nconc + (eword-encode-phrase-to-rword-list (nth 1 address)) + (list (list ":" nil nil)) + (eword-encode-mailboxes-to-rword-list (nth 2 address)) + (list (list ";" nil nil)))))) + +(defsubst eword-encode-addresses-to-rword-list (addresses) + (let ((dest (eword-encode-address-to-rword-list (car addresses)))) + (if dest + (while (setq addresses (cdr addresses)) + (setq dest + (nconc dest + (list '("," nil nil)) + ;; (list '(" " nil nil)) + (eword-encode-address-to-rword-list (car addresses)))))) + dest)) + +(defsubst eword-encode-msg-id-to-rword-list (msg-id) + (list + (list + (concat "<" + (caar (eword-encode-addr-seq-to-rword-list (cdr msg-id))) + ">") + nil nil))) + +(defsubst eword-encode-in-reply-to-to-rword-list (in-reply-to) + (let (dest) + (while in-reply-to + (setq dest + (append dest + (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) + )))) + (setq in-reply-to (cdr in-reply-to))) + dest)) + + +;;; @ application interfaces +;;; + +(defvar eword-encode-default-start-column 10 + "Default start column if it is omitted.") + +(defun eword-encode-string (string &optional column mode) + "Encode STRING as encoded-words, and return the result. +Optional argument COLUMN is start-position of the field. +Optional argument MODE allows `text', `comment', `phrase' or nil. +Default value is `phrase'." + (car (eword-encode-rword-list + (or column eword-encode-default-start-column) + (eword-encode-split-string string mode)))) + +(defun eword-encode-address-list (string &optional column) + "Encode header field STRING as list of address, and return the result. +Optional argument COLUMN is start-position of the field." + (car (eword-encode-rword-list + (or column eword-encode-default-start-column) + (eword-encode-addresses-to-rword-list + (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. +Optional argument COLUMN is start-position of the field." + (car (eword-encode-rword-list + (or column 13) + (eword-encode-in-reply-to-to-rword-list + (std11-parse-msg-ids-string string))))) + +(defun eword-encode-structured-field-body (string &optional column) + "Encode header field STRING as structured field, and return the result. +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)) + ))) + +(defun eword-encode-unstructured-field-body (string &optional column) + "Encode header field STRING as unstructured field, and return the result. +Optional argument COLUMN is start-position of the field." + (car (eword-encode-rword-list + (or column eword-encode-default-start-column) + (eword-encode-split-string string 'text)))) + +;;;###autoload +(defun mime-encode-field-body (field-body field-name) + "Encode FIELD-BODY as FIELD-NAME, and return the result. +A lexical token includes non-ASCII character is encoded as MIME +encoded-word. ASCII token is not encoded." + (setq field-body (std11-unfold-string field-body)) + (if (string= field-body "") + "" + (let ((method-alist mime-header-encode-method-alist) + start ret) + (if (symbolp field-name) + (setq start (1+ (length (symbol-name field-name)))) + (setq start (1+ (length field-name)) + field-name (intern (capitalize field-name)))) + (while (car method-alist) + (if (or (not (cdr (car method-alist))) + (memq field-name + (cdr (car method-alist)))) + (progn + (setq ret + (apply (caar method-alist) (list field-body start))) + (setq method-alist nil))) + (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) + +(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.") + +(defsubst eword-find-field-encoding-method (field-name) + (setq field-name (downcase field-name)) + (let ((alist mime-field-encoding-method-alist)) + (catch 'found + (while alist + (let* ((pair (car alist)) + (str (car pair))) + (if (and (stringp str) + (string= field-name (downcase str))) + (throw 'found (cdr pair)) + )) + (setq alist (cdr alist))) + (cdr (assq t mime-field-encoding-method-alist)) + ))) + +;;;###autoload +(defun mime-encode-header-in-buffer (&optional code-conversion) + "Encode header fields to network representation, such as MIME encoded-word. +It refers the `mime-field-encoding-method-alist' variable." + (interactive "*") + (save-excursion + (save-restriction + (std11-narrow-to-header mail-header-separator) + (goto-char (point-min)) + (let ((default-cs (mime-charset-to-coding-system default-mime-charset)) + bbeg end field-name) + (while (re-search-forward std11-field-head-regexp nil t) + (setq bbeg (match-end 0) + field-name (buffer-substring-no-properties (match-beginning 0) + (1- bbeg)) + end (std11-field-end)) + (and (delq 'ascii (find-charset-region bbeg end)) + (let ((method (eword-find-field-encoding-method + (downcase field-name)))) + (cond ((eq method 'mime) + (let* ((field-body + (buffer-substring-no-properties bbeg end)) + (encoded-body + (mime-encode-field-body + field-body field-name))) + (if (not encoded-body) + (error "Cannot encode %s:%s" + field-name field-body) + (delete-region bbeg end) + (insert encoded-body)))) + (code-conversion + (let ((cs + (or (mime-charset-to-coding-system + method) + 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) + + +;;; @ end +;;; + +(provide 'eword-encode) + +;;; eword-encode.el ends here diff --git a/flim-1.14.9/hex-util.el b/flim-1.14.9/hex-util.el new file mode 100644 index 0000000..09fca4a --- /dev/null +++ b/flim-1.14.9/hex-util.el @@ -0,0 +1,73 @@ +;;; hex-util.el --- Functions to encode/decode hexadecimal string. + +;; Copyright (C) 1999, 2001 Free Software Foundation, Inc. + +;; Author: Shuhei KOBAYASHI +;; Keywords: data + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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: + +;;; Code: + +(eval-when-compile + (defmacro hex-char-to-num (chr) + (` (let ((chr (, chr))) + (cond + ((and (<= ?a chr)(<= chr ?f)) (+ (- chr ?a) 10)) + ((and (<= ?A chr)(<= chr ?F)) (+ (- chr ?A) 10)) + ((and (<= ?0 chr)(<= chr ?9)) (- chr ?0)) + (t (error "Invalid hexadecimal digit `%c'" chr)))))) + (defmacro num-to-hex-char (num) + (` (aref "0123456789abcdef" (, num))))) + +(defun decode-hex-string (string) + "Decode hexadecimal STRING to octet string." + (let* ((len (length string)) + (dst (make-string (/ len 2) 0)) + (idx 0)(pos 0)) + (while (< pos len) +;;; logior and lsh are not byte-coded. +;;; (aset dst idx (logior (lsh (hex-char-to-num (aref string pos)) 4) +;;; (hex-char-to-num (aref string (1+ pos))))) + (aset dst idx (+ (* (hex-char-to-num (aref string pos)) 16) + (hex-char-to-num (aref string (1+ pos))))) + (setq idx (1+ idx) + pos (+ 2 pos))) + dst)) + +(defun encode-hex-string (string) + "Encode octet STRING to hexadecimal string." + (let* ((len (length string)) + (dst (make-string (* len 2) 0)) + (idx 0)(pos 0)) + (while (< pos len) +;;; logand and lsh are not byte-coded. +;;; (aset dst idx (num-to-hex-char (logand (lsh (aref string pos) -4) 15))) + (aset dst idx (num-to-hex-char (/ (aref string pos) 16))) + (setq idx (1+ idx)) +;;; (aset dst idx (num-to-hex-char (logand (aref string pos) 15))) + (aset dst idx (num-to-hex-char (% (aref string pos) 16))) + (setq idx (1+ idx) + pos (1+ pos))) + dst)) + +(provide 'hex-util) + +;;; hex-util.el ends here diff --git a/flim-1.14.9/hmac-def.el b/flim-1.14.9/hmac-def.el new file mode 100644 index 0000000..9b599d5 --- /dev/null +++ b/flim-1.14.9/hmac-def.el @@ -0,0 +1,85 @@ +;;; hmac-def.el --- A macro for defining HMAC functions. + +;; Copyright (C) 1999, 2001 Free Software Foundation, Inc. + +;; Author: Shuhei KOBAYASHI +;; Keywords: HMAC, RFC 2104 + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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 program is implemented from RFC 2104, +;; "HMAC: Keyed-Hashing for Message Authentication". + +;;; Code: + +(defmacro define-hmac-function (name H B L &optional bit) + "Define a function NAME(TEXT KEY) which computes HMAC with function H. + +HMAC function is H(KEY XOR opad, H(KEY XOR ipad, TEXT)): + +H is a cryptographic hash function, such as SHA1 and MD5, which takes +a string and return a digest of it (in binary form). +B is a byte-length of a block size of H. (B=64 for both SHA1 and MD5.) +L is a byte-length of hash outputs. (L=16 for MD5, L=20 for SHA1.) +If BIT is non-nil, truncate output to specified bits." + (` (defun (, name) (text key) + (, (concat "Compute " + (upcase (symbol-name name)) + " over TEXT with KEY.")) + (let ((key-xor-ipad (make-string (, B) ?\x36)) + (key-xor-opad (make-string (, B) ?\x5C)) + (len (length key)) + (pos 0)) + (unwind-protect + (progn + ;; if `key' is longer than the block size, apply hash function + ;; to `key' and use the result as a real `key'. + (if (> len (, B)) + (setq key ((, H) key) + len (, L))) + (while (< pos len) + (aset key-xor-ipad pos (logxor (aref key pos) ?\x36)) + (aset key-xor-opad pos (logxor (aref key pos) ?\x5C)) + (setq pos (1+ pos))) + (setq key-xor-ipad (unwind-protect + (concat key-xor-ipad text) + (fillarray key-xor-ipad 0)) + key-xor-ipad (unwind-protect + ((, H) key-xor-ipad) + (fillarray key-xor-ipad 0)) + key-xor-opad (unwind-protect + (concat key-xor-opad key-xor-ipad) + (fillarray key-xor-opad 0)) + key-xor-opad (unwind-protect + ((, H) key-xor-opad) + (fillarray key-xor-opad 0))) + ;; now `key-xor-opad' contains + ;; H(KEY XOR opad, H(KEY XOR ipad, TEXT)). + (, (if (and bit (< (/ bit 8) L)) + (` (substring key-xor-opad 0 (, (/ bit 8)))) + ;; return a copy of `key-xor-opad'. + (` (concat key-xor-opad))))) + ;; cleanup. + (fillarray key-xor-ipad 0) + (fillarray key-xor-opad 0)))))) + +(provide 'hmac-def) + +;;; hmac-def.el ends here diff --git a/flim-1.14.9/hmac-md5.el b/flim-1.14.9/hmac-md5.el new file mode 100644 index 0000000..037b9f6 --- /dev/null +++ b/flim-1.14.9/hmac-md5.el @@ -0,0 +1,93 @@ +;;; hmac-md5.el --- Compute HMAC-MD5. + +;; Copyright (C) 1999, 2001 Free Software Foundation, Inc. + +;; Author: Shuhei KOBAYASHI +;; Keywords: HMAC, RFC 2104, HMAC-MD5, MD5, KEYED-MD5, CRAM-MD5 + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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: + +;; Test cases from RFC 2202, "Test Cases for HMAC-MD5 and HMAC-SHA-1". +;; +;; (encode-hex-string (hmac-md5 "Hi There" (make-string 16 ?\x0b))) +;; => "9294727a3638bb1c13f48ef8158bfc9d" +;; +;; (encode-hex-string (hmac-md5 "what do ya want for nothing?" "Jefe")) +;; => "750c783e6ab0b503eaa86e310a5db738" +;; +;; (encode-hex-string (hmac-md5 (make-string 50 ?\xdd) (make-string 16 ?\xaa))) +;; => "56be34521d144c88dbb8c733f0e8b3f6" +;; +;; (encode-hex-string +;; (hmac-md5 +;; (make-string 50 ?\xcd) +;; (decode-hex-string "0102030405060708090a0b0c0d0e0f10111213141516171819"))) +;; => "697eaf0aca3a3aea3a75164746ffaa79" +;; +;; (encode-hex-string +;; (hmac-md5 "Test With Truncation" (make-string 16 ?\x0c))) +;; => "56461ef2342edc00f9bab995690efd4c" +;; +;; (encode-hex-string +;; (hmac-md5-96 "Test With Truncation" (make-string 16 ?\x0c))) +;; => "56461ef2342edc00f9bab995" +;; +;; (encode-hex-string +;; (hmac-md5 +;; "Test Using Larger Than Block-Size Key - Hash Key First" +;; (make-string 80 ?\xaa))) +;; => "6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd" +;; +;; (encode-hex-string +;; (hmac-md5 +;; "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data" +;; (make-string 80 ?\xaa))) +;; => "6f630fad67cda0ee1fb1f562db3aa53e" + +;;; 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))))) + +(define-hmac-function hmac-md5 md5-binary 64 16) ; => (hmac-md5 TEXT KEY) +(define-hmac-function hmac-md5-96 md5-binary 64 16 96) + +(provide 'hmac-md5) + +;;; hmac-md5.el ends here diff --git a/flim-1.14.9/hmac-sha1.el b/flim-1.14.9/hmac-sha1.el new file mode 100644 index 0000000..2e97b2b --- /dev/null +++ b/flim-1.14.9/hmac-sha1.el @@ -0,0 +1,86 @@ +;;; hmac-sha1.el --- Compute HMAC-SHA1. + +;; Copyright (C) 1999, 2001 Free Software Foundation, Inc. + +;; Author: Shuhei KOBAYASHI +;; Keywords: HMAC, RFC 2104, HMAC-SHA1, SHA1, Cancel-Lock + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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: + +;; Test cases from RFC 2202, "Test Cases for HMAC-MD5 and HMAC-SHA-1". +;; +;; (encode-hex-string (hmac-sha1 "Hi There" (make-string 20 ?\x0b))) +;; => "b617318655057264e28bc0b6fb378c8ef146be00" +;; +;; (encode-hex-string (hmac-sha1 "what do ya want for nothing?" "Jefe")) +;; => "effcdf6ae5eb2fa2d27416d5f184df9c259a7c79" +;; +;; (encode-hex-string (hmac-sha1 (make-string 50 ?\xdd) (make-string 20 ?\xaa))) +;; => "125d7342b9ac11cd91a39af48aa17b4f63f175d3" +;; +;; (encode-hex-string +;; (hmac-sha1 +;; (make-string 50 ?\xcd) +;; (decode-hex-string "0102030405060708090a0b0c0d0e0f10111213141516171819"))) +;; => "4c9007f4026250c6bc8414f9bf50c86c2d7235da" +;; +;; (encode-hex-string +;; (hmac-sha1 "Test With Truncation" (make-string 20 ?\x0c))) +;; => "4c1a03424b55e07fe7f27be1d58bb9324a9a5a04" +;; +;; (encode-hex-string +;; (hmac-sha1-96 "Test With Truncation" (make-string 20 ?\x0c))) +;; => "4c1a03424b55e07fe7f27be1" +;; +;; (encode-hex-string +;; (hmac-sha1 +;; "Test Using Larger Than Block-Size Key - Hash Key First" +;; (make-string 80 ?\xaa))) +;; => "aa4ae5e15272d00e95705637ce8a3b55ed402112" +;; +;; (encode-hex-string +;; (hmac-sha1 +;; "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data" +;; (make-string 80 ?\xaa))) +;; => "e8e99d0f45237d786d6bbaa7965c7808bbff1a91" + +;;; 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))))) + +(define-hmac-function hmac-sha1 sha1-binary 64 20) ; => (hmac-sha1 TEXT KEY) +(define-hmac-function hmac-sha1-96 sha1-binary 64 20 96) + +(provide 'hmac-sha1) + +;;; hmac-sha1.el ends here diff --git a/flim-1.14.9/luna.el b/flim-1.14.9/luna.el new file mode 100644 index 0000000..238fba8 --- /dev/null +++ b/flim-1.14.9/luna.el @@ -0,0 +1,434 @@ +;;; luna.el --- tiny OOP system kernel + +;; Copyright (C) 1999,2000,2002 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: OOP + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(eval-when-compile (require 'cl)) + + +;;; @ class +;;; + +(defmacro luna-find-class (name) + "Return a luna-class that has NAME." + `(get ,name 'luna-class)) + +;; Give NAME (symbol) the luna-class CLASS. +(defmacro luna-set-class (name class) + `(put ,name 'luna-class ,class)) + +;; Return the obarray of luna-class CLASS. +(defmacro luna-class-obarray (class) + `(aref ,class 1)) + +;; Return the parents of luna-class CLASS. +(defmacro luna-class-parents (class) + `(aref ,class 2)) + +;; Return the number of slots of luna-class CLASS. +(defmacro luna-class-number-of-slots (class) + `(aref ,class 3)) + +(defmacro luna-define-class (class &optional parents slots) + "Define CLASS as a luna-class. +CLASS always inherits the luna-class `standard-object'. + +The optional 1st arg PARENTS is a list luna-class names. These +luna-classes are also inheritted by CLASS. + +The optional 2nd arg SLOTS is a list of slots CLASS will have." + `(luna-define-class-function ',class ',(append parents '(standard-object)) + ',slots)) + + +;; Define CLASS as a luna-class. PARENTS, if non-nil, is a list of +;; luna-class names inherited by CLASS. SLOTS, if non-nil, is a list +;; of slots belonging to CLASS. + +(defun luna-define-class-function (class &optional parents slots) + (let ((oa (make-vector 31 0)) + (rest parents) + parent name + (i 2) + b j) + (while rest + (setq parent (pop rest) + b (- i 2)) + (mapatoms (lambda (sym) + (when (setq j (get sym 'luna-slot-index)) + (setq name (symbol-name sym)) + (unless (intern-soft name oa) + (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))) + (unless (intern-soft name oa) + (put (intern name oa) 'luna-slot-index i) + (setq i (1+ i)))) + (luna-set-class class (vector 'class oa parents i)))) + + +;; Return a member (slot or method) of CLASS that has name +;; 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))) + + +;; Return a member (slot or method) of CLASS that has name +;; MEMBER-NAME. If CLASS doesnt' have such a member, make it in +;; 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))) + + +;; Return the index number of SLOT-NAME in CLASS. + +(defmacro luna-class-slot-index (class slot-name) + `(get (luna-class-find-member ,class ,slot-name) 'luna-slot-index)) + +(defmacro luna-define-method (name &rest definition) + "Define NAME as a method of a luna class. + +Usage of this macro follows: + + (luna-define-method NAME [METHOD-QUALIFIER] ARGLIST [DOCSTRING] BODY...) + +The optional 1st argument METHOD-QUALIFIER specifies when and how the +method is called. + +If it is :before, call the method before calling the parents' methods. + +If it is :after, call the method after calling the parents' methods. + +If it is :around, call the method only. The parents' methods can be +executed by calling the function `luna-call-next-method' in BODY. + +Otherwize, call the method only, and the parents' methods are never +executed. In this case, METHOD-QUALIFIER is treated as ARGLIST. + +ARGLIST has the form ((VAR CLASS) METHOD-ARG ...), where VAR is a +variable name that should be bound to an entity that receives the +message NAME, CLASS is a class name. The first argument to the method +is VAR, and the remaining arguments are METHOD-ARGs. + +If VAR is nil, arguments to the method are METHOD-ARGs. This kind of +methods can't be called from generic-function (see +`luna-define-generic'). + +The optional 4th argument DOCSTRING is the documentation of the +method. If it is not string, it is treated as BODY. + +The optional 5th BODY is the body of the method." + (let ((method-qualifier (pop definition)) + args specializer class self) + (if (memq method-qualifier '(:before :after :around)) + (setq args (pop definition)) + (setq args method-qualifier + method-qualifier nil)) + (setq specializer (car args) + class (nth 1 specializer) + self (car specializer)) + `(let ((func (lambda ,(if self + (cons self (cdr args)) + (cdr args)) + ,@definition)) + (sym (luna-class-find-or-make-member + (luna-find-class ',class) ',name)) + (cache (get ',name 'luna-method-cache))) + (and cache + (fboundp sym) + (mapatoms + (lambda (s) + (if (memq (symbol-function sym) (symbol-value s)) + (unintern s cache))) + cache)) + (fset sym func) + (put sym 'luna-method-qualifier ,method-qualifier)))) + +(put 'luna-define-method 'lisp-indent-function 'defun) + +(def-edebug-spec luna-define-method + (&define name [&optional &or ":before" ":after" ":around"] + ((arg symbolp) + [&rest arg] + [&optional ["&optional" arg &rest arg]] + &optional ["&rest" arg]) + def-body)) + + +;; Return a list of method functions named SERVICE registered in the +;; parents of CLASS. + +(defun luna-class-find-parents-functions (class service) + (let ((parents (luna-class-parents class)) + ret) + (while (and parents + (null + (setq ret (luna-class-find-functions + (luna-find-class (pop parents)) + service))))) + ret)) + +;; Return a list of method functions named SERVICE registered in CLASS +;; and the parents.. + +(defun luna-class-find-functions (class service) + (let ((sym (luna-class-find-member class service))) + (if (fboundp sym) + (cond ((eq (get sym 'luna-method-qualifier) :before) + (cons (symbol-function sym) + (luna-class-find-parents-functions class service))) + ((eq (get sym 'luna-method-qualifier) :after) + (nconc (luna-class-find-parents-functions class service) + (list (symbol-function sym)))) + ((eq (get sym 'luna-method-qualifier) :around) + (cons sym (luna-class-find-parents-functions class service))) + (t + (list (symbol-function sym)))) + (luna-class-find-parents-functions class service)))) + + +;;; @ instance (entity) +;;; + +(defmacro luna-class-name (entity) + "Return class-name of the ENTITY." + `(aref ,entity 0)) + +(defmacro luna-set-class-name (entity name) + `(aset ,entity 0 ,name)) + +(defmacro luna-get-obarray (entity) + `(aref ,entity 1)) + +(defmacro luna-set-obarray (entity obarray) + `(aset ,entity 1 ,obarray)) + +(defmacro luna-slot-index (entity slot-name) + `(luna-class-slot-index (luna-find-class (luna-class-name ,entity)) + ,slot-name)) + +(defsubst luna-slot-value (entity slot) + "Return the value of SLOT of ENTITY." + (aref entity (luna-slot-index entity slot))) + +(defsubst luna-set-slot-value (entity slot value) + "Store VALUE into SLOT of ENTITY." + (aset entity (luna-slot-index entity slot) value)) + +(defmacro luna-find-functions (entity service) + `(luna-class-find-functions (luna-find-class (luna-class-name ,entity)) + ,service)) + +(defsubst luna-send (entity message &rest luna-current-method-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)) + luna-current-method + luna-previous-return-value) + (while (and luna-next-methods + (progn + (setq luna-current-method (pop luna-next-methods) + luna-previous-return-value + (apply luna-current-method + luna-current-method-arguments)) + (if (symbolp luna-current-method) + (not (eq (get luna-current-method + 'luna-method-qualifier) :around)) + 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 +to execute the parents' methods." + (let (luna-current-method + luna-previous-return-value) + (while (and luna-next-methods + (progn + (setq luna-current-method (pop luna-next-methods) + luna-previous-return-value + (apply luna-current-method + luna-current-method-arguments)) + (if (symbolp luna-current-method) + (not (eq (get luna-current-method + 'luna-method-qualifier) :around)) + t)))) + luna-previous-return-value)) + +(defun luna-make-entity (class &rest init-args) + "Make an entity (instance) of luna-class CLASS and return it. +INIT-ARGS is a plist of the form (:SLOT1 VAL1 :SLOT2 VAL2 ...), +where SLOTs are slots of CLASS and the VALs are initial values of +the corresponding SLOTs." + (let* ((c (get class 'luna-class)) + (v (make-vector (luna-class-number-of-slots c) nil))) + (luna-set-class-name v class) + (luna-set-obarray v (make-vector 7 0)) + (apply #'luna-send v 'initialize-instance v init-args))) + + +;;; @ interface (generic function) +;;; + +;; Find a method of ENTITY that handles MESSAGE, and call it with +;; arguments LUNA-CURRENT-METHOD-ARGUMENTS. + +(defun luna-apply-generic (entity message &rest luna-current-method-arguments) + (let* ((class (luna-class-name entity)) + (cache (get message 'luna-method-cache)) + (sym (intern-soft (symbol-name class) cache)) + luna-next-methods) + (if sym + (setq luna-next-methods (symbol-value sym)) + (setq luna-next-methods + (luna-find-functions entity message)) + (set (intern (symbol-name class) cache) + luna-next-methods)) + (luna-call-next-method))) + + +;; Convert ARGLIST (argument list spec for a method function) to the +;; actual list of arguments. + +(defsubst luna-arglist-to-arguments (arglist) + (let (dest) + (while arglist + (let ((arg (car arglist))) + (or (memq arg '(&optional &rest)) + (setq dest (cons arg dest)))) + (setq arglist (cdr arglist))) + (nreverse dest))) + + +(defmacro luna-define-generic (name args &optional doc) + "Define a function NAME that provides a generic interface to the method NAME. +ARGS is the argument list for NAME. The first element of ARGS is an +entity. + +The function handles a message sent to the entity by calling the +method with proper arguments. + +The optional 3rd argument DOC is the documentation string for NAME." + (if doc + `(progn + (defun ,(intern (symbol-name name)) ,args + ,doc + (luna-apply-generic ,(car args) ',name + ,@(luna-arglist-to-arguments args))) + (put ',name 'luna-method-cache (make-vector 31 0))) + `(progn + (defun ,(intern (symbol-name name)) ,args + (luna-apply-generic ,(car args) ',name + ,@(luna-arglist-to-arguments args))) + (put ',name 'luna-method-cache (make-vector 31 0))))) + +(put 'luna-define-generic 'lisp-indent-function 'defun) + + +;;; @ accessor +;;; + +(defun luna-define-internal-accessors (class-name) + "Define internal accessors for instances of the luna class CLASS-NAME. + +Internal accessors are macros to refer and set a slot value of the +instances. For instance, if the class has SLOT, macros +CLASS-NAME-SLOT-internal and CLASS-NAME-set-SLOT-internal are defined. + +CLASS-NAME-SLOT-internal accepts one argument INSTANCE, and returns +the value of SLOT. + +CLASS-NAME-set-SLOT-internal accepts two arguemnt INSTANCE and VALUE, +and sets SLOT to VALUE." + (let ((entity-class (luna-find-class class-name)) + parents parent-class) + (mapatoms + (lambda (slot) + (if (luna-class-slot-index entity-class slot) + (catch 'derived + (setq parents (luna-class-parents entity-class)) + (while parents + (setq parent-class (luna-find-class (car parents))) + (if (luna-class-slot-index parent-class slot) + (throw 'derived nil)) + (setq parents (cdr parents))) + (eval + `(progn + (defmacro ,(intern (format "%s-%s-internal" + class-name slot)) + (entity) + (list 'aref entity + ,(luna-class-slot-index entity-class + (intern (symbol-name slot))))) + (defmacro ,(intern (format "%s-set-%s-internal" + class-name slot)) + (entity value) + (list 'aset entity + ,(luna-class-slot-index + entity-class (intern (symbol-name slot))) + value))))))) + (luna-class-obarray entity-class)))) + + +;;; @ standard object +;;; + +;; Define super class of all luna classes. +(luna-define-class-function 'standard-object) + +(luna-define-method initialize-instance ((entity standard-object) + &rest init-args) + "Initialize slots of ENTITY by INIT-ARGS." + (let* ((c (luna-find-class (luna-class-name entity))) + (oa (luna-class-obarray c)) + s i) + (while init-args + (setq s (intern-soft (substring (symbol-name (pop init-args)) 1) oa) + i (pop init-args)) + (if s + (aset entity (get s 'luna-slot-index) i))) + entity)) + + +;;; @ end +;;; + +(provide 'luna) + +;; luna.el ends here diff --git a/flim-1.14.9/lunit.el b/flim-1.14.9/lunit.el new file mode 100644 index 0000000..0d5749a --- /dev/null +++ b/flim-1.14.9/lunit.el @@ -0,0 +1,331 @@ +;;; lunit.el --- simple testing framework for luna + +;; Copyright (C) 2000 Daiki Ueno. + +;; Author: Daiki Ueno +;; Keywords: OOP, XP + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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 GNU Emacs; 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 module is inspired by "JUnit A Cook's Tour". +;; + +;; (require 'lunit) +;; +;; (luna-define-class silly-test-case (lunit-test-case)) +;; +;; (luna-define-method test-1 ((case silly-test-case)) +;; (lunit-assert (integerp "a"))) +;; +;; (luna-define-method test-2 ((case silly-test-case)) +;; (lunit-assert (stringp "b"))) +;; +;; (with-output-to-temp-buffer "*Lunit Results*" +;; (lunit (lunit-make-test-suite-from-class 'silly-test-case))) +;; ______________________________________________________________________ +;; Starting test `silly-test-case#test-1' +;; failure: (integerp "a") +;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +;; ______________________________________________________________________ +;; Starting test `silly-test-case#test-2' +;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +;; 2 runs, 1 failures, 0 errors + +;;; Code: + +(require 'luna) + +(eval-when-compile (require 'cl)) + +;;; @ test +;;; + +(eval-and-compile + (luna-define-class lunit-test () + (name)) + + (luna-define-internal-accessors 'lunit-test)) + +(luna-define-generic lunit-test-number-of-tests (test) + "Count the number of test cases that will be run by the test.") + +(luna-define-generic lunit-test-run (test result) + "Run the test and collects its result in result.") + +(luna-define-generic lunit-test-suite-add-test (suite test) + "Add the test to the suite.") + +;;; @ test listener +;;; + +(luna-define-class lunit-test-listener) + +;;; @ test result +;;; + +(put 'lunit-error 'error-message "test error") +(put 'lunit-error 'error-conditions '(lunit-error error)) + +(put 'lunit-failure 'error-message "test failure") +(put 'lunit-failure 'error-conditions '(lunit-failure lunit-error error)) + +(eval-and-compile + (luna-define-class lunit-test-result () + (errors + failures + listeners)) + + (luna-define-internal-accessors 'lunit-test-result)) + +(luna-define-generic lunit-test-result-run (result case) + "Run the test case.") + +(luna-define-generic lunit-test-result-notify (result message &rest args) + "Report the current state of execution.") + +(luna-define-generic lunit-test-result-error (result case error) + "Add error to the list of errors. +The passed in exception caused the error.") + +(luna-define-generic lunit-test-result-failure (result case failure) + "Add failure to the list of failures. +The passed in exception caused the failure.") + +(luna-define-generic lunit-test-result-add-listener (result listener) + "Add listener to the list of listeners.") + +(defun lunit-make-test-result (&rest listeners) + "Return a newly allocated `lunit-test-result' instance with LISTENERS." + (luna-make-entity 'lunit-test-result :listeners listeners)) + +(luna-define-method lunit-test-result-notify ((result lunit-test-result) + message args) + (let ((listeners + (lunit-test-result-listeners-internal result))) + (dolist (listener listeners) + (apply #'luna-send listener message listener args)))) + +(luna-define-method lunit-test-result-run ((result lunit-test-result) case) + (lunit-test-result-notify result 'lunit-test-listener-start case) + (condition-case error + (lunit-test-case-run case) + (lunit-failure + (lunit-test-result-failure result case (nth 1 error))) + (lunit-error + (lunit-test-result-error result case (cdr error)))) + (lunit-test-result-notify result 'lunit-test-listener-end case)) + +(luna-define-method lunit-test-result-error ((result lunit-test-result) + case error) + (let ((errors + (lunit-test-result-errors-internal result))) + (setq errors (nconc errors (list (cons case error)))) + (lunit-test-result-set-errors-internal result errors)) + (lunit-test-result-notify result 'lunit-test-listener-error case error)) + +(luna-define-method lunit-test-result-failure ((result lunit-test-result) + case failure) + (let ((failures + (lunit-test-result-failures-internal result))) + (setq failures (nconc failures (list (cons case failure)))) + (lunit-test-result-set-failures-internal result failures)) + (lunit-test-result-notify result 'lunit-test-listener-failure case failure)) + +(luna-define-method lunit-test-result-add-listener ((result lunit-test-result) + listener) + (let ((listeners + (lunit-test-result-listeners-internal result))) + (setq listeners (nconc listeners (list listener))) + (lunit-test-result-set-listeners-internal result listeners))) + +;;; @ test case +;;; + +(luna-define-class lunit-test-case (lunit-test)) + +(luna-define-generic lunit-test-case-run (case) + "Run the test case.") + +(luna-define-generic lunit-test-case-setup (case) + "Setup the test case.") + +(luna-define-generic lunit-test-case-teardown (case) + "Clear the test case.") + +(defun lunit-make-test-case (class name) + "Return a newly allocated `lunit-test-case'. +CLASS is a symbol for class derived from `lunit-test-case'. +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)) + 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-run ((case lunit-test-case)) + (lunit-test-case-setup case) + (unwind-protect + (let* ((name + (lunit-test-name-internal case)) + (functions + (luna-find-functions case name))) + (unless functions + (error "Method \"%S\" not found" name)) + (condition-case error + (funcall (car functions) case) + (lunit-failure + (signal (car error)(cdr error))) + (error + (signal 'lunit-error error)))) + (lunit-test-case-teardown case))) + +;;; @ test suite +;;; + +(eval-and-compile + (luna-define-class lunit-test-suite (lunit-test) + (tests)) + + (luna-define-internal-accessors 'lunit-test-suite)) + +(defun lunit-make-test-suite (&rest tests) + "Return a newly allocated `lunit-test-suite' instance. +TESTS holds a number of instances of `lunit-test'." + (luna-make-entity 'lunit-test-suite :tests tests)) + +(luna-define-method lunit-test-suite-add-test ((suite lunit-test-suite) test) + (let ((tests (lunit-test-suite-tests-internal suite))) + (lunit-test-suite-set-tests-internal suite (nconc tests (list test))))) + +(luna-define-method lunit-test-number-of-tests ((suite lunit-test-suite)) + (let ((tests (lunit-test-suite-tests-internal suite)) + (accu 0)) + (dolist (test tests) + (setq accu (+ accu (lunit-test-number-of-tests test)))) + accu)) + +(luna-define-method lunit-test-run ((suite lunit-test-suite) result) + (let ((tests (lunit-test-suite-tests-internal suite))) + (dolist (test tests) + (lunit-test-run test result)))) + +;;; @ test runner +;;; + +(defmacro lunit-assert (condition-expr) + "Verify that CONDITION-EXPR returns non-nil; signal an error if not." + (let ((condition (eval condition-expr))) + `(when ,(not condition) + (signal 'lunit-failure (list ',condition-expr))))) + +(luna-define-class lunit-test-printer (lunit-test-listener)) + +(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) + (princ (format " failure: %S" failure))) + +(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) + (princ "\n")) + +(defun lunit-make-test-suite-from-class (class) + "Make a test suite from all test methods of the CLASS." + (let (tests) + (mapatoms + (lambda (symbol) + (if (and (fboundp symbol) + (string-match "^test" (symbol-name symbol)) + (null (get symbol 'luna-method-qualifier))) + (push (lunit-make-test-case class symbol) tests))) + (luna-class-obarray (luna-find-class class))) + (apply #'lunit-make-test-suite tests))) + +(defun lunit (test) + "Run TEST and display the result." + (let* ((printer + (luna-make-entity 'lunit-test-printer)) + (result + (lunit-make-test-result printer))) + (lunit-test-run test result) + (let ((failures + (lunit-test-result-failures-internal result)) + (errors + (lunit-test-result-errors-internal result))) + (princ (format "%d runs, %d failures, %d errors\n" + (lunit-test-number-of-tests test) + (length failures) + (length errors)))))) + +(defvar imenu-create-index-function) +(defun lunit-create-index-function () + (require 'imenu) + (save-excursion + (unwind-protect + (progn + (goto-char (point-min)) + (setq imenu-generic-expression + '((nil "^\\s-*(def\\(un\\|subst\\|macro\\)\\s-+\\([-A-Za-z0-9+*|:]+\\)" 2))) + (funcall imenu-create-index-function)) + (setq imenu-create-index-function lisp-imenu-generic-expression)))) + +(defun lunit-generate-template (file) + (interactive "fGenerate lunit template for: ") + (save-excursion + (set-buffer (find-file-noselect file)) + (let ((index-alist + (lunit-create-index-function))) + (with-output-to-temp-buffer "*Lunit template*" + (let* ((feature + (file-name-sans-extension + (file-name-nondirectory file))) + (class + (concat "test-" feature))) + (set-buffer standard-output) + (insert "\ +\(require 'lunit) +\(require '" feature ") + +\(luna-define-class " class " (lunit-test-case)) + +") + (dolist (index index-alist) + (insert "\ +\(luna-define-method " class "-" (car index) " ((case " class ")) + (lunit-assert nil)) + +"))))))) + +(provide 'lunit) + +;;; lunit.el ends here diff --git a/flim-1.14.9/mailcap.el b/flim-1.14.9/mailcap.el new file mode 100644 index 0000000..a2c40ae --- /dev/null +++ b/flim-1.14.9/mailcap.el @@ -0,0 +1,67 @@ +;;; mailcap.el --- mailcap parser + +;; Copyright (C) 1997,1998,1999,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Created: 1997-06-27 +;; 2000-11-24 Rewrote to use mime-conf.el. +;; Keywords: mailcap, setting, configuration, MIME, multimedia +;; Status: obsolete + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'mime-conf) +(require 'poe) ; define-obsolete-function-alias + +(define-obsolete-function-alias + 'mailcap-parse-buffer 'mime-parse-mailcap-buffer) + +(define-obsolete-function-alias + 'mailcap-format-command 'mime-format-mailcap-command) + +(cond + ((featurep 'xemacs) + (define-obsolete-variable-alias + 'mailcap-file 'mime-mailcap-file) + (define-obsolete-function-alias + 'mailcap-parse-file 'mime-parse-mailcap-file) + ) + (t + (defvar mailcap-file mime-mailcap-file) + (defun mailcap-parse-file (&optional filename order) + "Parse FILENAME as a mailcap, and return the result. +If optional argument ORDER is a function, result is sorted by it. +If optional argument ORDER is not specified, result is sorted original +order. Otherwise result is not sorted. +This function is obsolete. Please use mime-parse-mailcap-file instead." + (if filename + (mime-parse-mailcap-file filename order) + (let ((mime-mailcap-file mailcap-file)) + (mime-parse-mailcap-file nil order)))) + (make-obsolete 'mailcap-parse-file 'mime-parse-mailcap-file) + )) + + +;;; @ end +;;; + +(provide 'mailcap) + +;;; mailcap.el ends here diff --git a/flim-1.14.9/md4.el b/flim-1.14.9/md4.el new file mode 100644 index 0000000..43af2ae --- /dev/null +++ b/flim-1.14.9/md4.el @@ -0,0 +1,228 @@ +;;; md4.el --- MD4 Message Digest Algorithm. + +;; Copyright (C) 2004 Free Software Foundation, Inc. +;; Copyright (C) 2001 Taro Kawagishi +;; Author: Taro Kawagishi +;; Keywords: MD4 +;; Version: 1.00 +;; Created: February 2001 + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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. + +;;; Code: + +;;; +;;; MD4 hash calculation + +(defvar md4-buffer (make-vector 4 '(0 . 0)) + "work buffer of four 32-bit integers") + +(defun md4 (in n) + "Returns the MD4 hash string of 16 bytes long for a string IN of N +bytes long. N is required to handle strings containing character 0." + (let (m + (b (cons 0 (* n 8))) + (i 0) + (buf (make-string 128 0)) c4) + ;; initial values + (aset md4-buffer 0 '(26437 . 8961)) ;0x67452301 + (aset md4-buffer 1 '(61389 . 43913)) ;0xefcdab89 + (aset md4-buffer 2 '(39098 . 56574)) ;0x98badcfe + (aset md4-buffer 3 '(4146 . 21622)) ;0x10325476 + + ;; process the string in 64 bits chunks + (while (> n 64) + (setq m (md4-copy64 (substring in 0 64))) + (md4-64 m) + (setq in (substring in 64)) + (setq n (- n 64))) + + ;; process the rest of the string (length is now n <= 64) + (setq i 0) + (while (< i n) + (aset buf i (aref in i)) + (setq i (1+ i))) + (aset buf n 128) ;0x80 + (if (<= n 55) + (progn + (setq c4 (md4-pack-int32 b)) + (aset buf 56 (aref c4 0)) + (aset buf 57 (aref c4 1)) + (aset buf 58 (aref c4 2)) + (aset buf 59 (aref c4 3)) + (setq m (md4-copy64 buf)) + (md4-64 m)) + ;; else + (setq c4 (md4-pack-int32 b)) + (aset buf 120 (aref c4 0)) + (aset buf 121 (aref c4 1)) + (aset buf 122 (aref c4 2)) + (aset buf 123 (aref c4 3)) + (setq m (md4-copy64 buf)) + (md4-64 m) + (setq m (md4-copy64 (substring buf 64))) + (md4-64 m))) + + (concat (md4-pack-int32 (aref md4-buffer 0)) + (md4-pack-int32 (aref md4-buffer 1)) + (md4-pack-int32 (aref md4-buffer 2)) + (md4-pack-int32 (aref md4-buffer 3)))) + +(defsubst md4-F (x y z) (logior (logand x y) (logand (lognot x) z))) +(defsubst md4-G (x y z) (logior (logand x y) (logand x z) (logand y z))) +(defsubst md4-H (x y z) (logxor x y z)) + +(defmacro md4-make-step (name func) + (` + (defun (, name) (a b c d xk s ac) + (let* + ((h1 (+ (car a) ((, func) (car b) (car c) (car d)) (car xk) (car ac))) + (l1 (+ (cdr a) ((, func) (cdr b) (cdr c) (cdr d)) (cdr xk) (cdr ac))) + (h2 (logand 65535 (+ h1 (lsh l1 -16)))) + (l2 (logand 65535 l1)) + ;; cyclic shift of 32 bits integer + (h3 (logand 65535 (if (> s 15) + (+ (lsh h2 (- s 32)) (lsh l2 (- s 16))) + (+ (lsh h2 s) (lsh l2 (- s 16)))))) + (l3 (logand 65535 (if (> s 15) + (+ (lsh l2 (- s 32)) (lsh h2 (- s 16))) + (+ (lsh l2 s) (lsh h2 (- s 16))))))) + (cons h3 l3))))) + +(md4-make-step md4-round1 md4-F) +(md4-make-step md4-round2 md4-G) +(md4-make-step md4-round3 md4-H) + +(defsubst md4-add (x y) + "Return 32-bit sum of 32-bit integers X and Y." + (let ((h (+ (car x) (car y))) + (l (+ (cdr x) (cdr y)))) + (cons (logand 65535 (+ h (lsh l -16))) (logand 65535 l)))) + +(defsubst md4-and (x y) + (cons (logand (car x) (car y)) (logand (cdr x) (cdr y)))) + +(defun md4-64 (m) + "Calculate md4 of 64 bytes chunk M which is represented as 16 pairs of +32 bits integers. The resulting md4 value is placed in md4-buffer." + (let ((a (aref md4-buffer 0)) + (b (aref md4-buffer 1)) + (c (aref md4-buffer 2)) + (d (aref md4-buffer 3))) + (setq a (md4-round1 a b c d (aref m 0) 3 '(0 . 0)) + d (md4-round1 d a b c (aref m 1) 7 '(0 . 0)) + c (md4-round1 c d a b (aref m 2) 11 '(0 . 0)) + b (md4-round1 b c d a (aref m 3) 19 '(0 . 0)) + a (md4-round1 a b c d (aref m 4) 3 '(0 . 0)) + d (md4-round1 d a b c (aref m 5) 7 '(0 . 0)) + c (md4-round1 c d a b (aref m 6) 11 '(0 . 0)) + b (md4-round1 b c d a (aref m 7) 19 '(0 . 0)) + a (md4-round1 a b c d (aref m 8) 3 '(0 . 0)) + d (md4-round1 d a b c (aref m 9) 7 '(0 . 0)) + c (md4-round1 c d a b (aref m 10) 11 '(0 . 0)) + b (md4-round1 b c d a (aref m 11) 19 '(0 . 0)) + a (md4-round1 a b c d (aref m 12) 3 '(0 . 0)) + d (md4-round1 d a b c (aref m 13) 7 '(0 . 0)) + c (md4-round1 c d a b (aref m 14) 11 '(0 . 0)) + b (md4-round1 b c d a (aref m 15) 19 '(0 . 0)) + + a (md4-round2 a b c d (aref m 0) 3 '(23170 . 31129)) ;0x5A827999 + d (md4-round2 d a b c (aref m 4) 5 '(23170 . 31129)) + c (md4-round2 c d a b (aref m 8) 9 '(23170 . 31129)) + b (md4-round2 b c d a (aref m 12) 13 '(23170 . 31129)) + a (md4-round2 a b c d (aref m 1) 3 '(23170 . 31129)) + d (md4-round2 d a b c (aref m 5) 5 '(23170 . 31129)) + c (md4-round2 c d a b (aref m 9) 9 '(23170 . 31129)) + b (md4-round2 b c d a (aref m 13) 13 '(23170 . 31129)) + a (md4-round2 a b c d (aref m 2) 3 '(23170 . 31129)) + d (md4-round2 d a b c (aref m 6) 5 '(23170 . 31129)) + c (md4-round2 c d a b (aref m 10) 9 '(23170 . 31129)) + b (md4-round2 b c d a (aref m 14) 13 '(23170 . 31129)) + a (md4-round2 a b c d (aref m 3) 3 '(23170 . 31129)) + d (md4-round2 d a b c (aref m 7) 5 '(23170 . 31129)) + c (md4-round2 c d a b (aref m 11) 9 '(23170 . 31129)) + b (md4-round2 b c d a (aref m 15) 13 '(23170 . 31129)) + + a (md4-round3 a b c d (aref m 0) 3 '(28377 . 60321)) ;0x6ED9EBA1 + d (md4-round3 d a b c (aref m 8) 9 '(28377 . 60321)) + c (md4-round3 c d a b (aref m 4) 11 '(28377 . 60321)) + b (md4-round3 b c d a (aref m 12) 15 '(28377 . 60321)) + a (md4-round3 a b c d (aref m 2) 3 '(28377 . 60321)) + d (md4-round3 d a b c (aref m 10) 9 '(28377 . 60321)) + c (md4-round3 c d a b (aref m 6) 11 '(28377 . 60321)) + b (md4-round3 b c d a (aref m 14) 15 '(28377 . 60321)) + a (md4-round3 a b c d (aref m 1) 3 '(28377 . 60321)) + d (md4-round3 d a b c (aref m 9) 9 '(28377 . 60321)) + c (md4-round3 c d a b (aref m 5) 11 '(28377 . 60321)) + b (md4-round3 b c d a (aref m 13) 15 '(28377 . 60321)) + a (md4-round3 a b c d (aref m 3) 3 '(28377 . 60321)) + d (md4-round3 d a b c (aref m 11) 9 '(28377 . 60321)) + c (md4-round3 c d a b (aref m 7) 11 '(28377 . 60321)) + b (md4-round3 b c d a (aref m 15) 15 '(28377 . 60321))) + + (aset md4-buffer 0 (md4-add a (aref md4-buffer 0))) + (aset md4-buffer 1 (md4-add b (aref md4-buffer 1))) + (aset md4-buffer 2 (md4-add c (aref md4-buffer 2))) + (aset md4-buffer 3 (md4-add d (aref md4-buffer 3))) + )) + +(defun md4-copy64 (seq) + "Unpack a 64 bytes string into 16 pairs of 32 bits integers." + (let ((int32s (make-vector 16 0)) (i 0) j) + (while (< i 16) + (setq j (* i 4)) + (aset int32s i (cons (+ (aref seq (+ j 2)) (lsh (aref seq (+ j 3)) 8)) + (+ (aref seq j) (lsh (aref seq (1+ j)) 8)))) + (setq i (1+ i))) + int32s)) + +;;; +;;; sub functions + +(defun md4-pack-int16 (int16) + "Pack 16 bits integer in 2 bytes string as little endian." + (let ((str (make-string 2 0))) + (aset str 0 (logand int16 255)) + (aset str 1 (lsh int16 -8)) + str)) + +(defun md4-pack-int32 (int32) + "Pack 32 bits integer in a 4 bytes string as little endian. A 32 bits +integer is represented as a pair of two 16 bits integers (cons high low)." + (let ((str (make-string 4 0)) + (h (car int32)) (l (cdr int32))) + (aset str 0 (logand l 255)) + (aset str 1 (lsh l -8)) + (aset str 2 (logand h 255)) + (aset str 3 (lsh h -8)) + str)) + +(defun md4-unpack-int16 (str) + (if (eq 2 (length str)) + (+ (lsh (aref str 1) 8) (aref str 0)) + (error "%s is not 2 bytes long" str))) + +(defun md4-unpack-int32 (str) + (if (eq 4 (length str)) + (cons (+ (lsh (aref str 3) 8) (aref str 2)) + (+ (lsh (aref str 1) 8) (aref str 0))) + (error "%s is not 4 bytes long" str))) + +(provide 'md4) + +;;; md4.el ends here diff --git a/flim-1.14.9/md5-dl.el b/flim-1.14.9/md5-dl.el new file mode 100644 index 0000000..7006d43 --- /dev/null +++ b/flim-1.14.9/md5-dl.el @@ -0,0 +1,55 @@ +;;; md5-dl.el --- MD5 Message Digest Algorithm using DL module. + +;; Copyright (C) 1999, 2001 Free Software Foundation, Inc. + +;; Author: Shuhei KOBAYASHI +;; Keywords: MD5, RFC 1321 + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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: + +;;; Code: + +(provide 'md5-dl) ; beware of circular dependency. +(eval-when-compile (require 'md5)) ; md5-dl-module. + +;;; This file is loaded (from "md5.el") only when md5-dl-module is exists. +(defvar md5-dl-handle (dynamic-link md5-dl-module)) + +;;; md5-dl-module provides `md5-string'. +(dynamic-call "emacs_md5_init" md5-dl-handle) + +(defun md5-region (beg end) + (md5-string (buffer-substring-no-properties beg end))) + +;;; Note that v21 `md5' takes two more args: CODING and NOERROR. +(defun md5 (object &optional beg end) + "Return the MD5 (a secure message digest algorithm) of an object. +OBJECT is either a string or a buffer. +Optional arguments BEG and END denote buffer positions for computing the +hash of a portion of OBJECT." + (if (stringp object) + (md5-string object) + (save-excursion + (set-buffer object) + (md5-region (or beg (point-min)) (or end (point-max)))))) + +(provide 'md5-dl) + +;;; md5-dl.el ends here diff --git a/flim-1.14.9/md5-el.el b/flim-1.14.9/md5-el.el new file mode 100644 index 0000000..e7374d8 --- /dev/null +++ b/flim-1.14.9/md5-el.el @@ -0,0 +1,408 @@ +;;; md5.el -- MD5 Message Digest Algorithm +;;; Gareth Rees + +;; LCD Archive Entry: +;; md5|Gareth Rees|gdr11@cl.cam.ac.uk| +;; MD5 cryptographic message digest algorithm| +;; 13-Nov-95|1.0|~/misc/md5.el.Z| + +;;; Details: ------------------------------------------------------------------ + +;; This is a direct translation into Emacs LISP of the reference C +;; implementation of the MD5 Message-Digest Algorithm written by RSA +;; Data Security, Inc. +;; +;; The algorithm takes a message (that is, a string of bytes) and +;; computes a 16-byte checksum or "digest" for the message. This digest +;; is supposed to be cryptographically strong in the sense that if you +;; are given a 16-byte digest D, then there is no easier way to +;; construct a message whose digest is D than to exhaustively search the +;; space of messages. However, the robustness of the algorithm has not +;; been proven, and a similar algorithm (MD4) was shown to be unsound, +;; so treat with caution! +;; +;; The C algorithm uses 32-bit integers; because GNU Emacs +;; implementations provide 28-bit integers (with 24-bit integers on +;; versions prior to 19.29), the code represents a 32-bit integer as the +;; cons of two 16-bit integers. The most significant word is stored in +;; the car and the least significant in the cdr. The algorithm requires +;; at least 17 bits of integer representation in order to represent the +;; carry from a 16-bit addition. + +;;; Usage: -------------------------------------------------------------------- + +;; To compute the MD5 Message Digest for a message M (represented as a +;; string or as a vector of bytes), call +;; +;; (md5-encode M) +;; +;; which returns the message digest as a vector of 16 bytes. If you +;; need to supply the message in pieces M1, M2, ... Mn, then call +;; +;; (md5-init) +;; (md5-update M1) +;; (md5-update M2) +;; ... +;; (md5-update Mn) +;; (md5-final) + +;;; Copyright and licence: ---------------------------------------------------- + +;; Copyright (C) 1995, 1996, 1997 by Gareth Rees +;; Derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm +;; +;; md5.el is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by the +;; Free Software Foundation; either version 2, or (at your option) any +;; later version. +;; +;; md5.el 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. +;; +;; The original copyright notice is given below, as required by the +;; licence for the original code. This code is distributed under *both* +;; RSA's original licence and the GNU General Public Licence. (There +;; should be no problems, as the former is more liberal than the +;; latter). + +;;; Original copyright notice: ------------------------------------------------ + +;; Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. +;; +;; License to copy and use this software is granted provided that it is +;; identified as the "RSA Data Security, Inc. MD5 Message- Digest +;; Algorithm" in all material mentioning or referencing this software or +;; this function. +;; +;; License is also granted to make and use derivative works provided +;; that such works are identified as "derived from the RSA Data +;; Security, Inc. MD5 Message-Digest Algorithm" in all material +;; mentioning or referencing the derived work. +;; +;; RSA Data Security, Inc. makes no representations concerning either +;; the merchantability of this software or the suitability of this +;; software for any particular purpose. It is provided "as is" without +;; express or implied warranty of any kind. +;; +;; These notices must be retained in any copies of any part of this +;; documentation and/or software. + +;;; Code: --------------------------------------------------------------------- + +(defvar md5-program "md5" + "*Program that reads a message on its standard input and writes an +MD5 digest on its output.") + +(defvar md5-maximum-internal-length 4096 + "*The maximum size of a piece of data that should use the MD5 routines +written in lisp. If a message exceeds this, it will be run through an +external filter for processing. Also see the `md5-program' variable. +This variable has no effect if you call the md5-init|update|final +functions - only used by the `md5' function's simpler interface.") + +(defvar md5-bits (make-vector 4 0) + "Number of bits handled, modulo 2^64. +Represented as four 16-bit numbers, least significant first.") +(defvar md5-buffer (make-vector 4 '(0 . 0)) + "Scratch buffer (four 32-bit integers).") +(defvar md5-input (make-vector 64 0) + "Input buffer (64 bytes).") + +(defun md5-unhex (x) + (if (> x ?9) + (if (>= x ?a) + (+ 10 (- x ?a)) + (+ 10 (- x ?A))) + (- x ?0))) + +(defun md5-encode (message) + "Encodes MESSAGE using the MD5 message digest algorithm. +MESSAGE must be a string or an array of bytes. +Returns a vector of 16 bytes containing the message digest." + (if (or (null md5-maximum-internal-length) + (<= (length message) md5-maximum-internal-length)) + (progn + (md5-init) + (md5-update message) + (md5-final)) + (save-excursion + (set-buffer (get-buffer-create " *md5-work*")) + (erase-buffer) + (insert message) + (call-process-region (point-min) (point-max) + md5-program + t (current-buffer)) + ;; MD5 digest is 32 chars long + ;; mddriver adds a newline to make neaten output for tty + ;; viewing, make sure we leave it behind. + (let ((data (buffer-substring (point-min) (+ (point-min) 32))) + (vec (make-vector 16 0)) + (ctr 0)) + (while (< ctr 16) + (aset vec ctr (+ (* 16 (md5-unhex (aref data (* ctr 2)))) + (md5-unhex (aref data (1+ (* ctr 2)))))) + (setq ctr (1+ ctr))))))) + +(defsubst md5-add (x y) + "Return 32-bit sum of 32-bit integers X and Y." + (let ((m (+ (car x) (car y))) + (l (+ (cdr x) (cdr y)))) + (cons (logand 65535 (+ m (lsh l -16))) (logand l 65535)))) + +;; FF, GG, HH and II are basic MD5 functions, providing transformations +;; for rounds 1, 2, 3 and 4 respectively. Each function follows this +;; pattern of computation (where ROTATE(x,y) means rotate 32-bit value x +;; by y bits to the left): +;; +;; FF(a,b,c,d,x,s,ac) = ROTATE(a + F(b,c,d) + x + ac,s) + b +;; +;; so we use the macro `md5-make-step' to construct each one. The +;; helper functions F, G, H and I operate on 16-bit numbers; the full +;; operation splits its inputs, operates on the halves separately and +;; then puts the results together. + +(defsubst md5-F (x y z) (logior (logand x y) (logand (lognot x) z))) +(defsubst md5-G (x y z) (logior (logand x z) (logand y (lognot z)))) +(defsubst md5-H (x y z) (logxor x y z)) +(defsubst md5-I (x y z) (logxor y (logior x (logand 65535 (lognot z))))) + +(defmacro md5-make-step (name func) + (` + (defun (, name) (a b c d x s ac) + (let* + ((m1 (+ (car a) ((, func) (car b) (car c) (car d)) (car x) (car ac))) + (l1 (+ (cdr a) ((, func) (cdr b) (cdr c) (cdr d)) (cdr x) (cdr ac))) + (m2 (logand 65535 (+ m1 (lsh l1 -16)))) + (l2 (logand 65535 l1)) + (m3 (logand 65535 (if (> s 15) + (+ (lsh m2 (- s 32)) (lsh l2 (- s 16))) + (+ (lsh m2 s) (lsh l2 (- s 16)))))) + (l3 (logand 65535 (if (> s 15) + (+ (lsh l2 (- s 32)) (lsh m2 (- s 16))) + (+ (lsh l2 s) (lsh m2 (- s 16))))))) + (md5-add (cons m3 l3) b))))) + +(md5-make-step md5-FF md5-F) +(md5-make-step md5-GG md5-G) +(md5-make-step md5-HH md5-H) +(md5-make-step md5-II md5-I) + +(defun md5-init () + "Initialise the state of the message-digest routines." + (aset md5-bits 0 0) + (aset md5-bits 1 0) + (aset md5-bits 2 0) + (aset md5-bits 3 0) + (aset md5-buffer 0 '(26437 . 8961)) + (aset md5-buffer 1 '(61389 . 43913)) + (aset md5-buffer 2 '(39098 . 56574)) + (aset md5-buffer 3 '( 4146 . 21622))) + +(defun md5-update (string) + "Update the current MD5 state with STRING (an array of bytes)." + (let ((len (length string)) + (i 0) + (j 0)) + (while (< i len) + ;; Compute number of bytes modulo 64 + (setq j (% (/ (aref md5-bits 0) 8) 64)) + + ;; Store this byte (truncating to 8 bits to be sure) + (aset md5-input j (logand 255 (aref string i))) + + ;; Update number of bits by 8 (modulo 2^64) + (let ((c 8) (k 0)) + (while (and (> c 0) (< k 4)) + (let ((b (aref md5-bits k))) + (aset md5-bits k (logand 65535 (+ b c))) + (setq c (if (> b (- 65535 c)) 1 0) + k (1+ k))))) + + ;; Increment number of bytes processed + (setq i (1+ i)) + + ;; When 64 bytes accumulated, pack them into sixteen 32-bit + ;; integers in the array `in' and then tranform them. + (if (= j 63) + (let ((in (make-vector 16 (cons 0 0))) + (k 0) + (kk 0)) + (while (< k 16) + (aset in k (md5-pack md5-input kk)) + (setq k (+ k 1) kk (+ kk 4))) + (md5-transform in)))))) + +(defun md5-pack (array i) + "Pack the four bytes at ARRAY reference I to I+3 into a 32-bit integer." + (cons (+ (lsh (aref array (+ i 3)) 8) (aref array (+ i 2))) + (+ (lsh (aref array (+ i 1)) 8) (aref array (+ i 0))))) + +(defun md5-byte (array n b) + "Unpack byte B (0 to 3) from Nth member of ARRAY of 32-bit integers." + (let ((e (aref array n))) + (cond ((eq b 0) (logand 255 (cdr e))) + ((eq b 1) (lsh (cdr e) -8)) + ((eq b 2) (logand 255 (car e))) + ((eq b 3) (lsh (car e) -8))))) + +(defun md5-final () + (let ((in (make-vector 16 (cons 0 0))) + (j 0) + (digest (make-vector 16 0)) + (padding)) + + ;; Save the number of bits in the message + (aset in 14 (cons (aref md5-bits 1) (aref md5-bits 0))) + (aset in 15 (cons (aref md5-bits 3) (aref md5-bits 2))) + + ;; Compute number of bytes modulo 64 + (setq j (% (/ (aref md5-bits 0) 8) 64)) + + ;; Pad out computation to 56 bytes modulo 64 + (setq padding (make-vector (if (< j 56) (- 56 j) (- 120 j)) 0)) + (aset padding 0 128) + (md5-update padding) + + ;; Append length in bits and transform + (let ((k 0) (kk 0)) + (while (< k 14) + (aset in k (md5-pack md5-input kk)) + (setq k (+ k 1) kk (+ kk 4)))) + (md5-transform in) + + ;; Store the results in the digest + (let ((k 0) (kk 0)) + (while (< k 4) + (aset digest (+ kk 0) (md5-byte md5-buffer k 0)) + (aset digest (+ kk 1) (md5-byte md5-buffer k 1)) + (aset digest (+ kk 2) (md5-byte md5-buffer k 2)) + (aset digest (+ kk 3) (md5-byte md5-buffer k 3)) + (setq k (+ k 1) kk (+ kk 4)))) + + ;; Return digest + digest)) + +;; It says in the RSA source, "Note that if the Mysterious Constants are +;; arranged backwards in little-endian order and decrypted with the DES +;; they produce OCCULT MESSAGES!" Security through obscurity? + +(defun md5-transform (in) + "Basic MD5 step. Transform md5-buffer based on array IN." + (let ((a (aref md5-buffer 0)) + (b (aref md5-buffer 1)) + (c (aref md5-buffer 2)) + (d (aref md5-buffer 3))) + (setq + a (md5-FF a b c d (aref in 0) 7 '(55146 . 42104)) + d (md5-FF d a b c (aref in 1) 12 '(59591 . 46934)) + c (md5-FF c d a b (aref in 2) 17 '( 9248 . 28891)) + b (md5-FF b c d a (aref in 3) 22 '(49597 . 52974)) + a (md5-FF a b c d (aref in 4) 7 '(62844 . 4015)) + d (md5-FF d a b c (aref in 5) 12 '(18311 . 50730)) + c (md5-FF c d a b (aref in 6) 17 '(43056 . 17939)) + b (md5-FF b c d a (aref in 7) 22 '(64838 . 38145)) + a (md5-FF a b c d (aref in 8) 7 '(27008 . 39128)) + d (md5-FF d a b c (aref in 9) 12 '(35652 . 63407)) + c (md5-FF c d a b (aref in 10) 17 '(65535 . 23473)) + b (md5-FF b c d a (aref in 11) 22 '(35164 . 55230)) + a (md5-FF a b c d (aref in 12) 7 '(27536 . 4386)) + d (md5-FF d a b c (aref in 13) 12 '(64920 . 29075)) + c (md5-FF c d a b (aref in 14) 17 '(42617 . 17294)) + b (md5-FF b c d a (aref in 15) 22 '(18868 . 2081)) + a (md5-GG a b c d (aref in 1) 5 '(63006 . 9570)) + d (md5-GG d a b c (aref in 6) 9 '(49216 . 45888)) + c (md5-GG c d a b (aref in 11) 14 '( 9822 . 23121)) + b (md5-GG b c d a (aref in 0) 20 '(59830 . 51114)) + a (md5-GG a b c d (aref in 5) 5 '(54831 . 4189)) + d (md5-GG d a b c (aref in 10) 9 '( 580 . 5203)) + c (md5-GG c d a b (aref in 15) 14 '(55457 . 59009)) + b (md5-GG b c d a (aref in 4) 20 '(59347 . 64456)) + a (md5-GG a b c d (aref in 9) 5 '( 8673 . 52710)) + d (md5-GG d a b c (aref in 14) 9 '(49975 . 2006)) + c (md5-GG c d a b (aref in 3) 14 '(62677 . 3463)) + b (md5-GG b c d a (aref in 8) 20 '(17754 . 5357)) + a (md5-GG a b c d (aref in 13) 5 '(43491 . 59653)) + d (md5-GG d a b c (aref in 2) 9 '(64751 . 41976)) + c (md5-GG c d a b (aref in 7) 14 '(26479 . 729)) + b (md5-GG b c d a (aref in 12) 20 '(36138 . 19594)) + a (md5-HH a b c d (aref in 5) 4 '(65530 . 14658)) + d (md5-HH d a b c (aref in 8) 11 '(34673 . 63105)) + c (md5-HH c d a b (aref in 11) 16 '(28061 . 24866)) + b (md5-HH b c d a (aref in 14) 23 '(64997 . 14348)) + a (md5-HH a b c d (aref in 1) 4 '(42174 . 59972)) + d (md5-HH d a b c (aref in 4) 11 '(19422 . 53161)) + c (md5-HH c d a b (aref in 7) 16 '(63163 . 19296)) + b (md5-HH b c d a (aref in 10) 23 '(48831 . 48240)) + a (md5-HH a b c d (aref in 13) 4 '(10395 . 32454)) + d (md5-HH d a b c (aref in 0) 11 '(60065 . 10234)) + c (md5-HH c d a b (aref in 3) 16 '(54511 . 12421)) + b (md5-HH b c d a (aref in 6) 23 '( 1160 . 7429)) + a (md5-HH a b c d (aref in 9) 4 '(55764 . 53305)) + d (md5-HH d a b c (aref in 12) 11 '(59099 . 39397)) + c (md5-HH c d a b (aref in 15) 16 '( 8098 . 31992)) + b (md5-HH b c d a (aref in 2) 23 '(50348 . 22117)) + a (md5-II a b c d (aref in 0) 6 '(62505 . 8772)) + d (md5-II d a b c (aref in 7) 10 '(17194 . 65431)) + c (md5-II c d a b (aref in 14) 15 '(43924 . 9127)) + b (md5-II b c d a (aref in 5) 21 '(64659 . 41017)) + a (md5-II a b c d (aref in 12) 6 '(25947 . 22979)) + d (md5-II d a b c (aref in 3) 10 '(36620 . 52370)) + c (md5-II c d a b (aref in 10) 15 '(65519 . 62589)) + b (md5-II b c d a (aref in 1) 21 '(34180 . 24017)) + a (md5-II a b c d (aref in 8) 6 '(28584 . 32335)) + d (md5-II d a b c (aref in 15) 10 '(65068 . 59104)) + c (md5-II c d a b (aref in 6) 15 '(41729 . 17172)) + b (md5-II b c d a (aref in 13) 21 '(19976 . 4513)) + a (md5-II a b c d (aref in 4) 6 '(63315 . 32386)) + d (md5-II d a b c (aref in 11) 10 '(48442 . 62005)) + c (md5-II c d a b (aref in 2) 15 '(10967 . 53947)) + b (md5-II b c d a (aref in 9) 21 '(60294 . 54161))) + + (aset md5-buffer 0 (md5-add (aref md5-buffer 0) a)) + (aset md5-buffer 1 (md5-add (aref md5-buffer 1) b)) + (aset md5-buffer 2 (md5-add (aref md5-buffer 2) c)) + (aset md5-buffer 3 (md5-add (aref md5-buffer 3) d)))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Here begins the merger with the XEmacs API and the md5.el from the URL +;;; package. Courtesy wmperry@cs.indiana.edu +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defun md5 (object &optional start end) + "Return the MD5 (a secure message digest algorithm) of an object. +OBJECT is either a string or a buffer. +Optional arguments START and END denote buffer positions for computing the +hash of a portion of OBJECT." + (let ((buffer nil)) + (unwind-protect + (save-excursion + (setq buffer (generate-new-buffer " *md5-work*")) + (set-buffer buffer) + (cond + ((bufferp object) + (insert-buffer-substring object start end)) + ((stringp object) + (insert (if (or start end) + (substring object start end) + object))) + (t nil)) + (prog1 + (if (or (null md5-maximum-internal-length) + (<= (point-max) md5-maximum-internal-length)) + (mapconcat + (function (lambda (node) (format "%02x" node))) + (md5-encode (buffer-string)) + "") + (call-process-region (point-min) (point-max) + shell-file-name + t buffer nil + shell-command-switch md5-program) + ;; MD5 digest is 32 chars long + ;; mddriver adds a newline to make neaten output for tty + ;; viewing, make sure we leave it behind. + (buffer-substring (point-min) (+ (point-min) 32))) + (kill-buffer buffer))) + (and buffer (buffer-name buffer) (kill-buffer buffer) nil)))) + +(provide 'md5-el) diff --git a/flim-1.14.9/md5.el b/flim-1.14.9/md5.el new file mode 100644 index 0000000..cde5f85 --- /dev/null +++ b/flim-1.14.9/md5.el @@ -0,0 +1,79 @@ +;;; md5.el --- MD5 Message Digest Algorithm. + +;; Copyright (C) 1999, 2001 Free Software Foundation, Inc. + +;; Author: Shuhei KOBAYASHI +;; Keywords: MD5, RFC 1321 + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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: + +;; Test cases from RFC 1321. +;; +;; (md5 "") +;; => d41d8cd98f00b204e9800998ecf8427e +;; +;; (md5 "a") +;; => 0cc175b9c0f1b6a831c399e269772661 +;; +;; (md5 "abc") +;; => 900150983cd24fb0d6963f7d28e17f72 +;; +;; (md5 "message digest") +;; => f96b697d7cb7938d525a2f31aaf161d0 +;; +;; (md5 "abcdefghijklmnopqrstuvwxyz") +;; => c3fcd3d76192e4007dfb496cca67e13b +;; +;; (md5 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") +;; => d174ab98d277d9f5a5611c2c9f419d9f +;; +;; (md5 "12345678901234567890123456789012345678901234567890123456789012345678901234567890") +;; => 57edf4a22be3c955ac49da2e2107b67a + +;;; 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))) + +(provide 'md5) + +;;; md5.el ends here diff --git a/flim-1.14.9/mel-b-ccl.el b/flim-1.14.9/mel-b-ccl.el new file mode 100644 index 0000000..69e178b --- /dev/null +++ b/flim-1.14.9/mel-b-ccl.el @@ -0,0 +1,481 @@ +;;; mel-b-ccl.el --- Base64 encoder/decoder using CCL. + +;; Copyright (C) 1998,1999,2000 Free Software Foundation, Inc. + +;; Author: Tanaka Akira +;; Created: 1998/9/17 +;; Keywords: MIME, Base64 + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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. + +;;; Code: + +(require 'ccl) +(require 'pccl) +(require 'mime-def) + + +;;; @ constants +;;; + +(eval-when-compile + +(defconst mel-ccl-4-table + '( 0 1 2 3)) + +(defconst mel-ccl-16-table + '( 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)) + +(defconst mel-ccl-64-table + '( 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 + 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 + 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63)) + +(defconst mel-ccl-256-table + '( 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 + 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 + 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 + 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 + 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 + 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 + 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 + 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 + 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 + 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 + 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 + 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 + 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 + 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 + 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255)) + +(defconst mel-ccl-256-to-64-table + '(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 62 nil nil nil 63 + 52 53 54 55 56 57 58 59 60 61 nil nil nil t nil nil + nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + 15 16 17 18 19 20 21 22 23 24 25 nil nil nil nil nil + nil 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 + 41 42 43 44 45 46 47 48 49 50 51 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 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 nil nil nil + nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) + +(defconst mel-ccl-64-to-256-table + (mapcar + 'char-int + "ABCDEFGHIJKLMNOPQRSTUVWXYZ\ +abcdefghijklmnopqrstuvwxyz\ +0123456789\ ++/")) + +) + + +;;; @ CCL programs +;;; + +(eval-when-compile + +(defun mel-ccl-decode-b-bit-ex (v) + (logior + (lsh (logand v (lsh 255 16)) -16) + (logand v (lsh 255 8)) + (lsh (logand v 255) 16))) + +) + +(eval-when-compile + +(defconst mel-ccl-decode-b-0-table + (vconcat + (mapcar + (lambda (v) + (if (integerp v) + (mel-ccl-decode-b-bit-ex (lsh v 18)) + (lsh 1 24))) + mel-ccl-256-to-64-table))) + +(defconst mel-ccl-decode-b-1-table + (vconcat + (mapcar + (lambda (v) + (if (integerp v) + (mel-ccl-decode-b-bit-ex (lsh v 12)) + (lsh 1 25))) + mel-ccl-256-to-64-table))) + +(defconst mel-ccl-decode-b-2-table + (vconcat + (mapcar + (lambda (v) + (if (integerp v) + (mel-ccl-decode-b-bit-ex (lsh v 6)) + (lsh 1 26))) + mel-ccl-256-to-64-table))) + +(defconst mel-ccl-decode-b-3-table + (vconcat + (mapcar + (lambda (v) + (if (integerp v) + (mel-ccl-decode-b-bit-ex v) + (lsh 1 27))) + mel-ccl-256-to-64-table))) + +) + +(check-broken-facility ccl-cascading-read) + +(if-broken ccl-cascading-read + (define-ccl-program mel-ccl-decode-b + `(1 + (loop + (loop + (read-branch + r1 + ,@(mapcar + (lambda (v) + (cond + ((or (eq v nil) (eq v t)) '(repeat)) + (t `((r0 = ,(lsh v 2)) (break))))) + mel-ccl-256-to-64-table))) + (loop + (read-branch + r1 + ,@(mapcar + (lambda (v) + (cond + ((or (eq v nil) (eq v t)) '(repeat)) + ((= (lsh v -4) 0) `((write r0) (r0 = ,(lsh (logand v 15) 4)) (break))) + (t `((r0 |= ,(lsh v -4)) (write r0) (r0 = ,(lsh (logand v 15) 4)) (break))))) + mel-ccl-256-to-64-table))) + (loop + (read-branch + r1 + ,@(mapcar + (lambda (v) + (cond + ((eq v nil) '(repeat)) + ((eq v t) '(end)) + ((= (lsh v -2) 0) `((write r0) (r0 = ,(lsh (logand v 3) 6)) (break))) + (t `((r0 |= ,(lsh v -2)) (write r0) (r0 = ,(lsh (logand v 3) 6)) (break))))) + mel-ccl-256-to-64-table))) + (loop + (read-branch + r1 + ,@(mapcar + (lambda (v) + (cond + ((eq v nil) '(repeat)) + ((eq v t) '(end)) + (t `((r0 |= ,v) (write r0) (break))))) + mel-ccl-256-to-64-table))) + (repeat)))) + (define-ccl-program mel-ccl-decode-b + `(1 + (loop + (read r0 r1 r2 r3) + (r4 = r0 ,mel-ccl-decode-b-0-table) + (r5 = r1 ,mel-ccl-decode-b-1-table) + (r4 |= r5) + (r5 = r2 ,mel-ccl-decode-b-2-table) + (r4 |= r5) + (r5 = r3 ,mel-ccl-decode-b-3-table) + (r4 |= r5) + (if (r4 & ,(lognot (1- (lsh 1 24)))) + ((loop + (if (r4 & ,(lsh 1 24)) + ((r0 = r1) (r1 = r2) (r2 = r3) (read r3) + (r4 >>= 1) (r4 &= ,(logior (lsh 7 24))) + (r5 = r3 ,mel-ccl-decode-b-3-table) + (r4 |= r5) + (repeat)) + (break))) + (loop + (if (r4 & ,(lsh 1 25)) + ((r1 = r2) (r2 = r3) (read r3) + (r4 >>= 1) (r4 &= ,(logior (lsh 7 24))) + (r5 = r3 ,mel-ccl-decode-b-3-table) + (r4 |= r5) + (repeat)) + (break))) + (loop + (if (r2 != ?=) + (if (r4 & ,(lsh 1 26)) + ((r2 = r3) (read r3) + (r4 >>= 1) (r4 &= ,(logior (lsh 7 24))) + (r5 = r3 ,mel-ccl-decode-b-3-table) + (r4 |= r5) + (repeat)) + ((r6 = 0) + (break))) + ((r6 = 1) + (break)))) + (loop + (if (r3 != ?=) + (if (r4 & ,(lsh 1 27)) + ((read r3) + (r4 = r3 ,mel-ccl-decode-b-3-table) + (repeat)) + (break)) + ((r6 |= 2) + (break)))) + (r4 = r0 ,mel-ccl-decode-b-0-table) + (r5 = r1 ,mel-ccl-decode-b-1-table) + (r4 |= r5) + (branch + r6 + ;; BBBB + ((r5 = r2 ,mel-ccl-decode-b-2-table) + (r4 |= r5) + (r5 = r3 ,mel-ccl-decode-b-3-table) + (r4 |= r5) + (r4 >8= 0) + (write r7) + (r4 >8= 0) + (write r7) + (write-repeat r4)) + ;; error: BB=B + ((write (r4 & 255)) + (end)) + ;; BBB= + ((r5 = r2 ,mel-ccl-decode-b-2-table) + (r4 |= r5) + (r4 >8= 0) + (write r7) + (write (r4 & 255)) + (end) ; Excessive (end) is workaround for XEmacs 21.0. + ; Without this, "AAA=" is converted to "^@^@^@". + (end)) + ;; BB== + ((write (r4 & 255)) + (end)))) + ((r4 >8= 0) + (write r7) + (r4 >8= 0) + (write r7) + (write-repeat r4)))))) + ) + +(eval-when-compile + +;; Generated CCL program works not properly on 20.2 because CCL_EOF_BLOCK +;; is not executed. +(defun mel-ccl-encode-base64-generic + (&optional quantums-per-line output-crlf terminate-with-newline) + `(2 + ((r3 = 0) + (r2 = 0) + (read r1) + (loop + (branch + r1 + ,@(mapcar + (lambda (r1) + `((write ,(nth (lsh r1 -2) mel-ccl-64-to-256-table)) + (r0 = ,(logand r1 3)))) + mel-ccl-256-table)) + (r2 = 1) + (read-branch + r1 + ,@(mapcar + (lambda (r1) + `((write r0 ,(vconcat + (mapcar + (lambda (r0) + (nth (logior (lsh r0 4) + (lsh r1 -4)) + mel-ccl-64-to-256-table)) + mel-ccl-4-table))) + (r0 = ,(logand r1 15)))) + mel-ccl-256-table)) + (r2 = 2) + (read-branch + r1 + ,@(mapcar + (lambda (r1) + `((write r0 ,(vconcat + (mapcar + (lambda (r0) + (nth (logior (lsh r0 2) + (lsh r1 -6)) + mel-ccl-64-to-256-table)) + mel-ccl-16-table))))) + mel-ccl-256-table)) + (r1 &= 63) + (write r1 ,(vconcat + (mapcar + (lambda (r1) + (nth r1 mel-ccl-64-to-256-table)) + mel-ccl-64-table))) + (r3 += 1) + (r2 = 0) + (read r1) + ,@(when quantums-per-line + `((if (r3 == ,quantums-per-line) + ((write ,(if output-crlf "\r\n" "\n")) + (r3 = 0))))) + (repeat))) + (branch + r2 + ,(if terminate-with-newline + `(if (r3 > 0) (write ,(if output-crlf "\r\n" "\n"))) + `(r0 = 0)) + ((write r0 ,(vconcat + (mapcar + (lambda (r0) + (nth (lsh r0 4) mel-ccl-64-to-256-table)) + mel-ccl-4-table))) + (write ,(if terminate-with-newline + (if output-crlf "==\r\n" "==\n") + "=="))) + ((write r0 ,(vconcat + (mapcar + (lambda (r0) + (nth (lsh r0 2) mel-ccl-64-to-256-table)) + mel-ccl-16-table))) + (write ,(if terminate-with-newline + (if output-crlf "=\r\n" "=\n") + "=")))) + )) +) + +(define-ccl-program mel-ccl-encode-b + (mel-ccl-encode-base64-generic)) + +;; 19 * 4 = 76 +(define-ccl-program mel-ccl-encode-base64-crlf-crlf + (mel-ccl-encode-base64-generic 19 t)) + +(define-ccl-program mel-ccl-encode-base64-crlf-lf + (mel-ccl-encode-base64-generic 19 nil)) + + +;;; @ coding system +;;; + +(make-ccl-coding-system + 'mel-ccl-b-rev ?B "MIME B-encoding (reversed)" + 'mel-ccl-encode-b 'mel-ccl-decode-b) + +(make-ccl-coding-system + 'mel-ccl-base64-crlf-rev + ?B "MIME Base64-encoding (reversed)" + 'mel-ccl-encode-base64-crlf-crlf + 'mel-ccl-decode-b) + +(make-ccl-coding-system + 'mel-ccl-base64-lf-rev + ?B "MIME Base64-encoding (LF encoding) (reversed)" + 'mel-ccl-encode-base64-crlf-lf + 'mel-ccl-decode-b) + + +;;; @ B +;;; + +(check-broken-facility ccl-execute-eof-block-on-decoding-some) + +(unless-broken ccl-execute-eof-block-on-decoding-some + + (defun base64-ccl-encode-string (string &optional no-line-break) + "Encode STRING with base64 encoding." + (if no-line-break + (decode-coding-string string 'mel-ccl-b-rev) + (decode-coding-string string 'mel-ccl-base64-lf-rev))) + (defalias-maybe 'base64-encode-string 'base64-ccl-encode-string) + + (defun base64-ccl-encode-region (start end &optional no-line-break) + "Encode region from START to END with base64 encoding." + (interactive "*r") + (if no-line-break + (decode-coding-region start end 'mel-ccl-b-rev) + (decode-coding-region start end 'mel-ccl-base64-lf-rev))) + (defalias-maybe 'base64-encode-region 'base64-ccl-encode-region) + + (defun base64-ccl-insert-encoded-file (filename) + "Encode contents of file FILENAME to base64, and insert the result." + (interactive "*fInsert encoded file: ") + (insert + (decode-coding-string + (with-temp-buffer + (set-buffer-multibyte nil) + (insert-file-contents-as-binary filename) + (buffer-string)) + 'mel-ccl-base64-lf-rev))) + + (mel-define-method-function (mime-encode-string string (nil "base64")) + 'base64-ccl-encode-string) + (mel-define-method-function (mime-encode-region start end (nil "base64")) + 'base64-ccl-encode-region) + (mel-define-method-function + (mime-insert-encoded-file filename (nil "base64")) + 'base64-ccl-insert-encoded-file) + + (mel-define-method-function (encoded-text-encode-string string (nil "B")) + 'base64-ccl-encode-string) + ) + +(defun base64-ccl-decode-string (string) + "Decode base64 encoded STRING" + (encode-coding-string string 'mel-ccl-b-rev)) +(defalias-maybe 'base64-decode-string 'base64-ccl-decode-string) + +(defun base64-ccl-decode-region (start end) + "Decode base64 encoded the region from START to END." + (interactive "*r") + (encode-coding-region start end 'mel-ccl-b-rev)) +(defalias-maybe 'base64-decode-region 'base64-ccl-decode-region) + +(defun base64-ccl-write-decoded-region (start end filename) + "Decode the region from START to END and write out to FILENAME." + (interactive "*r\nFWrite decoded region to file: ") + (let ((coding-system-for-write 'mel-ccl-b-rev) + jka-compr-compression-info-list jam-zcat-filename-list) + (write-region start end filename))) + +(mel-define-method-function (mime-decode-string string (nil "base64")) + 'base64-ccl-decode-string) +(mel-define-method-function (mime-decode-region start end (nil "base64")) + 'base64-ccl-decode-region) +(mel-define-method-function + (mime-write-decoded-region start end filename (nil "base64")) + 'base64-ccl-write-decoded-region) + +(mel-define-method encoded-text-decode-string (string (nil "B")) + (if (string-match (eval-when-compile + (concat "\\`" B-encoded-text-regexp "\\'")) + string) + (base64-ccl-decode-string string) + (error "Invalid encoded-text %s" string))) + + +;;; @ end +;;; + +(provide 'mel-b-ccl) + +;;; mel-b-ccl.el ends here. diff --git a/flim-1.14.9/mel-b-dl.el b/flim-1.14.9/mel-b-dl.el new file mode 100644 index 0000000..76758c0 --- /dev/null +++ b/flim-1.14.9/mel-b-dl.el @@ -0,0 +1,114 @@ +;;; mel-b-dl.el --- Base64 encoder/decoder using DL module. + +;; Copyright (C) 1998,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: MIME, Base64 + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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. + +;;; Code: + +(require 'mime-def) + +(defvar base64-dl-handle + (and (stringp base64-dl-module) + (file-exists-p base64-dl-module) + (dynamic-link base64-dl-module))) + +(dynamic-call "emacs_base64_init" base64-dl-handle) + +;; base64-dl-module provides `encode-base64-string' and `decode-base64-string'. +(defalias 'base64-encode-string 'encode-base64-string) +(defalias 'base64-decode-string 'decode-base64-string) + +(defun base64-encode-region (start end) + "Encode current region by base64. +START and END are buffer positions." + (interactive "*r") + (insert + (prog1 + (base64-encode-string + (buffer-substring start end)) + (delete-region start end))) + (or (bolp) (insert ?\n))) + +(defun base64-decode-region (start end) + "Decode current region by base64. +START and END are buffer positions." + (interactive "*r") + (insert + (prog1 + (base64-decode-string + (buffer-substring start end)) + (delete-region start end)))) + + +(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-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))) + + +;;; @ base64 encoder/decoder for file +;;; + +(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) + (insert-file-contents-as-binary filename) + (buffer-string)))) + (or (bolp) (insert ?\n))) + +;; (mel-define-method mime-write-decoded-region (start end filename +;; (nil "base64")) +;; "Decode and write current region encoded by base64 into FILENAME. +;; START and END are buffer positions." +;; (interactive "*r\nFWrite decoded region to file: ") +;; (let ((str (buffer-substring start end))) +;; (with-temp-buffer +;; (insert (base64-decode-string str)) +;; (write-region-as-binary (point-min)(point-max) filename)))) + + +;;; @ end +;;; + +(provide 'mel-b-dl) + +;;; mel-b-dl.el ends here. diff --git a/flim-1.14.9/mel-b-el.el b/flim-1.14.9/mel-b-el.el new file mode 100644 index 0000000..a16b412 --- /dev/null +++ b/flim-1.14.9/mel-b-el.el @@ -0,0 +1,403 @@ +;;; mel-b-el.el --- Base64 encoder/decoder. + +;; Copyright (C) 1992,95,96,97,98,99,2001 Free Software Foundation, Inc. + +;; Author: ENAMI Tsugutomo +;; MORIOKA Tomohiko +;; Created: 1995/6/24 +;; Keywords: MIME, Base64 + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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. + +;;; Code: + +(require 'mime-def) +(eval-when-compile + ;; XXX: the macro `as-binary-process' should be provided when compiling. + (require 'pces)) + + +;;; @ variables +;;; + +(defgroup base64 nil + "Base64 encoder/decoder" + :group 'mime) + +(defcustom base64-external-encoder '("mmencode") + "*list of base64 encoder program name and its arguments." + :group 'base64 + :type '(cons (file :tag "Command")(repeat :tag "Arguments" string))) + +(defcustom base64-external-decoder '("mmencode" "-u") + "*list of base64 decoder program name and its arguments." + :group 'base64 + :type '(cons (file :tag "Command")(repeat :tag "Arguments" string))) + +(defcustom base64-external-decoder-option-to-specify-file '("-o") + "*list of options of base64 decoder program to specify file. +If the base64 decoder program does not have such option, set this as nil." + :group 'base64 + :type '(repeat :tag "Arguments" string)) + +(defcustom base64-internal-encoding-limit 1000 + "*limit size to use internal base64 encoder. +If size of input to encode is larger than this limit, +external encoder is called." + :group 'base64 + :type '(choice (const :tag "Always use internal encoder" nil) + (integer :tag "Size"))) + +(defcustom base64-internal-decoding-limit (if (and (featurep 'xemacs) + (featurep 'mule)) + 1000 + 7600) + "*limit size to use internal base64 decoder. +If size of input to decode is larger than this limit, +external decoder is called." + :group 'base64 + :type '(choice (const :tag "Always use internal decoder" nil) + (integer :tag "Size"))) + + +;;; @ utility function +;;; + +(defun pack-sequence (seq size) + "Split sequence SEQ into SIZE elements packs, and return list of packs. +\[mel-b-el; tl-seq function]" + (let ((len (length seq)) + (p 0) + dest unit) + (while (< p len) + (setq unit (cons (elt seq p) unit)) + (setq p (1+ p)) + (when (zerop (mod p size)) + (setq dest (cons (nreverse unit) dest)) + (setq unit nil))) + (if unit + (nreverse (cons (nreverse unit) dest)) + (nreverse dest)))) + + +;;; @ internal base64 encoder +;;; based on base64 decoder by Enami Tsugutomo + +(eval-and-compile + (defconst base64-characters + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/") + ) + +(defmacro base64-num-to-char (n) + `(aref base64-characters ,n)) + +(defun base64-encode-1 (pack) + (let ((buf (make-string 4 ?=))) + (aset buf 0 (base64-num-to-char (ash (car pack) -2))) + (if (nth 1 pack) + (progn + (aset buf 1 (base64-num-to-char + (logior (ash (logand (car pack) 3) 4) + (ash (nth 1 pack) -4)))) + (if (nth 2 pack) + (progn + (aset buf 2 (base64-num-to-char + (logior (ash (logand (nth 1 pack) 15) 2) + (ash (nth 2 pack) -6)))) + (aset buf 3 (base64-num-to-char + (logand (nth 2 pack) 63)))) + (aset buf 2 (base64-num-to-char + (ash (logand (nth 1 pack) 15) 2))))) + (aset buf 1 (base64-num-to-char + (ash (logand (car pack) 3) 4)))) + buf)) + +(defun-maybe base64-encode-string (string &optional no-line-break) + "Base64-encode STRING and return the result. +Optional second argument NO-LINE-BREAK means do not break long lines +into shorter lines." + (let* ((len (length string)) + (b 0)(e 57) + (dest "")) + (while (< e len) + (setq dest + (concat dest + (mapconcat + (function base64-encode-1) + (pack-sequence (substring string b e) 3) + "") + (if (not no-line-break) "\n"))) + (setq b e + e (+ e 57))) + (concat dest + (mapconcat + (function base64-encode-1) + (pack-sequence (substring string b) 3) + "")))) + +(defun base64-internal-encode-region (beg end &optional no-line-break) + (save-excursion + (save-restriction + (narrow-to-region beg end) + (insert + (prog1 + (base64-encode-string (buffer-substring beg end) no-line-break) + (delete-region beg end)))))) + + +;;; @ internal base64 decoder +;;; + +(defconst base64-numbers + (eval-when-compile + (let ((len (length base64-characters)) + (vec (make-vector 123 nil)) + (i 0)) + (while (< i len) + (aset vec (aref base64-characters i) i) + (setq i (1+ i))) + vec))) + +(defmacro base64-char-to-num (c) + `(aref base64-numbers ,c)) + +(defsubst base64-internal-decode (string buffer) + (let* ((len (length string)) + (i 0)(j 0) + v1 v2 v3) + (catch 'tag + (while (< i len) + (when (prog1 (setq v1 (base64-char-to-num (aref string i))) + (setq i (1+ i))) + (setq v2 (base64-char-to-num (aref string i)) + i (1+ i) + v3 (base64-char-to-num (aref string i)) + i (1+ i)) + (aset buffer j (logior (lsh v1 2)(lsh v2 -4))) + (setq j (1+ j)) + (if v3 + (let ((v4 (base64-char-to-num (aref string i)))) + (setq i (1+ i)) + (aset buffer j (logior (lsh (logand v2 15) 4)(lsh v3 -2))) + (setq j (1+ j)) + (if v4 + (aset buffer (prog1 j (setq j (1+ j))) + (logior (lsh (logand v3 3) 6) v4)) + (throw 'tag nil))) + (throw 'tag nil))))) + (substring buffer 0 j))) + +(defun base64-internal-decode-string (string) + (base64-internal-decode string (make-string (length string) 0))) + +;; (defsubst base64-decode-string! (string) +;; (setq string (string-as-unibyte string)) +;; (base64-internal-decode string string)) + +(defun base64-internal-decode-region (beg end) + (save-excursion + (let ((str (string-as-unibyte (buffer-substring beg end)))) + (insert + (prog1 + (base64-internal-decode str str) + (delete-region beg end)))))) + +;; (defun base64-internal-decode-region2 (beg end) +;; (save-excursion +;; (let ((str (buffer-substring beg end))) +;; (delete-region beg end) +;; (goto-char beg) +;; (insert (base64-decode-string! str))))) + +;; (defun base64-internal-decode-region3 (beg end) +;; (save-excursion +;; (let ((str (buffer-substring beg end))) +;; (delete-region beg end) +;; (goto-char beg) +;; (insert (base64-internal-decode-string str))))) + + +;;; @ external encoder/decoder +;;; + +(defun base64-external-encode-region (beg end &optional no-line-break) + (save-excursion + (save-restriction + (narrow-to-region beg end) + (as-binary-process + (apply (function call-process-region) + beg end (car base64-external-encoder) + t t nil + (cdr base64-external-encoder))) + ;; for OS/2 + ;; regularize line break code + (goto-char (point-min)) + (while (re-search-forward "\r$" nil t) + (replace-match "")) + (if no-line-break + (progn + (goto-char (point-min)) + (while (search-forward "\n" nil t) + (replace-match ""))))))) + +(defun base64-external-decode-region (beg end) + (save-excursion + (as-binary-process + (apply (function call-process-region) + beg end (car base64-external-decoder) + t t nil + (cdr base64-external-decoder))))) + +(defun base64-external-decode-string (string) + (with-temp-buffer + (insert string) + (as-binary-process + (apply (function call-process-region) + (point-min)(point-max) (car base64-external-decoder) + t t nil + (cdr base64-external-decoder))) + (buffer-string))) + + +;;; @ application interfaces +;;; + +(defun-maybe base64-encode-region (start end &optional no-line-break) + "Base64-encode the region between START and END. +Return the length of the encoded text. +Optional third argument NO-LINE-BREAK means do not break long lines +into shorter lines. +This function calls internal base64 encoder if size of region is +smaller than `base64-internal-encoding-limit', otherwise it calls +external base64 encoder specified by `base64-external-encoder'. In +this case, you must install the program (maybe mmencode included in +metamail or XEmacs package)." + (interactive "*r") + (if (and base64-internal-encoding-limit + (> (- end start) base64-internal-encoding-limit)) + (base64-external-encode-region start end no-line-break) + (base64-internal-encode-region start end no-line-break))) + +(defun-maybe base64-decode-region (start end) + "Decode current region by base64. +START and END are buffer positions. +This function calls internal base64 decoder if size of region is +smaller than `base64-internal-decoding-limit', otherwise it calls +external base64 decoder specified by `base64-external-decoder'. In +this case, you must install the program (maybe mmencode included in +metamail or XEmacs package)." + (interactive "*r") + (if (and base64-internal-decoding-limit + (> (- end start) base64-internal-decoding-limit)) + (base64-external-decode-region start end) + (base64-internal-decode-region start end))) + +(defun-maybe base64-decode-string (string) + "Decode STRING which is encoded in base64, and return the result. +This function calls internal base64 decoder if size of STRING is +smaller than `base64-internal-decoding-limit', otherwise it calls +external base64 decoder specified by `base64-external-decoder'. In +this case, you must install the program (maybe mmencode included in +metamail or XEmacs package)." + (if (and base64-internal-decoding-limit + (> (length string) base64-internal-decoding-limit)) + (base64-external-decode-string string) + (base64-internal-decode-string string))) + + +(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-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))) + +(defun base64-insert-encoded-file (filename) + "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: ") + (if (and base64-internal-encoding-limit + (> (nth 7 (file-attributes filename)) + base64-internal-encoding-limit)) + (apply (function call-process) + (car base64-external-encoder) + filename t nil + (cdr base64-external-encoder)) + (insert + (base64-encode-string + (with-temp-buffer + (set-buffer-multibyte nil) + (insert-file-contents-as-binary filename) + (buffer-string)))) + (or (bolp) (insert ?\n)))) + +(mel-define-method-function (mime-insert-encoded-file filename (nil "base64")) + 'base64-insert-encoded-file) + +(defun base64-write-decoded-region (start end filename) + "Decode and write current region encoded by base64 into FILENAME. +START and END are buffer positions." + (interactive "*r\nFWrite decoded region to file: ") + (if (and base64-internal-decoding-limit + (> (- end start) base64-internal-decoding-limit)) + (progn + (as-binary-process + (apply (function call-process-region) + start end (car base64-external-decoder) + (null base64-external-decoder-option-to-specify-file) + (unless base64-external-decoder-option-to-specify-file + (list (current-buffer) nil)) + nil + (delq nil + (append + (cdr base64-external-decoder) + base64-external-decoder-option-to-specify-file + (when base64-external-decoder-option-to-specify-file + (list filename)))))) + (unless base64-external-decoder-option-to-specify-file + (write-region-as-binary (point-min) (point-max) filename))) + (let ((str (buffer-substring start end))) + (with-temp-buffer + (insert (base64-internal-decode-string str)) + (write-region-as-binary (point-min) (point-max) filename))))) + +(mel-define-method-function + (mime-write-decoded-region start end filename (nil "base64")) + 'base64-write-decoded-region) + + +;;; @ end +;;; + +(provide 'mel-b-el) + +;;; mel-b-el.el ends here. diff --git a/flim-1.14.9/mel-g.el b/flim-1.14.9/mel-g.el new file mode 100644 index 0000000..91088e8 --- /dev/null +++ b/flim-1.14.9/mel-g.el @@ -0,0 +1,128 @@ +;;; mel-g.el --- Gzip64 encoder/decoder. + +;; Copyright (C) 1995,96,97,98,99,2001 Free Software Foundation, Inc. + +;; Author: Shuhei KOBAYASHI +;; MORIOKA Tomohiko +;; Maintainer: Shuhei KOBAYASHI +;; Created: 1995/10/25 +;; Keywords: Gzip64, base64, gzip, MIME + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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: + +;;; NOTE: Gzip64 is an experimental Content-Transfer-Encoding and its +;;; use is STRONGLY DISCOURAGED except for private communication. + +;;; Code: + +(require 'mime-def) +(require 'path-util) + + +;;; @ variables +;;; + +(defvar gzip64-external-encoder '("sh" "-c" "gzip -c | mmencode") + "*list of gzip64 encoder program name and its arguments.") + +(defvar gzip64-external-decoder '("sh" "-c" "mmencode -u | gzip -dc") + "*list of gzip64 decoder program name and its arguments.") + + +;;; @ encoder/decoder for region +;;; + +(defun gzip64-external-encode-region (beg end) + (interactive "*r") + (save-excursion + (let ((coding-system-for-write 'binary)) + (apply (function call-process-region) + beg end (car gzip64-external-encoder) + t t nil + (cdr gzip64-external-encoder))) + ;; for OS/2 + ;; regularize line break code + ;;(goto-char (point-min)) + ;;(while (re-search-forward "\r$" nil t) + ;; (replace-match "")) + )) + +(defun gzip64-external-decode-region (beg end) + (interactive "*r") + (save-excursion + (let ((coding-system-for-read 'binary)) + (apply (function call-process-region) + beg end (car gzip64-external-decoder) + t t nil + (cdr gzip64-external-decoder))))) + +(mel-define-method-function (mime-encode-region start end (nil "x-gzip64")) + 'gzip64-external-encode-region) +(mel-define-method-function (mime-decode-region start end (nil "x-gzip64")) + 'gzip64-external-decode-region) + + +;;; @ encoder/decoder for string +;;; + +(mel-define-method mime-encode-string (string (nil "x-gzip64")) + (with-temp-buffer + (insert string) + (gzip64-external-encode-region (point-min)(point-max)) + (buffer-string))) + +(mel-define-method mime-decode-string (string (nil "x-gzip64")) + (with-temp-buffer + (insert string) + (gzip64-external-decode-region (point-min)(point-max)) + (buffer-string))) + + +;;; @ encoder/decoder for file +;;; + +(mel-define-method mime-insert-encoded-file (filename (nil "x-gzip64")) + (interactive "*fInsert encoded file: ") + (apply (function call-process) + (car gzip64-external-encoder) + filename t nil + (cdr gzip64-external-encoder))) + +(mel-define-method mime-write-decoded-region (start end filename + (nil "x-gzip64")) + "Decode and write current region encoded by gzip64 into FILENAME. +START and END are buffer positions." + (interactive "*r\nFWrite decoded region to file: ") + (let ((coding-system-for-read 'binary) + (coding-system-for-write 'binary)) + (apply (function call-process-region) + start end (car gzip64-external-decoder) + nil nil nil + (let ((args (cdr gzip64-external-decoder))) + (append (butlast args) + (list (concat (car (last args)) ">" filename))))))) + + +;;; @ end +;;; + +(provide 'mel-g) + +;;; mel-g.el ends here diff --git a/flim-1.14.9/mel-q-ccl.el b/flim-1.14.9/mel-q-ccl.el new file mode 100644 index 0000000..cccacd8 --- /dev/null +++ b/flim-1.14.9/mel-q-ccl.el @@ -0,0 +1,1000 @@ +;;; mel-q-ccl.el --- Quoted-Printable encoder/decoder using CCL. + +;; Copyright (C) 1998,1999 Tanaka Akira + +;; Author: Tanaka Akira +;; Created: 1998/9/17 +;; Keywords: MIME, Quoted-Printable, Q-encoding + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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. + +;;; Code: + +(require 'ccl) +(require 'pccl) +(require 'mime-def) + + +;;; @ constants +;;; + +(eval-when-compile + +(defconst mel-ccl-16-table + '( 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)) + +(defconst mel-ccl-28-table + '( 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + 16 17 18 19 20 21 22 23 24 25 26 27)) + +(defconst mel-ccl-256-table + '( 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 + 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 + 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 + 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 + 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 + 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 + 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 + 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 + 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 + 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 + 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 + 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 + 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 + 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 + 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255)) + +(defconst mel-ccl-256-to-16-table + '(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 + 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 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 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 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)) + +(defconst mel-ccl-16-to-256-table + (mapcar 'char-int "0123456789ABCDEF")) + +(defconst mel-ccl-high-table + (vconcat + (mapcar + (lambda (v) (nth (lsh v -4) mel-ccl-16-to-256-table)) + mel-ccl-256-table))) + +(defconst mel-ccl-low-table + (vconcat + (mapcar + (lambda (v) (nth (logand v 15) mel-ccl-16-to-256-table)) + mel-ccl-256-table))) + +(defconst mel-ccl-u-raw + (mapcar + 'char-int + "0123456789\ +ABCDEFGHIJKLMNOPQRSTUVWXYZ\ +abcdefghijklmnopqrstuvwxyz\ +!@#$%&'()*+,-./:;<>@[\\]^`{|}~")) + +(defconst mel-ccl-c-raw + (mapcar + 'char-int + "0123456789\ +ABCDEFGHIJKLMNOPQRSTUVWXYZ\ +abcdefghijklmnopqrstuvwxyz\ +!@#$%&'*+,-./:;<>@[]^`{|}~")) + +(defconst mel-ccl-p-raw + (mapcar + 'char-int + "0123456789\ +ABCDEFGHIJKLMNOPQRSTUVWXYZ\ +abcdefghijklmnopqrstuvwxyz\ +!*+-/")) + +(defconst mel-ccl-qp-table + [enc enc enc enc enc enc enc enc enc wsp lf enc enc cr enc enc + enc enc enc enc enc enc enc enc enc enc enc enc enc enc enc enc + wsp raw raw raw raw raw raw raw raw raw raw raw raw raw raw raw + raw raw raw raw raw raw raw raw raw raw raw raw raw enc raw raw + raw raw raw raw raw raw raw raw raw raw raw raw raw raw raw raw + raw raw raw raw raw raw raw raw raw raw raw raw raw raw raw raw + raw raw raw raw raw raw raw raw raw raw raw raw raw raw raw raw + raw raw raw raw raw raw raw raw raw raw raw raw raw raw raw 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 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 +;;; + +;;; Q + +(define-ccl-program mel-ccl-decode-q + `(1 + ((loop + (read-branch + r0 + ,@(mapcar + (lambda (r0) + (cond + ((= r0 (char-int ?_)) + `(write-repeat ? )) + ((= r0 (char-int ?=)) + `((loop + (read-branch + r1 + ,@(mapcar + (lambda (v) + (if (integerp v) + `((r0 = ,v) (break)) + '(repeat))) + mel-ccl-256-to-16-table))) + (loop + (read-branch + r1 + ,@(mapcar + (lambda (v) + (if (integerp v) + `((write r0 ,(vconcat + (mapcar + (lambda (r0) + (logior (lsh r0 4) v)) + mel-ccl-16-table))) + (break)) + '(repeat))) + mel-ccl-256-to-16-table))) + (repeat))) + (t + `(write-repeat ,r0)))) + mel-ccl-256-table)))))) + +(eval-when-compile + +(defun mel-ccl-encode-q-generic (raw) + `(3 + (loop + (loop + (read-branch + r0 + ,@(mapcar + (lambda (r0) + (cond + ((= r0 32) `(write-repeat ?_)) + ((member r0 raw) `(write-repeat ,r0)) + (t '(break)))) + mel-ccl-256-table))) + (write ?=) + (write r0 ,mel-ccl-high-table) + (write r0 ,mel-ccl-low-table) + (repeat)))) + +;; On xemacs, generated program counts iso-8859-1 8bit character as 6bytes. +(defun mel-ccl-count-q-length (raw) + `(0 + ((r0 = 0) + (loop + (read-branch + r1 + ,@(mapcar + (lambda (r1) + (if (or (= r1 32) (member r1 raw)) + '((r0 += 1) (repeat)) + '((r0 += 3) (repeat)))) + mel-ccl-256-table)))))) + +) + +(define-ccl-program mel-ccl-encode-uq + (mel-ccl-encode-q-generic mel-ccl-u-raw)) +(define-ccl-program mel-ccl-encode-cq + (mel-ccl-encode-q-generic mel-ccl-c-raw)) +(define-ccl-program mel-ccl-encode-pq + (mel-ccl-encode-q-generic mel-ccl-p-raw)) + +(define-ccl-program mel-ccl-count-uq + (mel-ccl-count-q-length mel-ccl-u-raw)) +(define-ccl-program mel-ccl-count-cq + (mel-ccl-count-q-length mel-ccl-c-raw)) +(define-ccl-program mel-ccl-count-pq + (mel-ccl-count-q-length mel-ccl-p-raw)) + +;; Quoted-Printable + +(eval-when-compile + +(defvar eof-block-branches) +(defvar eof-block-reg) +(defun mel-ccl-set-eof-block (branch) + (let ((p (assoc branch eof-block-branches))) + (unless p + (setq p (cons branch (length eof-block-branches)) + eof-block-branches (cons p eof-block-branches))) + `(,eof-block-reg = ,(cdr p)))) + +) + +(eval-when-compile + +(defun mel-ccl-try-to-read-crlf (input-crlf reg + succ + cr-eof cr-fail + lf-eof lf-fail + crlf-eof crlf-fail) + (if input-crlf + `(,(mel-ccl-set-eof-block cr-eof) + (read-if (,reg == ?\r) + (,(mel-ccl-set-eof-block lf-eof) + (read-if (,reg == ?\n) + ,succ + ,lf-fail)) + ,cr-fail)) + `(,(mel-ccl-set-eof-block crlf-eof) + (read-if (,reg == ?\n) + ,succ + ,crlf-fail)))) + +) + +(eval-when-compile + +;; Generated CCL program works not properly on 20.2 because CCL_EOF_BLOCK +;; is not executed. +(defun mel-ccl-encode-quoted-printable-generic (input-crlf output-crlf) + (let ((hard (if output-crlf "\r\n" "\n")) + (soft (if output-crlf "=\r\n" "=\n")) + (eof-block-branches nil) + (eof-block-reg 'r4) + (after-wsp 'r5) + (column 'r6) + (type 'r3) + (current 'r0) + (type-raw 0) + (type-enc 1) + (type-wsp 2) + (type-brk 3) + ) + `(4 + ((,column = 0) + (,after-wsp = 0) + ,(mel-ccl-set-eof-block '(end)) + (read r0) + (loop ; invariant: column <= 75 + (loop + (loop + (branch + r0 + ,@(mapcar + (lambda (r0) + (let ((tmp (aref mel-ccl-qp-table r0))) + (cond + ((eq r0 (char-int ?F)) + `(if (,column == 0) + (,(mel-ccl-set-eof-block '((write "F") (end))) + (read-if (r0 == ?r) + (,(mel-ccl-set-eof-block '((write "Fr") (end))) + (read-if (r0 == ?o) + (,(mel-ccl-set-eof-block '((write "Fro") (end))) + (read-if (r0 == ?m) + (,(mel-ccl-set-eof-block '((write "From") (end))) + (read-if (r0 == ? ) + ((,column = 7) + (,after-wsp = 1) + ,(mel-ccl-set-eof-block '((write "From=20") (end))) + (read r0) + (write-repeat "=46rom ")) + ((,column = 4) + (write-repeat "From")))) + ((,column = 3) + (write-repeat "Fro")))) + ((,column = 2) + (write-repeat "Fr")))) + ((,column = 1) + (write-repeat "F")))) + ((,type = ,type-raw) (break)) ; RAW + )) + ((eq r0 (char-int ?.)) + `(if (,column == 0) + ,(mel-ccl-try-to-read-crlf + input-crlf 'r0 + ;; "." CR LF (input-crlf: t) + ;; "." LF (input-crlf: nil) + `((write ,(concat "=2E" hard)) + ,(mel-ccl-set-eof-block '(end)) + (read r0) + (repeat)) + ;; "." + '((write ".") (end)) + ;; "." noCR (input-crlf: t) + `((,column = 1) + (write-repeat ".")) + ;; "." CR (input-crlf: t) + '((write ".=0D") (end)) + ;; "." CR noLF (input-crlf: t) + `((,column = 4) + (write-repeat ".=0D")) + ;; "." (input-crlf: nil) + '((write ".") (end)) + ;; "." noLF (input-crlf: nil) + `((,column = 1) + (write-repeat "."))) + ((,type = ,type-raw) (break)) ; RAW + )) + ((eq tmp 'raw) `((,type = ,type-raw) (break))) + ((eq tmp 'enc) `((,type = ,type-enc) (break))) + ((eq tmp 'wsp) `((,type = ,type-wsp) (break))) + ((eq tmp 'cr) `((,type = ,(if input-crlf type-brk type-enc)) + (break))) + ((eq tmp 'lf) `((,type = ,(if input-crlf type-enc type-brk)) + (break))) + ))) + mel-ccl-256-table))) + ;; r0:type{raw,enc,wsp,brk} + (branch + ,type + ;; r0:type-raw + (if (,column < 75) + ((,column += 1) + (,after-wsp = 0) + ,(mel-ccl-set-eof-block '(end)) + (write-read-repeat r0)) + ((r1 = (r0 + 0)) + (,after-wsp = 0) + ,@(mel-ccl-try-to-read-crlf + input-crlf 'r0 + `((,column = 0) + (write r1) + ,(mel-ccl-set-eof-block `((write ,hard) (end))) + (read r0) + (write-repeat ,hard)) + '((write r1) (end)) + `((,column = 1) + (write ,soft) (write-repeat r1)) + `((write ,soft) (write r1) (write "=0D") (end)) + `((,column = 4) + (write ,soft) (write r1) (write-repeat "=0D")) + '((write r1) (end)) + `((,column = 1) + (write ,soft) (write-repeat r1))))) + ;; r0:type-enc + ((,after-wsp = 0) + (if (,column < 73) + ((,column += 3) + (write "=") + (write r0 ,mel-ccl-high-table) + ,(mel-ccl-set-eof-block '(end)) + (write-read-repeat r0 ,mel-ccl-low-table)) + (if (,column < 74) + ((r1 = (r0 + 0)) + (,after-wsp = 0) + ,@(mel-ccl-try-to-read-crlf + input-crlf 'r0 + `((,column = 0) + (write "=") + (write r1 ,mel-ccl-high-table) + (write r1 ,mel-ccl-low-table) + (write ,hard) + ,(mel-ccl-set-eof-block '(end)) + (read r0) + (repeat)) + `((write "=") + (write r1 ,mel-ccl-high-table) + (write r1 ,mel-ccl-low-table) + (end)) + `((,column = 3) + (write ,(concat soft "=")) + (write r1 ,mel-ccl-high-table) + (write r1 ,mel-ccl-low-table) + (repeat)) + `((write ,(concat soft "=")) + (write r1 ,mel-ccl-high-table) + (write r1 ,mel-ccl-low-table) + (write "=0D") + (end)) + `((,column = 6) + (write ,(concat soft "=")) + (write r1 ,mel-ccl-high-table) + (write r1 ,mel-ccl-low-table) + (write-repeat "=0D")) + `((write "=") + (write r1 ,mel-ccl-high-table) + (write r1 ,mel-ccl-low-table) + (end)) + `((,column = 3) + (write ,(concat soft "=")) + (write r1 ,mel-ccl-high-table) + (write r1 ,mel-ccl-low-table) + (repeat)))) + ((,column = 3) + (write ,(concat soft "=")) + (write r0 ,mel-ccl-high-table) + ,(mel-ccl-set-eof-block '(end)) + (write-read-repeat r0 ,mel-ccl-low-table))))) + ;; r0:type-wsp + (if (,column < 73) + ((r1 = (r0 + 0)) + ,@(mel-ccl-try-to-read-crlf + input-crlf 'r0 + `((,column = 0) + (,after-wsp = 0) + (write "=") + (write r1 ,mel-ccl-high-table) + (write r1 ,mel-ccl-low-table) + (write ,hard) + ,(mel-ccl-set-eof-block `(end)) + (read r0) + (repeat)) + `((write "=") + (write r1 ,mel-ccl-high-table) + (write r1 ,mel-ccl-low-table) + (end)) + `((,column += 1) + (,after-wsp = 1) + (write-repeat r1)) + `((write r1) + (write "=0D") + (end)) + `((,column += 4) + (,after-wsp = 0) + (write r1) + (write-repeat "=0D")) + `((write "=") + (write r1 ,mel-ccl-high-table) + (write r1 ,mel-ccl-low-table) + (end)) + `((,column += 1) + (,after-wsp = 1) + (write-repeat r1)))) + (if (,column < 74) + ((r1 = (r0 + 0)) + ,@(mel-ccl-try-to-read-crlf + input-crlf 'r0 + `((,column = 0) + (,after-wsp = 0) + (write "=") + (write r1 ,mel-ccl-high-table) + (write r1 ,mel-ccl-low-table) + (write ,hard) + ,(mel-ccl-set-eof-block `(end)) + (read r0) + (repeat)) + `((write "=") + (write r1 ,mel-ccl-high-table) + (write r1 ,mel-ccl-low-table) + (end)) + `((,column += 1) + (,after-wsp = 1) + (write-repeat r1)) + `((write r1) + (write ,(concat soft "=0D")) + (end)) + `((,column = 3) + (,after-wsp = 0) + (write r1) + (write-repeat ,(concat soft "=0D"))) + `((write "=") + (write r1 ,mel-ccl-high-table) + (write r1 ,mel-ccl-low-table) + (end)) + `((,column += 1) + (,after-wsp = 1) + (write-repeat r1)))) + (if (,column < 75) + ((,column += 1) + (,after-wsp = 1) + ,(mel-ccl-set-eof-block `((write ,soft) (end))) + (write-read-repeat r0)) + ((write ,soft) + (,column = 0) + (,after-wsp = 0) + (repeat))))) + ;; r0:type-brk + ,(if input-crlf + ;; r0{CR}:type-brk + `((if ((,column > 73) & ,after-wsp) + ((,column = 0) + (,after-wsp = 0) + (write ,soft))) + ,(mel-ccl-set-eof-block `((if (,column > 73) (write ,soft)) + (write "=0D") (end))) + (read-if (r0 == ?\n) + (if ,after-wsp + ((,after-wsp = 0) + (,column = 0) + (write ,(concat soft hard)) + ,(mel-ccl-set-eof-block '(end)) + (read r0) + (repeat)) + ((,after-wsp = 0) + (,column = 0) + (write ,hard) + ,(mel-ccl-set-eof-block '(end)) + (read r0) + (repeat))) + (if (,column < 73) + ((,after-wsp = 0) + (,column += 3) + (write-repeat "=0D")) + (if (,column < 74) + (if (r0 == ?\r) + ((,after-wsp = 0) + ,(mel-ccl-set-eof-block + `((write ,(concat soft "=0D=0D")) (end))) + (read-if (r0 == ?\n) + ((,column = 0) + ,(mel-ccl-set-eof-block + `((write ,(concat "=0D" hard)) (end))) + (read r0) + (write-repeat ,(concat "=0D" hard))) + ((,column = 6) + (write-repeat ,(concat soft "=0D=0D"))))) + ((,after-wsp = 0) + (,column = 3) + (write-repeat ,(concat soft "=0D")))) + ((,after-wsp = 0) + (,column = 3) + (write-repeat ,(concat soft "=0D"))))))) + ;; r0{LF}:type-brk + `(if ,after-wsp + ;; WSP ; r0{LF}:type-brk + ((,after-wsp = 0) + (,column = 0) + (write ,(concat soft (if output-crlf "\r" ""))) + ,(mel-ccl-set-eof-block `(end)) + (write-read-repeat r0)) + ;; noWSP ; r0{LF}:type-brk + ((,after-wsp = 0) + (,column = 0) + ,@(if output-crlf '((write ?\r)) '()) + ,(mel-ccl-set-eof-block `(end)) + (write-read-repeat r0))) + ))))) + (branch + ,eof-block-reg + ,@(reverse (mapcar 'car eof-block-branches)))))) + +(defun mel-ccl-decode-quoted-printable-generic (input-crlf output-crlf) + `(1 + ((read r0) + (loop + (branch + r0 + ,@(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 ? )) + `(r1 = 1) + `(r1 = 0))) + ((eq tmp 'cr) + (if input-crlf + ;; r0='\r' + `((read r0) + ;; '\r' r0 + (if (r0 == ?\n) + ;; '\r' r0='\n' + ;; hard line break found. + ,(if output-crlf + '((write ?\r) + (write-read-repeat r0)) + '(write-read-repeat r0)) + ;; '\r' r0:[^\n] + ;; invalid control character (bare CR) found. + ;; -> ignore it and rescan from r0. + (repeat))) + ;; r0='\r' + ;; invalid character (bare CR) found. + ;; -> ignore. + `((read r0) + (repeat)))) + ((eq tmp 'lf) + (if input-crlf + ;; r0='\n' + ;; invalid character (bare LF) found. + ;; -> ignore. + `((read r0) + (repeat)) + ;; r0='\r\n' + ;; hard line break found. + (if output-crlf + '((write ?\r) + (write-read-repeat r0)) + '(write-read-repeat r0)))) + ((eq r0 (char-int ?=)) + ;; r0='=' + `((read r0) + ;; '=' r0 + (r1 = (r0 == ?\t)) + (if ((r0 == ? ) | r1) + ;; '=' r0:[\t ] + ;; Skip transport-padding. + ;; It should check CR LF after + ;; transport-padding. + (loop + (read-if (r0 == ?\t) + (repeat) + (if (r0 == ? ) + (repeat) + (break))))) + ;; '=' [\t ]* r0:[^\t ] + (branch + r0 + ,@(mapcar + (lambda (r0) + (cond + ((eq r0 (char-int ?\r)) + (if input-crlf + ;; '=' [\t ]* r0='\r' + `((read r0) + ;; '=' [\t ]* '\r' r0 + (if (r0 == ?\n) + ;; '=' [\t ]* '\r' r0='\n' + ;; soft line break found. + ((read r0) + (repeat)) + ;; '=' [\t ]* '\r' r0:[^\n] + ;; invalid input -> + ;; output "=" and rescan from r0. + ((write "=") + (repeat)))) + ;; '=' [\t ]* r0='\r' + ;; invalid input (bare CR found) -> + ;; output "=" and rescan from next. + `((write ?=) + (read r0) + (repeat)))) + ((eq r0 (char-int ?\n)) + (if input-crlf + ;; '=' [\t ]* r0='\n' + ;; invalid input (bare LF found) -> + ;; output "=" and rescan from next. + `((write ?=) + (read r0) + (repeat)) + ;; '=' [\t ]* r0='\r\n' + ;; soft line break found. + `((read r0) + (repeat)))) + ((setq tmp (nth r0 mel-ccl-256-to-16-table)) + ;; '=' [\t ]* r0:[0-9A-F] + ;; upper nibble of hexadecimal digit found. + `((r1 = (r0 + 0)) + (r0 = ,tmp))) + (t + ;; '=' [\t ]* r0:[^\r0-9A-F] + ;; invalid input -> + ;; output "=" and rescan from r0. + `((write ?=) + (repeat))))) + mel-ccl-256-table)) + ;; '=' [\t ]* r1:r0:[0-9A-F] + (read-branch + r2 + ,@(mapcar + (lambda (r2) + (if (setq tmp (nth r2 mel-ccl-256-to-16-table)) + ;; '=' [\t ]* r1:r0:[0-9A-F] r2:[0-9A-F] + `(write-read-repeat + r0 + ,(vconcat + (mapcar + (lambda (r0) + (logior (lsh r0 4) tmp)) + mel-ccl-16-table))) + ;; '=' [\t ]* r1:r0:[0-9A-F] r2:[^0-9A-F] + ;; invalid input + `(r3 = 0) ; nop + )) + mel-ccl-256-table)) + ;; '=' [\t ]* r1:r0:[0-9A-F] r2:[^0-9A-F] + ;; invalid input -> + ;; output "=" with hex digit and rescan from r2. + (write ?=) + (r0 = (r2 + 0)) + (write-repeat r1))) + (t + ;; r0:[^\t\r -~] + ;; invalid character found. + ;; -> ignore. + `((read r0) + (repeat)))))) + mel-ccl-256-table)) + ;; r1[0]:[\t ] + (loop + ,@(apply + 'append + (mapcar + (lambda (regnum) + (let ((reg (aref [r1 r2 r3 r4 r5] regnum))) + (apply + 'append + (mapcar + (lambda (bit) + (if (= bit 0) + (if (= regnum 0) + nil + `((read r0) + (if (r0 == ?\t) + (,reg = 0) + (if (r0 == ?\ ) + (,reg = 1) + ((r6 = ,(+ (* regnum 28) bit)) + (break)))))) + `((read r0) + (if (r0 == ?\ ) + (,reg |= ,(lsh 1 bit)) + (if (r0 != ?\t) + ((r6 = ,(+ (* regnum 28) bit)) + (break))))))) + mel-ccl-28-table)))) + '(0 1 2 3 4))) + ;; white space buffer exhaust. + ;; error: line length limit (76bytes) violation. + ;; -> ignore these white spaces. + (repeat)) + ,(if input-crlf + `(if (r0 == ?\r) + ((read r0) + (if (r0 == ?\n) + ;; trailing white spaces found. + ;; -> ignore these white spacs. + ((write ,(if output-crlf "\r\n" "\n")) + (read r0) + (repeat)) + ;; [\t ]* \r r0:[^\n] + ;; error: bare CR found. + ;; -> output white spaces and ignore bare CR. + )) + ;; [\t ]* r0:[^\r] + ;; middle white spaces found. + ) + `(if (r0 == ?\n) + ;; trailing white spaces found. + ;; -> ignore these white spacs. + ((write ,(if output-crlf "\r\n" "\n")) + (read r0) + (repeat)) + ;; [\t ]* r0:[^\n] + ;; middle white spaces found. + )) + ,@(apply + 'append + (mapcar + (lambda (regnum) + (let ((reg (aref [r1 r2 r3 r4 r5] regnum))) + (apply + 'append + (mapcar + (lambda (bit) + `((if (,reg & ,(lsh 1 bit)) + (write ?\ ) + (write ?\t)) + (if (r6 == ,(+ (* regnum 28) bit 1)) + (repeat)))) + mel-ccl-28-table)))) + '(0 1 2 3 4))) + (repeat) + )))) + +) + +(define-ccl-program mel-ccl-encode-quoted-printable-crlf-crlf + (mel-ccl-encode-quoted-printable-generic t t)) + +(define-ccl-program mel-ccl-encode-quoted-printable-crlf-lf + (mel-ccl-encode-quoted-printable-generic t nil)) + +(define-ccl-program mel-ccl-encode-quoted-printable-lf-crlf + (mel-ccl-encode-quoted-printable-generic nil t)) + +(define-ccl-program mel-ccl-encode-quoted-printable-lf-lf + (mel-ccl-encode-quoted-printable-generic nil nil)) + +(define-ccl-program mel-ccl-decode-quoted-printable-crlf-crlf + (mel-ccl-decode-quoted-printable-generic t t)) + +(define-ccl-program mel-ccl-decode-quoted-printable-crlf-lf + (mel-ccl-decode-quoted-printable-generic t nil)) + +(define-ccl-program mel-ccl-decode-quoted-printable-lf-crlf + (mel-ccl-decode-quoted-printable-generic nil t)) + +(define-ccl-program mel-ccl-decode-quoted-printable-lf-lf + (mel-ccl-decode-quoted-printable-generic nil nil)) + + +;;; @ coding system +;;; + +(make-ccl-coding-system + 'mel-ccl-uq-rev ?Q "MIME Q-encoding in unstructured field (reversed)" + 'mel-ccl-encode-uq 'mel-ccl-decode-q) + +(make-ccl-coding-system + 'mel-ccl-cq-rev ?Q "MIME Q-encoding in comment (reversed)" + 'mel-ccl-encode-cq 'mel-ccl-decode-q) + +(make-ccl-coding-system + 'mel-ccl-pq-rev ?Q "MIME Q-encoding in phrase (reversed)" + 'mel-ccl-encode-pq 'mel-ccl-decode-q) + +(make-ccl-coding-system + 'mel-ccl-quoted-printable-crlf-crlf-rev + ?Q "MIME Quoted-Printable-encoding (reversed)" + 'mel-ccl-encode-quoted-printable-crlf-crlf + 'mel-ccl-decode-quoted-printable-crlf-crlf) + +(make-ccl-coding-system + 'mel-ccl-quoted-printable-lf-crlf-rev + ?Q "MIME Quoted-Printable-encoding (LF encoding) (reversed)" + 'mel-ccl-encode-quoted-printable-crlf-lf + 'mel-ccl-decode-quoted-printable-lf-crlf) + +(make-ccl-coding-system + 'mel-ccl-quoted-printable-crlf-lf-rev + ?Q "MIME Quoted-Printable-encoding (LF internal) (reversed)" + 'mel-ccl-encode-quoted-printable-lf-crlf + 'mel-ccl-decode-quoted-printable-crlf-lf) + +(make-ccl-coding-system + 'mel-ccl-quoted-printable-lf-lf-rev + ?Q "MIME Quoted-Printable-encoding (LF encoding) (LF internal) (reversed)" + 'mel-ccl-encode-quoted-printable-lf-lf + 'mel-ccl-decode-quoted-printable-lf-lf) + + +;;; @ quoted-printable +;;; + +(check-broken-facility ccl-execute-eof-block-on-decoding-some) + +(unless-broken ccl-execute-eof-block-on-decoding-some + + (defun quoted-printable-ccl-encode-string (string) + "Encode STRING with quoted-printable encoding." + (decode-coding-string + string + 'mel-ccl-quoted-printable-lf-lf-rev)) + + (defun quoted-printable-ccl-encode-region (start end) + "Encode the region from START to END with quoted-printable encoding." + (interactive "*r") + (decode-coding-region start end 'mel-ccl-quoted-printable-lf-lf-rev)) + + (defun quoted-printable-ccl-insert-encoded-file (filename) + "Encode contents of the file named as FILENAME, and insert it." + (interactive "*fInsert encoded file: ") + (insert + (decode-coding-string + (with-temp-buffer + (set-buffer-multibyte nil) + (insert-file-contents-as-binary filename) + (buffer-string)) + 'mel-ccl-quoted-printable-lf-lf-rev))) + + (mel-define-method-function + (mime-encode-string string (nil "quoted-printable")) + 'quoted-printable-ccl-encode-string) + (mel-define-method-function + (mime-encode-region start end (nil "quoted-printable")) + 'quoted-printable-ccl-encode-region) + (mel-define-method-function + (mime-insert-encoded-file filename (nil "quoted-printable")) + 'quoted-printable-ccl-insert-encoded-file) + ) + +(defun quoted-printable-ccl-decode-string (string) + "Decode quoted-printable encoded STRING." + (encode-coding-string + string + 'mel-ccl-quoted-printable-lf-lf-rev)) + +(defun quoted-printable-ccl-decode-region (start end) + "Decode the region from START to END with quoted-printable +encoding." + (interactive "*r") + (encode-coding-region start end 'mel-ccl-quoted-printable-lf-lf-rev)) + +(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) + jka-compr-compression-info-list jam-zcat-filename-list) + (write-region start end filename))) + +(mel-define-method-function + (mime-decode-string string (nil "quoted-printable")) + 'quoted-printable-ccl-decode-string) +(mel-define-method-function + (mime-decode-region start end (nil "quoted-printable")) + 'quoted-printable-ccl-decode-region) +(mel-define-method-function + (mime-write-decoded-region start end filename (nil "quoted-printable")) + 'quoted-printable-ccl-write-decoded-region) + + +;;; @ Q +;;; + +(defun q-encoding-ccl-encode-string (string &optional mode) + "Encode STRING to Q-encoding of encoded-word, and return the result. +MODE allows `text', `comment', `phrase' or nil. Default value is +`phrase'." + (decode-coding-string + string + (cond + ((eq mode 'text) 'mel-ccl-uq-rev) + ((eq mode 'comment) 'mel-ccl-cq-rev) + (t 'mel-ccl-pq-rev)))) + +(defun q-encoding-ccl-decode-string (string) + "Decode Q encoded STRING and return the result." + (encode-coding-string + 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))) + ) + +(mel-define-method-function (encoded-text-encode-string string (nil "Q")) + 'q-encoding-ccl-encode-string) + +(mel-define-method encoded-text-decode-string (string (nil "Q")) + (if (string-match (eval-when-compile + (concat "\\`" Q-encoded-text-regexp "\\'")) + string) + (q-encoding-ccl-decode-string string) + (error "Invalid encoded-text %s" string))) + + +;;; @ end +;;; + +(provide 'mel-q-ccl) + +;;; mel-q-ccl.el ends here. diff --git a/flim-1.14.9/mel-q.el b/flim-1.14.9/mel-q.el new file mode 100644 index 0000000..953b549 --- /dev/null +++ b/flim-1.14.9/mel-q.el @@ -0,0 +1,343 @@ +;;; mel-q.el --- Quoted-Printable encoder/decoder. + +;; Copyright (C) 1995,96,97,98,99,2000,2001 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Created: 1995/6/25 +;; Keywords: MIME, Quoted-Printable, Q-encoding + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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. + +;;; 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)) + + +;;; @ Quoted-Printable encoder +;;; + +(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 (logand character 15))))) + +(defun quoted-printable-internal-encode-region (start end) + (save-excursion + (save-restriction + (narrow-to-region (goto-char start) end) + (let ((col 0) + chr) + (while (not (eobp)) + (cond + ((>= col 75) ; soft line break. + (insert "=\n") + (setq col 0)) + ((eolp) ; end of line. + (forward-char) + (setq col 0)) + (t + (setq chr (char-after (point))) + (cond + ((and (memq chr '(? ?\t)) ; encode WSP char before CRLF. + (eq (char-after (1+ (point))) ?\n)) + (forward-char) + (insert "=\n") + (forward-char) + (setq col 0)) + ((and (bolp) ; "^From " is not safe. + (eq chr ?F) + (eq (char-after (1+ (point))) ?r) + (eq (char-after (+ 2 (point))) ?o) + (eq (char-after (+ 3 (point))) ?m) + (eq (char-after (+ 4 (point))) ? )) + (delete-region (point)(1+ (point))) + (insert "=46") ; moved to ?r. + (forward-char 4) ; skip "rom ". + (setq col 7)) + ((or (= chr ?\t) ; skip safe char. + (and (<= 32 chr)(/= chr ?=)(< chr 127))) + (forward-char) + (setq col (1+ col))) + ((>= col 73) ; soft line break. + (insert "=\n") + (setq col 0)) + (t ; encode unsafe char. + (delete-region (point)(1+ (point))) + ;; (insert (quoted-printable-quote-char chr)) + (insert + ?= + (aref quoted-printable-hex-chars (ash chr -4)) + (aref quoted-printable-hex-chars (logand chr 15))) + (setq col (+ col 3))))))))))) + + +(defvar quoted-printable-external-encoder '("mmencode" "-q") + "*list of quoted-printable encoder program name and its arguments.") + +(defun quoted-printable-external-encode-region (start end) + (save-excursion + (save-restriction + (narrow-to-region start end) + (as-binary-process + (apply (function call-process-region) + start end (car quoted-printable-external-encoder) + t t nil + (cdr quoted-printable-external-encoder))) + ;; for OS/2 + ;; regularize line break code + (goto-char (point-min)) + (while (re-search-forward "\r$" nil t) + (replace-match ""))))) + + +(defvar quoted-printable-internal-encoding-limit + (if (and (featurep 'xemacs)(featurep 'mule)) + 0 + (require 'path-util) + (if (exec-installed-p "mmencode") + 1000 + ;; XXX: Fix this message, or simply remove it. + ;; (message "Don't found external encoder for Quoted-Printable!") + nil)) + "*limit size to use internal quoted-printable encoder. +If size of input to encode is larger than this limit, +external encoder is called.") + +(defun quoted-printable-encode-region (start end) + "Encode current region by quoted-printable. +START and END are buffer positions. +This function calls internal quoted-printable encoder if size of +region is smaller than `quoted-printable-internal-encoding-limit', +otherwise it calls external quoted-printable encoder specified by +`quoted-printable-external-encoder'. In this case, you must install +the program (maybe mmencode included in metamail or XEmacs package)." + (interactive "*r") + (if (and quoted-printable-internal-encoding-limit + (> (- end start) quoted-printable-internal-encoding-limit)) + (quoted-printable-external-encode-region start end) + (quoted-printable-internal-encode-region start end))) + +(defun quoted-printable-encode-string (string) + "Encode STRING to quoted-printable, and return the result." + (with-temp-buffer + (insert string) + (quoted-printable-encode-region (point-min)(point-max)) + (buffer-string))) + + +(mel-define-method-function + (mime-encode-string string (nil "quoted-printable")) + 'quoted-printable-encode-string) + +(mel-define-method-function + (mime-encode-region start end (nil "quoted-printable")) + 'quoted-printable-encode-region) + +(mel-define-method mime-insert-encoded-file (filename (nil "quoted-printable")) + "Encode contents of file FILENAME to quoted-printable, and insert the result. +It calls external quoted-printable encoder specified by +`quoted-printable-external-encoder'. So you must install the program +\(maybe mmencode included in metamail or XEmacs package)." + (interactive "*fInsert encoded file: ") + (apply (function call-process) + (car quoted-printable-external-encoder) + filename t nil + (cdr quoted-printable-external-encoder))) + + +;;; @ Quoted-Printable decoder +;;; + +(defsubst quoted-printable-hex-char-to-num (chr) + (cond ((<= ?a chr) (+ (- chr ?a) 10)) + ((<= ?A chr) (+ (- chr ?A) 10)) + ((<= ?0 chr) (- chr ?0)) + )) + +(defun quoted-printable-internal-decode-region (start end) + (save-excursion + (save-restriction + (narrow-to-region start end) + (goto-char (point-min)) + (while (search-forward "=" nil t) + (cond + ((eolp) + ;; unfold soft line break. + (delete-region (1- (point))(1+ (point)))) + ((and (memq (char-after (point)) + (eval-when-compile + ;; XXX: should provide char-list instead. + (string-to-char-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)))) + ;; 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))))) + (delete-region (1- (point))(+ 2 (point)))))) + (t + ;; invalid encoding. + )))))) + +(defvar quoted-printable-external-decoder '("mmencode" "-q" "-u") + "*list of quoted-printable decoder program name and its arguments.") + +(defun quoted-printable-external-decode-region (start end) + (save-excursion + (as-binary-process + (apply (function call-process-region) + start end (car quoted-printable-external-decoder) + t t nil + (cdr quoted-printable-external-decoder))))) + + +(defvar quoted-printable-internal-decoding-limit nil + "*limit size to use internal quoted-printable decoder. +If size of input to decode is larger than this limit, +external decoder is called.") + +(defun quoted-printable-decode-region (start end) + "Decode current region by quoted-printable. +START and END are buffer positions. +This function calls internal quoted-printable decoder if size of +region is smaller than `quoted-printable-internal-decoding-limit', +otherwise it calls external quoted-printable decoder specified by +`quoted-printable-external-decoder'. In this case, you must install +the program (maybe mmencode included in metamail or XEmacs package)." + (interactive "*r") + (if (and quoted-printable-internal-decoding-limit + (> (- end start) quoted-printable-internal-decoding-limit)) + (quoted-printable-external-decode-region start end) + (quoted-printable-internal-decode-region start end))) + +(defun quoted-printable-decode-string (string) + "Decode STRING which is encoded in quoted-printable, and return the result." + (with-temp-buffer + (insert string) + (quoted-printable-decode-region (point-min)(point-max)) + (buffer-string))) + + +(mel-define-method-function + (mime-decode-string string (nil "quoted-printable")) + 'quoted-printable-decode-string) + +(mel-define-method-function + (mime-decode-region start end (nil "quoted-printable")) + 'quoted-printable-decode-region) + + +(defvar quoted-printable-external-decoder-option-to-specify-file '("-o") + "*list of options of quoted-printable decoder program to specify file. +If the quoted-printable decoder does not have such option, set this as nil.") + +(mel-define-method mime-write-decoded-region (start end filename + (nil "quoted-printable")) + "Decode and write current region encoded by quoted-printable into FILENAME. +START and END are buffer positions." + (interactive "*r\nFWrite decoded region to file: ") + (as-binary-process + (apply (function call-process-region) + start end (car quoted-printable-external-decoder) + (null quoted-printable-external-decoder-option-to-specify-file) + (unless quoted-printable-external-decoder-option-to-specify-file + (list (current-buffer) nil)) + nil + (delq nil + (append + (cdr quoted-printable-external-decoder) + quoted-printable-external-decoder-option-to-specify-file + (when quoted-printable-external-decoder-option-to-specify-file + (list filename)))))) + (unless quoted-printable-external-decoder-option-to-specify-file + (write-region-as-binary (point-min) (point-max) filename))) + + +;;; @ Q-encoding encode/decode string +;;; + +(defconst q-encoding-special-chars-alist + '((text ?= ?? ?_) + (comment ?= ?? ?_ ?\( ?\) ?\\) + (phrase ?= ?? ?_ ?\( ?\) ?\\ ?\" ?# ?$ ?% ?& ?' ?, ?. ?/ + ?: ?\; ?< ?> ?@ ?\[ ?\] ?^ ?` ?{ ?| ?} ?~) + )) + +(defun q-encoding-encode-string (string &optional mode) + "Encode STRING to Q-encoding of encoded-word, and return the result. +MODE allows `text', `comment', `phrase' or nil. Default value is +`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))))) + 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))))) + string ""))) + +(mel-define-method-function (encoded-text-encode-string string (nil "Q")) + 'q-encoding-encode-string) + +(mel-define-method encoded-text-decode-string (string (nil "Q")) + (if (string-match (eval-when-compile + (concat "\\`" Q-encoded-text-regexp "\\'")) + string) + (q-encoding-decode-string string) + (error "Invalid encoded-text %s" string))) + + +;;; @ end +;;; + +(provide 'mel-q) + +;;; mel-q.el ends here. diff --git a/flim-1.14.9/mel-u.el b/flim-1.14.9/mel-u.el new file mode 100644 index 0000000..c5f3fe1 --- /dev/null +++ b/flim-1.14.9/mel-u.el @@ -0,0 +1,164 @@ +;;; mel-u.el --- uuencode encoder/decoder. + +;; Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Created: 1995/10/25 +;; Keywords: uuencode + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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. + +;;; Code: + +(require 'mime-def) +(require 'path-util) + + +(mel-define-backend "x-uue") + + +;;; @ variables +;;; + +(defvar uuencode-external-encoder '("uuencode" "-") + "*list of uuencode encoder program name and its arguments.") + +(defvar uuencode-external-decoder '("sh" "-c" "uudecode") + "*list of uuencode decoder program name and its arguments.") + + +;;; @ uuencode encoder/decoder for region +;;; + +(defun uuencode-external-encode-region (start end) + "Encode current region by unofficial uuencode format. +This function uses external uuencode encoder which is specified by +variable `uuencode-external-encoder'." + (interactive "*r") + (save-excursion + (let ((coding-system-for-read 'binary) + (coding-system-for-write 'binary)) + (apply (function call-process-region) + start end (car uuencode-external-encoder) + t t nil + (cdr uuencode-external-encoder))) + ;; for OS/2 + ;; regularize line break code + (goto-char (point-min)) + (while (re-search-forward "\r$" nil t) + (replace-match "")))) + +(defun uuencode-external-decode-region (start end) + "Decode current region by unofficial uuencode format. +This function uses external uuencode decoder which is specified by +variable `uuencode-external-decoder'." + (interactive "*r") + (save-excursion + (let ((filename (make-temp-file "x-uue"))) + (save-excursion + (save-restriction + (set-mark end) + (narrow-to-region start end) + (goto-char start) + (when (and (re-search-forward "^begin [0-9]+ " nil t) + (looking-at ".+$")) + (replace-match filename) + (let ((coding-system-for-read 'binary) + (coding-system-for-write 'binary)) + (apply (function call-process-region) + start (mark) (car uuencode-external-decoder) + t nil nil + (cdr uuencode-external-decoder))) + (insert-file-contents filename) + ;; The previous line causes the buffer to be made read-only, I + ;; do not pretend to understand the control flow leading to this + ;; but suspect it has something to do with image-mode. -slb + ;; Use `inhibit-read-only' to avoid to force + ;; buffer-read-only nil. - tomo. + (let ((inhibit-read-only t)) + (delete-file filename)))))))) + +(mel-define-method-function (mime-encode-region start end (nil "x-uue")) + 'uuencode-external-encode-region) +(mel-define-method-function (mime-decode-region start end (nil "x-uue")) + 'uuencode-external-decode-region) + + +;;; @ encoder/decoder for string +;;; + +(mel-define-method mime-encode-string (string (nil "x-uue")) + (with-temp-buffer + (insert string) + (uuencode-external-encode-region (point-min)(point-max)) + (buffer-string))) + +(mel-define-method mime-decode-string (string (nil "x-uue")) + (with-temp-buffer + (insert string) + (uuencode-external-decode-region (point-min)(point-max)) + (buffer-string))) + + +;;; @ uuencode encoder/decoder for file +;;; + +(mel-define-method mime-insert-encoded-file (filename (nil "x-uue")) + "Insert file encoded by unofficial uuencode format. +This function uses external uuencode encoder which is specified by +variable `uuencode-external-encoder'." + (interactive "*fInsert encoded file: ") + (call-process (car uuencode-external-encoder) + filename t nil + (file-name-nondirectory filename))) + +(mel-define-method mime-write-decoded-region (start end filename + (nil "x-uue")) + "Decode and write current region encoded by uuencode into FILENAME. +START and END are buffer positions." + (interactive "*r\nFWrite decoded region to file: ") + (save-excursion + (let ((clone-buf (clone-buffer " *x-uue*")) + (file (make-temp-file "x-uue"))) + (save-excursion + (save-restriction + (set-buffer clone-buf) + (narrow-to-region start end) + (setq buffer-read-only nil) + (goto-char start) + (when (and (re-search-forward "^begin [0-9]+ " nil t) + (looking-at ".+$")) + (replace-match file) + (let ((coding-system-for-read 'binary) + (coding-system-for-write 'binary)) + (apply (function call-process-region) + (point-min) (point-max) (car uuencode-external-decoder) + nil nil nil + (cdr uuencode-external-decoder)) + (rename-file file filename 'overwrites) + (message (concat "Wrote " filename)))))) + (kill-buffer clone-buf)))) + +;;; @ end +;;; + +(provide 'mel-u) + +(mel-define-backend "x-uuencode" ("x-uue")) + +;;; mel-u.el ends here. diff --git a/flim-1.14.9/mel.el b/flim-1.14.9/mel.el new file mode 100644 index 0000000..90534cb --- /dev/null +++ b/flim-1.14.9/mel.el @@ -0,0 +1,343 @@ +;;; mel.el --- A MIME encoding/decoding library. + +;; Copyright (C) 1995,1996,1997,1998,1999,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Created: 1995/6/25 +;; Keywords: MIME, Base64, Quoted-Printable, uuencode, gzip64 + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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. + +;;; Code: + +(require 'mime-def) +(require 'alist) + +(defcustom mime-encoding-list + '("7bit" "8bit" "binary" "base64" "quoted-printable") + "List of Content-Transfer-Encoding. Each encoding must be string." + :group 'mime + :type '(repeat string)) + +(defun mime-encoding-list (&optional service) + "Return list of Content-Transfer-Encoding. +If SERVICE is specified, it returns available list of +Content-Transfer-Encoding for it." + (if service + (let (dest) + (mapatoms (lambda (sym) + (or (eq sym nil) + (setq dest (cons (symbol-name sym) dest))) + ) + (symbol-value (intern (format "%s-obarray" service)))) + (let ((rest mel-encoding-module-alist) + pair) + (while (setq pair (car rest)) + (let ((key (car pair))) + (or (member key dest) + (<= (length key) 1) + (setq dest (cons key dest)))) + (setq rest (cdr rest))) + ) + dest) + mime-encoding-list)) + +(defun mime-encoding-alist (&optional service) + "Return table of Content-Transfer-Encoding for completion." + (mapcar #'list (mime-encoding-list service))) + +(defsubst mel-use-module (name encodings) + (while encodings + (set-alist 'mel-encoding-module-alist + (car encodings) + (cons name (cdr (assoc (car encodings) + mel-encoding-module-alist)))) + (setq encodings (cdr encodings)))) + +(defsubst mel-find-function (service encoding) + (mel-find-function-from-obarray + (symbol-value (intern (format "%s-obarray" service))) encoding)) + + +;;; @ setting for modules +;;; + +(defun 8bit-insert-encoded-file (filename) + "Insert file FILENAME encoded by \"7bit\" format." + (let ((coding-system-for-read 'raw-text) + format-alist) + ;; Returns list of absolute file name and length of data inserted. + (insert-file-contents filename))) + +(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) + format-alist) + (write-region start end filename))) + +(mel-define-backend "8bit") +(mel-define-method-function (mime-encode-string string (nil "8bit")) + '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-function (mime-insert-encoded-file filename (nil "8bit")) + '8bit-insert-encoded-file) +(mel-define-method-function (mime-write-decoded-region + start end filename (nil "8bit")) + '8bit-write-decoded-region) + + +(defalias '7bit-insert-encoded-file '8bit-insert-encoded-file) +(defalias '7bit-write-decoded-region '8bit-write-decoded-region) + +(mel-define-backend "7bit" ("8bit")) + + +(defun binary-write-decoded-region (start end filename) + "Decode and write current region encoded by \"binary\" into FILENAME." + (let ((coding-system-for-write 'binary) + jka-compr-compression-info-list jam-zcat-filename-list) + (write-region start end filename))) + +(defalias 'binary-insert-encoded-file 'insert-file-contents-literally) + +(defun binary-find-file-noselect (filename &optional nowarn rawfile) + "Like `find-file-noselect', q.v., but don't code and format conversion." + (let ((coding-system-for-read 'binary) + format-alist) + (find-file-noselect filename nowarn rawfile))) + +(defun binary-funcall (name &rest args) + "Like `funcall', q.v., but read and write as binary." + (let ((coding-system-for-read 'binary) + (coding-system-for-write 'binary)) + (apply name args))) + +(defun binary-to-text-funcall (coding-system name &rest args) + "Like `funcall', q.v., but write as binary and read as text. +Read text is decoded as CODING-SYSTEM." + (let ((coding-system-for-read coding-system) + (coding-system-for-write 'binary)) + (apply name args))) + +(mel-define-backend "binary") +(mel-define-method-function (mime-encode-string string (nil "binary")) + '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-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")) + '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) + (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)))) + +(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"))) + +(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 +;;; + +;;;###autoload +(defun mime-encode-region (start end encoding) + "Encode region START to END of current buffer using ENCODING. +ENCODING must be string." + (interactive + (list (region-beginning)(region-end) + (completing-read "Encoding: " + (mime-encoding-alist) + nil t "base64"))) + (funcall (mel-find-function 'mime-encode-region encoding) start end)) + + +;;;###autoload +(defun mime-decode-region (start end encoding) + "Decode region START to END of current buffer using ENCODING. +ENCODING must be string." + (interactive + (list (region-beginning)(region-end) + (completing-read "Encoding: " + (mime-encoding-alist 'mime-decode-region) + nil t "base64"))) + (funcall (mel-find-function 'mime-decode-region encoding) + start end)) + + +;;; @ string +;;; + +;;;###autoload +(defun mime-decode-string (string encoding) + "Decode STRING using ENCODING. +ENCODING must be string. If ENCODING is found in +`mime-string-decoding-method-alist' as its key, this function decodes +the STRING by its value." + (let ((f (mel-find-function 'mime-decode-string encoding))) + (if f + (funcall f string) + string))) + + +(mel-define-service encoded-text-encode-string) +(defun encoded-text-encode-string (string encoding &optional mode) + "Encode STRING as encoded-text using ENCODING. +ENCODING must be string. +Optional argument MODE allows `text', `comment', `phrase' or nil. +Default value is `phrase'." + (if (string= encoding "B") + (base64-encode-string string 'no-line-break) + (let ((f (mel-find-function 'encoded-text-encode-string encoding))) + (if f + (funcall f string mode) + string)))) + +(mel-define-service encoded-text-decode-string (string encoding) + "Decode STRING as encoded-text using ENCODING. ENCODING must be string.") + +(defun base64-encoded-length (string) + (* (/ (+ (length string) 2) 3) 4)) + +(defsubst Q-encoding-printable-char-p (chr mode) + (and (not (memq chr '(?= ?? ?_))) + (<= ?\ chr)(<= chr ?~) + (cond ((eq mode 'text) t) + ((eq mode 'comment) + (not (memq chr '(?\( ?\) ?\\)))) + (t + (string-match "[A-Za-z0-9!*+/=_---]" (char-to-string chr)))))) + +(defun Q-encoded-text-length (string &optional mode) + (let ((l 0)(i 0)(len (length string)) chr) + (while (< i len) + (setq chr (aref string i)) + (if (or (Q-encoding-printable-char-p chr mode) + (eq chr ? )) + (setq l (+ l 1)) + (setq l (+ l 3))) + (setq i (+ i 1))) + l)) + + +;;; @ file +;;; + +;;;###autoload +(defun mime-insert-encoded-file (filename encoding) + "Insert file FILENAME encoded by ENCODING format." + (interactive + (list (read-file-name "Insert encoded file: ") + (completing-read "Encoding: " + (mime-encoding-alist) + nil t "base64"))) + (funcall (mel-find-function 'mime-insert-encoded-file encoding) + filename)) + + +;;;###autoload +(defun mime-write-decoded-region (start end filename encoding) + "Decode and write current region encoded by ENCODING into FILENAME. +START and END are buffer positions." + (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"))) + (funcall (mel-find-function 'mime-write-decoded-region encoding) + start end filename)) + + +;;; @ end +;;; + +(provide 'mel) + +;;; mel.el ends here. diff --git a/flim-1.14.9/mime-conf.el b/flim-1.14.9/mime-conf.el new file mode 100644 index 0000000..67f613b --- /dev/null +++ b/flim-1.14.9/mime-conf.el @@ -0,0 +1,275 @@ +;;; mime-conf.el --- mailcap parser and MIME playback configuration + +;; Copyright (C) 1997,1998,1999,2000,2004 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Created: 1997-06-27 +;; Original: 1997-06-27 mailcap.el by MORIOKA Tomohiko +;; Renamed: 2000-11-24 to mime-conf.el by MORIOKA Tomohiko +;; Keywords: mailcap, setting, configuration, MIME, multimedia + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'mime-def) + + +;;; @ comment +;;; + +(defsubst mime-mailcap-skip-comment () + (let ((chr (char-after (point)))) + (when (and chr + (or (= chr ?\n) + (= chr ?#))) + (forward-line) + t))) + + +;;; @ token +;;; + +(defsubst mime-mailcap-look-at-token () + (if (looking-at mime-token-regexp) + (let ((beg (match-beginning 0)) + (end (match-end 0))) + (goto-char end) + (buffer-substring beg end) + ))) + + +;;; @ typefield +;;; + +(defsubst mime-mailcap-look-at-type-field () + (let ((type (mime-mailcap-look-at-token))) + (if type + (if (eq (char-after (point)) ?/) + (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))) + )))) + + +;;; @ field separator +;;; + +(defsubst mime-mailcap-skip-field-separator () + (let ((ret (looking-at "\\([ \t]\\|\\\\\n\\)*;\\([ \t]\\|\\\\\n\\)*"))) + (when ret + (goto-char (match-end 0)) + t))) + + +;;; @ mtext +;;; + +(defsubst mime-mailcap-look-at-schar () + (let ((chr (char-after (point)))) + (if (and chr + (>= chr ? ) + (/= chr ?\;) + (/= chr ?\\) + ) + (prog1 + chr + (forward-char))))) + +(defsubst mime-mailcap-look-at-qchar () + (when (eq (char-after (point)) ?\\) + (prog2 + (forward-char) + (char-after (point)) + (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)) + )) + + +;;; @ field +;;; + +(defsubst mime-mailcap-look-at-field () + (let ((token (mime-mailcap-look-at-token))) + (if token + (if (looking-at "[ \t]*=[ \t]*") + (let ((value (progn + (goto-char (match-end 0)) + (mime-mailcap-look-at-mtext)))) + (if value + (cons (intern token) value) + )) + (list (intern token)) + )))) + + +;;; @ mailcap entry +;;; + +(defun mime-mailcap-look-at-entry () + (let ((type (mime-mailcap-look-at-type-field))) + (if (and type (mime-mailcap-skip-field-separator)) + (let ((view (mime-mailcap-look-at-mtext)) + fields field) + (when view + (while (and (mime-mailcap-skip-field-separator) + (setq field (mime-mailcap-look-at-field)) + ) + (setq fields (cons field fields)) + ) + (nconc type + (list (cons 'view view)) + fields)))))) + + +;;; @ main +;;; + +;;;###autoload +(defun mime-parse-mailcap-buffer (&optional buffer order) + "Parse BUFFER as a mailcap, and return the result. +If optional argument ORDER is a function, result is sorted by it. +If optional argument ORDER is not specified, result is sorted original +order. Otherwise result is not sorted." + (save-excursion + (if buffer + (set-buffer buffer)) + (goto-char (point-min)) + (let (entries entry) + (while (progn + (while (mime-mailcap-skip-comment)) + (setq entry (mime-mailcap-look-at-entry)) + ) + (setq entries (cons entry entries)) + (forward-line) + ) + (cond ((functionp order) (sort entries order)) + ((null order) (nreverse entries)) + (t entries) + )))) + + +;;;###autoload +(defvar mime-mailcap-file "~/.mailcap" + "*File name of user's mailcap file.") + +;;;###autoload +(defun mime-parse-mailcap-file (&optional filename order) + "Parse FILENAME as a mailcap, and return the result. +If optional argument ORDER is a function, result is sorted by it. +If optional argument ORDER is not specified, result is sorted original +order. Otherwise result is not sorted." + (or filename + (setq filename mime-mailcap-file)) + (with-temp-buffer + (insert-file-contents filename) + (mime-parse-mailcap-buffer (current-buffer) order) + )) + + +;;;###autoload +(defun mime-format-mailcap-command (mtext situation) + "Return formated command string from MTEXT and SITUATION. + +MTEXT is a command text of mailcap specification, such as +view-command. + +SITUATION is an association-list about information of entity. Its key +may be: + + 'type primary media-type + 'subtype media-subtype + 'filename filename + STRING parameter of Content-Type field" + (let ((i 0) + (len (length mtext)) + (p 0) + 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)) + )) + + +;;; @ end +;;; + +(provide 'mime-conf) + +;;; mime-conf.el ends here diff --git a/flim-1.14.9/mime-def.el b/flim-1.14.9/mime-def.el new file mode 100644 index 0000000..9ee7781 --- /dev/null +++ b/flim-1.14.9/mime-def.el @@ -0,0 +1,402 @@ +;;; mime-def.el --- definition module about MIME -*- coding: iso-8859-4; -*- + +;; Copyright (C) 1995,96,97,98,99,2000,2001,2002,2003,2004,2005,2006 +;; Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Shuhei KOBAYASHI +;; Keywords: definition, MIME, multimedia, mail, news + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'custom) +(require 'mcharset) +(require 'alist) + +(eval-when-compile (require 'luna)) ; luna-arglist-to-arguments + +(eval-and-compile + (defconst mime-library-product ["FLIM" (1 14 9) "Goj"] + "Product name, version number and code name of MIME-library package.")) + +(defmacro mime-product-name (product) + `(aref ,product 0)) + +(defmacro mime-product-version (product) + `(aref ,product 1)) + +(defmacro mime-product-code-name (product) + `(aref ,product 2)) + +(defconst mime-library-version + (eval-when-compile + (concat (mime-product-name mime-library-product) " " + (mapconcat #'number-to-string + (mime-product-version mime-library-product) ".") + " - \"" (mime-product-code-name mime-library-product) "\""))) + + +;;; @ variables +;;; + +(defgroup mime '((default-mime-charset custom-variable)) + "Emacs MIME Interfaces" + :group 'news + :group 'mail) + +(defcustom mime-uuencode-encoding-name-list '("x-uue" "x-uuencode") + "*List of encoding names for uuencode format." + :group 'mime + :type '(repeat string)) + + +;;; @@ for encoded-word +;;; + +(defgroup mime-header nil + "Header representation, specially encoded-word" + :group 'mime) + +;;; @@@ decoding +;;; + +(defcustom mime-field-decoding-max-size 1000 + "*Max size to decode header field." + :group 'mime-header + :type '(choice (integer :tag "Limit (bytes)") + (const :tag "Don't limit" nil))) + +(defcustom mime-header-accept-quoted-encoded-words nil + "*Accept encoded-words in quoted-strings." + :group 'mime-header + :type 'boolean) + + +;;; @@@ encoding +;;; + +(defcustom mime-field-encoding-method-alist + '(("X-Nsubject" . iso-2022-jp-2) + ("Newsgroups" . nil) + ("Message-ID" . nil) + (t . mime) + ) + "*Alist to specify field encoding method. +Its key is field-name, value is encoding method. + +If method is `mime', this field will be encoded into MIME format. + +If method is a MIME-charset, this field will be encoded as the charset +when it must be convert into network-code. + +If method is `default-mime-charset', this field will be encoded as +variable `default-mime-charset' when it must be convert into +network-code. + +If method is nil, this field will not be encoded." + :group 'mime-header + :type '(repeat (cons (choice :tag "Field" + (string :tag "Name") + (const :tag "Default" t)) + (choice :tag "Method" + (const :tag "MIME conversion" mime) + (symbol :tag "non-MIME conversion") + (const :tag "no-conversion" nil))))) + + +;;; @ required functions +;;; + +(defsubst regexp-* (regexp) + (concat regexp "*")) + +(defsubst regexp-or (&rest args) + (concat "\\(" (mapconcat (function identity) args "\\|") "\\)")) + +(or (fboundp 'char-int) + (defalias 'char-int 'identity)) + + +;;; @ MIME constants +;;; + +(defconst mime-tspecial-char-list + '(?\] ?\[ ?\( ?\) ?< ?> ?@ ?, ?\; ?: ?\\ ?\" ?/ ?? ?=)) +(defconst mime-token-regexp + (concat "[^" mime-tspecial-char-list "\000-\040]+")) +(defconst mime-attribute-char-regexp + (concat "[^" mime-tspecial-char-list "\000-\040" + "*'%" ; introduced in RFC 2231. + "]")) + +(defconst mime-charset-regexp + (concat "[^" mime-tspecial-char-list "\000-\040" + "*'%" ; should not include "%"? + "]+")) + +;; More precisely, length of "[A-Za-z]+" is limited to at most 8. +;; (defconst mime-language-regexp "[A-Za-z]+\\(-[A-Za-z]+\\)*") +(defconst mime-language-regexp "[-A-Za-z]+") + +(defconst mime-encoding-regexp mime-token-regexp) + + +;;; @@ base64 / B +;;; + +(defconst base64-token-regexp "[A-Za-z0-9+/]") +(defconst base64-token-padding-regexp "[A-Za-z0-9+/=]") + +(defconst B-encoded-text-regexp + (concat "\\(\\(" + base64-token-regexp + base64-token-regexp + base64-token-regexp + base64-token-regexp + "\\)*" + base64-token-regexp + base64-token-regexp + base64-token-padding-regexp + base64-token-padding-regexp + "\\)")) + +;; (defconst eword-B-encoding-and-encoded-text-regexp +;; (concat "\\(B\\)\\?" eword-B-encoded-text-regexp)) + + +;;; @@ Quoted-Printable / Q +;;; + +(defconst quoted-printable-hex-chars "0123456789ABCDEF") + +(defconst quoted-printable-octet-regexp + (concat "=[" quoted-printable-hex-chars + "][" quoted-printable-hex-chars "]")) + +(defconst Q-encoded-text-regexp + (concat "\\([^=?]\\|" quoted-printable-octet-regexp "\\)+")) + +;; (defconst eword-Q-encoding-and-encoded-text-regexp +;; (concat "\\(Q\\)\\?" eword-Q-encoded-text-regexp)) + + +;;; @ Content-Type +;;; + +(defsubst make-mime-content-type (type subtype &optional parameters) + (cons (cons 'type type) + (cons (cons 'subtype subtype) + parameters))) + +(defsubst mime-content-type-primary-type (content-type) + "Return primary-type of CONTENT-TYPE." + (cdr (car content-type))) + +(defsubst mime-content-type-subtype (content-type) + "Return subtype of CONTENT-TYPE." + (cdr (car (cdr content-type)))) + +(defsubst mime-content-type-parameters (content-type) + "Return parameters of CONTENT-TYPE." + (cdr (cdr content-type))) + +(defsubst mime-content-type-parameter (content-type parameter) + "Return PARAMETER value of CONTENT-TYPE." + (cdr (assoc parameter (cdr (cdr content-type))))) + + +(defsubst mime-type/subtype-string (type &optional subtype) + "Return type/subtype string from TYPE and SUBTYPE." + (if type + (if subtype + (format "%s/%s" type subtype) + (format "%s" type)))) + + +;;; @ Content-Disposition +;;; + +(defsubst make-mime-content-disposition (type &optional parameters) + (cons (cons 'type type) + parameters)) + +(defsubst mime-content-disposition-type (content-disposition) + "Return disposition-type of CONTENT-DISPOSITION." + (cdr (car content-disposition))) + +(defsubst mime-content-disposition-parameters (content-disposition) + "Return disposition-parameters of CONTENT-DISPOSITION." + (cdr content-disposition)) + +(defsubst mime-content-disposition-parameter (content-disposition parameter) + "Return PARAMETER value of CONTENT-DISPOSITION." + (cdr (assoc parameter (cdr content-disposition)))) + +(defsubst mime-content-disposition-filename (content-disposition) + "Return filename of CONTENT-DISPOSITION." + (mime-content-disposition-parameter content-disposition "filename")) + + +;;; @ message structure +;;; + +(defvar mime-message-structure nil + "Information about structure of message. +Please use reference function `mime-entity-SLOT' to get value of SLOT. + +Following is a list of slots of the structure: + +node-id node-id (list of integers) +content-type content-type (content-type) +content-disposition content-disposition (content-disposition) +encoding Content-Transfer-Encoding (string or nil) +children entities included in this entity (list of entity) + +If an entity includes other entities in its body, such as multipart or +message/rfc822, `mime-entity' structures of them are included in +`children', so the `mime-entity' structure become a tree.") + +(make-variable-buffer-local 'mime-message-structure) + +(make-obsolete-variable 'mime-message-structure "should not use it.") + + +;;; @ for mel-backend +;;; + +(defvar mel-service-list nil) + +(defmacro mel-define-service (name &optional args &rest rest) + "Define NAME as a service for Content-Transfer-Encodings. +If ARGS is specified, NAME is defined as a generic function for the +service." + `(progn + (add-to-list 'mel-service-list ',name) + (defvar ,(intern (format "%s-obarray" name)) (make-vector 7 0)) + ,@(if args + `((defun ,name ,args + ,@rest + (funcall (mel-find-function ',name ,(car (last args))) + ,@(luna-arglist-to-arguments (butlast args))) + ))) + )) + +(put 'mel-define-service 'lisp-indent-function 'defun) + + +(defvar mel-encoding-module-alist nil) + +(defsubst mel-find-function-from-obarray (ob-array encoding) + (let* ((f (intern-soft encoding ob-array))) + (or f + (let ((rest (cdr (assoc encoding mel-encoding-module-alist)))) + (while (and rest + (progn + (require (car rest)) + (null (setq f (intern-soft encoding ob-array))) + )) + (setq rest (cdr rest)) + ) + f)))) + +(defsubst mel-copy-method (service src-backend dst-backend) + (let* ((oa (symbol-value (intern (format "%s-obarray" service)))) + (f (mel-find-function-from-obarray oa src-backend)) + sym) + (when f + (setq sym (intern dst-backend oa)) + (or (fboundp sym) + (fset sym (symbol-function f)) + )))) + +(defsubst mel-copy-backend (src-backend dst-backend) + (let ((services mel-service-list)) + (while services + (mel-copy-method (car services) src-backend dst-backend) + (setq services (cdr services))))) + +(defmacro mel-define-backend (type &optional parents) + "Define TYPE as a mel-backend. +If PARENTS is specified, TYPE inherits PARENTS. +Each parent must be backend name (string)." + (cons 'progn + (mapcar (lambda (parent) + `(mel-copy-backend ,parent ,type) + ) + parents))) + +(defmacro mel-define-method (name args &rest body) + "Define NAME as a method function of (nth 1 (car (last ARGS))) backend. +ARGS is like an argument list of lambda, but (car (last ARGS)) must be +specialized parameter. (car (car (last ARGS))) is name of variable +and (nth 1 (car (last ARGS))) is name of backend (encoding)." + (let* ((specializer (car (last args))) + (class (nth 1 specializer))) + `(progn + (mel-define-service ,name) + (fset (intern ,class ,(intern (format "%s-obarray" name))) + (lambda ,(butlast args) + ,@body))))) + +(put 'mel-define-method 'lisp-indent-function 'defun) + +(defmacro mel-define-method-function (spec function) + "Set SPEC's function definition to FUNCTION. +First element of SPEC is service. +Rest of ARGS is like an argument list of lambda, but (car (last ARGS)) +must be specialized parameter. (car (car (last ARGS))) is name of +variable and (nth 1 (car (last ARGS))) is name of backend (encoding)." + (let* ((name (car spec)) + (args (cdr spec)) + (specializer (car (last args))) + (class (nth 1 specializer))) + `(let (sym) + (mel-define-service ,name) + (setq sym (intern ,class ,(intern (format "%s-obarray" name)))) + (or (fboundp sym) + (fset sym (symbol-function ,function)))))) + +(defmacro mel-define-function (function spec) + (let* ((name (car spec)) + (args (cdr spec)) + (specializer (car (last args))) + (class (nth 1 specializer))) + `(progn + (define-function ,function + (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) + )))) + + +;;; @ end +;;; + +(provide 'mime-def) + +;;; mime-def.el ends here diff --git a/flim-1.14.9/mime-en.sgml b/flim-1.14.9/mime-en.sgml new file mode 100644 index 0000000..35783df --- /dev/null +++ b/flim-1.14.9/mime-en.sgml @@ -0,0 +1,1422 @@ + + +FLIM 1.14 Reference Manual about MIME Features +<author>MORIOKA Tomohiko <mail>morioka@jaist.ac.jp</mail> +<date>1999-01-27 + +<toc> +</head> + +<body> + +<abstract> +<p> +This file documents MIME features of FLIM, a fundamental library to +process Internet Messages for GNU Emacsen. +</abstract> + + +<h1> What is FLIM? +<node> Introduction +<p> +FLIM is a library to provide basic features about message +representation or encoding. + + +<h1> How to use MIME features +<node> How to use +<p> +Please eval following to use MIME features provided by FLIM: + +<lisp> +(require 'mime) +</lisp> + + +<h1> Message and Entity +<node> Entity +<p> +According to <dref>RFC 2045</dref>, `The term ``entity'', refers +specifically to the MIME-defined header fields and contents of either +a message or one of the parts in the body of a multipart entity.' In +this document, the term <concept>entity</concept> indicates all of +header fields and body. +<p> +The definition of RFC 2045 indicates that a MIME message is a tree, +and each node of the tree is an entity. Namely MIME extends message +to tree structure. +<p> +FLIM uses <concept>mime-entity</concept> structure to represent +information of entity. In this document, it is called simply +`mime-entity'. + + +<h2> Functions to create mime-entity +<node> Entity creation +<p> +<defun name="mime-open-entity"> + <opts> type location +<p> +Open an entity and return it. +<p> +<var>type</var> is representation-type. <cf node="mm-backend"> +<p> +<var>location</var> is location of entity. Specification of it is +depended on representation-type. +</defun> + +<defun name="mime-parse-buffer"> + <opts> buffer type +<p> +Parse <var>buffer</var> as message, and set the result to buffer local +variable <code>mime-message-structure</code> of <var>buffer</var> as +mime-entity. +<p> +If <var>buffer</var> is omitted, current buffer is used. +<p> +<var>type</var> is representation-type of created mime-entity. <cf +node="mm-backend"> Default value is <var>buffer</var>. +</defun> + + +<h2> Features about message tree +<node> Entity hierarchy +<p> +Structure of a MIME message is tree. +<p> +In the tree, root node is the entity indicates all of the message. In +this document, it is called <concept>root-entity</concept> or +<concept>message</concept>. In FLIM, it is indicated by buffer local +variable <code>mime-message-structure</code>. +<p> +Each entity except root-entity has a parent. An entity may have +children. We can indicate an entity by relative position from a base +entity, based on the parent-child relationship. +<p> +In addition, we can indicate an entity by absolute position of the +message. +<p> +Each entity, which is a node of the tree, can be numbered by +depth and left-to-right order of the depth. +<verb> + + +-------+ + | nil | + +---+---+ + +-------------------+-------------------+ + +-+-+ +-+-+ +-+-+ + | 0 | | 1 | | 2 | + +-+-+ +-+-+ +-+-+ + | +---------+---------+ | + +--+--+ +--+--+ +--+--+ +--+--+ +--+--+ + | 0.0 | | 1.0 | | 1.1 | | 1.2 | | 2.0 | + +-----+ +-----+ +-----+ +-----+ +-----+ + +</verb> +<p> +Namely, if depth of a node is n, the node has a node-number, which is +consists of n integers. In this document, it is called +<concept>entity-number</concept>. An entity-number is represented by +list of integer, like <code>(1 2 3)</code>. +<p> +mime-entity has also <concept>node-id</concept>. A node-id is +represented by reversed list of entity-number. For example, node-id +corresponding with 1.2.3 is <code>(3 2 1)</code>. +<p> +Each entity can be indicated by entity-number or node-id in +<code>mime-message-structure</code>. + +<defvar name="mime-message-structure"> +<p> +Buffer local variable to store mime-entity structure of message. +</defvar> + +<defun name="mime-entity-children"> + <args> entity +<p> +Return list of entities included in the <var>entity</var>. +</defun> + +<defun name="mime-entity-parent"> + <args> entity <opts> message +<p> +Return parent entity of the <var>entity</var>. +<p> +If <var>message</var> is specified, it is regarded as root instead of +<code>mime-message-structure</code>. +</defun> + +<defun name="mime-root-entity-p"> + <args> entity +<p> +Return non-<code>nil</code> if <var>entity</var> is root entity +(message). +</defun> + +<defun name="mime-entity-node-id"> + <args> entity +<p> +Return node-id of <var>entity</var>. +</defun> + +<defun name="mime-entity-number"> + <args> entity +<p> +Return entity-number of <var>entity</var>. +</defun> + + +<h2> Find Entity +<node> Entity Search +<p> +<defun name="mime-find-entity-from-number"> + <args> entity-number <opts> message +<p> +Return entity from <var>entity-number</var> in <var>message</var>. +<p> +If <var>message</var> is not specified, +<code>mime-message-structure</code> is used. +</defun> + +<defun name="mime-find-entity-from-node-id"> + <args> entity-node-id <opts> message +<p> +Return entity from <var>entity-node-id</var> in <var>message</var>. +<p> +If <var>message</var> is not specified, +<code>mime-message-structure</code> is used. +</defun> + +<defun name="mime-find-entity-from-content-id"> + <args> cid <opts> message +<p> +Return entity from <var>cid</var> in <var>message</var>. +<p> +If <var>message</var> is not specified, +<code>mime-message-structure</code> is used. +</defun> + + +<h2> Functions about attributes of mime-entity +<node> Entity Attributes +<p> +<defun name="mime-entity-content-type"> + <args> entity +<p> +Return content-type of <var>entity</var>. +<cf node="mime-content-type"> +</defun> + +<defun name="mime-entity-content-disposition"> + <args> entity +<p> +Return content-disposition of <var>entity</var>. <cf +node="mime-content-disposition"> +</defun> + +<defun name="mime-entity-filename"> + <args> entity +<p> +Return file name of <var>entity</var>. +</defun> + +<defun name="mime-entity-encoding"> + <args> entity <opts> default-encoding +<p> +Return content-transfer-encoding of <var>entity</var>. +<cf node="Content-Transfer-Encoding"> +<p> +If the <var>entity</var> does not have Content-Transfer-Encoding +field, this function returns <var>default-encoding</var>. If it is +nil, <code>"7bit"</code> is used as default value. +</defun> + +<defun name="mime-entity-cooked-p"> + <args> entity +<p> +Return non-nil if contents of <var>entity</var> has been already +code-converted. +</defun> + + +<h2> Information of entity header +<node> Entity-header +<p> +<defun name="mime-fetch-field"> + <args> field-name <opts> entity +<p> +Return field-body of <var>field-name</var> field in header of +<var>entity</var>. +<p> +The results is network representation. +<p> +If <var>entity</var> is omitted, <code>mime-message-structure</code> +is used as default value. +<p> +If <var>field-name</var> field is not found, this function returns +<code>nil</code>. +</defun> + +<defun name="mime-read-field"> + <args> field-name <opts> entity +<p> +Parse <var>field-name</var> field in header of <var>entity</var>, and +return the result. +<p> +Format of result is depended on kind of field. For non-structured +field, this function returns string. For structured field, it returns +list corresponding with structure of the field. +<p> +Strings in the result will be converted to internal representation of +Emacs. +<p> +If <var>entity</var> is omitted, <code>mime-message-structure</code> +is used as default value. +<p> +If <var>field-name</var> field is not found, this function returns +<code>nil</code>. +</defun> + + +<h2> Text presentation of entity +<node> entity formatting +<p> +<defun name="mime-insert-header"> + <args> entity <opts> invisible-fields visible-fields +<p> +Insert before point a decoded contents of header of <var>entity</var>. +<p> +<var>invisible-fields</var> is list of regexps to match field-name to +hide. <var>visible-fields</var> is list of regexps to match +field-name to hide. +<p> +If a field-name is matched with some elements of +<var>invisible-fields</var> and matched with none of +<var>visible-fields</var>, this function don't insert the field. +<p> +Each <dref>encoded-word</dref> in the header is decoded. ``Raw non +us-ascii characters'' are also decoded as +<code>default-mime-charset</code>. +</defun> + +<defun name="mime-insert-text-content"> + <args> entity +<p> +Insert before point a contents of <var>entity</var> as text entity. +<p> +Contents of the <var>entity</var> are decoded as <dref>MIME +charset</dref>. If the <var>entity</var> does not have charset +parameter of Content-Type field, <code>default-mime-charset</code> is +used as default value. +</defun> + +<defvar name="default-mime-charset"> +<p> +Symbol to indicate default value of <dref>MIME charset</dref>. +<p> +It is used when MIME charset is not specified. +<p> +It is originally variable of APEL. +</defvar> + + +<h2> Contents of Entity +<node> Entity-content +<p> +<defun name="mime-entity-content"> + <args> entity +<p> +Return content of <var>entity</var> as byte sequence. +</defun> + +<defun name="mime-insert-entity-content"> + <args> entity +<p> +Insert content of <var>entity</var> at point. +</defun> + +<defun name="mime-write-entity-content"> + <args> entity filename +<p> +Write content of <var>entity</var> into <var>filename</var>. +</defun> + + +<h2> Network representation of Entity +<node> Entity-network-representation +<p> +<defun name="mime-insert-entity"> + <args> entity +<p> +Insert header and body of <var>entity</var> at point. +</defun> + +<defun name="mime-write-entity"> + <args> entity filename +<p> +Write representation of <var>entity</var> into <var>filename</var>. +</defun> + +<defun name="mime-write-entity-body"> + <args> entity filename +<p> +Write body of <var>entity</var> into <var>filename</var>. +</defun> + + +<h2> Entity as buffer representation +<node> Entity buffer +<p> +<defun name="mime-entity-buffer"> + <args> entity +<p> +Return buffer, which contains <var>entity</var>. +</defun> + +<defun name="mime-entity-point-min"> + <args> entity +<p> +Return the start point of <var>entity</var> in the buffer which +contains <var>entity</var>. +</defun> + +<defun name="mime-entity-point-max"> + <args> entity +<p> +Return the end point of <var>entity</var> in the buffer which +contains <var>entity</var>. +</defun> + +<defun name="mime-entity-header-start"> + <args> entity +<p> +Return the start point of header of <var>entity</var> in the buffer +which contains <var>entity</var>. +</defun> + +<defun name="mime-entity-header-end"> + <args> entity +<p> +Return the end point of header of <var>entity</var> in the buffer +which contains <var>entity</var>. +</defun> + +<defun name="mime-entity-body-start"> + <args> entity +<p> +Return the start point of body of <var>entity</var> in the buffer +which contains <var>entity</var>. +</defun> + +<defun name="mime-entity-body-end"> + <args> entity +<p> +Return the end point of body of <var>entity</var> in the buffer which +contains <var>entity</var>. +</defun> + + +<h2> Entity representations and implementations +<node> mm-backend +<p> +Entity is an abstraction. It is designed to use various data +representations for their purposes. +<p> +Each entity has <concept>representation-type</concept>. It must be +specified when an entity is created. <cf node="Entity Creation"> +<p> +Functions about entity are implemented by request processing to the +entity. Each entity knows its representation-type. Each entity calls +processing function corresponding with the representation-type. Such +kind of function is called <concept>entity processing +method</concept>. A module, consists of them corresponding with a +representation-type, is called <concept>mm-backend</concept>. +<p> +Module name of each mm-backend consists of the prefix <code>mm</code> +and its representation-type. The module is required automatically +when its entity is created at first. + + +<h3> Message-passing for entity +<node> Request for entity +<p> +<defun name="mime-entity-send"> + <args> entity message <rest> args +<p> +Send <var>message</var> to <var>entity</var> with <var>args</var>, and +return the result. +<p> +<var>args</var> is arguments of the <var>message</var>. +</defun> + + +<h3> Definition of mm-backend +<node> mm-backend module +<p> +<defmacro name="mm-define-backend"> +<args> type +<opts> parents +<p> +Define <var>type</var> as a mm-backend. +<p> +If <var>PARENTS</var> is specified, <var>type</var> inherits parents. +Each parent must be representation-type. +<p> +Example: +<p> +<lisp> +(mm-define-backend chao (generic)) +</lisp> +</defmacro> + +<defmacro name="mm-define-method"> +<args> name args <rest> body +<p> +Define <var>name</var> as a method function of (nth 1 (car +<var>args</var>)) backend. +<p> +<var>args</var> is like an argument list of lambda, but (car +<var>args</var>) must be specialized parameter. (car (car +<var>args</var>)) is name of variable and (nth 1 (car +<var>args</var>)) is name of backend (representation-type). +<p> +Example: +<p> +<lisp> +(mm-define-method entity-cooked-p ((entity chao)) nil) +</lisp> +</defmacro> + + +<h1> Information of Content-Type field +<node> Content-Type +<p> +<concept>Content-Type field</concept> is a field to indicate kind of +contents or data format, such as <dref>media-type</dref> and MIME +charset. It is defined in <dref>RFC 2045</dref>. + +<memo> +<p> +Historically, Content-Type field was proposed in RFC 1049. In it, +Content-Type did not distinguish type and subtype, and there are no +mechanism to represent kind of character code like MIME charset. +</memo> + +<p> +FLIM provides parser for Content-Type field and structure +<concept>mime-content-type</concept> to store information of +Content-Type field. + + +<h2> Format of Content-Type field +<node> Content-Type field +<p> +Format of Content-Type field is defined as follows: + +<quote> +``Content-Type'' ``:'' <concept>type</concept> ``/'' +<concept>subtype</concept> *( ``;'' <concept>parameter</concept> ) +</quote> +<p> +For example: + +<quote> +<verb> +Content-Type: image/jpeg +</verb> +</quote> + +<quote> +<verb> +Content-Type: text/plain; charset=iso-2022-jp +</verb> +</quote> +<p> +`type' and `subtype' indicate format of an entity. In this document, +pair of them is called `media-type'. `image/jpeg' or `text/plain' is +a media-type. + +<memo> +<p> +If an entity does not have Content-Type field, it is regarded as +following: + +<quote> +<verb> +Content-Type: text/plain; charset=us-ascii +</verb> +</quote> + +<noindent> +<cf node="us-ascii"> +</memo> + + +<h2> mime-content-type structure +<node> mime-content-type +<p> +<define type="Structure" name="mime-content-type"> +<p> +Structure to store information of a Content-Type field. +<p> +Applications should use reference functions +<code>mime-content-type-SLOT</code> to refer information of the +structure. +<p> +Slots of the structure are following: + +<vl> +<dt>primary-type<dd>primary type of media-type (symbol). +</dd> +<dt>subtype<dd>subtype of media-type (symbol). +</dd> +<dt>parameters<dd>parameters of Content-Type field (association-list). +</dd> +</vl> +</define> + +<defun name="make-mime-content-type"> + <args> type subtype + <opts> parameters +<p>Constructor of content-type. +</defun> + +<defun name="mime-content-type-parameter"> +<args> content-type parameter +<p> +Return value of <var>parameter</var> of <var>content-type</var>. +</defun> + + +<h2> Parser +<node> Content-Type parser +<p> +<defun name="mime-parse-Content-Type"> + <args> string +<p> +Parse <var>string</var> as a field-body of Content-Type field, and +return the result as <dref>mime-content-type</dref> structure. +</defun> + +<defun name="mime-read-Content-Type"> +<p> +Parse Content-Type field of the current buffer, and return the result +as <dref>mime-content-type</dref> structure. +<p> +Return <code>nil</code> if Content-Type field is not found. +</defun> + + +<h2> Utility functions +<node> Content-Type utility +<p> +<defun name="mime-type/subtype-string"> + <args> type <opts> subtype +<p> +Return type/subtype string from <var>type</var> and +<var>subtype</var>. +</defun> + + +<h1> Information of Content-Disposition field +<node> Content-Disposition +<p> +<concept>Content-Disposition field</concept> is an optional field to +specify presentation of an entity or attributes of an entity, such as +file name. + +<rfc number="2183" type="Standards Track" + author="S. Dorner, K. Moore and R. Troost" + title="Communicating Presentation Information in Internet + Messages: The Content-Disposition Header" date="August + 1997"> +<p> +FLIM provides parser for Content-Disposition field and structure +<concept>mime-content-disposition</concept> to store information of +Content-Disposition field. + + +<h2> mime-content-disposition structure +<node> mime-content-disposition +<p> +<define type="Structure" name="mime-content-disposition"> +<p> +Structure to store information of a Content-Disposition field. +<p> +Applications should use reference functions +<code>mime-content-disposition-SLOT</code> to refer information of the +structure. +<p> +Slots of the structure are following: + +<vl> +<dt>disposition-type<dd>disposition-type (symbol). +</dd> +<dt>parameters<dd>parameters of Content-Disposition field +(association-list). +</dd> +</vl> +</define> + +<defun name="mime-content-disposition-parameter"> +<args> content-disposition parameter +<p> +Return value of <var>parameter</var> of +<var>content-disposition</var>. +</defun> + +<defun name="mime-content-disposition-filename"> +<args> content-disposition +<p> +Return filename of <var>content-disposition</var>. +</defun> + + +<h2> Parser for Content-Disposition field +<node> Content-Disposition parser +<p> +<defun name="mime-parse-Content-Disposition"> + <args> string +<p> +Parse <var>string</var> as field-body of Content-Disposition field, +and return the result as <dref>mime-content-disposition</dref> +structure. +</defun> + +<defun name="mime-read-Content-Disposition"> +<p> +Parse Content-Disposition field of the current buffer, and return the +result as <dref>mime-content-disposition</dref> structure. +<p> +Return <code>nil</code> if Content-Disposition field is not found. +</defun> + + +<h1> Encoding Method +<node> Content-Transfer-Encoding +<p> +<concept>Content-Transfer-Encoding field</concept> is a header field +to indicate body encoding of a entity. +<p> +FLIM provides parser functions for Content-Transfer-Encoding field. +They represent information of Content-Transfer-Encoding field as +string. +<p> +In addition, FLIM provides encoder/decoder functions by +Content-Transfer-Encoding. + + +<h2> Parser +<node> Content-Transfer-Encoding parser +<p> +<defun name="mime-parse-Content-Transfer-Encoding"> + <args> string +<p> +Parse <var>string</var> as a field-body of Content-Transfer-Encoding +field, and return the result. +</defun> + +<defun name="mime-read-Content-Transfer-Encoding"> + <opts>default-encoding +<p> +Parse Content-Transfer-Encoding field of the current buffer, and +return the result. +<p> +Return <var>default-encoding</var> if Content-Transfer-Encoding field +is not found. If it is not specified, <code>nil</code> is used as the +default value. +</defun> + + +<h2> Encoder/decoder +<node> encoder/decoder +<p> +<defun name="mime-encode-region"> + <args> start end encoding +<p> +Encode region <var>start</var> to <var>end</var> of current buffer +using <var>encoding</var>. +</defun> + +<defun name="mime-decode-region"> + <args> start end encoding +<p> +Decode region <var>start</var> to <var>end</var> of current buffer +using <var>encoding</var>. +</defun> + + +<defun name="mime-decode-string"> + <args> string encoding +<p> +Decode <var>string</var> which is encoded in <var>encoding</var>, and +return the result. +</defun> + + +<defun name="mime-insert-encoded-file"> + <args> filename encoding +<p> +Insert file <var>FILENAME</var> encoded by <var>ENCODING</var> format. +</defun> + +<defun name="mime-write-decoded-region"> + <args> start end filename encoding +<p> +Decode and write current region encoded by <var>encoding</var> into +<var>filename</var>. +<p> +<var>start</var> and <var>end</var> are buffer positions. +</defun> + + +<h2> Other utilities +<node> Encoding information +<p> +<defun name="mime-encoding-list"> + <opts> SERVICE +<p> +Return list of Content-Transfer-Encoding. +<p> +If <var>service</var> is specified, it returns available list of +Content-Transfer-Encoding for it. +</defun> + +<defun name="mime-encoding-alist"> + <opts> SERVICE +<p> +Return table of Content-Transfer-Encoding for completion. +<p> +If <var>service</var> is specified, it returns available list of +Content-Transfer-Encoding for it. +</defun> + + +<h2> How to write encoder/decoder module +<node> mel-backend +<p> +<defmacro name="mel-define-method"> +<args> name args <rest> body +<p> +Define <var>name</var> as a method function of (nth 1 (car (last +<var>args</var>))) backend. +<p> +<var>args</var> is like an argument list of lambda, but (car (last +<var>args</var>)) must be specialized parameter. (car (car (last +<var>args</var>))) is name of variable and (nth 1 (car (last +<var>args</var>))) is name of backend (encoding). +<p> +Example: +<p> +<lisp> +(mel-define-method mime-write-decoded-region (start end filename + (nil "base64")) + "Decode and write current region encoded by base64 into FILENAME. +START and END are buffer positions." + (interactive + (list (region-beginning) (region-end) + (read-file-name "Write decoded region to file: "))) + (let ((str (buffer-substring start end))) + (with-temp-buffer + (insert (decode-base64-string str)) + (write-region-as-binary (point-min) (point-max) filename) + ))) +</lisp> +</defmacro> + +<defmacro name="mel-define-method-function"> +<args> spec function +<p> +Set <var>spec</var>'s function definition to <var>function</var>. +<p> +First element of <var>spec</var> is service. +<p> +Rest of <var>args</var> is like an argument list of lambda, but (car +(last <var>args</var>)) must be specialized parameter. (car (car +(last <var>args</var>))) is name of variable and (nth 1 (car (last +<var>args</var>))) is name of backend (encoding). +<p> +Example: +<p> +<lisp> +(mel-define-method-function (mime-encode-string string (nil "base64")) + 'encode-base64-string) +</lisp> +</defmacro> + + +<h2> How to add encoding/decoding service +<node> generic function for mel-backend +<p> +<defmacro name="mel-define-service"> +<args> name +<opts> args doc-string +<p> +Define <var>name</var> as a service for Content-Transfer-Encodings. +<p> +If <var>args</var> is specified, <var>name</var> is defined as a +generic function for the service. +<p> +Example: +<p> +<lisp> +(mel-define-service encoded-text-encode-string (string encoding) + "Encode STRING as encoded-text using ENCODING. +ENCODING must be string.") +</lisp> +</defmacro> + + +<h1> Network representation of header +<node> encoded-word +<p> +<concept>RFC 2047</concept> defines the +<concept>encoded-word</concept> which is a format to represent +non-<dref>ASCII</dref> characters in a header. +<p> +<rfc number="2047" type="Standards Track" author="K. Moore" + title="MIME (Multipurpose Internet Mail Extensions) Part + Three: Message Header Extensions for Non-ASCII Text" + date="November 1996" obsolete="1521,1522,1590"> +<p> +The encoded-word is the only valid format to represent +non-<dref>ASCII</dref> characters in a header, but there are also +invalid styles. Such kinds of evil messages represent +non-<dref>ASCII</dref> characters in headers without encoded-words (it +is called "raw" non-<dref>ASCII</dref> characters). +<p> +FLIM provides encoding/decoding features of both encoded-word and +invalid "raw" non-<dref>ASCII</dref> characters. + + +<h2> Header encoding/decoding +<node> Header encoder/decoder +<p> +<defun name="eword-decode-header"> + <opts> code-conversion separator +<p> +Decode MIME encoded-words in header fields. +<p> +If <var>code-conversion</var> is <code>nil</code>, only encoded-words +are decoded. If <var>code-conversion</var> is a <dref>MIME +charset</dref>, non-ASCII bit patterns are decoded as the MIME +charset. Otherwise non-ASCII bit patterns are decoded as the +<code>default-mime-charset</code>. <cf node="entity formatting"> +<p> +If <var>separator</var> is not <code>nil</code>, it is used as header +separator. +</defun> + +<defun name="eword-encode-header"> + <opts> code-conversion +<p> +Encode header fields to network representation, such as MIME +encoded-word. +<p> +Each field is encoded as corresponding method specified by variable +<code>mime-field-encoding-method-alist</code>. +</defun> + +<defvar name="mime-field-encoding-method-alist"> +<p> +Association list to specify field encoding method. Each element looks +like (FIELD . METHOD). +<p> +If METHOD is <code>mime</code>, the FIELD will be encoded into MIME +format (encoded-word). +<p> +If METHOD is <code>nil</code>, the FIELD will not be encoded. +<p> +If METHOD is a MIME charset, the FIELD will be encoded as the charset +when it must be convert into network-code. +<p> +Otherwise the FIELD will be encoded as variable +<code>default-mime-charset</code> when it must be convert into +network-code. +</defvar> + + +<h1> Various Customization +<node> custom +<p> +<define type="group" name="mime"> +<p> +The group associated with functions related to MIME. +<p> +It belongs to <code>mail</code> and <code>news</code>. +</define> + + +<h1> Appendix +<node> Appendix + +<h2> Glossary +<node> Glossary + +<h3> 7bit +<node> 7bit +<p> +<concept>7bit</concept> means any integer between 0 .. 127. +<p> +Any data represented by 7bit integers is called <concept>7bit +data</concept>. +<p> +Textual string consisted of Control characters between 0 .. 31 and +127, and space represented by 32, and graphic characters between 33 +.. 236 are called <concept>7bit (textual) string</concept>. +<p> +Conventional Internet <a node="MTA">MTA</a> can translate 7bit data, +so it is no need to translate by <a +node="Quoted-Printable">Quoted-Printable</a> or <a +node="Base64">Base64</a> for 7bit data. +<p> +However if there are too long lines, it can not translate by 7bit MTA +even if it is 7bit data. <dref>RFC 821</dref> and <dref>RFC +2045</dref> 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 <dref>binary</dref>. For example, Postscript file should be +encoded by Quoted-Printable. + + +<h3> 8bit +<node> 8bit +<p> +<concept>8bit</concept> means any integer between 0 .. 255. +<p> +Any data represented by 8bit integers is called <concept>8bit +data</concept>. +<p> +Textual string consisted of Control characters between 0 .. 31, 127, +and 128 .. 159, and space represented by 32, and graphic characters +between 33 .. 236 and 160 .. 255 are called <concept>8bit (textual) +string</concept>. +<p> +For example, <dref>iso-8859-1</dref> or <dref>euc-kr</dref> are +coded-character-set represented by 8bit textual string. +<p> +Traditional Internet <a node="MTA">MTA</a> can translate only +<dref>7bit</dref> data, so if a 8bit data will be translated such MTA, +it must be encoded by <dref>Quoted-Printable</dref> or +<dref>Base64</dref>. +<p> +However 8bit MTA are increasing today. +<p> +However if there are too long lines, it can not translate by 8bit MTA +even if it is 8bit data. <dref>RFC 2045</dref> require lines in 8bit +data must be less than 998 bytes. So if a ``8bit data'' has a line +more than 999 bytes, it is regarded as <dref>binary</dref>, so it must +be encoded by Base64 or Quoted-Printable. + + +<h3> ASCII +<node> ASCII +<p> +<concept>ASCII</concept> 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 <a node="ISO +646">ISO 646</a>. + +<standard abbrev="ASCII" title-en="Coded Character Set -- 7-Bit + American Standard Code for Information Interchange" + number="ANSI X3.4" year="1986"> + + +<h3> Base64 +<node> Base64 +<p> +<concept>Base64</concept> is a transfer encoding method of +<dref>MIME</dref> defined in <dref>RFC 2045</dref>. +<p> +The encoding process represents 24-bit groups of input bits as output +strings of 4 encoded characters. Encoded characters represent integer +0 .. 63 or <concept>pad</concept>. Base64 data must be 4 * n bytes, +so pad is used to adjust size. +<p> +These 65 characters are subset of all versions of ISO 646, including +US-ASCII, and all versions of EBCDIC. So it is safe even if it is +translated by non-Internet gateways. + + +<h3> binary +<node> binary +<p> +Any byte stream is called <concept>binary</concept>. +<p> +It does not require structureof lines. It differs from from <a +node="8bit">8bit</a>. +<p> +In addition, if line structured data contain too long line (more than +998 bytes), it is regarded as binary. + + +<h3> Coded character set, Character code +<node> coded character set +<p> +A set of unambiguous rules that establishes a character set and the +one-to-one relationship between the characters of the set and their +bit combinations. + + +<h3> media-type +<node> media-type +<p> +<concept>media-type</concept> specifies the nature of the data in the +body of <dref>MIME</dref> <dref>entity</dref>. It consists of +<concept>type</concept> and <concept>subtype</concept>. It is defined +in <dref>RFC 2046</dref>. +<p> +Currently there are following standard primary-types: + +<ul> +<li><concept>text</concept> +</li> +<li><concept>image</concept> +</li> +<li><concept>audio</concept> +</li> +<li><concept>video</concept> +</li> +<li><concept>application</concept> +</li> +<li><a node="multipart"><concept>multipart</concept></a> +</li> +<li><concept>message</concept> +</ul> + +<p> +And there are various subtypes, for example, application/octet-stream, +audio/basic, image/jpeg, <dref>multipart/mixed</dref>, +<dref>text/plain</dref>, video/mpeg... + +<p> +You can refer registered media types at <a +href="ftp://ftp.isi.edu/in-notes/iana/assignments/media-types">MEDIA +TYPES</a>. +<p> +In addition, you can use private type or subtype using +<concept>x-token</concept>, which as the prefix `x-'. However you can +not use them in public. +<p> +<cf node="Content-Type field"> + + +<h3> message +<node> message +<p> +In this document, it means mail defined in <dref>RFC 822</dref> and +news message defined in <dref>RFC 1036</dref>. + + +<h3> MIME +<node> MIME +<p> +MIME stands for <concept>Multipurpose Internet Mail +Extensions</concept>, it is an extension for <dref>RFC 822</dref>. +<p> +According to RFC 2045: +<p> +STD 11, RFC 822, defines a message representation protocol specifying +considerable detail about US-ASCII message headers, and leaves the +message content, or message body, as flat US-ASCII text. This set of +documents, collectively called the Multipurpose Internet Mail +Extensions, or MIME, redefines the format of messages to allow for + +<ol> +<li>textual message bodies in character sets other than US-ASCII, +</li> +<li>an extensible set of different formats for non-textual message +bodies, +</li> +<li>multi-part message bodies, and +</li> +<li>textual header information in character sets other than US-ASCII. +</ol> + +<p> +It is defined in <dref>RFC 2045</dref>, <dref>RFC 2046</dref>, <a +node="encoded-word">RFC 2047</a>, <dref>RFC 2048</dref> and <dref>RFC +2049</dref>. + + +<h3> MIME charset +<node> MIME charset +<p> +<a node="coded character set">Coded character set</a> used in +<dref>Content-Type field</dref> or charset parameter of <a +node="encoded-word">encoded-word</a>. +<p> +It is defined in <dref>RFC 2045</dref>. +<p> +<dref>iso-2022-jp</dref> or <dref>euc-kr</dref> are kinds of it. (In +this document, MIME charsets are written by small letters to +distinguish <dref>graphic character set</dref>. For example, ISO +8859-1 is a graphic character set, and iso-8859-1 is a MIME charset) + + +<h3> MTA +<node> MTA +<p> +<concept>Message Transfer Agent</concept>. It means mail transfer +programs (ex. sendmail) and news servers. +<p> +<cf node="MUA"> + + +<h3> MUA +<node> MUA +<p> +<concept>Message User Agent</concept>. It means mail readers and news +readers. +<p> +<cf node="MTA"> + + +<h3> Quoted-Printable +<node> Quoted-Printable +<p> +<concept>Quoted-Printable</concept> is a transfer encoding method of +<dref>MIME</dref> defined in <dref>RFC 2045</dref>. +<p> +If the data being encoded are mostly US-ASCII text, the encoded form +of the data remains largely recognizable by humans. +<p> +<cf node="Base64"> + + +<h3> RFC 822 +<node> RFC 822 +<p> +A RFC defines format of Internet mail message, mainly <concept>message +header</concept>. + +<memo> +<p> +news message is based on RFC 822, so <concept>Internet +message</concept> may be more suitable than <concept>Internet +mail</concept> . +</memo> + +<rfc number="822" type="STD 11" author="D. Crocker" title="Standard + for the Format of ARPA Internet Text Messages" + date="August 1982"> + + +<h3> RFC 1036 +<node> RFC 1036 +<p> +A RFC defines format of USENET message. It is a subset of <dref>RFC +822</dref>. It is not Internet standard, but a lot of netnews +excepting Usenet uses it. + +<rfc name="USENET" number="1036" author="M. Horton and R. Adams" + title="Standard for Interchange of USENET Messages" + date="December 1987" obsolete="850"> + + +<h3> RFC 2045 +<node> RFC 2045 +<p> +<rfc number="2045" type="Standards Track" author="N. Freed and + N. Borenstein" title="Multipurpose Internet Mail + Extensions (MIME) Part One: Format of Internet Message + Bodies" date="November 1996" obsolete="1521, 1522, + 1590"> + + +<h3> RFC 2046 +<node> RFC 2046 +<p> +<rfc number="2046" type="Standards Track" author="N. Freed and + N. Borenstein" title="Multipurpose Internet Mail + Extensions (MIME) Part Two: Media Types" + date="November 1996" obsolete="1521, 1522, 1590"> + + +<h3> RFC 2048 +<node> RFC 2048 +<p> +<rfc number="2048" type="Standards Track" author="N. Freed, J. Klensin + and J. Postel" title="Multipurpose Internet Mail + Extensions (MIME) Part Four: Registration Procedures" + date="November 1996" obsolete="1521, 1522, 1590"> + + +<h3> RFC 2049 +<node> RFC 2049 +<p> +<rfc number="2049" type="Standards Track" author="N. Freed and + N. Borenstein" title="Multipurpose Internet Mail + Extensions (MIME) Part Five: Conformance Criteria and + Examples" date="November 1996" obsolete="1521, 1522, + 1590"> + + +<h3> plain text +<node> plain text +<p> +A textual data represented by only <dref>coded character set</dref>. +It does not have information about font or typesetting. +<cf node="text/plain"> + + +<h3> us-ascii +<node> us-ascii +<p> +A <a node="MIME charset">MIME charset</a> for primary Latin script +mainly written by English or other languages. +<p> +It is a 7bit <dref>coded character set</dref> based on <dref>ISO +2022</dref>, it contains only +<dref>ASCII</dref> and <dref>code extension</dref> is not allowed. +<p> +It is standard coded character set of Internet mail. If MIME charset +is not specified, <concept>us-ascii</concept> is used as default. +<p> +In addition, <concept>ASCII</concept> of <dref>RFC 822</dref> should +be interpreted as us-ascii. + + +<h2> How to report bugs +<node> Bug report +<p> +If you write bug-reports and/or suggestions for improvement, please +send them to the EMACS-MIME Mailing List: + +<ul> +<li> English <mail>emacs-mime-en@m17n.org</mail> +<li> Japanese <mail>emacs-mime-ja@m17n.org</mail> +</ul> + +<p> +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. +<p> +You should write <concept>good bug report</concept>. 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 file="emacs" node="Bugs"> +<p> +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. + +<p> +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: + +<ul> +<li> English <mail>emacs-mime-en-ctl@m17n.org</mail> +<li> Japanese <mail>emacs-mime-ja-ctl@m17n.org</mail> +</ul> + + +<h2> CVS based development +<node> CVS +<p> +Files in FLIM are managed under CVS. Therefore you can obtain the +newest FLIM by the following method: + +<verb> +(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 [-r TAG] flim +</verb> + +<p> +If you would like to join CVS based development, please send mail to + +<ul> +<li> <mail>cvs@cvs.m17n.org</mail> +</ul> + +<noindent> +with your account name and your public key for ssh. +cvsroot is :ext:cvs@@cvs.m17n.org:/cvs/root. + + +<h2> History of FLIM +<node> History +<p> +FLIM $B$N(B code $B$N:G8E$NItJ,$O(B $B1]JB(B $B;LCR(B $B;a$,=q$$$?(B <file>mime.el</file> +$B$K5/8;$7$^$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 +<p> +$B$=$N8e!"<i2,(B $BCNI'(B $B$O(B <file>mime.el</file> $B$r85$K(B +<file>tiny-mime.el</file> $B$H$$$&%W%m%0%i%`$r=q$-$^$9!#$3$l$O!"(BNemacs +$B$H(B Mule $B$GF0:n$9$k(B encoded-word $B$NId9f2=!&I|9f2=%W%m%0%i%`$G$7$?!#(B +<file>tiny-mime.el</file> $B$O(B B-encoding $B$@$1$G$J$/(B Q-encoding $B$b(B +support $B$7!"$^$?!"(BMULE $B$G07$&$3$H$,$G$-$k$5$^$6$^$J(B <dref>MIME +charset</dref> $B$rF1;~$K;H$&$3$H$,$G$-$^$7$?!#$3$N;~!"(BNemacs $B$H(B Mule $B$N(B +$BAPJ}$r(B support $B$9$k$?$a$KMQ$$$i$l$?%F%/%K%C%/$O8e$K(B emu package $B$K$^$H(B +$B$a$i$l$^$9!#(B +<p> +$B$3$N:"!"<i2,(B $BCNI'(B $B$O(B <file>tiny-mime.el</file> $B$r$5$^$6$^$J(B MUA $B$G;H$&(B +$B$?$a$N@_Dj=8$bG[I[$7$F$$$^$7$?$,!"$=$l$i$O8e$K(B +<file>tiny-mime.el</file> $B$H$H$b$K#1$D$N(B package $B$K$^$H$a$i$l!"(Btm $B$H$$(B +$B$&L>A0$GG[I[$5$l$^$9!#(B +<p> +$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</file> $B$r=q$-$^$9!#$3$l$O!"$9$0$K(B +<file>tm-view.el</file> $B$H$$$&L>A0$KJQ$o$j$^$7$?$,!"$d$,$F!"$3$l$,(B +<file>tiny-mime.el</file> $B$KBe$o$C$F!"(Btm $B$NCf3K$H$J$j$^$9!#(B +<p> +<file>tm-view.el</file> $B$OEvA3!"(BContent-Transfer-Encoding $B$r07$&I,MW$,(B +$B$"$j$^$9!#$3$NL\E*$N$?$a$K!"(BMEL $B$,@0Hw$5$l$O$8$a$^$7$?!#(BBase64 $B$K4X$7(B +$B$F$O(B <file>tiny-mime.el</file> $B$N(B code $B$,0\$5$l!"$^$?!"?7$?$K(B +Quoted-Printable $B$N(B code $B$,DI2C$5$l$^$7$?!#$3$l$i$,(B +<file>mel-b.el</file> $B$H(B <file>mel-q.el</file> $B$K$J$j$^$7$?!#(B +<p> +$B$^$?!"8e$K!"<i2,(B $BCNI'(B $B$K$h$C$F(B uuencode $BMQ$N(B <file>mel-u.el</file> $B$,(B +$BDI2C$5$l!"$=$N8e$K!">.NS(B $B=$J?(B $B;a$K$h$C$F(B x-gzip64 $BMQ$N(B +<file>mel-g.el</file> $B$,DI2C$5$l$^$7$?!#(B +<p> +tm $B$G$O8e$K!"<i2,(B $BCNI'(B $B$K$h$C$F(B <file>tiny-mime.el</file> $B$N:F<BAu$,9T(B +$B$o$l!"$3$N2aDx$G!"(BSTD 11 $B$N(B parser $B$,=q$+$l$^$7$?!#$3$l$O!"8=:_$N(B +<file>std11.el</file> $B$KEv$?$j$^$9!#$^$?!"$3$N2aDx$G(B +<file>tiny-mime.el</file> $B$OI|9f2=$r9T$&(B <file>tm-ew-d.el</file> $B$HId(B +$B9f2=$r9T$&(B <file>tm-ew-e.el</file> $B$KJ,$1$i$l$^$7$?!#$3$NN><T$,8=:_$N(B +<file>eword-decode.el</file> $B$H(B <file>eword-encode.el</file> $B$N@hAD$K(B +$BEv$?$j$^$9!#(B +<p> +$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!"(B +tm $B$O(B APEL, MEL, SEMI, EMH, RMAIL-MIME, Gnus-MIME $B$J$I$KJ,$1$i$l$^$7$?!#(B +$B$3$N$&$A$N(B MEL $B$,(B FLIM $B$ND>@\$N@hAD$KEv$?$j$^$9!#(B +<p> +$B8e$K!"(BAPEL $B$+$i(B <file>std11.el</file> $B$,0\$5$l!"$^$?!"(B +<file>mailcap.el</file>, <file>eword-decode.el</file> $B$*$h$S(B +<file>eword-encode.el</file> $B$,(B SEMI $B$+$i0\$5$l!"(Bpackage $B$NL>A0$,(B FLIM +$B$H$J$j$^$9!#(B +<p> +$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 + + +<h1> Concept Index +<node> Concept Index + +<cindex> + + +<h1> Function Index +<node> Function Index + +<findex> + + +<h1> Variable Index +<node> Variable Index + +<vindex> + +</body> diff --git a/flim-1.14.9/mime-en.texi b/flim-1.14.9/mime-en.texi new file mode 100644 index 0000000..e04f744 --- /dev/null +++ b/flim-1.14.9/mime-en.texi @@ -0,0 +1,1626 @@ +\input texinfo.tex +@c Generated automatically from mime-en.sgml by sinfo 3.7. +@setfilename mime-en.info +@settitle{FLIM 1.14 Reference Manual about MIME Features} +@titlepage +@title FLIM 1.14 Reference Manual about MIME Features +@author MORIOKA Tomohiko <morioka@@jaist.ac.jp> +@subtitle 1999-01-27 +@end titlepage +@node Top, Introduction, (dir), (dir) +@top FLIM 1.14 Reference Manual about MIME Features + +@ifinfo + +This file documents MIME features of FLIM, a fundamental library to +process Internet Messages for GNU Emacsen. +@end ifinfo + +@menu +* Introduction:: What is FLIM? +* How to use:: How to use MIME features +* Entity:: Message and Entity +* Content-Type:: Information of Content-Type field +* Content-Disposition:: Information of Content-Disposition field +* Content-Transfer-Encoding:: Encoding Method +* encoded-word:: Network representation of header +* custom:: Various Customization +* Appendix:: +* Concept Index:: +* Function Index:: +* Variable Index:: +@end menu + +@node Introduction, How to use, Top, Top +@chapter What is FLIM? + +FLIM is a library to provide basic features about message +representation or encoding. + + +@node How to use, Entity, Introduction, Top +@chapter How to use MIME features + +Please eval following to use MIME features provided by FLIM: + +@lisp +(require 'mime) +@end lisp + + + +@node Entity, Content-Type, How to use, Top +@chapter Message and Entity +@cindex mime-entity +@cindex entity + +According to RFC 2045 (@ref{RFC 2045}), `The term ``entity'', refers +specifically to the MIME-defined header fields and contents of either a +message or one of the parts in the body of a multipart entity.' In this +document, the term @strong{entity} indicates all of header fields and +body.@refill + +The definition of RFC 2045 indicates that a MIME message is a tree, and +each node of the tree is an entity. Namely MIME extends message to tree +structure.@refill + +FLIM uses @strong{mime-entity} structure to represent +information of entity. In this document, it is called simply +`mime-entity'. + + +@menu +* Entity creation:: Functions to create mime-entity +* Entity hierarchy:: Features about message tree +* Entity Search:: Find Entity +* Entity Attributes:: Functions about attributes of mime-entity +* Entity-header:: Information of entity header +* entity formatting:: Text presentation of entity +* Entity-content:: Contents of Entity +* Entity-network-representation:: Network representation of Entity +* Entity buffer:: Entity as buffer representation +* mm-backend:: Entity representations and implementations +@end menu + +@node Entity creation, Entity hierarchy, Entity, Entity +@section Functions to create mime-entity + +@defun mime-open-entity &optional type location + +Open an entity and return it.@refill + +@var{type} is representation-type. (cf. @ref{mm-backend}) @refill + +@var{location} is location of entity. Specification of it is depended +on representation-type. +@end defun + + +@defun mime-parse-buffer &optional buffer type + +Parse @var{buffer} as message, and set the result to buffer local +variable @code{mime-message-structure} of @var{buffer} as +mime-entity.@refill + +If @var{buffer} is omitted, current buffer is used.@refill + +@var{type} is representation-type of created +mime-entity. (cf. @ref{mm-backend}) Default value is @var{buffer}. +@end defun + + + +@node Entity hierarchy, Entity Search, Entity creation, Entity +@section Features about message tree +@cindex node-id +@cindex entity-number +@cindex message +@cindex root-entity + +Structure of a MIME message is tree.@refill + +In the tree, root node is the entity indicates all of the message. In +this document, it is called @strong{root-entity} or @strong{message}. +In FLIM, it is indicated by buffer local variable +@code{mime-message-structure}.@refill + +Each entity except root-entity has a parent. An entity may have +children. We can indicate an entity by relative position from a base +entity, based on the parent-child relationship.@refill + +In addition, we can indicate an entity by absolute position of the +message.@refill + +Each entity, which is a node of the tree, can be numbered by +depth and left-to-right order of the depth. +@example + + +-------+ + | nil | + +---+---+ + +-------------------+-------------------+ + +-+-+ +-+-+ +-+-+ + | 0 | | 1 | | 2 | + +-+-+ +-+-+ +-+-+ + | +---------+---------+ | + +--+--+ +--+--+ +--+--+ +--+--+ +--+--+ + | 0.0 | | 1.0 | | 1.1 | | 1.2 | | 2.0 | + +-----+ +-----+ +-----+ +-----+ +-----+ +@end example + +Namely, if depth of a node is n, the node has a node-number, which is +consists of n integers. In this document, it is called +@strong{entity-number}. An entity-number is represented by list of +integer, like @code{(1 2 3)}.@refill + +mime-entity has also @strong{node-id}. A node-id is represented by +reversed list of entity-number. For example, node-id corresponding with +1.2.3 is @code{(3 2 1)}.@refill + +Each entity can be indicated by entity-number or node-id in +@code{mime-message-structure}. + +@defvar mime-message-structure + +Buffer local variable to store mime-entity structure of message. +@end defvar + + +@defun mime-entity-children entity + +Return list of entities included in the @var{entity}. +@end defun + + +@defun mime-entity-parent entity &optional message + +Return parent entity of the @var{entity}.@refill + +If @var{message} is specified, it is regarded as root instead of +@code{mime-message-structure}. +@end defun + + +@defun mime-root-entity-p entity + +Return non-@code{nil} if @var{entity} is root entity (message). +@end defun + + +@defun mime-entity-node-id entity + +Return node-id of @var{entity}. +@end defun + + +@defun mime-entity-number entity + +Return entity-number of @var{entity}. +@end defun + + + +@node Entity Search, Entity Attributes, Entity hierarchy, Entity +@section Find Entity + +@defun mime-find-entity-from-number entity-number &optional message + +Return entity from @var{entity-number} in @var{message}.@refill + +If @var{message} is not specified, @code{mime-message-structure} is +used. +@end defun + + +@defun mime-find-entity-from-node-id entity-node-id &optional message + +Return entity from @var{entity-node-id} in @var{message}.@refill + +If @var{message} is not specified, @code{mime-message-structure} is +used. +@end defun + + +@defun mime-find-entity-from-content-id cid &optional message + +Return entity from @var{cid} in @var{message}.@refill + +If @var{message} is not specified, @code{mime-message-structure} is +used. +@end defun + + + +@node Entity Attributes, Entity-header, Entity Search, Entity +@section Functions about attributes of mime-entity + +@defun mime-entity-content-type entity + +Return content-type of @var{entity}. (cf. @ref{mime-content-type}) +@end defun + + +@defun mime-entity-content-disposition entity + +Return content-disposition of +@var{entity}. (cf. @ref{mime-content-disposition}) +@end defun + + +@defun mime-entity-filename entity + +Return file name of @var{entity}. +@end defun + + +@defun mime-entity-encoding entity &optional default-encoding + +Return content-transfer-encoding of @var{entity}. +(cf. @ref{Content-Transfer-Encoding}) @refill + +If the @var{entity} does not have Content-Transfer-Encoding field, this +function returns @var{default-encoding}. If it is nil, @code{"7bit"} is +used as default value. +@end defun + + +@defun mime-entity-cooked-p entity + +Return non-nil if contents of @var{entity} has been already +code-converted. +@end defun + + + +@node Entity-header, entity formatting, Entity Attributes, Entity +@section Information of entity header + +@defun mime-fetch-field field-name &optional entity + +Return field-body of @var{field-name} field in header of +@var{entity}.@refill + +The results is network representation.@refill + +If @var{entity} is omitted, @code{mime-message-structure} is used as +default value.@refill + +If @var{field-name} field is not found, this function returns +@code{nil}. +@end defun + + +@defun mime-read-field field-name &optional entity + +Parse @var{field-name} field in header of @var{entity}, and return the +result.@refill + +Format of result is depended on kind of field. For non-structured +field, this function returns string. For structured field, it returns +list corresponding with structure of the field.@refill + +Strings in the result will be converted to internal representation of +Emacs.@refill + +If @var{entity} is omitted, @code{mime-message-structure} is used as +default value.@refill + +If @var{field-name} field is not found, this function returns +@code{nil}. +@end defun + + + +@node entity formatting, Entity-content, Entity-header, Entity +@section Text presentation of entity + +@defun mime-insert-header entity &optional invisible-fields visible-fields + +Insert before point a decoded contents of header of @var{entity}.@refill + +@var{invisible-fields} is list of regexps to match field-name to hide. +@var{visible-fields} is list of regexps to match field-name to +hide.@refill + +If a field-name is matched with some elements of @var{invisible-fields} +and matched with none of @var{visible-fields}, this function don't +insert the field.@refill + +Each encoded-word (@ref{encoded-word}) in the header is decoded. ``Raw +non us-ascii characters'' are also decoded as +@code{default-mime-charset}. +@end defun + + +@defun mime-insert-text-content entity + +Insert before point a contents of @var{entity} as text entity.@refill + +Contents of the @var{entity} are decoded as MIME charset (@ref{MIME charset}). If the @var{entity} does not have charset parameter of +Content-Type field, @code{default-mime-charset} is used as default +value. +@end defun + + +@defvar default-mime-charset + +Symbol to indicate default value of MIME charset (@ref{MIME charset}).@refill + +It is used when MIME charset is not specified.@refill + +It is originally variable of APEL. +@end defvar + + + +@node Entity-content, Entity-network-representation, entity formatting, Entity +@section Contents of Entity + +@defun mime-entity-content entity + +Return content of @var{entity} as byte sequence. +@end defun + + +@defun mime-insert-entity-content entity + +Insert content of @var{entity} at point. +@end defun + + +@defun mime-write-entity-content entity filename + +Write content of @var{entity} into @var{filename}. +@end defun + + + +@node Entity-network-representation, Entity buffer, Entity-content, Entity +@section Network representation of Entity + +@defun mime-insert-entity entity + +Insert header and body of @var{entity} at point. +@end defun + + +@defun mime-write-entity entity filename + +Write representation of @var{entity} into @var{filename}. +@end defun + + +@defun mime-write-entity-body entity filename + +Write body of @var{entity} into @var{filename}. +@end defun + + + +@node Entity buffer, mm-backend, Entity-network-representation, Entity +@section Entity as buffer representation + +@defun mime-entity-buffer entity + +Return buffer, which contains @var{entity}. +@end defun + + +@defun mime-entity-point-min entity + +Return the start point of @var{entity} in the buffer which contains +@var{entity}. +@end defun + + +@defun mime-entity-point-max entity + +Return the end point of @var{entity} in the buffer which contains +@var{entity}. +@end defun + + +@defun mime-entity-header-start entity + +Return the start point of header of @var{entity} in the buffer which +contains @var{entity}. +@end defun + + +@defun mime-entity-header-end entity + +Return the end point of header of @var{entity} in the buffer which +contains @var{entity}. +@end defun + + +@defun mime-entity-body-start entity + +Return the start point of body of @var{entity} in the buffer which +contains @var{entity}. +@end defun + + +@defun mime-entity-body-end entity + +Return the end point of body of @var{entity} in the buffer which +contains @var{entity}. +@end defun + + + +@node mm-backend, , Entity buffer, Entity +@section Entity representations and implementations +@cindex mm-backend +@cindex entity processing method +@cindex representation-type + +Entity is an abstraction. It is designed to use various data +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 + +Functions about entity are implemented by request processing to the +entity. Each entity knows its representation-type. Each entity calls +processing function corresponding with the representation-type. Such +kind of function is called @strong{entity processing method}. A module, +consists of them corresponding with a representation-type, is called +@strong{mm-backend}.@refill + +Module name of each mm-backend consists of the prefix @code{mm} +and its representation-type. The module is required automatically +when its entity is created at first. + + +@menu +* Request for entity:: Message-passing for entity +* mm-backend module:: Definition of mm-backend +@end menu + +@node Request for entity, mm-backend module, mm-backend, mm-backend +@subsection Message-passing for entity + +@defun mime-entity-send entity message &rest args + +Send @var{message} to @var{entity} with @var{args}, and return the +result.@refill + +@var{args} is arguments of the @var{message}. +@end defun + + + +@node mm-backend module, , Request for entity, mm-backend +@subsection Definition of mm-backend + +@defmac mm-define-backend type &optional parents + +Define @var{type} as a mm-backend.@refill + +If @var{PARENTS} is specified, @var{type} inherits parents. Each parent +must be representation-type.@refill + +Example:@refill + +@lisp +(mm-define-backend chao (generic)) +@end lisp +@end defmac + + +@defmac mm-define-method name args &rest body + +Define @var{name} as a method function of (nth 1 (car @var{args})) +backend.@refill + +@var{args} is like an argument list of lambda, but (car @var{args}) must +be specialized parameter. (car (car @var{args})) is name of variable +and (nth 1 (car @var{args})) is name of backend +(representation-type).@refill + +Example:@refill + +@lisp +(mm-define-method entity-cooked-p ((entity chao)) nil) +@end lisp +@end defmac + + + +@node Content-Type, Content-Disposition, Entity, Top +@chapter Information of Content-Type field +@cindex mime-content-type +@cindex Content-Type field + +@strong{Content-Type field} is a field to indicate kind of contents or +data format, such as media-type (@ref{media-type}) and MIME charset. It +is defined in RFC 2045 (@ref{RFC 2045}). + +@noindent +@strong{[Memo]} +@quotation + +Historically, Content-Type field was proposed in RFC 1049. In it, +Content-Type did not distinguish type and subtype, and there are no +mechanism to represent kind of character code like MIME charset. +@end quotation + + +FLIM provides parser for Content-Type field and structure +@strong{mime-content-type} to store information of +Content-Type field. + + +@menu +* Content-Type field:: Format of Content-Type field +* mime-content-type:: mime-content-type structure +* Content-Type parser:: Parser +* Content-Type utility:: Utility functions +@end menu + +@node Content-Type field, mime-content-type, Content-Type, Content-Type +@section Format of Content-Type field +@cindex parameter +@cindex subtype +@cindex type + +Format of Content-Type field is defined as follows: + +@quotation +``Content-Type'' ``:'' @strong{type} ``/'' +@strong{subtype} *( ``;'' @strong{parameter} ) +@end quotation + +For example: + +@quotation +@example +Content-Type: image/jpeg +@end example +@end quotation + + +@quotation +@example +Content-Type: text/plain; charset=iso-2022-jp +@end example +@end quotation + +`type' and `subtype' indicate format of an entity. In this document, +pair of them is called `media-type'. `image/jpeg' or `text/plain' is +a media-type. + +@noindent +@strong{[Memo]} +@quotation + +If an entity does not have Content-Type field, it is regarded as +following: + +@quotation +@example +Content-Type: text/plain; charset=us-ascii +@end example +@end quotation + +@noindent +(cf. @ref{us-ascii}) +@end quotation + + + +@node mime-content-type, Content-Type parser, Content-Type field, Content-Type +@section mime-content-type structure + +@deffn{Structure} mime-content-type + +Structure to store information of a Content-Type field.@refill + +Applications should use reference functions +@code{mime-content-type-SLOT} to refer information of the +structure.@refill + +Slots of the structure are following: + +@table @var +@item primary-type +primary type of media-type (symbol). + +@item subtype +subtype of media-type (symbol). + +@item parameters +parameters of Content-Type field (association-list). + +@end table +@end deffn + + +@defun make-mime-content-type type subtype + &optional parameters + +Constructor of content-type. +@end defun + + +@defun mime-content-type-parameter content-type parameter + +Return value of @var{parameter} of @var{content-type}. +@end defun + + + +@node Content-Type parser, Content-Type utility, mime-content-type, Content-Type +@section Parser + +@defun mime-parse-Content-Type string + +Parse @var{string} as a field-body of Content-Type field, and return the +result as mime-content-type (@ref{mime-content-type}) structure. +@end defun + + +@defun mime-read-Content-Type + +Parse Content-Type field of the current buffer, and return the result as +mime-content-type (@ref{mime-content-type}) structure.@refill + +Return @code{nil} if Content-Type field is not found. +@end defun + + + +@node Content-Type utility, , Content-Type parser, Content-Type +@section Utility functions + +@defun mime-type/subtype-string type &optional subtype + +Return type/subtype string from @var{type} and @var{subtype}. +@end defun + + + +@node Content-Disposition, Content-Transfer-Encoding, Content-Type, Top +@chapter Information of Content-Disposition field +@cindex mime-content-disposition +@cindex RFC 2183 +@cindex Standards Track +@cindex Content-Disposition field + +@strong{Content-Disposition field} is an optional field to +specify presentation of an entity or attributes of an entity, such as +file name. + + +@noindent +[RFC 2183] +@quotation +S. Dorner, K. Moore and R. Troost, ``Communicating Presentation +Information in Internet Messages: The Content-Disposition Header'', +August 1997, Standards Track. +@end quotation + +FLIM provides parser for Content-Disposition field and structure +@strong{mime-content-disposition} to store information of +Content-Disposition field. + + +@menu +* mime-content-disposition:: mime-content-disposition structure +* Content-Disposition parser:: Parser for Content-Disposition field +@end menu + +@node mime-content-disposition, Content-Disposition parser, Content-Disposition, Content-Disposition +@section mime-content-disposition structure + +@deffn{Structure} mime-content-disposition + +Structure to store information of a Content-Disposition field.@refill + +Applications should use reference functions +@code{mime-content-disposition-SLOT} to refer information of the +structure.@refill + +Slots of the structure are following: + +@table @var +@item disposition-type +disposition-type (symbol). + +@item parameters +parameters of Content-Disposition field +(association-list). + +@end table +@end deffn + + +@defun mime-content-disposition-parameter content-disposition parameter + +Return value of @var{parameter} of @var{content-disposition}. +@end defun + + +@defun mime-content-disposition-filename content-disposition + +Return filename of @var{content-disposition}. +@end defun + + + +@node Content-Disposition parser, , mime-content-disposition, Content-Disposition +@section Parser for Content-Disposition field + +@defun mime-parse-Content-Disposition string + +Parse @var{string} as field-body of Content-Disposition field, and +return the result as mime-content-disposition +(@ref{mime-content-disposition}) structure. +@end defun + + +@defun mime-read-Content-Disposition + +Parse Content-Disposition field of the current buffer, and return the +result as mime-content-disposition (@ref{mime-content-disposition}) +structure.@refill + +Return @code{nil} if Content-Disposition field is not found. +@end defun + + + +@node Content-Transfer-Encoding, encoded-word, Content-Disposition, Top +@chapter Encoding Method +@cindex Content-Transfer-Encoding field + +@strong{Content-Transfer-Encoding field} is a header field to indicate +body encoding of a entity.@refill + +FLIM provides parser functions for Content-Transfer-Encoding field. +They represent information of Content-Transfer-Encoding field as +string.@refill + +In addition, FLIM provides encoder/decoder functions by +Content-Transfer-Encoding. + + +@menu +* Content-Transfer-Encoding parser:: Parser +* encoder/decoder:: 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 Parser + +@defun mime-parse-Content-Transfer-Encoding string + +Parse @var{string} as a field-body of Content-Transfer-Encoding field, +and return the result. +@end defun + + +@defun mime-read-Content-Transfer-Encoding &optional default-encoding + +Parse Content-Transfer-Encoding field of the current buffer, and return +the result.@refill + +Return @var{default-encoding} if Content-Transfer-Encoding field is not +found. If it is not specified, @code{nil} is used as the default value. +@end defun + + + +@node encoder/decoder, Encoding information, Content-Transfer-Encoding parser, Content-Transfer-Encoding +@section Encoder/decoder + +@defun mime-encode-region start end encoding + +Encode region @var{start} to @var{end} of current buffer using +@var{encoding}. +@end defun + + +@defun mime-decode-region start end encoding + +Decode region @var{start} to @var{end} of current buffer using +@var{encoding}. +@end defun + + + +@defun mime-decode-string string encoding + +Decode @var{string} which is encoded in @var{encoding}, and return the +result. +@end defun + + + +@defun mime-insert-encoded-file filename encoding + +Insert file @var{FILENAME} encoded by @var{ENCODING} format. +@end defun + + +@defun mime-write-decoded-region start end filename encoding + +Decode and write current region encoded by @var{encoding} into +@var{filename}.@refill + +@var{start} and @var{end} are buffer positions. +@end defun + + + +@node Encoding information, mel-backend, encoder/decoder, Content-Transfer-Encoding +@section Other utilities + +@defun mime-encoding-list &optional SERVICE + +Return list of Content-Transfer-Encoding.@refill + +If @var{service} is specified, it returns available list of +Content-Transfer-Encoding for it. +@end defun + + +@defun mime-encoding-alist &optional SERVICE + +Return table of Content-Transfer-Encoding for completion.@refill + +If @var{service} is specified, it returns available list of +Content-Transfer-Encoding for it. +@end defun + + + +@node mel-backend, generic function for mel-backend, Encoding information, Content-Transfer-Encoding +@section How to write encoder/decoder module + +@defmac mel-define-method name args &rest body + +Define @var{name} as a method function of (nth 1 (car (last +@var{args}))) backend.@refill + +@var{args} is like an argument list of lambda, but (car (last +@var{args})) must be specialized parameter. (car (car (last +@var{args}))) is name of variable and (nth 1 (car (last @var{args}))) is +name of backend (encoding).@refill + +Example:@refill + +@lisp +(mel-define-method mime-write-decoded-region (start end filename + (nil "base64")) + "Decode and write current region encoded by base64 into FILENAME. +START and END are buffer positions." + (interactive + (list (region-beginning) (region-end) + (read-file-name "Write decoded region to file: "))) + (let ((str (buffer-substring start end))) + (with-temp-buffer + (insert (decode-base64-string str)) + (write-region-as-binary (point-min) (point-max) filename) + ))) +@end lisp +@end defmac + + +@defmac mel-define-method-function spec function + +Set @var{spec}'s function definition to @var{function}.@refill + +First element of @var{spec} is service.@refill + +Rest of @var{args} is like an argument list of lambda, but (car (last +@var{args})) must be specialized parameter. (car (car (last +@var{args}))) is name of variable and (nth 1 (car (last @var{args}))) is +name of backend (encoding).@refill + +Example:@refill + +@lisp +(mel-define-method-function (mime-encode-string string (nil "base64")) + 'encode-base64-string) +@end lisp +@end defmac + + + +@node generic function for mel-backend, , mel-backend, Content-Transfer-Encoding +@section How to add encoding/decoding service + +@defmac mel-define-service name &optional args doc-string + +Define @var{name} as a service for Content-Transfer-Encodings.@refill + +If @var{args} is specified, @var{name} is defined as a generic function +for the service.@refill + +Example:@refill + +@lisp +(mel-define-service encoded-text-encode-string (string encoding) + "Encode STRING as encoded-text using ENCODING. +ENCODING must be string.") +@end lisp +@end defmac + + + +@node encoded-word, custom, Content-Transfer-Encoding, Top +@chapter Network representation of header +@cindex RFC 2047 +@cindex Standards Track +@cindex encoded-word +@cindex RFC 2047 + +@strong{RFC 2047} defines the @strong{encoded-word} which is a format to +represent non-ASCII (@ref{ASCII}) characters in a header.@refill + + +@noindent +[RFC 2047] +@quotation +K. Moore, ``MIME (Multipurpose Internet Mail Extensions) Part Three: +Message Header Extensions for Non-ASCII Text'', November 1996, Standards +Track (obsolete RFC 1521,1522,1590). +@end quotation + +The encoded-word is the only valid format to represent non-ASCII +(@ref{ASCII}) characters in a header, but there are also invalid styles. +Such kinds of evil messages represent non-ASCII (@ref{ASCII}) characters +in headers without encoded-words (it is called "raw" non-ASCII +(@ref{ASCII}) characters).@refill + +FLIM provides encoding/decoding features of both encoded-word and +invalid "raw" non-ASCII (@ref{ASCII}) characters. + + +@menu +* Header encoder/decoder:: Header encoding/decoding +@end menu + +@node Header encoder/decoder, , encoded-word, encoded-word +@section Header encoding/decoding + +@defun eword-decode-header &optional code-conversion separator + +Decode MIME encoded-words in header fields.@refill + +If @var{code-conversion} is @code{nil}, only encoded-words are decoded. +If @var{code-conversion} is a MIME charset (@ref{MIME charset}), +non-ASCII bit patterns are decoded as the MIME charset. Otherwise +non-ASCII bit patterns are decoded as the +@code{default-mime-charset}. (cf. @ref{entity formatting}) @refill + +If @var{separator} is not @code{nil}, it is used as header separator. +@end defun + + +@defun eword-encode-header &optional code-conversion + +Encode header fields to network representation, such as MIME +encoded-word.@refill + +Each field is encoded as corresponding method specified by variable +@code{mime-field-encoding-method-alist}. +@end defun + + +@defvar mime-field-encoding-method-alist + +Association list to specify field encoding method. Each element looks +like (FIELD . METHOD).@refill + +If METHOD is @code{mime}, the FIELD will be encoded into MIME format +(encoded-word).@refill + +If METHOD is @code{nil}, the FIELD will not be encoded.@refill + +If METHOD is a MIME charset, the FIELD will be encoded as the charset +when it must be convert into network-code.@refill + +Otherwise the FIELD will be encoded as variable +@code{default-mime-charset} when it must be convert into network-code. +@end defvar + + + +@node custom, Appendix, encoded-word, Top +@chapter Various Customization + +@deffn{group} mime + +The group associated with functions related to MIME.@refill + +It belongs to @code{mail} and @code{news}. +@end deffn + + +@node Appendix, Concept Index, custom, Top +@chapter Appendix + + +@menu +* Glossary:: +* Bug report:: How to report bugs +* CVS:: CVS based development +* History:: History of FLIM +@end menu + +@node Glossary, Bug report, Appendix, Appendix +@section Glossary + + +@menu +* 7bit:: +* 8bit:: +* ASCII:: +* Base64:: +* binary:: +* coded character set:: Coded character set, Character code +* media-type:: +* message:: +* MIME:: +* MIME charset:: +* MTA:: +* MUA:: +* Quoted-Printable:: +* RFC 822:: +* RFC 1036:: +* RFC 2045:: +* RFC 2046:: +* RFC 2048:: +* RFC 2049:: +* plain text:: +* us-ascii:: +@end menu + +@node 7bit, 8bit, Glossary, Glossary +@subsection 7bit +@cindex 7bit (textual) string +@cindex 7bit data +@cindex 7bit + +@strong{7bit} means any integer between 0 .. 127.@refill + +Any data represented by 7bit integers is called @strong{7bit data}.@refill + +Textual string consisted of Control characters between 0 .. 31 and 127, +and space represented by 32, and graphic characters between 33 .. 236 +are called @strong{7bit (textual) string}.@refill + +Conventional Internet MTA (@ref{MTA}) can translate 7bit data, so it is +no need to translate by Quoted-Printable (@ref{Quoted-Printable}) or +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 +``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. + + +@node 8bit, ASCII, 7bit, Glossary +@subsection 8bit +@cindex 8bit (textual) string +@cindex 8bit data +@cindex 8bit + +@strong{8bit} means any integer between 0 .. 255.@refill + +Any data represented by 8bit integers is called @strong{8bit data}.@refill + +Textual string consisted of Control characters between 0 .. 31, 127, and +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 +coded-character-set represented by 8bit textual string.@refill + +Traditional Internet MTA (@ref{MTA}) can translate only 7bit +(@ref{7bit}) data, so if a 8bit data will be translated such MTA, it +must be encoded by Quoted-Printable (@ref{Quoted-Printable}) or Base64 +(@ref{Base64}).@refill + +However 8bit MTA are increasing today.@refill + +However if there are too long lines, it can not translate by 8bit MTA +even if it is 8bit data. RFC 2045 (@ref{RFC 2045}) require lines in +8bit data must be less than 998 bytes. So if a ``8bit data'' has a line +more than 999 bytes, it is regarded as binary (@ref{binary}), so it must +be encoded by Base64 or Quoted-Printable. + + +@node ASCII, Base64, 8bit, Glossary +@subsection ASCII +@cindex ANSI X3.4:1986 +@cindex ASCII +@cindex ASCII + +@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}). + + +@noindent +[ASCII] +@quotation +``Coded Character Set -- 7-Bit American Standard Code for Information +Interchange'', ANSI X3.4:1986. +@end quotation + + + +@node Base64, binary, ASCII, Glossary +@subsection Base64 +@cindex pad +@cindex Base64 + +@strong{Base64} is a transfer encoding method of MIME (@ref{MIME}) +defined in RFC 2045 (@ref{RFC 2045}).@refill + +The encoding process represents 24-bit groups of input bits as output +strings of 4 encoded characters. Encoded characters represent integer 0 +.. 63 or @strong{pad}. Base64 data must be 4 * n bytes, so pad is used +to adjust size.@refill + +These 65 characters are subset of all versions of ISO 646, including +US-ASCII, and all versions of EBCDIC. So it is safe even if it is +translated by non-Internet gateways. + + +@node binary, coded character set, Base64, Glossary +@subsection binary +@cindex binary + +Any byte stream is called @strong{binary}.@refill + +It does not require structureof lines. It differs from from 8bit +(@ref{8bit}).@refill + +In addition, if line structured data contain too long line (more than +998 bytes), it is regarded as binary. + + +@node coded character set, media-type, binary, Glossary +@subsection Coded character set, Character code + +A set of unambiguous rules that establishes a character set and the +one-to-one relationship between the characters of the set and their +bit combinations. + + +@node media-type, message, coded character set, Glossary +@subsection media-type +@cindex x-token +@cindex message +@cindex multipart +@cindex application +@cindex video +@cindex audio +@cindex image +@cindex text +@cindex subtype +@cindex type +@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 +@strong{subtype}. It is defined in RFC 2046 (@ref{RFC 2046}).@refill + +Currently there are following standard primary-types: + +@itemize @bullet +@item +@strong{text} +@item +@strong{image} +@item +@strong{audio} +@item +@strong{video} +@item +@strong{application} +@item +@strong{multipart} (@ref{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 + +You can refer registered media types at MEDIA TYPES +(ftp://ftp.isi.edu/in-notes/iana/assignments/media-types).@refill + +In addition, you can use private type or subtype using @strong{x-token}, +which as the prefix `x-'. However you can not use them in +public.@refill + +(cf. @ref{Content-Type field}) + + + +@node message, MIME, media-type, Glossary +@subsection message + +In this document, it means mail defined in RFC 822 (@ref{RFC 822}) and +news message defined in RFC 1036 (@ref{RFC 1036}). + + +@node MIME, MIME charset, message, Glossary +@subsection MIME +@cindex Multipurpose Internet Mail Extensions + +MIME stands for @strong{Multipurpose Internet Mail Extensions}, it is an +extension for RFC 822 (@ref{RFC 822}).@refill + +According to RFC 2045:@refill + +STD 11, RFC 822, defines a message representation protocol specifying +considerable detail about US-ASCII message headers, and leaves the +message content, or message body, as flat US-ASCII text. This set of +documents, collectively called the Multipurpose Internet Mail +Extensions, or MIME, redefines the format of messages to allow for + +@enumerate +@item +textual message bodies in character sets other than US-ASCII, +@item +an extensible set of different formats for non-textual message +bodies, +@item +multi-part message bodies, and +@item +textual header information in character sets other than US-ASCII. +@end enumerate + + +It is defined in RFC 2045 (@ref{RFC 2045}), RFC 2046 (@ref{RFC 2046}), +RFC 2047 (@ref{encoded-word}), RFC 2048 (@ref{RFC 2048}) and RFC 2049 +(@ref{RFC 2049}). + + +@node MIME charset, MTA, MIME, Glossary +@subsection MIME charset + +Coded character set (@ref{coded character set}) used in Content-Type +field (@ref{Content-Type field}) or charset parameter of encoded-word +(@ref{encoded-word}).@refill + +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 +it. (In this document, MIME charsets are written by small letters to +distinguish graphic character set (@ref{graphic character set}). For +example, ISO 8859-1 is a graphic character set, and iso-8859-1 is a MIME +charset) + + +@node MTA, MUA, MIME charset, Glossary +@subsection MTA +@cindex Message Transfer Agent + +@strong{Message Transfer Agent}. It means mail transfer programs +(ex. sendmail) and news servers.@refill + +(cf. @ref{MUA}) + + + +@node MUA, Quoted-Printable, MTA, Glossary +@subsection MUA +@cindex Message User Agent + +@strong{Message User Agent}. It means mail readers and news +readers.@refill + +(cf. @ref{MTA}) + + + +@node Quoted-Printable, RFC 822, MUA, Glossary +@subsection Quoted-Printable +@cindex Quoted-Printable + +@strong{Quoted-Printable} is a transfer encoding method of MIME +(@ref{MIME}) defined in RFC 2045 (@ref{RFC 2045}).@refill + +If the data being encoded are mostly US-ASCII text, the encoded form of +the data remains largely recognizable by humans.@refill + +(cf. @ref{Base64}) + + + +@node RFC 822, RFC 1036, Quoted-Printable, Glossary +@subsection RFC 822 +@cindex RFC 822 +@cindex STD 11 +@cindex Internet mail +@cindex Internet message +@cindex message header + +A RFC defines format of Internet mail message, mainly @strong{message header}. + +@noindent +@strong{[Memo]} +@quotation + +news message is based on RFC 822, so @strong{Internet message} may be +more suitable than @strong{Internet mail} . +@end quotation + + + +@noindent +[RFC 822] +@quotation +D. Crocker, ``Standard for the Format of ARPA Internet Text Messages'', +August 1982, STD 11. +@end quotation + + + +@node RFC 1036, RFC 2045, RFC 822, Glossary +@subsection RFC 1036 +@cindex RFC 1036 +@cindex USENET + +A RFC defines format of USENET message. It is a subset of RFC 822 +(@ref{RFC 822}). It is not Internet standard, but a lot of netnews +excepting Usenet uses it. + + +@noindent +[USENET: RFC 1036] +@quotation +M. Horton and R. Adams, ``Standard for Interchange of USENET Messages'', +December 1987, (obsolete RFC 850). +@end quotation + + + +@node RFC 2045, RFC 2046, RFC 1036, Glossary +@subsection RFC 2045 +@cindex RFC 2045 +@cindex Standards Track + + +@noindent +[RFC 2045] +@quotation +N. Freed and N. Borenstein, ``Multipurpose Internet Mail Extensions +(MIME) Part One: Format of Internet Message Bodies'', November 1996, +Standards Track (obsolete RFC 1521, 1522, 1590). +@end quotation + + + +@node RFC 2046, RFC 2048, RFC 2045, Glossary +@subsection RFC 2046 +@cindex RFC 2046 +@cindex Standards Track + + +@noindent +[RFC 2046] +@quotation +N. Freed and N. Borenstein, ``Multipurpose Internet Mail Extensions +(MIME) Part Two: Media Types'', November 1996, Standards Track (obsolete +RFC 1521, 1522, 1590). +@end quotation + + + +@node RFC 2048, RFC 2049, RFC 2046, Glossary +@subsection RFC 2048 +@cindex RFC 2048 +@cindex Standards Track + + +@noindent +[RFC 2048] +@quotation +N. Freed, J. Klensin and J. Postel, ``Multipurpose Internet Mail +Extensions (MIME) Part Four: Registration Procedures'', November 1996, +Standards Track (obsolete RFC 1521, 1522, 1590). +@end quotation + + + +@node RFC 2049, plain text, RFC 2048, Glossary +@subsection RFC 2049 +@cindex RFC 2049 +@cindex Standards Track + + +@noindent +[RFC 2049] +@quotation +N. Freed and N. Borenstein, ``Multipurpose Internet Mail Extensions +(MIME) Part Five: Conformance Criteria and Examples'', November 1996, +Standards Track (obsolete RFC 1521, 1522, 1590). +@end quotation + + + +@node plain text, us-ascii, RFC 2049, Glossary +@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}) + + + +@node us-ascii, , plain text, Glossary +@subsection us-ascii +@cindex ASCII +@cindex us-ascii + +A MIME charset (@ref{MIME charset}) for primary Latin script mainly +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 + +It is standard coded character set of Internet mail. If MIME charset is +not specified, @strong{us-ascii} is used as default.@refill + +In addition, @strong{ASCII} of RFC 822 (@ref{RFC 822}) should be +interpreted as us-ascii. + + +@node Bug report, CVS, 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: + +@itemize @bullet +@item + English <emacs-mime-en@@m17n.org> +@item + Japanese <emacs-mime-ja@@m17n.org> +@end itemize + + +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 + +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 + +Files in FLIM are managed under CVS. Therefore you can obtain the +newest FLIM by the following method. + +@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 +@end example + + +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. + + +@node History, , CVS, 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 + +$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 + + +@node Concept Index, Function Index, Appendix, Top +@chapter Concept Index + +@printindex cp + +@node Function Index, Variable Index, Concept Index, Top +@chapter Function Index + +@printindex fn + +@node Variable Index, , Function Index, Top +@chapter Variable Index + +@printindex vr +@bye diff --git a/flim-1.14.9/mime-ja.sgml b/flim-1.14.9/mime-ja.sgml new file mode 100644 index 0000000..2067e17 --- /dev/null +++ b/flim-1.14.9/mime-ja.sgml @@ -0,0 +1,1422 @@ +<!doctype sinfo system> +<head> +<title>FLIM 1.14 MIME $B5!G=@bL@=q(B +<author>$B<i2,(B $BCNI'(B <mail>morioka@jaist.ac.jp</mail> +<date>1999-01-27 + +<toc> +</head> + +<body> + +<abstract> +<p> +This file documents MIME features of FLIM, a fundamental library to +process Internet Messages for GNU Emacsen. +<p> +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 +</abstract> + + +<h1> FLIM $B$C$F2?!)(B +<node> Introduction +<p> +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 + + +<h1> FLIM $B$N(B MIME $B5!G=$N;H$$J}(B +<node> How to use +<p> +FLIM $B$NDs6!$9$k(B MIME $B5!G=$r;H$&$?$a$K$O(B + +<lisp> +(require 'mime) +</lisp> + +<noindent>$B$rI>2A$7$F$/$@$5$$!#(B + + +<h1> Message $B$H(B Entity +<node> Entity +<p> +<dref>RFC 2045</dref> $B$K$h$l$P!"!V(BEntity $B$H$$$&8l$O!"(Bmessage, $B$b$7$/$O!"(B +multipart 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 +<concept>entity</concept>$B$rMQ$$$k$3$H$K$7$^$9!#(B +<p> +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 +<p> +FLIM $B$O(B entity $B$N>pJs$rI=8=$9$k$?$a$K(B<concept>mime-entity</concept> $B9=(B +$BB$BN$rMQ$$$^$9!#0J2<$G$OC1$K(B mime-entity $B$H8F$V$3$H$K$7$^$9!#(B + + +<h2> Entity $B$N@8@.(B +<node> Entity creation +<p> +<defun name="mime-open-entity"> + <opts> type location +<p> +Entity $B$r3+$$$F!"$=$l$rJV$7$^$9!#(B +<p> +<var>type</var> $B$O(B representation-type $B$G$9!#(B <cf node="mm-backend"> +<p> +<var>location</var> $B$O(B entity $B$N0LCV$G$9!#;XDjJ}K!$O(B +representation-type $B$K0M$C$FJQ$o$j$^$9!#(B +</defun> + +<defun name="mime-parse-buffer"> + <opts> buffer type +<p> +<var>buffer</var> $B$r(B message $B$H$7$F9=J82r@O$7!"$=$N7k2L$N(B mime-entity +$B$r(B <var>buffer</var> $B$N(B<code>mime-message-structure</code> $B$K3JG<$9$k!#(B +<p> +<var>buffer</var> $B$,>JN,$5$l$?>l9g!"8=:_$N(B buffer $B$r9=J82r@O$9$k!#(B +<p> +<var>type</var> $B$,;XDj$5$l$?>l9g!"$=$NCM$r@8@.$5$l$k(B mime-entity $B$NI=(B +$B>]7?$H$7$FMQ$$$k!#>JN,$5$l$?>l9g$O(B <var>buffer</var> $B$H$J$k!#(B<cf +node="mm-backend"> +</defun> + + +<h2> Entity $B3,AX(B +<node> Entity hierarchy +<p> +MIME message $B$O(B entity $B$rC10L$H$9$kLZ9=B$$K$J$C$F$$$^$9!#(B +<p> +$B$3$NLZ$K$*$$$F:,$H$J$k@a$O(B message $BA4BN$rI=$9(B entity $B$G$9!#$3$3$G$O!"(B +$B$3$l$r(B <concept>root-entity</concept> $B$b$7$/$O(B +<concept>message</concept> $B$H8F$S$^$9!#(B +<p> +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$,(B +$B$G$-$^$9!#(B +<p> +$B0lJ}!"(Bentity $B$N(B message $B$K$*$1$k0LCV$r9M$($k$3$H$b$G$-$^$9!#(B +<p> +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 +<verb> + + $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 + +</verb> +<p> +<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 <concept>entity-number</concept> $B$H8F$S$^$9!#(Bentity-number $B$O(B S $B<0$H(B +$B$7$F$O(B <code>(1 2 3)</code> $B$N$h$&$J@0?t$N%j%9%H$H$7$FI=8=$5$l$^$9!#(B +<p> +mime-entity $B$G$O!"$3$l$HF1MM$N(B <concept>node-id</concept> $B$rMQ$$$^$9!#(B +node-id $B$O$A$g$&$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)</code> $B$G$9!#(B +<p> +$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</code> $B$K3JG<$9$k$3$H$K$7$^$9!#(B +<p> +<code>mime-message-structure</code> $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 + +<defvar name="mime-message-structure"> +<p> +$B8=:_$N(B buffer $B$K$*$1$k(B message $BA4BN$N(B mime-entity $B9=B$BN$r3JG<$9$k(B +buffer local $BJQ?t!#(B +</defvar> + +<defun name="mime-entity-children"> + <args> entity +<p> +<var>entity</var> $B$K4^$^$l$k(B entity $B$N(B list $B$rJV$9!#(B +</defun> + +<defun name="mime-entity-parent"> + <args> entity <opts> message +<p> +<var>entity</var> $B$N?F$N(B entity $B$rJV$9!#(B +<p> +<var>message</var> $B$,;XDj$5$l$?>l9g!"$3$l$r:,$H8+Jo$9!#(B +</defun> + +<defun name="mime-root-entity-p"> + <args> entity +<p> +<var>entity</var> $B$,:,!JB($A!"(Bmessage $BA4BN!K$G$"$k>l9g$K!"(B +$BHs(B-<code>nil</code> $B$rJV$9!#(B +</defun> + +<defun name="mime-entity-node-id"> + <args> entity +<p> +<var>entity</var> $B$N(B node-id $B$rJV$9!#(B +</defun> + +<defun name="mime-entity-number"> + <args> entity +<p> +<var>entity</var> $B$N(B entity-number $B$rJV$9!#(B +</defun> + + +<h2> Entity $B$N8!:w(B +<node> Entity Search +<p> +<defun name="mime-find-entity-from-number"> + <args> entity-number <opts> message +<p> +<var>message</var> $B$+$i!"(B<var>enity-number</var> $B$N(B entity $B$rJV$7$^$9!#(B +<p> +<var>message</var> $B$,;XDj$5$l$F$$$J$$>l9g$O!"(B +<code>mime-message-structrue</code> $B$,;H$o$l$^$9!#(B +</defun> + +<defun name="mime-find-entity-from-node-id"> + <args> entity-node-id <opts> message +<p> +<var>message</var> $B$+$i!"(B<var>entity-node-id</var> $B$N(B entity $B$rJV$7$^(B +$B$9!#(B +<p> +<var>message</var> $B$,;XDj$5$l$F$$$J$$>l9g$O!"(B +<code>mime-message-structure</code> $B$,;H$o$l$^$9!#(B +</defun> + +<defun name="mime-find-entity-from-content-id"> + <args> cid <opts> message +<p> +<var>message</var> $B$+$i!"(B<var>cid</var> $B$N(B entity $B$rJV$7$^$9!#(B +<p> +<var>message</var> $B$,;XDj$5$l$F$$$J$$>l9g$O!"(B +<code>mime-message-structure</code> $B$,;H$o$l$^$9!#(B +</defun> + + +<h2> Entity $B$NB0@-(B +<node> Entity Attributes +<p> +<defun name="mime-entity-content-type"> + <args> entity +<p> +<var>entity</var> $B$N(B content-type $B$rJV$9!#(B<cf +node="mime-content-type"> +</defun> + +<defun name="mime-entity-content-disposition"> + <args> entity +<p> +<var>entity</var> $B$N(B content-disposition $B$rJV$9!#(B<cf +node="mime-content-disposition"> +</defun> + +<defun name="mime-entity-filename"> + <args> entity +<p> +<var>entity</var> $B$N(B file $BL>$rJV$9!#(B +</defun> + +<defun name="mime-entity-encoding"> + <args> entity <opts> default-encoding +<p> +<var>entity</var> $B$N(B content-transfer-encoding $B$rJV$9!#(B<cf +node="Content-Transfer-Encoding"> +<p> +$B$b$7!"(B<var>entity</var> $B$K(B Content-Transfer-Encoding $BMs$,B8:_$7$J$$>l(B +$B9g$O!"(B<var>default-encoding</var> $B$rJV$9!#$3$l$,;XDj$5$l$J$$>l9g$O!"(B +<code>"7bit"</code> $B$rMQ$$$k!#(B +</defun> + +<defun name="mime-entity-cooked-p"> + <args> entity +<p> +<var>entity</var> $B$NFbMF$,4{$K%3!<%IJQ49$5$l$F$$$k>l9g$O(B nil $B$GL5$$CM(B +$B$rJV$9!#(B +</defun> + + +<h2> Entity header $B$N>pJs(B +<node> Entity-header +<p> +<defun name="mime-fetch-field"> + <args> field-name <opts> entity +<p> +<var>entity</var> $B$N(B header $BCf$N(B <var>field-name</var> $BMs$N(B body $B$rJV$9!#(B +<p> +$B7k2L$NJ8;zNs$O(B network $BI=8=$N$^$^$G$"$k!#(B +<p> +<var>entity</var> $B$,>JN,$5$l$?>l9g$O!"(B +<code>mime-message-structure</code> $B$NCM$rMQ$$$k!#(B +<p> +<var>field-name</var> $BMs$,B8:_$7$J$$>l9g$O(B <code>nil</code> $B$rJV$9!#(B +</defun> + +<defun name="mime-read-field"> + <args> field-name <opts> entity +<p> +<var>entity</var> $B$N(B header $BCf$N(B <var>field-name</var> $BMs$r9=J82r@O$7$?(B +$B7k2L$rJV$9!#(B +<p> +$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 +<p> +$B7k2LCf$NJ8;zNs$O(B Emacs $B$NFbItI=8=$KJQ49$5$l$k!#(B +<p> +<var>entity</var> $B$,>JN,$5$l$?>l9g$O!"(B +<code>mime-message-structure</code> $B$NCM$rMQ$$$k!#(B +<p> +<var>field-name</var> $BMs$,B8:_$7$J$$>l9g$O(B nil $B$rJV$9!#(B +</defun> + + +<h2> Entity $B$NJ8;zI=8=(B +<node> entity formatting +<p> +<defun name="mime-insert-header"> + <args> entity <opts> invisible-fields visible-fields +<p> +$B8=:_0LCV$K(B <var>entity</var> $B$NI|9f$7$?(B header $B$rA^F~$9$k!#(B +<p> +<var>invisible-fields</var> $B$H(B <var>visible-fields</var> $B$O@55,I=8=$N(B +list $B$G!"$=$l$>$l!"I=<($7$?$/$J$$(B field $BL>$HI=<($7$?$$MsL>$rI=8=$7$?$b$N(B +$B$G$"$k!#(B +<p> +<var>invisible-fields</var> $B$NMWAG$N$I$l$+$K(B match $B$7!"$+$D!"(B +<var>visible-fields</var> $B$NMWAG$N$I$l$K$b(B match $B$7$J$$Ms$OI=<($5$l$J(B +$B$$!#(B +<p> +<dref>encoded-word</dref> $B$OI|9f$5$l$k!#!X@8$NHs(B us-ascii $BJ8;z!Y$O(B +<code>default-mime-charset</code> $B$H$7$F2r<a$5$l$k!#(B +</defun> + +<defun name="mime-insert-text-content"> + <args> entity +<p> +point $B$NA0$K(B <var>entity</var> $B$r(B text entity $B$H$7$FA^F~$7$^$9!#(B +<p> +<var>entity</var> $B$NFbMF$O(B <dref>MIME charset</dref> $B$H$7$FI|9f2=$5$l(B +$B$^$9!#(B<var>entity</var> $B$N(B Content-Type field $B$K(B charset paramter $B$,L5(B +$B$$$H!"(B<code>default-mime-charset</code> $B$,=i4|CM$H$7$F;H$o$l$^$9!#(B +</defun> + +<defvar name="default-mime-charset"> +<p> +$BE,@Z$J(B <dref>MIME charset</dref> $B$,8+$D$+$i$J$+$C$?>l9g$KMQ$$$i$l$k(B +MIME charset. +<p> +$BK\Mh$O(B APEL $B$NJQ?t$G$"$k!#(B +</defvar> + + +<h2> Entity $B$NFbMF(B +<node> Entity-content +<p> +<defun name="mime-entity-content"> + <args> entity +<p> +<var>entity</var> $B$NFbMF$N(B byte $BNs$rJV$9!#(B +</defun> + +<defun name="mime-insert-entity-content"> + <args> entity +<p> +point $B$N0LCV$K(B <var>entity</var> $B$NFbMF$rA^F~$7$^$9!#(B +</defun> + +<defun name="mime-write-entity-content"> + <args> entity filename +<p> +<var>entity</var> $B$NFbMF$r(B <var>filename</var> $B$K=q$-9~$_$^$9!#(B +</defun> + + +<h2> Entity $B$N%M%C%H%o!<%/I=8=(B +<node> Entity-network-representation +<p> +<defun name="mime-insert-entity"> + <args> entity +<p> +<var>entity</var> $B$N(B header $B$H(B body $B$r(B point $B$N$H$3$m$KA^F~$7$^$9!#(B +</defun> + +<defun name="mime-write-entity"> + <args> entity filename +<p> +<var>entity</var> $B$NI=8=$r(B <var>filename</var> $B$K=q$-9~$_$^$9!#(B +</defun> + +<defun name="mime-write-entity-body"> + <args> entity filename +<p> +<var>entity</var> $B$N(B body $B$r(B <var>filename</var> $B$K=q$-9~$_$^$9!#(B +</defun> + + +<h2> Entity $B$N(B buffer $B$K$h$kI=8=(B +<node> Entity buffer +<p> +<defun name="mime-entity-buffer"> + <args> entity +<p> +<var>entity</var> $B$,B8:_$9$k(B buffer $B$rJV$9!#(B +</defun> + +<defun name="mime-entity-point-min"> + <args> entity +<p> +<var>entity</var> $B$,B8:_$9$k(B buffer $B$K$*$1$k!"(B<var>entity</var> $B$,@j$a$k(B +$BNN0h$N@hF,0LCV$rJV$9!#(B +</defun> + +<defun name="mime-entity-point-max"> + <args> entity +<p> +<var>entity</var> $B$,B8:_$9$k(B buffer $B$K$*$1$k!"(B<var>entity</var> $B$,@j$a$k(B +$BNN0h$NKvHx0LCV$rJV$9!#(B +</defun> + +<defun name="mime-entity-header-start"> + <args> entity +<p> +<var>entity</var> $B$,B8:_$9$k(B buffer $B$K$*$1$k!"(Bheader $B$,@j$a$kNN0h$N@hF,(B +$B0LCV$rJV$9!#(B +</defun> + +<defun name="mime-entity-header-end"> + <args> entity +<p> +<var>entity</var> $B$,B8:_$9$k(B buffer $B$K$*$1$k!"(Bheader $B$,@j$a$kNN0h$NKvHx(B +$B0LCV$rJV$9!#(B +</defun> + +<defun name="mime-entity-body-start"> + <args> entity +<p> +<var>entity</var> $B$,B8:_$9$k(B buffer $B$K$*$1$k!"(Bbody $B$,@j$a$kNN0h$N@hF,0L(B +$BCV$rJV$9!#(B +</defun> + +<defun name="mime-entity-body-end"> + <args> entity +<p> +<var>entity</var> $B$,B8:_$9$k(B buffer $B$K$*$1$k!"(Bbody $B$,@j$a$kNN0h$NKvHx0L(B +$BCV$rJV$9!#(B +</defun> + + +<h2> Entity $B$NI=8=$H<B8=(B +<node> mm-backend +<p> +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 +<p> +$B$3$3$G!"(Bentity $B$,$I$&$$$&<oN`$NI=8=$r9T$C$F$$$k$+$r<($9$N$,(B +<concept>representation-type</concept> $B$G!"(Bentity $B$r@8@.$9$k;~$K$O$3$l$r(B +$B;XDj$7$^$9!#(B<cf node="Entity Creation"> +<p> +$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:](B +$B$N=hM}$r9T$&4X?t$r8F$S=P$7$^$9!#$3$N$h$&$J4X?t$r(B <concept>entity $B=hM}(B +method</concept> $B$H8F$S$^$9!#$^$?!"(Brepresentation-type $BKh$K$3$N$h$&$J4X(B +$B?t$r$^$H$a$?$b$N$r(B <concept>mm-backend</concept> $B$H8F$S$^$9!#(B +<p> +mm-backend $B$O(B representation-type $B$NL>A0$N@hF,$K(B <code>mm</code> $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</code> $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 + + +<h3> Entity $B$X$NJX$j(B +<node> Request for entity +<p> +<defun name="mime-entity-send"> + <args> entity message <rest> args +<p> +<var>entity</var> $B$K(B <var>message</var> $B$rAw$k!#(B +<p> +<var>args</var> $B$O(B <var>message</var> $B$N0z?t$G$"$k!#(B +</defun> + + +<h3> mm-backend $B$N:n$jJ}(B +<node> mm-backend module +<p> +<defmacro name="mm-define-backend"> +<args> type +<opts> parents +<p> +<var>type</var> $B$r(B mm-backend $B$H$7$FDj5A$7$^$9!#(B +<p> +<var>PARENTS</var> $B$,;XDj$5$l$F$$$k>l9g$O!"(B<var>type</var> $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 +<p> +$BNc(B: +<p> +<lisp> +(mm-define-backend chao (generic)) +</lisp> +</defmacro> + +<defmacro name="mm-define-method"> +<args> name args <rest> body +<p> +<var>name</var> $B$r(B (nth 1 (car <var>args</var>)) backend $B$N(B method $B4X(B +$B?t$H$7$FDj5A$7$^$9!#(B +<p> +<var>args</var> $B$O(B lambda $B$N0z?t%j%9%H$N$h$&$J$b$N$G$9$,!"(B(car +<var>args</var>) $B$O;XDj$5$l$?(B parameter $B$G$"$kI,MW$,$"$j$^$9!#(B(car +(car <var>args</var>)) $B$OJQ?t$NL>A0$G!"(B(nth 1 (car <var>args</var>)) +$B$O(B backend $B$NL>A0(B (representation-type) $B$G$9!#(B +<p> +$BNc(B: +<p> +<lisp> +(mm-define-method entity-cooked-p ((entity chao)) nil) +</lisp> +</defmacro> + + +<h1> Content-Type $BMs$N>pJs(B +<node> Content-Type +<p> +<concept>Content-Type $BMs(B</concept> $B$O(B <dref>media-type</dref> $B$d(B MIME +charset $B$H$$$C$?(B <dref>entity</dref> $B$NFbMF$N<oN`$dI=8=7A<0$J$I$r5-=R(B +$B$9$k$?$a$N$b$N$G!"(B<dref>RFC 2045</dref> $B$GDj5A$5$l$F$$$^$9!#(B + +<memo> +<p> +$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$&(B +$B$JJ8;zId9f$N<oN`$rI=8=$9$k$3$H$b$G$-$J$$!#(B +</memo> + +<p> +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 <concept>mime-content-type</concept> $B$rDs6!$7$^$9!#(B + + +<h2> Content-Type $BMs$N7A<0(B +<node> Content-Type field +<p> +Content-Type $BMs$N7A<0$O0J2<$N$h$&$KDj5A$5$l$F$$$^$9!'(B + +<quote> +``Content-Type'' ``:'' <concept>type</concept> ``/'' +<concept>subtype</concept> *( ``;'' <concept>parameter</concept> ) +</quote> +<p> +$BNc$($P!"(B + +<quote> +<verb> +Content-Type: image/jpeg +</verb> +</quote> + +<noindent> +$B$d(B + +<quote> +<verb> +Content-Type: text/plain; charset=iso-2022-jp +</verb> +</quote> + +<noindent> +$B$J$I$N$h$&$KMQ$$$i$l$^$9!#(B +<p> +$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 + +<memo> +<p> +Content-Type $BMs$N$J$$(B entity $B$O(B + +<quote> +<verb> +Content-Type: text/plain; charset=us-ascii +</verb> +</quote> + +<noindent> +$B$H$7$F2r<a$5$l$k!#(B<cf node="us-ascii"> +</memo> + + +<h2> mime-content-type $B9=B$BN(B +<node> mime-content-type +<p> +<define type="Structure" name="mime-content-type"> +<p> +Content-Type $BMs$N>pJs$r3JG<$9$k$?$a$N9=B$BN!#(B +<p> +$B$3$N9=B$BN$r;2>H$9$k$K$O(B <code>mime-content-type-$BMWAGL>(B</code> $B$H$$$&L>(B +$BA0$N;2>H4X?t$rMQ$$$k!#(B +<p> +$B$3$N9=B$BN$NMWAG$O0J2<$NDL$j$G$"$k!'(B + +<vl> +<dt>primary-type<dd>media-type $B$N<g7?(B (symbol). +</dd> +<dt>subtype<dd>media-type $B$NI{7?(B (symbol). +</dd> +<dt>parameters<dd>Content-Type $BMs$N(B parameter ($BO"A[(B list). +</dd> +</vl> +</define> + +<defun name="make-mime-content-type"> + <args> type subtype + <opts> parameters +<p>content-type $B$N@8@.;R!#(B +</defun> + +<defun name="mime-content-type-parameter"> +<args> content-type parameter +<p> +<var>content-type</var> $B$N(B <var>parameter</var> $B$NCM$rJV$9!#(B +</defun> + + +<h2> Content-Type $BMs$N2r@O4o(B +<node> Content-Type parser +<p> +<defun name="mime-parse-Content-Type"> + <args> string +<p> +<var>string</var> $B$r(B content-type $B$H$7$F2r@O$7$?7k2L$rJV$9!#(B +</defun> + +<defun name="mime-read-Content-Type"> +<p> +$B8=:_$N(B buffer $B$N(B Content-Type $BMs$rFI$_<h$j!"2r@O$7$?7k2L$rJV$9!#(B +<p> +Content-Type $BMs$,B8:_$7$J$$>l9g$O(B nil $B$rJV$9!#(B +</defun> + + +<h2> Content-Type $B$K4X$9$kM-MQ$J4X?t(B +<node> Content-Type utility +<p> +<defun name="mime-type/subtype-string"> + <args> type <opts> subtype +<p> +<var>type</var> $B$H(B <var>subtype</var> $B$+$i(B type/subtype $B7A<0$NJ8;zNs$rJV(B +$B$9!#(B +</defun> + + +<h1> Content-Disposition $BMs$N>pJs(B +<node> Content-Disposition +<p> +<concept>Content-Disposition $BMs(B</concept> $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 + +<rfc number="2183" type="Standards Track" + author="S. Dorner, K. Moore and R. Troost" + title="Communicating Presentation Information in + Internet Messages: The Content-Disposition Header" + date="August 1997"> +<p> +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 +<concept>mime-content-disposition</concept> $B$rDs6!$7$^$9!#(B + + +<h2> mime-content-disposition $B9=B$BN(B +<node> mime-content-disposition +<p> +<define type="Structure" name="mime-content-disposition"> +<p> +Content-Disposition $BMs$N2r@O7k2L$r<}$a$k$?$a$N9=B$BN!#(B +<p> +$B$3$N9=B$BN$r;2>H$9$k$K$O(B <code>mime-content-disposition-$BMWAGL>(B</code> $B$H(B +$B$$$&L>A0$N;2>H4X?t$rMQ$$$k!#(B +<p> +$B$3$N9=B$BN$NMWAG$O0J2<$NDL$j$G$"$k!'(B + +<vl> +<dt>disposition-type<dd>disposition-type (symbol). +</dd> +<dt>parameters<dd>Content-Disposition $BMs$N(B parameter ($BO"A[(B list). +</dd> +</vl> +</define> + +<defun name="mime-content-disposition-parameter"> +<args> content-disposition parameter +<p> +<var>content-disposition</var> $B$N(B <var>parameter</var> $B$NCM$rJV$9!#(B +</defun> + +<defun name="mime-content-disposition-filename"> +<args> content-disposition +<p> +<var>content-disposition</var> $B$N(B filename $B$NCM$rJV$9!#(B +</defun> + + +<h2> Content-Disposition $BMs$N2r@O4o(B +<node> Content-Disposition parser +<p> +<defun name="mime-parse-Content-Disposition"> + <args> string +<p> +<var>string</var> $B$r(B content-disposition $B$H$7$F2r@O$7$?7k2L$rJV$9!#(B +</defun> + +<defun name="mime-read-Content-Disposition"> +<p> +$B8=:_$N(B buffer $B$N(B Content-Disposition $BMs$rFI$_<h$j!"2r@O$7$?7k2L$rJV$9!#(B +<p> +Content-Disposition $BMs$,B8:_$7$J$$>l9g$O(B nil $B$rJV$9!#(B +</defun> + + +<h1> $BId9f2=K!(B +<node> Content-Transfer-Encoding +<p> +<concept>Content-Transfer-Encoding $BMs(B</concept> $B$O(B entity $B$NId9f2=K!$r5-(B +$B=R$9$k$?$a$N$b$N$G$9!#(B +<p> +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 +<p> +$B$^$?!"(BContent-Transfer-Encoding $B$K4p$E$$$FId9f2=!&I|9f2=$r9T$&4X?t$bDs(B +$B6!$5$l$^$9!#(B + + +<h2> Content-Transfer-Encoding $BMs$N2r@O4o(B +<node> Content-Transfer-Encoding parser +<p> +<defun name="mime-parse-Content-Transfer-Encoding"> + <args> string +<p> +<var>string</var> $B$r(B content-transfer-encoding $B$H$7$F2r@O$7$?7k2L$rJV$9!#(B +</defun> + +<defun name="mime-read-Content-Transfer-Encoding"> + <opts>default-encoding +<p> +$B8=:_$N(B buffer $B$N(B Content-Transfer-Encoding $BMs$rFI$_<h$j!"2r@O$7$?7k2L$r(B +$BJV$9!#(B +<p> +Content-Transfer-Encoding $BMs$,B8:_$7$J$$>l9g$O(B +<var>default-encoding</var> $B$rJV$9!#(B +</defun> + + +<h2> $BId9f2=!&I|9f2=(B +<node> encoder/decoder +<p> +<defun name="mime-encode-region"> + <args> start end encoding +<p> +$B8=:_$N(B buffer $B$N(B <var>start</var> $B$+$i(B <var>end</var> $B$^$G$N(B region $B$r(B +<var>encoding</var> $B$r;H$C$FId9f2=$7$^$9!#(B +</defun> + +<defun name="mime-decode-region"> + <args> start end encoding +<p> +$B8=:_$N(B buffer $B$N(B <var>start</var> $B$+$i(B <var>end</var> $B$^$G$N(B region $B$r(B +<var>encoding</var> $B$r;H$C$FI|9f2=$7$^$9!#(B +</defun> + + +<defun name="mime-decode-string"> + <args> string encoding +<p> +<var>string</var> $B$r(B <var>encoding</var> $B$H$7$FI|9f$7$?7k2L$rJV$9!#(B +</defun> + + +<defun name="mime-insert-encoded-file"> + <args> filename encoding +<p> +<var>ENCODING</var> format $B$GId9f2=$5$l$?(B file <var>FILENAME</var> $B$r(B +$BA^F~$9$k!#(B +</defun> + +<defun name="mime-write-decoded-region"> + <args> start end filename encoding +<p> +<var>encoding</var> $B$GId9f2=$5$l$?8=:_$N(B region $B$rI|9f2=$7$F(B +<var>filename</var>$B$K=q$-9~$_$^$9!#(B +<p> +<var>start<var> $B$H(B <var>end</var> $B$O(B buffer $B$N0LCV$G$9!#(B +</defun> + + +<h2> $BB>$N(B utility +<node> Encoding information +<p> +<defun name="mime-encoding-list"> + <opts> SERVICE +<p> +Content-Transfer-Encoding $B$N(B list $B$rJV$7$^$9!#(B +<p> +<var>service</var> $B$,;XDj$5$l$F$$$k$H!"$=$l$KBP$9$k(B +Content-Transfer-Encoding $B$rJV$7$^$9!#(B +</defun> + +<defun name="mime-encoding-alist"> + <opts> SERVICE +<p> +$BJd40$N$?$a$N(B Content-Transfer-Encoding $B$NI=$rJV$7$^$9!#(B +<p> +<var>service</var> $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 +</defun> + + +<h2> $BId9f2=(B/$BI|9f2=(B module $B$N=q$-J}(B +<node> mel-backend +<p> +<defmacro name="mel-define-method"> +<args> name args <rest> body +<p> +<var>name</var> $B$r(B (nth 1 (car (last <var>args</var>))) backend $B$N(B +method $B4X?t$H$7$FDj5A$7$^$9!#(B +<p> +<var>args</var> $B$O(B lambda $B$N0z?t(B list $B$H;w$F$$$^$9$,!"(B(car (last +<var>args</var>)) $B$O;XDj$5$l$?(B parameter $B$G$"$kI,MW$,$"$j$^$9!#(B(car +(car (last <var>args</var>))) $B$OJQ?t$NL>A0$G!"(B(nth 1 (car (last +<var>args</var>))) $B$O(B backend $B$NL>A0(B (encoding) $B$G$9!#(B +<p> +$BNc(B: +<p> +<lisp> +(mel-define-method mime-write-decoded-region (start end filename + (nil "base64")) + "Decode and write current region encoded by base64 into FILENAME. +START and END are buffer positions." + (interactive + (list (region-beginning) (region-end) + (read-file-name "Write decoded region to file: "))) + (let ((str (buffer-substring start end))) + (with-temp-buffer + (insert (decode-base64-string str)) + (write-region-as-binary (point-min) (point-max) filename) + ))) +</lisp> +</defmacro> + +<defmacro name="mel-define-method-function"> +<args> spec function +<p> +<var>spec</var> $B$N4X?tDj5A$r(B <var>function</var> $B$K@_Dj$7$^$9!#(B +<p> +<var>spec</var> $B$N:G=i$NMWAG$O(B service $B$G$9!#(B +<p> +<var>args</var> $B$N;D$j$O(B lambda $B$N0z?t(B list $B;w$F$$$^$9$,!"(B(car (last +<var>args</var>)) $B$O;XDj$5$l$?(B parameter $B$G$"$kI,MW$,$"$j$^$9!#(B(car +(car (last <var>args</var>))) $B$OJQ?t$NL>A0$G!"(B(nth 1 (car (last +<var>args</var>))) $B$O(B backend $B$NL>A0(B (encoding) $B$G$9!#(B +<p> +$BNc(B: +<p> +<lisp> +(mel-define-method-function (mime-encode-string string (nil "base64")) + 'encode-base64-string) +</lisp> +</defmacro> + + +<h2> $BId9f2=(B/$BI|9f2=(B service $B$rDI2C$9$kJ}K!(B +<node> generic function for mel-backend +<p> +<defmacro name="mel-define-service"> +<args> name +<opts> args doc-string +<p> +<var>name</var> $B$r(B Content-Transfer-Encoding $B$N(B service $B$H$7$FDj5A$7$^(B +$B$9!#(B +<p> +<var>args</var> $B$,;XDj$5$l$F$$$k$H!"(B<var>name</var> $B$O(B service $B$N(B +generic function $B$H$7$FDj5A$5$l$^$9!#(B +<p> +$BNc(B: +<p> +<lisp> +(mel-define-service encoded-text-encode-string (string encoding) + "Encode STRING as encoded-text using ENCODING. +ENCODING must be string.") +</lisp> +</defmacro> + + +<h1> Header $B$N(B network $BI=8=(B +<node> encoded-word +<p> +encoded-word $B$O(B header $B$GHs(B <dref>ASCII</dref> $BJ8;z$rI=8=$9$k$?$a$N7A(B +$B<0$G!"(B<concept>RFC 2047</concept> $B$GDj5A$5$l$F$$$^$9!#(B +<p> +<rfc number="2047" type="Standards Track" author="K. Moore" + title="MIME (Multipurpose Internet Mail Extensions) Part + Three: Message Header Extensions for Non-ASCII Text" + date="November 1996" obsolete="1521,1522,1590"> +<p> +$B$^$?!"9T57$N0-$$$3$H$@$H8@$($^$9$,!"(Bencoded-word $B$rMQ$$$:$KHs(B +<dref>ASCII</dref> $BJ8;z$r(B header $B$KF~$l$?5-;v$bB8:_$7$^$9!#(B +<p> +FLIM $B$O$3$l$i$rId9f2=!&I|9f2=$9$k5!G=$rDs6!$7$^$9!#(B + + +<h2> Header $B$NId9f2=!&I|9f2=(B +<node> Header encoder/decoder +<p> +<defun name="eword-decode-header"> + <opts> code-conversion separator +<p> +Header $BCf$N(B encoded-word $B$rI|9f$9$k!#(B +<p> +$B$b$7(B <var>code-conversion</var> $B$,(B <code>nil</code> $B$J$i!"(Bencoded-word +$B$@$1$,I|9f$5$l$k!#$b$7!"(B<var>code-conversion</var> $B$,(B <dref>MIME +charset</dref> $B$J$i!"Hs(B ASCII bit patterns $B$O$=$N(B MIME charset $B$H$7$F(B +$BI|9f$5$l$k!#$3$l0J30$N>l9g!"Hs(B ASCII bit patterns $B$O(B +<code>default-mime-charset</code>. $B$H$7$FI|9f$5$l$k!#(B<cf node="entity +formatting"> +<p> +$B$b$7(B <var>separator</var> $B$,(B <code>nil</code> $B$G$J$1$l$P!"$=$NCM$,(B +header separator $B$H$7$FMQ$$$i$l$k!#(B +</defun> + +<defun name="eword-encode-header"> + <opts> code-conversion +<p> +Header $B$r(B network $BI=8=$KId9f2=$9$k!#(B +<p> +$B3F(B field $B$O(B <code>mime-field-encoding-method-alist</code> $B$G;XDj$5$l(B +$B$?J}<0$GId9f2=$5$l$k!#(B +</defun> + +<defvar name="mime-field-encoding-method-alist"> +<p> +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 +<p> +METHOD $B$,(B <code>mime</code> $B$G$"$l$P!"(BFIELD $B$O(B MIME format $B$KId9f2=$5(B +$B$l$k(B (encoded-word)$B!#(B +<p> +METHOD $B$,(B <code>nil</code> $B$G$"$l$P!"(BFIELD $B$OId9f2=$5$l$J$$!#(B +<p> +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 +<p> +$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</code> $B$GId9f2=$5$l$k(B +</defvar> + + +<h1> $B0lHL@_Dj(B +<node> custom +<p> +<define type="group" name="mime"> +<p> +MIME $B4XO"5!G=$K4X$9$k(B group. +<p> +<code>mail</code> $B$H(B <code>news</code> $B$KB0$9$k!#(B +</define> + + +<h1> $BIUO?(B +<node> Appendix + +<h2> $BMQ8l(B +<node> Glossary + +<h3> 7bit +<node> 7bit +<p> +$B$3$3$G$O(B 0 $B$+$i(B 127 $B$N@0?t$r;X$9!#(B +<p> +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(B +$B$V!#(B +<p> +$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(B +$B$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(B +$B;zNs(B'' $B$H8F$V!J$3$l$O(B <dref>ISO 2022</dref> $B$N!V(B7 $BC10L7O!W$HF1MM!K!#(B +<p> +$BEAE}E*$J(B Internet $B$N(B <dref>MTA</dref> $B$O(B 7bit $B$N(B data $B$rE>Aw$G$-$k$N$G!"(B +7bit $B$N(B data $B$O(B <dref>Quoted-Printable</dref> $B$d(B <dref>Base64</dref> +$B$H$$$C$?JQ49$r9T$o$J$/$F$b$=$N$^$^E>Aw$G$-$k!#(B +<p> +$B$7$+$7!"(B7bit $B$G$"$l$P$I$s$J(B data $B$G$bNI$$$H$O$$$($J$$!#$J$<$J$i!"#19T(B +$B$ND9$5$,$"$^$j$KD9$$$H!"(BMTA $B$O$=$N(B message $B$rE>Aw$9$k$3$H$,$G$-$J$$$+(B +$B$i$G$"$k!#$A$J$_$K!"(B<dref>RFC 821</dref> $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=@-(B +$B$N$"$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 + + +<h3> 8bit +<node> 8bit +<p> +$B$3$3$G$O(B 0 $B$+$i(B 255 $B$N@0?t$r;X$9!#(B +<p> +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(B +$B$V!#(B +<p> +$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$G(B +$BI=8=$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(B +$B$J$kJ8;zNs$N$3$H$r(B ``8bit $B$NJ8;zNs(B'' $B$H8F$V!J$3$l$O(B <dref>ISO +2022</dref> $B$N!V(B8 $BC10L7O!W$HF1MM!K!#(B +<p> +<dref>iso-8859-1</dref> $B$d(B <dref>euc-kr</dref> $B$H$$$C$?Id9f2=J8;z=89g(B +$B$O(B 8bit $B$NJ8;zNs$G$"$k!#(B +<p> +$BEAE}E*$J(B Internet $B$N(B <dref>MTA</dref> $B$O(B <dref>7bit</dref> $B$N(B data $B$7(B +$B$+E>Aw$G$-$J$$$N$G!"$=$&$7$?(B MTA $B$r7PM3$9$k>l9g!"(B +<dref>Quoted-Printable</dref> $B$d(B <dref>Base64</dref> $B$H$$$C$?JQ49$r9T(B +$B$o$J$/$F$O$J$i$J$$!#(B +<p> +$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(B +$B$F$-$?$N$G!"$=$N$^$^Aw$k$3$H$,$G$-$k>l9g$bA}$($F$-$?!#(B +<p> +$B$7$+$7!"(B8bit $B$G$"$l$P$I$s$J(B data $B$G$bNI$$$H$O$$$($J$$!#$J$<$J$i!"#19T(B +$B$ND9$5$,$"$^$j$KD9$$$H!"(BMTA $B$O$=$N(B message $B$rE>Aw$9$k$3$H$,$G$-$J$$$+(B +$B$i$G$"$k!#$A$J$_$K!"(B<dref>RFC 821</dref> $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=@-(B +$B$N$"$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 +<p> +$B$^$?!"$3$&$7$?M}M3$+$i!"#19T$,(B 999 byte $B0J>e$N9T$,B8:_$9$k2DG=@-$N$"$k(B +data $B$O(B <a node="binary"><concept>binary</concept></a> $B$H8F$V$3$H$K$9(B +$B$k!#(B +<p> +$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 + + +<h3> ASCII +<node> ASCII +<p> +$B%"%a%j%+O"K.$G;H$o$l$kJ8;z$rId9f2=$7$?(B<dref>$BId9f2=J8;z=89g(B</dref>$B!#(B +A-Z, a-z $B$N(B Latin $BJ8;z$H?t;z!"4v$D$+$N5-9f$+$i$J$k!#(BISO 646 $B$N0l$D$G!"(B +$B8=:_$O9q:]4p=`HG(B (IRV) $B$K$J$C$F$$$k!#(B + +<standard abbrev="ASCII" title-en="Coded Character Set -- 7-Bit + American Standard Code for Information Interchange" + number="ANSI X3.4" year="1986"> + + +<h3> Base64 +<node> Base64 +<p> +<dref>RFC 2045</dref> $B$GDj5A$5$l$F$$$k(B <dref>MIME</dref> $B$K$*$1$k(B <a +node="binary">binary data</a> $B$N(B network $B$G$NJQ49K!$N#1$D!#(B +<p> +$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 +<dref>ASCII</dref> 4 $BJ8;z$KJQ49$9$kJ}K!!#!J$b$7!"(B4 $BJ8;z$K$J$i$J$1$l$P(B +<concept>pad</concept> $B$H8F$P$l$k5M$aJ*$r$7$FD9$5$rD4@0$9$k!K(B +<p> +$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 + + +<h3> binary +<node> binary +<p> +$BG$0U$N(B byte $BNs$r(B <concept>binary</concept> $B$H8F$V!#(B +<p> +<dref>8bit</dref> $B$H0[$J$k$N$O(B data $B$K9T$N9=B$$r2>Dj$7$J$$$3$H$G$"$k!#(B +<p> +$B$^$?!"9T$N9=B$$,$"$C$F$b!"(B999 byte $B0J>e$+$i$J$k9T$,$"$k>l9g$b(B binary +$B$H8F$V$3$H$K$9$k!#(B +<p> +$B$A$J$_$K!"(B<dref>7bit</dref> $B$d(B 8bit $B$GI=8=$G$-$k(B data $B$O(B binary $B$G$bI=(B +$B8=$G$-$k!#$h$C$F!"(B<concept>binary data</concept> $B$H8@$C$?>l9g!"G$0U$N(B +data $B$r;X$9$3$H$,$"$k!#(B + + +<h3> Coded character set$B!JId9f2=J8;z=89g!K(B, Character code$B!JJ8;zId9f!K(B +<node> Coded character set +<p> +$BJ8;z$H(B byte $BNs$H#1BP#1$KBP1~IU$1$k[#Kf$G$J$$5,B'$N=89g!#(B + + +<h3> media-type +<node> media-type +<p> +<dref>MIME</dref> $B$K$*$1$k(B <dref>entity</dref> $B$N<oN`!#(B +<concept>primary-type</concept> $B$H(B <concept>subtype</concept> $B$+$i$J$k!#(B +<dref>RFC 2046</dref> $B$GDj5A$5$l$F$$$k!#(B +<p> +primary-type $B$OI8=`$G$O(B + +<ul> +<li><concept>text</concept> +</li> +<li><concept>image</concept> +</li> +<li><concept>audio</concept> +</li> +<li><concept>video</concept> +</li> +<li><concept>application</concept> +</li> +<li><a node="multipart"><concept>multipart</concept></a> +</li> +<li><concept>message</concept> +</ul> + +<noindent> +$B$,Dj5A$5$l!"$=$l$>$l$K$O(B application/octet-stream, audio/basic, +image/jpeg, <dref>multipart/mixed</dref>, <dref>text/plain</dref>, +video/mpeg $B$J$I$N$5$^$6$^$J(B subtype $B$,Dj5A$5$l$F$$$k!#(B + +<memo title="$BCm0U(B"> +<p> +$B$3$3$G$O!"(Btext/plain $B$J$I$N(B type/subtype $B$NAH$r$7$P$7$P(B +<concept>primary-type/subtype</concept> $B$H=q$/!#(B +</memo> + +<p> +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 <a +href="ftp://ftp.isi.edu/in-notes/iana/assignments/media-types">MEDIA +TYPES</a> $B$G;2>H$G$-$k!#(B +<p> +$B$^$?!"(Btype $B$b$7$/$O(B subtype $B$K!"A0$K(B `x-' $B$rIU$1$?(B +<concept>x-token</concept> $B$rMQ$$$k$3$H$K$h$j!"EPO?$5$l$F$$$J$$$b$N$r(B +$B;dE*$KMQ$$$k$3$H$b$G$-$k!#$7$+$7!"EvA3$N$3$H$J$,$i!"$3$&$7$?;dE*$J(B +media-type $B$ONJ2r$rF@$?<T$N4V$G$7$+2r<a$G$-$J$$$N$GMxMQ$K$OCm0U$9$k$3(B +$B$H!#(B +<p> +<cf node="Content-Type"> + + +<h3> message +<node> message +<p> +$B$3$3$G$O(B mail $B$H(B news $B5-;v$NAm>N$H$7$FMQ$$$k!#(B + + +<h3> MIME +<node> MIME +<p> +<concept>Multipurpose Internet Mail Extensions</concept> $B$NN,$G!"(B +Internet $B$N(B mail $B$d(B news $B$G(B <a node="us-ascii">us-ascii plain text</a> +$B0J30$NJ8;z$r;H$&$?$a$N(B <dref>RFC 822</dref> $B$KBP$9$k3HD%!#(B +<p> +RFC 2045 $B$OKAF,$G<!$N$h$&$K=R$Y$F$$$k!'(B +<p> +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 + +<ol> +<li>$BJ8=q(B message body $B$K$*$1$k(B US-ASCII $B0J30$NJ8;z=89g(B +</li> +<li>$BHsJ8=q(B message body +</li> +<li>$BJ#?t$NItJ,$+$i$J$k(B message body +</li> +<li>US-ASCII $B0J30$NJ8;z=89g$+$i$J$kJ8=q(B header $B>pJs(B +</ol> + +<p> +<dref>RFC 2045</dref>, <dref>RFC 2046</dref>, <a +node="encoded-word">RFC 2047</a>, <dref>RFC 2048</dref>, <dref>RFC +2049</dref> $B$GDj5A$5$l$F$$$k!#(B + + +<h3> MIME charset +<node> MIME charset +<p> +<dref>Content-Type</dref> $BMs$d(B <dref>encoded-word</dref> $B$N(B charset +parameter $B$GMQ$$$i$l$kEPO?$5$l$?(B<a node="Coded character set">$BId9f2=J8(B +$B;z=89g(B</a>$B!#(B +<p> +<dref>RFC 2045</dref> $B$GDj5A$5$l$F$$$k!#(B +<p> +iso-2022-jp $B$d(B euc-kr $B$O$=$N#1$D!#(B + + +<h3> MTA +<node> MTA +<p> +<concept>Message Transfer Agent</concept> $B$NN,$G!"(Bqmail $B$d(B sendmail $B$J(B +$B$I$N(B mail $BG[Aw(B program $B$H(B inn $B$J$I$N(B news server $B$NAm>N!#(B +<p> +<cf node="MUA"> + + +<h3> MUA +<node> MUA +<p> +<concept>Message User Agent</concept> $B$NN,$G!"(Bmail reader $B$H(B news +reader $B$NAm>N!#(B +<p> +<cf node="MTA"> + + +<h3> Quoted-Printable +<node> Quoted-Printable +<p> +<dref>RFC 2045</dref> $B$GDj5A$5$l$F$$$k(B <dref>MIME</dref> $B$K$*$1$k(B +<dref>binary data</dref> $B$N(B network $B$G$NJQ49K!$N#1$D!#(B +<p> +`=' $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!"(B<dref>ASCII</dref> $BJ8;zCf?4$N(B data $B$G$O(B +<dref>Base64</dref> $B$KHf$Y$k$H2DFI@-$,9b$/$J$k2DG=@-$,$"$k!#(B +<p> +$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 + + +<h3> RFC 822 +<node> RFC 822 +<p> +Internet mail $B$N<g$K(B <concept>message header</concept> $B$K4X$9$k7A<0$K(B +$B4X$9$kI8=`$rDj$a$F$$$k(B RFC. + +<memo> +<p> +news message $B$b$3$l$K=`$8$F$$$k$N$G!"(B<concept>Internet mail</concept> +$B$H=q$/$h$j$b!"(B<concept>Internet message</concept> $B$H=q$$$?J}$,NI$$$+$b(B +$B$7$l$J$$!#(B +</memo> + +<rfc number="822" type="STD 11" author="D. Crocker" title="Standard + for the Format of ARPA Internet Text Messages" + date="August 1982"> + + +<h3> RFC 1036 +<node> RFC 1036 +<p> +USENET $B$G$N(B message $B$N7A<0$rDj$a$?(B RFC. <dref>RFC 822</dref> $B$N(B +subset $B$K$J$C$F$$$k!#(BInternet $B$NI8=`$G$O$J$$$,!"(BUSENET $B0J30$N(B netnews +$B$G$b$3$l$K=`$8$F$$$k$b$N$,B?$$!#(B + +<rfc name="USENET" number="1036" author="M. Horton and R. Adams" + title="Standard for Interchange of USENET Messages" + date="December 1987" obsolete="850"> + + +<h3> RFC 2045 +<node> RFC 2045 +<p> +<rfc number="2045" type="Standards Track" author="N. Freed and + N. Borenstein" title="Multipurpose Internet Mail + Extensions (MIME) Part One: Format of Internet Message + Bodies" date="November 1996" obsolete="1521, 1522, + 1590"> + + +<h3> RFC 2046 +<node> RFC 2046 +<p> +<rfc number="2046" type="Standards Track" author="N. Freed and + N. Borenstein" title="Multipurpose Internet Mail + Extensions (MIME) Part Two: Media Types" + date="November 1996" obsolete="1521, 1522, 1590"> + + +<h3> RFC 2048 +<node> RFC 2048 +<p> +<rfc number="2048" type="Standards Track" author="N. Freed, J. Klensin + and J. Postel" title="Multipurpose Internet Mail + Extensions (MIME) Part Four: Registration Procedures" + date="November 1996" obsolete="1521, 1522, 1590"> + + +<h3> RFC 2049 +<node> RFC 2049 +<p> +<rfc number="2049" type="Standards Track" author="N. Freed and + N. Borenstein" title="Multipurpose Internet Mail + Extensions (MIME) Part Five: Conformance Criteria and + Examples" date="November 1996" obsolete="1521, 1522, + 1590"> + + +<h3> plain text +<node> plain text +<p> +$B=qBN$dAHHG$K4X$9$k>pJs$r;}$?$J$$(B<a node="Coded character set">$BJ8;zId9f(B +</a>$B$N$_$GI=8=$5$l$k(B text $B>pJs!#(B<cf node="text/plain"> + + +<h3> us-ascii +<node> us-ascii +<p> +$B%"%a%j%+O"K.$J$I$G;H$o$l$k1Q8l$J$I$rI=8=$9$k$?$a$N(B <dref>MIME +charset</dref> $B$N#1$D!#(B +<p> +<dref>ASCII</dref> $B$N$_$+$i$J$j(B ISO 2022 $B$K$h$kId9f3HD%$O5v$5$l$J$$!#(B +<p> +Internet message $B$K$*$1$kI8=`$N(B<a node="Coded character set">$BId9f2=J8(B +$B;z=89g(B</a>$B$G$"$j!"L@<(E*$K(B MIME charset $B$,<($5$l$J$$>l9g$O86B'$H$7$F(B +<concept>us-ascii</concept> $B$,;H$o$l$k!#(B +<p> +$B$^$?!"(B<dref>RFC 822</dref> $B$K$*$1$k(B <concept>ASCII</concept> +$B$O(B us-ascii $B$G$"$k!#(B + + +<h2> bug $BJs9p$N;EJ}(B +<node> Bug report +<p> +FLIM $B$N%P%0$r8+$D$1$?$i!"0J2<$N(B address $B$K(B mail $B$rAw$C$F$/$@$5$$!'(B + +<ul> +<li> $B1Q8l(B <mail>emacs-mime-en@m17n.org</mail> +<li> $BF|K\8l(B <mail>emacs-mime-ja@m17n.org</mail> +</ul> + +<p> +$BC"$7!"$"$^$j$K$b8E$$HG$K4X$9$kJs9p$O4?7^$5$l$^$;$s!#8E$$HG$N(B bug $B$O!"(B +$B?7$7$$HG$G$O<#$C$F$$$k$+$b$7$l$^$;$s!#$^$:!":G?7HG$G3NG'$7$F$_$^$7$g$&!#(B +<p> +$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!#$^$?!"(B +error $B$,5/$C$F$$$k>l9g$O(B backtrace $B$rAw$k$3$H$b=EMW$G$9!#(B<cf +file="emacs" node="Bugs"> +<p> +$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 + +<p> +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 + +<ul> +<li> $B1Q8l(B <mail>emacs-mime-en-ctl@m17n.org</mail> +<li> $BF|K\8l(B <mail>emacs-mime-ja-ctl@m17n.org</mail> +</ul> + +<noindent> +$B$K6u$N(B mail $B$rAw$C$F2<$5$$!#(B + + +<h2> CVS $B$K$h$k3+H/(B +<node> CVS +<p> +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 + +<verb> +(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 [-r TAG] flim +</verb> + +<p> +CVS $B$rMQ$$$?3+H/$K;22C$7$?$$J}$O(B + +<ul> +<li> <mail>cvs@cvs.m17n.org</mail> +</ul> + +<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 + + +<h2> $BNr;K(B +<node> History +<p> +FLIM $B$N(B code $B$N:G8E$NItJ,$O(B $B1]JB(B $B;LCR(B $B;a$,=q$$$?(B <file>mime.el</file> +$B$K5/8;$7$^$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 +<p> +$B$=$N8e!"<i2,(B $BCNI'(B $B$O(B <file>mime.el</file> $B$r85$K(B +<file>tiny-mime.el</file> $B$H$$$&%W%m%0%i%`$r=q$-$^$9!#$3$l$O!"(BNemacs +$B$H(B Mule $B$GF0:n$9$k(B encoded-word $B$NId9f2=!&I|9f2=%W%m%0%i%`$G$7$?!#(B +<file>tiny-mime.el</file> $B$O(B B-encoding $B$@$1$G$J$/(B Q-encoding $B$b(B +support $B$7!"$^$?!"(BMULE $B$G07$&$3$H$,$G$-$k$5$^$6$^$J(B <dref>MIME +charset</dref> $B$rF1;~$K;H$&$3$H$,$G$-$^$7$?!#$3$N;~!"(BNemacs $B$H(B Mule $B$N(B +$BAPJ}$r(B support $B$9$k$?$a$KMQ$$$i$l$?%F%/%K%C%/$O8e$K(B emu package $B$K$^$H(B +$B$a$i$l$^$9!#(B +<p> +$B$3$N:"!"<i2,(B $BCNI'(B $B$O(B <file>tiny-mime.el</file> $B$r$5$^$6$^$J(B MUA $B$G;H$&(B +$B$?$a$N@_Dj=8$bG[I[$7$F$$$^$7$?$,!"$=$l$i$O8e$K(B +<file>tiny-mime.el</file> $B$H$H$b$K#1$D$N(B package $B$K$^$H$a$i$l!"(Btm $B$H$$(B +$B$&L>A0$GG[I[$5$l$^$9!#(B +<p> +$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</file> $B$r=q$-$^$9!#$3$l$O!"$9$0$K(B +<file>tm-view.el</file> $B$H$$$&L>A0$KJQ$o$j$^$7$?$,!"$d$,$F!"$3$l$,(B +<file>tiny-mime.el</file> $B$KBe$o$C$F!"(Btm $B$NCf3K$H$J$j$^$9!#(B +<p> +<file>tm-view.el</file> $B$OEvA3!"(BContent-Transfer-Encoding $B$r07$&I,MW$,(B +$B$"$j$^$9!#$3$NL\E*$N$?$a$K!"(BMEL $B$,@0Hw$5$l$O$8$a$^$7$?!#(BBase64 $B$K4X$7(B +$B$F$O(B <file>tiny-mime.el</file> $B$N(B code $B$,0\$5$l!"$^$?!"?7$?$K(B +Quoted-Printable $B$N(B code $B$,DI2C$5$l$^$7$?!#$3$l$i$,(B +<file>mel-b.el</file> $B$H(B <file>mel-q.el</file> $B$K$J$j$^$7$?!#(B +<p> +$B$^$?!"8e$K!"<i2,(B $BCNI'(B $B$K$h$C$F(B uuencode $BMQ$N(B <file>mel-u.el</file> $B$,(B +$BDI2C$5$l!"$=$N8e$K!">.NS(B $B=$J?(B $B;a$K$h$C$F(B x-gzip64 $BMQ$N(B +<file>mel-g.el</file> $B$,DI2C$5$l$^$7$?!#(B +<p> +tm $B$G$O8e$K!"<i2,(B $BCNI'(B $B$K$h$C$F(B <file>tiny-mime.el</file> $B$N:F<BAu$,9T(B +$B$o$l!"$3$N2aDx$G!"(BSTD 11 $B$N(B parser $B$,=q$+$l$^$7$?!#$3$l$O!"8=:_$N(B +<file>std11.el</file> $B$KEv$?$j$^$9!#$^$?!"$3$N2aDx$G(B +<file>tiny-mime.el</file> $B$OI|9f2=$r9T$&(B <file>tm-ew-d.el</file> $B$HId(B +$B9f2=$r9T$&(B <file>tm-ew-e.el</file> $B$KJ,$1$i$l$^$7$?!#$3$NN><T$,8=:_$N(B +<file>eword-decode.el</file> $B$H(B <file>eword-encode.el</file> $B$N@hAD$K(B +$BEv$?$j$^$9!#(B +<p> +$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!"(B +tm $B$O(B APEL, MEL, SEMI, EMH, RMAIL-MIME, Gnus-MIME $B$J$I$KJ,$1$i$l$^$7$?!#(B +$B$3$N$&$A$N(B MEL $B$,(B FLIM $B$ND>@\$N@hAD$KEv$?$j$^$9!#(B +<p> +$B8e$K!"(BAPEL $B$+$i(B <file>std11.el</file> $B$,0\$5$l!"$^$?!"(B +<file>mailcap.el</file>, <file>eword-decode.el</file> $B$*$h$S(B +<file>eword-encode.el</file> $B$,(B SEMI $B$+$i0\$5$l!"(Bpackage $B$NL>A0$,(B FLIM +$B$H$J$j$^$9!#(B +<p> +$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 + + +<h1> $B35G0:w0z(B +<node> Concept Index + +<cindex> + + +<h1> $B4X?t:w0z(B +<node> Function Index + +<findex> + + +<h1> $BJQ?t:w0z(B +<node> Variable Index + +<vindex> + +</body> diff --git a/flim-1.14.9/mime-ja.texi b/flim-1.14.9/mime-ja.texi new file mode 100644 index 0000000..c7520bd --- /dev/null +++ b/flim-1.14.9/mime-ja.texi @@ -0,0 +1,1622 @@ +\input texinfo.tex +@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} +@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 +@end titlepage +@node Top, Introduction, (dir), (dir) +@top FLIM 1.14 MIME $B5!G=@bL@=q(B + +@ifinfo + +This file documents MIME features of FLIM, 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 +@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 +@end menu + +@node Introduction, How to use, Top, Top +@chapter FLIM $B$C$F2?!)(B + +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 + + +@node How to use, Entity, Introduction, Top +@chapter FLIM $B$N(B MIME $B5!G=$N;H$$J}(B + +FLIM $B$NDs6!$9$k(B MIME $B5!G=$r;H$&$?$a$K$O(B + +@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 +@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 $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 + +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 + + +@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 +@end menu + +@node Entity creation, Entity hierarchy, Entity, Entity +@section Entity $B$N@8@.(B + +@defun mime-open-entity type location + +Entity $B$r3+$$$F!"$=$l$rJV$7$^$9!#(B@refill + +@var{type} $B$O(B representation-type $B$G$9!#(B(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 +@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} $B$,>JN,$5$l$?>l9g!"8=:_$N(B buffer $B$r9=J82r@O$9$k!#(B@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}) +@end defun + + + +@node Entity hierarchy, Entity Search, Entity creation, Entity +@section Entity $B3,AX(B +@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 + +$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 + +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 + +$B0lJ}!"(Bentity $B$N(B message $B$K$*$1$k0LCV$r9M$($k$3$H$b$G$-$^$9!#(B@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 +@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 +@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 + +@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 + +@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 +@end defvar + + +@defun mime-entity-children entity + +@var{entity} $B$K4^$^$l$k(B entity $B$N(B list $B$rJV$9!#(B +@end defun + + +@defun mime-entity-parent entity &optional message + +@var{entity} $B$N?F$N(B entity $B$rJV$9!#(B@refill + +@var{message} $B$,;XDj$5$l$?>l9g!"$3$l$r:,$H8+Jo$9!#(B +@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 +@end defun + + +@defun mime-entity-node-id entity + +@var{entity} $B$N(B node-id $B$rJV$9!#(B +@end defun + + +@defun mime-entity-number entity + +@var{entity} $B$N(B entity-number $B$rJV$9!#(B +@end defun + + + +@node Entity Search, Entity Attributes, Entity hierarchy, Entity +@section Entity $B$N8!:w(B + +@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} $B$,;XDj$5$l$F$$$J$$>l9g$O!"(B +@code{mime-message-structrue} $B$,;H$o$l$^$9!#(B +@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} $B$,;XDj$5$l$F$$$J$$>l9g$O!"(B +@code{mime-message-structure} $B$,;H$o$l$^$9!#(B +@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} $B$,;XDj$5$l$F$$$J$$>l9g$O!"(B +@code{mime-message-structure} $B$,;H$o$l$^$9!#(B +@end defun + + + +@node Entity Attributes, Entity-header, Entity Search, Entity +@section Entity $B$NB0@-(B + +@defun mime-entity-content-type entity + +@var{entity} $B$N(B content-type $B$rJV$9!#(B(cf. @ref{mime-content-type}) +@end defun + + +@defun mime-entity-content-disposition entity + +@var{entity} $B$N(B content-disposition $B$rJV$9!#(B +(cf. @ref{mime-content-disposition}) +@end defun + + +@defun mime-entity-filename entity + +@var{entity} $B$N(B file $BL>$rJV$9!#(B +@end defun + + +@defun mime-entity-encoding entity &optional default-encoding + +@var{entity} $B$N(B content-transfer-encoding $B$rJV$9!#(B +(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 +@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 +@end defun + + + +@node Entity-header, entity formatting, Entity Attributes, Entity +@section Entity header $B$N>pJs(B + +@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 + +$B7k2L$NJ8;zNs$O(B network $BI=8=$N$^$^$G$"$k!#(B@refill + +@var{entity} $B$,>JN,$5$l$?>l9g$O!"(B@code{mime-message-structure} $B$NCM$rMQ(B +$B$$$k!#(B@refill + +@var{field-name} $BMs$,B8:_$7$J$$>l9g$O(B @code{nil} $B$rJV$9!#(B +@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 +@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 + +$B7k2LCf$NJ8;zNs$O(B Emacs $B$NFbItI=8=$KJQ49$5$l$k!#(B@refill + +@var{entity} $B$,>JN,$5$l$?>l9g$O!"(B@code{mime-message-structure} $B$NCM$rMQ(B +$B$$$k!#(B@refill + +@var{field-name} $BMs$,B8:_$7$J$$>l9g$O(B nil $B$rJV$9!#(B +@end defun + + + +@node entity formatting, Entity-content, Entity-header, Entity +@section Entity $B$NJ8;zI=8=(B + +@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{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 +@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 +@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 +@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 + +@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 +@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 + +$BK\Mh$O(B APEL $B$NJQ?t$G$"$k!#(B +@end defvar + + + +@node Entity-content, Entity-network-representation, entity formatting, Entity +@section Entity $B$NFbMF(B + +@defun mime-entity-content entity + +@var{entity} $B$NFbMF$N(B byte $BNs$rJV$9!#(B +@end defun + + +@defun mime-insert-entity-content entity + +point $B$N0LCV$K(B @var{entity} $B$NFbMF$rA^F~$7$^$9!#(B +@end defun + + +@defun mime-write-entity-content entity filename + +@var{entity} $B$NFbMF$r(B @var{filename} $B$K=q$-9~$_$^$9!#(B +@end defun + + + +@node Entity-network-representation, Entity buffer, Entity-content, Entity +@section Entity $B$N%M%C%H%o!<%/I=8=(B + +@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 +@end defun + + +@defun mime-write-entity entity filename + +@var{entity} $B$NI=8=$r(B @var{filename} $B$K=q$-9~$_$^$9!#(B +@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 +@end defun + + + +@node Entity buffer, mm-backend, Entity-network-representation, Entity +@section Entity $B$N(B buffer $B$K$h$kI=8=(B + +@defun mime-entity-buffer entity + +@var{entity} $B$,B8:_$9$k(B buffer $B$rJV$9!#(B +@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 +@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 +@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 +@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 +@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 +@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 +@end defun + + + +@node mm-backend, , Entity buffer, Entity +@section Entity $B$NI=8=$H<B8=(B +@cindex mm-backend +@cindex entity $B=hM}(B 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 + +$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 + + +@menu +* Request for entity:: Entity $B$X$NJX$j(B +* mm-backend module:: mm-backend $B$N:n$jJ}(B +@end menu + +@node Request for entity, mm-backend module, mm-backend, mm-backend +@subsection Entity $B$X$NJX$j(B + +@defun mime-entity-send entity message &rest args + +@var{entity} $B$K(B @var{message} $B$rAw$k!#(B@refill + +@var{args} $B$O(B @var{message} $B$N0z?t$G$"$k!#(B +@end defun + + + +@node mm-backend module, , Request for entity, mm-backend +@subsection mm-backend $B$N:n$jJ}(B + +@defmac mm-define-backend type &optional parents + +@var{type} $B$r(B mm-backend $B$H$7$FDj5A$7$^$9!#(B@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 + +$BNc(B:@refill + +@lisp +(mm-define-backend chao (generic)) +@end lisp +@end defmac + + +@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{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 + +$BNc(B:@refill + +@lisp +(mm-define-method entity-cooked-p ((entity chao)) nil) +@end lisp +@end defmac + + + +@node Content-Type, Content-Disposition, Entity, Top +@chapter Content-Type $BMs$N>pJs(B +@cindex mime-content-type +@cindex Content-Type $BMs(B + +@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 + +@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 +@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 + + +@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 +@end menu + +@node Content-Type field, mime-content-type, Content-Type, Content-Type +@section Content-Type $BMs$N7A<0(B +@cindex parameter +@cindex subtype +@cindex type + +Content-Type $BMs$N7A<0$O0J2<$N$h$&$KDj5A$5$l$F$$$^$9!'(B + +@quotation +``Content-Type'' ``:'' @strong{type} ``/'' +@strong{subtype} *( ``;'' @strong{parameter} ) +@end quotation + +$BNc$($P!"(B + +@quotation +@example +Content-Type: image/jpeg +@end example +@end quotation + +@noindent +$B$d(B + +@quotation +@example +Content-Type: text/plain; charset=iso-2022-jp +@end example +@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 + +@noindent +@strong{[Memo]} +@quotation + +Content-Type $BMs$N$J$$(B entity $B$O(B + +@quotation +@example +Content-Type: text/plain; charset=us-ascii +@end example +@end quotation + +@noindent +$B$H$7$F2r<a$5$l$k!#(B(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 + +@deffn{Structure} mime-content-type + +Content-Type $BMs$N>pJs$r3JG<$9$k$?$a$N9=B$BN!#(B@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 + +$B$3$N9=B$BN$NMWAG$O0J2<$NDL$j$G$"$k!'(B + +@table @var +@item primary-type +media-type $B$N<g7?(B (symbol). + +@item subtype +media-type $B$NI{7?(B (symbol). + +@item parameters +Content-Type $BMs$N(B parameter ($BO"A[(B list). + +@end table +@end deffn + + +@defun make-mime-content-type type subtype + &optional parameters + +content-type $B$N@8@.;R!#(B +@end defun + + +@defun mime-content-type-parameter content-type parameter + +@var{content-type} $B$N(B @var{parameter} $B$NCM$rJV$9!#(B +@end defun + + + +@node Content-Type parser, Content-Type utility, mime-content-type, Content-Type +@section Content-Type $BMs$N2r@O4o(B + +@defun mime-parse-Content-Type string + +@var{string} $B$r(B content-type $B$H$7$F2r@O$7$?7k2L$rJV$9!#(B +@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 + +Content-Type $BMs$,B8:_$7$J$$>l9g$O(B nil $B$rJV$9!#(B +@end defun + + + +@node Content-Type utility, , Content-Type parser, Content-Type +@section Content-Type $B$K4X$9$kM-MQ$J4X?t(B + +@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 +@end defun + + + +@node Content-Disposition, Content-Transfer-Encoding, Content-Type, Top +@chapter Content-Disposition $BMs$N>pJs(B +@cindex mime-content-disposition +@cindex RFC 2183 +@cindex Standards Track +@cindex Content-Disposition $BMs(B + +@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 + + +@noindent +[RFC 2183] +@quotation +S. Dorner, K. Moore and R. Troost, ``Communicating Presentation +Information in Internet Messages: The Content-Disposition Header'', +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 + + +@menu +* mime-content-disposition:: mime-content-disposition $B9=B$BN(B +* Content-Disposition parser:: Content-Disposition $BMs$N2r@O4o(B +@end menu + +@node mime-content-disposition, Content-Disposition parser, Content-Disposition, Content-Disposition +@section mime-content-disposition $B9=B$BN(B + +@deffn{Structure} mime-content-disposition + +Content-Disposition $BMs$N2r@O7k2L$r<}$a$k$?$a$N9=B$BN!#(B@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 + +$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). + +@end table +@end deffn + + +@defun mime-content-disposition-parameter content-disposition parameter + +@var{content-disposition} $B$N(B @var{parameter} $B$NCM$rJV$9!#(B +@end defun + + +@defun mime-content-disposition-filename content-disposition + +@var{content-disposition} $B$N(B filename $B$NCM$rJV$9!#(B +@end defun + + + +@node Content-Disposition parser, , mime-content-disposition, Content-Disposition +@section Content-Disposition $BMs$N2r@O4o(B + +@defun mime-parse-Content-Disposition string + +@var{string} $B$r(B content-disposition $B$H$7$F2r@O$7$?7k2L$rJV$9!#(B +@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 +@refill + +Content-Disposition $BMs$,B8:_$7$J$$>l9g$O(B nil $B$rJV$9!#(B +@end defun + + + +@node Content-Transfer-Encoding, encoded-word, Content-Disposition, Top +@chapter $BId9f2=K!(B +@cindex Content-Transfer-Encoding $BMs(B + +@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 + +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 +@refill + +$B$^$?!"(BContent-Transfer-Encoding $B$K4p$E$$$FId9f2=!&I|9f2=$r9T$&4X?t$bDs(B +$B6!$5$l$^$9!#(B + + +@menu +* Content-Transfer-Encoding parser:: Content-Transfer-Encoding $BMs$N2r@O4o(B +* encoder/decoder:: $BId9f2=!&I|9f2=(B +* 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 + +@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 +@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 + +Content-Transfer-Encoding $BMs$,B8:_$7$J$$>l9g$O(B@var{default-encoding} $B$r(B +$BJV$9!#(B +@end defun + + + +@node encoder/decoder, Encoding information, Content-Transfer-Encoding parser, Content-Transfer-Encoding +@section $BId9f2=!&I|9f2=(B + +@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 +@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 +@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 +@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 +@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>start<var> $B$H(B @var{end} $B$O(B buffer $B$N0LCV$G$9!#(B +@end defun + + + +@node Encoding information, mel-backend, encoder/decoder, Content-Transfer-Encoding +@section Other utilities + +@defun mime-encoding-list &optional SERVICE + +Content-Transfer-Encoding $B$N(B list $B$rJV$7$^$9!#(B@refill + +@var{service} $B$,;XDj$5$l$F$$$k$H!"$=$l$KBP$9$k(B +Content-Transfer-Encoding $B$rJV$7$^$9!#(B +@end defun + + +@defun mime-encoding-alist &optional SERVICE + +$BJd40$N$?$a$N(B Content-Transfer-Encoding $B$NI=$rJV$7$^$9!#(B@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 +@end defun + + + +@node mel-backend, generic function for mel-backend, Encoding information, Content-Transfer-Encoding +@section How to write encoder/decoder module + +@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{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 + +$BNc(B:@refill + +@lisp +(mel-define-method mime-write-decoded-region (start end filename + (nil "base64")) + "Decode and write current region encoded by base64 into FILENAME. +START and END are buffer positions." + (interactive + (list (region-beginning) (region-end) + (read-file-name "Write decoded region to file: "))) + (let ((str (buffer-substring start end))) + (with-temp-buffer + (insert (decode-base64-string str)) + (write-region-as-binary (point-min) (point-max) filename) + ))) +@end lisp +@end defmac + + +@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} $B$N:G=i$NMWAG$O(B service $B$G$9!#(B@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 + +$BNc(B:@refill + +@lisp +(mel-define-method-function (mime-encode-string string (nil "base64")) + 'encode-base64-string) +@end lisp +@end defmac + + + +@node generic function for mel-backend, , mel-backend, Content-Transfer-Encoding +@section $BId9f2=(B/$BI|9f2=(B service $B$rDI2C$9$kJ}K!(B + +@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{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 + +$BNc(B:@refill + +@lisp +(mel-define-service encoded-text-encode-string (string encoding) + "Encode STRING as encoded-text using ENCODING. +ENCODING must be string.") +@end lisp +@end defmac + + + +@node encoded-word, custom, Content-Transfer-Encoding, Top +@chapter Header $B$N(B network $BI=8=(B +@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 + + +@noindent +[RFC 2047] +@quotation +K. Moore, ``MIME (Multipurpose Internet Mail Extensions) Part Three: +Message Header Extensions for Non-ASCII Text'', November 1996, Standards +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 + +FLIM $B$O$3$l$i$rId9f2=!&I|9f2=$9$k5!G=$rDs6!$7$^$9!#(B + + +@menu +* Header encoder/decoder:: Header $B$NId9f2=!&I|9f2=(B +@end menu + +@node Header encoder/decoder, , encoded-word, encoded-word +@section Header $B$NId9f2=!&I|9f2=(B + +@defun eword-decode-header &optional code-conversion separator + +Header $BCf$N(B encoded-word $B$rI|9f$9$k!#(B@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 + +$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 +@end defun + + +@defun eword-encode-header &optional code-conversion + +Header $B$r(B network $BI=8=$KId9f2=$9$k!#(B@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 +@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 + +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 $B$,(B @code{nil} $B$G$"$l$P!"(BFIELD $B$OId9f2=$5$l$J$$!#(B + +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 + +$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 +@end defvar + + + +@node custom, Appendix, encoded-word, Top +@chapter $B0lHL@_Dj(B + +@deffn{group} mime + +MIME $B4XO"5!G=$K4X$9$k(B group.@refill + +@code{mail} $B$H(B @code{news} $B$KB0$9$k!#(B +@end deffn + + +@node Appendix, Concept Index, custom, Top +@chapter $BIUO?(B + + +@menu +* Glossary:: $BMQ8l(B +* Bug report:: bug $BJs9p$N;EJ}(B +* CVS:: CVS $B$K$h$k3+H/(B +* History:: $BNr;K(B +@end menu + +@node Glossary, Bug report, Appendix, Appendix +@section $BMQ8l(B + + +@menu +* 7bit:: +* 8bit:: +* ASCII:: +* Base64:: +* binary:: +* Coded character set:: Coded character set$B!JId9f2=J8;z=89g!K(B, Character code$B!JJ8;zId9f!K(B +* media-type:: +* message:: +* MIME:: +* MIME charset:: +* MTA:: +* MUA:: +* Quoted-Printable:: +* RFC 822:: +* RFC 1036:: +* RFC 2045:: +* RFC 2046:: +* RFC 2048:: +* RFC 2049:: +* plain text:: +* us-ascii:: +@end menu + +@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 $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 +@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 + + +@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 $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 +@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 + + +@node ASCII, Base64, 8bit, Glossary +@subsection ASCII +@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 + + +@noindent +[ASCII] +@quotation +``Coded Character Set -- 7-Bit American Standard Code for Information +Interchange'', ANSI X3.4:1986. +@end quotation + + + +@node Base64, binary, ASCII, Glossary +@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 + +$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 + + +@node binary, Coded character set, Base64, Glossary +@subsection binary +@cindex binary data +@cindex binary + +$BG$0U$N(B byte $BNs$r(B @strong{binary} $B$H8F$V!#(B@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 + +$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 + +$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 + + +@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 + +$BJ8;z$H(B byte $BNs$H#1BP#1$KBP1~IU$1$k[#Kf$G$J$$5,B'$N=89g!#(B + + +@node media-type, message, Coded character set, Glossary +@subsection media-type +@cindex x-token +@cindex primary-type/subtype +@cindex message +@cindex multipart +@cindex application +@cindex video +@cindex audio +@cindex image +@cindex text +@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 + +primary-type $B$OI8=`$G$O(B + +@itemize @bullet +@item +@strong{text} +@item +@strong{image} +@item +@strong{audio} +@item +@strong{video} +@item +@strong{application} +@item +@strong{multipart} (@ref{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 + +@noindent +@strong{[$BCm0U(B]} +@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 +@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 + +(cf. @ref{Content-Type}) + + + +@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 + + +@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 + +@enumerate +@item +$BJ8=q(B message body $B$K$*$1$k(B US-ASCII $B0J30$NJ8;z=89g(B +@item +$BHsJ8=q(B message body +@item +$BJ#?t$NItJ,$+$i$J$k(B message body +@item +US-ASCII $B0J30$NJ8;z=89g$+$i$J$kJ8=q(B header $B>pJs(B +@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 + + +@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 + +RFC 2045 (@ref{RFC 2045}) $B$GDj5A$5$l$F$$$k!#(B@refill + +iso-2022-jp $B$d(B euc-kr $B$O$=$N#1$D!#(B + + +@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 + +(cf. @ref{MUA}) + + + +@node MUA, Quoted-Printable, MTA, Glossary +@subsection MUA +@cindex Message User Agent + +@strong{Message User Agent} $B$NN,$G!"(Bmail reader $B$H(B news reader $B$NAm>N!#(B +@refill + +(cf. @ref{MTA}) + + + +@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 + +`=' $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 + + +@node RFC 822, RFC 1036, Quoted-Printable, Glossary +@subsection RFC 822 +@cindex RFC 822 +@cindex STD 11 +@cindex Internet message +@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. + +@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 +@end quotation + + + +@noindent +[RFC 822] +@quotation +D. Crocker, ``Standard for the Format of ARPA Internet Text Messages'', +August 1982, STD 11. +@end quotation + + + +@node RFC 1036, RFC 2045, RFC 822, Glossary +@subsection RFC 1036 +@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 + + +@noindent +[USENET: RFC 1036] +@quotation +M. Horton and R. Adams, ``Standard for Interchange of USENET Messages'', +December 1987, (obsolete RFC 850). +@end quotation + + + +@node RFC 2045, RFC 2046, RFC 1036, Glossary +@subsection RFC 2045 +@cindex RFC 2045 +@cindex Standards Track + + +@noindent +[RFC 2045] +@quotation +N. Freed and N. Borenstein, ``Multipurpose Internet Mail Extensions +(MIME) Part One: Format of Internet Message Bodies'', November 1996, +Standards Track (obsolete RFC 1521, 1522, 1590). +@end quotation + + + +@node RFC 2046, RFC 2048, RFC 2045, Glossary +@subsection RFC 2046 +@cindex RFC 2046 +@cindex Standards Track + + +@noindent +[RFC 2046] +@quotation +N. Freed and N. Borenstein, ``Multipurpose Internet Mail Extensions +(MIME) Part Two: Media Types'', November 1996, Standards Track (obsolete +RFC 1521, 1522, 1590). +@end quotation + + + +@node RFC 2048, RFC 2049, RFC 2046, Glossary +@subsection RFC 2048 +@cindex RFC 2048 +@cindex Standards Track + + +@noindent +[RFC 2048] +@quotation +N. Freed, J. Klensin and J. Postel, ``Multipurpose Internet Mail +Extensions (MIME) Part Four: Registration Procedures'', November 1996, +Standards Track (obsolete RFC 1521, 1522, 1590). +@end quotation + + + +@node RFC 2049, plain text, RFC 2048, Glossary +@subsection RFC 2049 +@cindex RFC 2049 +@cindex Standards Track + + +@noindent +[RFC 2049] +@quotation +N. Freed and N. Borenstein, ``Multipurpose Internet Mail Extensions +(MIME) Part Five: Conformance Criteria and Examples'', November 1996, +Standards Track (obsolete RFC 1521, 1522, 1590). +@end quotation + + + +@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}) + + + +@node us-ascii, , plain text, Glossary +@subsection us-ascii +@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 + +ASCII (@ref{ASCII}) $B$N$_$+$i$J$j(B ISO 2022 $B$K$h$kId9f3HD%$O5v$5$l$J$$!#(B + +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 + +$B$^$?!"(BRFC 822 (@ref{RFC 822}) $B$K$*$1$k(B @strong{ASCII} $B$O(B us-ascii $B$G$"$k!#(B + + +@node Bug report, CVS, Glossary, Appendix +@section bug $BJs9p$N;EJ}(B + +FLIM $B$N%P%0$r8+$D$1$?$i!"0J2<$N(B address $B$K(B mail $B$rAw$C$F$/$@$5$$!'(B + +@itemize @bullet +@item + $B1Q8l(B <emacs-mime-en@@m17n.org> +@item + $BF|K\8l(B <emacs-mime-ja@@m17n.org> +@end itemize + + +$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 + +$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 + +@itemize @bullet +@item + $B1Q8l(B <emacs-mime-en-ctl@@m17n.org> +@item + $BF|K\8l(B <emacs-mime-ja-ctl@@m17n.org> +@end itemize + +@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 + +@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 +@end example + + +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 + + +@node Concept Index, Function Index, Appendix, Top +@chapter $B35G0:w0z(B + +@printindex cp + +@node Function Index, Variable Index, Concept Index, Top +@chapter $B4X?t:w0z(B + +@printindex fn + +@node Variable Index, , Function Index, Top +@chapter $BJQ?t:w0z(B + +@printindex vr +@bye diff --git a/flim-1.14.9/mime-parse.el b/flim-1.14.9/mime-parse.el new file mode 100644 index 0000000..5f34c07 --- /dev/null +++ b/flim-1.14.9/mime-parse.el @@ -0,0 +1,511 @@ +;;; mime-parse.el --- MIME message parser + +;; Copyright (C) 1994,95,96,97,98,99,2001 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> +;; Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp> +;; Keywords: parse, MIME, multimedia, mail, news + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'mime-def) +(require 'luna) +(require 'std11) + +(autoload 'mime-entity-body-buffer "mime") +(autoload 'mime-entity-body-start-point "mime") +(autoload 'mime-entity-body-end-point "mime") + + +;;; @ lexical analyzer +;;; + +(defcustom mime-lexical-analyzer + '(std11-analyze-quoted-string + std11-analyze-domain-literal + std11-analyze-comment + std11-analyze-spaces + mime-analyze-tspecial + mime-analyze-token) + "*List of functions to return result of lexical analyze. +Each function must have two arguments: STRING and START. +STRING is the target string to be analyzed. +START is start position of STRING to analyze. + +Previous function is preferred to next function. If a function +returns nil, next function is used. Otherwise the return value will +be the result." + :group 'mime + :type '(repeat function)) + +(defun mime-analyze-tspecial (string start) + (if (and (> (length string) start) + (memq (aref string start) mime-tspecial-char-list)) + (cons (cons 'tspecials (substring string start (1+ start))) + (1+ start)))) + +(defun mime-analyze-token (string start) + (if (and (string-match mime-token-regexp string start) + (= (match-beginning 0) start)) + (let ((end (match-end 0))) + (cons (cons 'mime-token (substring string start end)) + end)))) + +(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)) + + +;;; @ field parser +;;; + +(defun mime-decode-parameter-value (text charset language) + (with-temp-buffer + (set-buffer-multibyte nil) + (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 + (buffer-substring (point)(- (point) 2)) + 16) + (delete-region (point)(- (point) 3))))) + (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))) + (when language + (put-text-property 0 (length text) 'mime-language language text)) + text)) + +(defun mime-decode-parameter-encode-segment (segment) + (with-temp-buffer + (set-buffer-multibyte nil) + (insert segment) + (goto-char (point-min)) + (while (progn + (when (looking-at (eval-when-compile + (concat mime-attribute-char-regexp "+"))) + (goto-char (match-end 0))) + (not (eobp))) + (insert (prog1 (format "%%%02X" (char-int (char-after))) + (delete-region (point)(1+ (point)))))) + (buffer-string))) + +(defun mime-decode-parameters (params) + "Decode PARAMS as a property list of MIME parameter values. +Return value is an association list of MIME parameter values. +If parameter continuation is used, segments of values are concatenated. +If parameters contain charset information, values are decoded. +If parameters contain language information, it is set to `mime-language' +property of the decoded-value." + ;; (unless (zerop (% (length params) 2)) ...) + (let ((len (/ (length params) 2)) + dest eparams) + (while params + (if (and (string-match (eval-when-compile + (concat "^\\(" mime-attribute-char-regexp "+\\)" + "\\(\\*[0-9]+\\)?" ; continuation + "\\(\\*\\)?$")) ; charset/language + (car params)) + (> (match-end 0) (match-end 1))) + ;; parameter value extensions are used. + (let* ((attribute (downcase + (substring (car params) 0 (match-end 1)))) + (section (if (match-beginning 2) + (string-to-int + (substring (car params) + (1+ (match-beginning 2)) + (match-end 2))) + 0)) + ;; EPARAM := (ATTRIBUTE VALUES CHARSET LANGUAGE) + ;; VALUES := [1*VALUE] ; vector of LEN elements. + (eparam (assoc attribute eparams)) + (value (progn + (setq params (cdr params)) + (car params)))) + (if eparam + (setq eparam (cdr eparam)) + (setq eparam (list (make-vector len nil) nil nil) + eparams (cons (cons attribute eparam) eparams))) + ;; if parameter-name ends with "*", it is an extended-parameter. + (if (match-beginning 3) + (if (zerop section) + ;; extended-initial-parameter. + (if (string-match (eval-when-compile + (concat + "^\\(" mime-charset-regexp "\\)?" + "'\\(" mime-language-regexp "\\)?" + "'\\(\\(" mime-attribute-char-regexp + "\\|%[0-9A-Fa-f][0-9A-Fa-f]\\)+\\)$")) + value) + (progn + ;; text + (aset (car eparam) 0 + (substring value (match-beginning 3))) + (setq eparam (cdr eparam)) + ;; charset + (when (match-beginning 1) + (setcar eparam + (downcase + (substring value 0 (match-end 1))))) + (setq eparam (cdr eparam)) + ;; language + (when (match-beginning 2) + (setcar eparam + (intern + (downcase + (substring value + (match-beginning 2) + (match-end 2))))))) + ;; invalid parameter-value. + (aset (car eparam) 0 + (mime-decode-parameter-encode-segment value))) + ;; extended-other-parameter. + (if (string-match (eval-when-compile + (concat + "^\\(\\(" mime-attribute-char-regexp + "\\|%[0-9A-Fa-f][0-9A-Fa-f]\\)+\\)$")) + value) + (aset (car eparam) section value) + ;; invalid parameter-value. + (aset (car eparam) section + (mime-decode-parameter-encode-segment value)))) + ;; regular-parameter. parameter continuation only. + (aset (car eparam) section + (mime-decode-parameter-encode-segment value)))) + ;; parameter value extensions are not used, + ;; or invalid attribute-name (in RFC2231, although valid in RFC2045). + (setq dest (cons (cons (downcase (car params)) +;;; ;; decode (invalid!) encoded-words. +;;; (eword-decode-string +;;; (decode-mime-charset-string +;;; (car (cdr params)) +;;; default-mime-charset) +;;; 'must-unfold) + (car (cdr params))) + dest) + params (cdr params))) + (setq params (cdr params))) + ;; concat and decode parameters. + (while eparams + (setq dest (cons (cons (car (car eparams)) ; attribute + (mime-decode-parameter-value + (mapconcat (function identity) + (nth 1 (car eparams)) ; values + "") + (nth 2 (car eparams)) ; charset + (nth 3 (car eparams)) ; language + )) + dest) + eparams (cdr eparams))) + dest)) + +;;; 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) + +(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...)." + (let (params attribute) + (while (and tokens + (eq (car (car tokens)) 'tspecials) + (string= (cdr (car tokens)) ";") + (setq tokens (cdr tokens)) + (eq (car (car tokens)) 'mime-token) + (progn + (setq attribute (cdr (car tokens))) + (setq tokens (cdr tokens))) + (eq (car (car tokens)) 'tspecials) + (string= (cdr (car tokens)) "=") + (setq tokens (cdr tokens)) + (memq (car (car tokens)) '(mime-token quoted-string))) + (setq params (cons (if (eq (car (car tokens)) 'quoted-string) + (std11-strip-quoted-pair (cdr (car tokens))) + (cdr (car tokens))) + (cons attribute params)) + tokens (cdr tokens))) + (nreverse params))) + + +;;; @@ Content-Type +;;; + +;;;###autoload +(defun mime-parse-Content-Type (field-body) + "Parse FIELD-BODY as a Content-Type field. +FIELD-BODY is a string. +Return value is a mime-content-type object. +If FIELD-BODY is not a valid Content-Type field, return nil." + (let ((tokens (mime-lexical-analyze field-body))) + (when (eq (car (car tokens)) 'mime-token) + (let ((primary-type (cdr (car tokens)))) + (setq tokens (cdr tokens)) + (when (and (eq (car (car tokens)) 'tspecials) + (string= (cdr (car tokens)) "/") + (setq tokens (cdr tokens)) + (eq (car (car tokens)) 'mime-token)) + (make-mime-content-type + (intern (downcase primary-type)) + (intern (downcase (cdr (car tokens)))) + (mime-decode-parameters + (mime-parse-parameters (cdr tokens))))))))) + +;;;###autoload +(defun mime-read-Content-Type () + "Parse field-body of Content-Type field of current-buffer. +Return value is a mime-content-type object. +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) + ))) + + +;;; @@ Content-Disposition +;;; + +;;;###autoload +(defun mime-parse-Content-Disposition (field-body) + "Parse FIELD-BODY as a Content-Disposition field. +FIELD-BODY is a string. +Return value is a mime-content-disposition object. +If FIELD-BODY is not a valid Content-Disposition field, return nil." + (let ((tokens (mime-lexical-analyze field-body))) + (when (eq (car (car tokens)) 'mime-token) + (make-mime-content-disposition + (intern (downcase (cdr (car tokens)))) + (mime-decode-parameters + (mime-parse-parameters (cdr tokens))))))) + +;;;###autoload +(defun mime-read-Content-Disposition () + "Parse field-body of Content-Disposition field of current-buffer. +Return value is a mime-content-disposition object. +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) + ))) + + +;;; @@ Content-Transfer-Encoding +;;; + +;;;###autoload +(defun mime-parse-Content-Transfer-Encoding (field-body) + "Parse FIELD-BODY as a Content-Transfer-Encoding field. +FIELD-BODY is a string. +Return value is a string. +If FIELD-BODY is not a valid Content-Transfer-Encoding field, return nil." + (let ((tokens (mime-lexical-analyze field-body))) + (when (eq (car (car tokens)) 'mime-token) + (downcase (cdr (car tokens)))))) + +;;;###autoload +(defun mime-read-Content-Transfer-Encoding () + "Parse field-body of Content-Transfer-Encoding field of current-buffer. +Return value is a string. +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) + ))) + + +;;; @@ Content-ID / Message-ID +;;; + +;;;###autoload +(defun mime-parse-msg-id (tokens) + "Parse TOKENS as msg-id of Content-ID or Message-ID field." + (car (std11-parse-msg-id tokens))) + +;;;###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 . ">")))))) + + +;;; @ message parser +;;; + +;; (defun mime-parse-multipart (entity) +;; (with-current-buffer (mime-entity-body-buffer entity) +;; (let* ((representation-type +;; (mime-entity-representation-type-internal entity)) +;; (content-type (mime-entity-content-type-internal entity)) +;; (dash-boundary +;; (concat "--" +;; (mime-content-type-parameter content-type "boundary"))) +;; (delimiter (concat "\n" (regexp-quote dash-boundary))) +;; (close-delimiter (concat delimiter "--[ \t]*$")) +;; (rsep (concat delimiter "[ \t]*\n")) +;; (dc-ctl +;; (if (eq (mime-content-type-subtype content-type) 'digest) +;; (make-mime-content-type 'message 'rfc822) +;; (make-mime-content-type 'text 'plain) +;; )) +;; (body-start (mime-entity-body-start-point entity)) +;; (body-end (mime-entity-body-end-point entity))) +;; (save-restriction +;; (goto-char body-end) +;; (narrow-to-region body-start +;; (if (re-search-backward close-delimiter nil t) +;; (match-beginning 0) +;; body-end)) +;; (goto-char body-start) +;; (if (re-search-forward +;; (concat "^" (regexp-quote dash-boundary) "[ \t]*\n") +;; nil t) +;; (let ((cb (match-end 0)) +;; ce ncb ret children +;; (node-id (mime-entity-node-id-internal entity)) +;; (i 0)) +;; (while (re-search-forward rsep nil t) +;; (setq ce (match-beginning 0)) +;; (setq ncb (match-end 0)) +;; (save-restriction +;; (narrow-to-region cb ce) +;; (setq ret (mime-parse-message representation-type dc-ctl +;; entity (cons i node-id))) +;; ) +;; (setq children (cons ret children)) +;; (goto-char (setq cb ncb)) +;; (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))) +;; ) +;; (setq children (cons ret children)) +;; (mime-entity-set-children-internal entity (nreverse children)) +;; ) +;; (mime-entity-set-content-type-internal +;; entity (make-mime-content-type 'message 'x-broken)) +;; nil) +;; )))) + +;; (defun mime-parse-encapsulated (entity) +;; (mime-entity-set-children-internal +;; entity +;; (with-current-buffer (mime-entity-body-buffer entity) +;; (save-restriction +;; (narrow-to-region (mime-entity-body-start-point entity) +;; (mime-entity-body-end-point entity)) +;; (list (mime-parse-message +;; (mime-entity-representation-type-internal entity) nil +;; entity (cons 0 (mime-entity-node-id-internal entity)))) +;; )))) + +;; (defun mime-parse-external (entity) +;; (require 'mmexternal) +;; (mime-entity-set-children-internal +;; entity +;; (with-current-buffer (mime-entity-body-buffer entity) +;; (save-restriction +;; (narrow-to-region (mime-entity-body-start-point entity) +;; (mime-entity-body-end-point entity)) +;; (list (mime-parse-message +;; 'mime-external-entity nil +;; entity (cons 0 (mime-entity-node-id-internal entity)))) +;; ;; [tomo] Should we unify with `mime-parse-encapsulated'? +;; )))) + +(defun mime-parse-message (representation-type &optional default-ctl + parent node-id) + (let ((header-start (point-min)) + header-end + body-start + (body-end (point-max)) + content-type) + (goto-char header-start) + (if (re-search-forward "^$" nil t) + (setq header-end (match-end 0) + body-start (if (= header-end body-end) + body-end + (1+ header-end))) + (setq header-end (point-min) + 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)) + ) + (luna-make-entity representation-type + :location (current-buffer) + :content-type content-type + :parent parent + :node-id node-id + :buffer (current-buffer) + :header-start header-start + :header-end header-end + :body-start body-start + :body-end body-end) + )) + + +;;; @ for buffer +;;; + +;;;###autoload +(defun mime-parse-buffer (&optional buffer representation-type) + "Parse BUFFER as a MIME message. +If buffer is omitted, it parses current-buffer." + (require 'mmbuffer) + (save-excursion + (if buffer (set-buffer buffer)) + (mime-parse-message (or representation-type + 'mime-buffer-entity) nil))) + + +;;; @ end +;;; + +(provide 'mime-parse) + +;;; mime-parse.el ends here diff --git a/flim-1.14.9/mime.el b/flim-1.14.9/mime.el new file mode 100644 index 0000000..9dc2fcc --- /dev/null +++ b/flim-1.14.9/mime.el @@ -0,0 +1,437 @@ +;;; mime.el --- MIME library module + +;; Copyright (C) 1998,1999,2000,2001,2003 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko <tomo@m17n.org> +;; Keywords: MIME, multimedia, mail, news + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'alist) +(require 'std11) +(require 'mime-def) +(require 'eword-decode) + +(eval-when-compile (require 'mmgeneric)) + +(eval-and-compile + +(autoload 'mime-encode-header-in-buffer "eword-encode" + "Encode header fields to network representation, such as MIME encoded-word.") + +(autoload 'mime-parse-Content-Type "mime-parse" + "Parse STRING as field-body of Content-Type field.") +(autoload 'mime-read-Content-Type "mime-parse" + "Read field-body of Content-Type field from current-buffer, +and return parsed it.") + +(autoload 'mime-parse-Content-Disposition "mime-parse" + "Parse STRING as field-body of Content-Disposition field.") +(autoload 'mime-read-Content-Disposition "mime-parse" + "Read field-body of Content-Disposition field from current-buffer, +and return parsed it.") + +(autoload 'mime-parse-Content-Transfer-Encoding "mime-parse" + "Parse STRING as field-body of Content-Transfer-Encoding field.") +(autoload 'mime-read-Content-Transfer-Encoding "mime-parse" + "Read field-body of Content-Transfer-Encoding field from +current-buffer, and return it.") + +(autoload 'mime-parse-msg-id "mime-parse" + "Parse TOKENS as msg-id of Content-Id or Message-Id field.") + +(autoload 'mime-uri-parse-cid "mime-parse" + "Parse STRING as cid URI.") + +(autoload 'mime-parse-buffer "mime-parse" + "Parse BUFFER as a MIME message.") + +) + +(autoload 'mime-encode-field-body "eword-encode" + "Encode FIELD-BODY as FIELD-NAME, and return the result.") + + +;;; @ Entity Representation and Implementation +;;; + +(defmacro mime-entity-send (entity message &rest args) + `(luna-send ,entity ',(intern (format "mime-%s" (eval message))) ,@args)) + +(defun mime-open-entity (type location) + "Open an entity and return it. +TYPE is representation-type. +LOCATION is location of entity. Specification of it is depended on +representation-type." + (require (intern (format "mm%s" type))) + (luna-make-entity (mm-expand-class-name type) :location location)) + +(luna-define-generic mime-entity-cooked-p (entity) + "Return non-nil if contents of ENTITY has been already code-converted.") + + +;;; @ Entity as node of message +;;; + +(defun mime-entity-children (entity) + "Return list of entities included in the ENTITY." + (or (mime-entity-children-internal entity) + (luna-send entity 'mime-entity-children entity))) + +(defun mime-entity-node-id (entity) + "Return node-id of ENTITY." + (mime-entity-node-id-internal entity)) + +(defun mime-entity-number (entity) + "Return entity-number of ENTITY." + (reverse (mime-entity-node-id-internal entity))) + +(defun mime-find-entity-from-number (entity-number message) + "Return entity from ENTITY-NUMBER in MESSAGE." + (let ((sn (car entity-number))) + (if (null sn) + message + (let ((rc (nth sn (mime-entity-children message)))) + (if 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." + (mime-find-entity-from-number (reverse entity-node-id) message)) + +(defun mime-find-entity-from-content-id (cid message) + "Return entity from CID in MESSAGE." + (if (equal cid (mime-entity-read-field message "Content-Id")) + message + (let ((children (mime-entity-children message)) + ret) + (while (and children + (null (setq ret (mime-find-entity-from-content-id + cid (car children))))) + (setq children (cdr children))) + ret))) + +(defun mime-entity-parent (entity &optional message) + "Return mother entity of ENTITY. +If MESSAGE is specified, it is regarded as root entity." + (if (equal entity message) + nil + (mime-entity-parent-internal entity))) + +(defun mime-root-entity-p (entity &optional message) + "Return t if ENTITY is root-entity (message). +If MESSAGE is specified, it is regarded as root entity." + (null (mime-entity-parent entity message))) + +(defun mime-find-root-entity (entity) + "Return root entity of ENTITY." + (while (not (mime-root-entity-p entity)) + (setq entity (mime-entity-parent entity))) + entity) + + +;;; @ Header buffer (obsolete) +;;; + +;; (luna-define-generic mime-entity-header-buffer (entity)) + +;; (luna-define-generic mime-goto-header-start-point (entity) +;; "Set buffer and point to header-start-position of ENTITY.") + +;; (luna-define-generic mime-entity-header-start-point (entity) +;; "Return header-start-position of ENTITY.") + +;; (luna-define-generic mime-entity-header-end-point (entity) +;; "Return header-end-position of ENTITY.") + +;; (make-obsolete 'mime-entity-header-buffer "don't use it.") +;; (make-obsolete 'mime-goto-header-start-point "don't use it.") +;; (make-obsolete 'mime-entity-header-start-point "don't use it.") +;; (make-obsolete 'mime-entity-header-end-point "don't use it.") + + +;;; @ Body buffer (obsolete) +;;; + +;; (luna-define-generic mime-entity-body-buffer (entity)) + +;; (luna-define-generic mime-goto-body-start-point (entity) +;; "Set buffer and point to body-start-position of ENTITY.") + +;; (luna-define-generic mime-goto-body-end-point (entity) +;; "Set buffer and point to body-end-position of ENTITY.") + +;; (luna-define-generic mime-entity-body-start-point (entity) +;; "Return body-start-position of ENTITY.") + +;; (luna-define-generic mime-entity-body-end-point (entity) +;; "Return body-end-position of ENTITY.") + +;; (defalias 'mime-entity-body-start 'mime-entity-body-start-point) +;; (defalias 'mime-entity-body-end 'mime-entity-body-end-point) + +;; (make-obsolete 'mime-entity-body-buffer "don't use it.") +;; (make-obsolete 'mime-goto-body-start-point "don't use it.") +;; (make-obsolete 'mime-goto-body-end-point "don't use it.") +;; (make-obsolete 'mime-entity-body-start-point "don't use it.") +;; (make-obsolete 'mime-entity-body-end-point "don't use it.") +;; (make-obsolete 'mime-entity-body-start "don't use it.") +;; (make-obsolete 'mime-entity-body-end "don't use it.") + + +;;; @ Entity buffer (obsolete) +;;; + +;; (luna-define-generic mime-entity-buffer (entity)) +;; (make-obsolete 'mime-entity-buffer "don't use it.") + +;; (luna-define-generic mime-entity-point-min (entity)) +;; (make-obsolete 'mime-entity-point-min "don't use it.") + +;; (luna-define-generic mime-entity-point-max (entity)) +;; (make-obsolete 'mime-entity-point-max "don't use it.") + + +;;; @ Entity +;;; + +(luna-define-generic mime-insert-entity (entity) + "Insert header and body of ENTITY at point.") + +(luna-define-generic mime-write-entity (entity filename) + "Write header and body of ENTITY into FILENAME.") + + +;;; @ Entity Body +;;; + +(luna-define-generic mime-entity-body (entity) + "Return network representation of ENTITY body.") + +(luna-define-generic mime-insert-entity-body (entity) + "Insert network representation of ENTITY body at point.") + +(luna-define-generic mime-write-entity-body (entity filename) + "Write body of ENTITY into FILENAME.") + + +;;; @ Entity Content +;;; + +(luna-define-generic mime-entity-content (entity) + "Return content of ENTITY as byte sequence (string).") + +(luna-define-generic mime-insert-entity-content (entity) + "Insert content of ENTITY at point.") + +(luna-define-generic mime-write-entity-content (entity filename) + "Write content of ENTITY into FILENAME.") + +(luna-define-generic mime-insert-text-content (entity) + "Insert decoded text body of ENTITY.") + + +;;; @ Header fields +;;; + +(luna-define-generic mime-entity-fetch-field (entity field-name) + "Return the value of the ENTITY's header field whose type is FIELD-NAME.") + +;; (defun mime-fetch-field (field-name &optional entity) +;; "Return the value of the ENTITY's header field whose type is FIELD-NAME." +;; (if (symbolp field-name) +;; (setq field-name (symbol-name field-name)) +;; ) +;; (or entity +;; (setq entity mime-message-structure)) +;; (mime-entity-fetch-field entity field-name) +;; ) +;; (make-obsolete 'mime-fetch-field 'mime-entity-fetch-field) + +(defun mime-entity-content-type (entity) + "Return content-type of ENTITY." + (or (mime-entity-content-type-internal entity) + (let ((ret (mime-entity-fetch-field entity "Content-Type"))) + (if ret + (mime-entity-set-content-type-internal + entity (mime-parse-Content-Type ret)) + )))) + +(defun mime-entity-content-disposition (entity) + "Return content-disposition of ENTITY." + (or (mime-entity-content-disposition-internal entity) + (let ((ret (mime-entity-fetch-field entity "Content-Disposition"))) + (if ret + (mime-entity-set-content-disposition-internal + entity (mime-parse-Content-Disposition ret)) + )))) + +(defun mime-entity-encoding (entity &optional default-encoding) + "Return content-transfer-encoding of ENTITY. +If the ENTITY does not have Content-Transfer-Encoding field, this +function returns DEFAULT-ENCODING. If it is nil, \"7bit\" is used as +default value." + (or (mime-entity-encoding-internal entity) + (let ((ret (mime-entity-fetch-field entity "Content-Transfer-Encoding"))) + (mime-entity-set-encoding-internal + entity + (or (and ret (mime-parse-Content-Transfer-Encoding ret)) + default-encoding "7bit")) + ))) + +(defvar mime-field-parser-alist + '((Return-Path . std11-parse-route-addr) + + (Reply-To . std11-parse-addresses) + + (Sender . std11-parse-mailbox) + (From . std11-parse-addresses) + + (Resent-Reply-To . std11-parse-addresses) + + (Resent-Sender . std11-parse-mailbox) + (Resent-From . std11-parse-addresses) + + (To . std11-parse-addresses) + (Resent-To . std11-parse-addresses) + (Cc . std11-parse-addresses) + (Resent-Cc . std11-parse-addresses) + (Bcc . std11-parse-addresses) + (Resent-Bcc . std11-parse-addresses) + + (Message-Id . mime-parse-msg-id) + (Recent-Message-Id . mime-parse-msg-id) + + (In-Reply-To . std11-parse-msg-ids) + (References . std11-parse-msg-ids) + + (Content-Id . mime-parse-msg-id) + )) + +(defun mime-entity-read-field (entity field-name) + (let ((sym (if (symbolp field-name) + (prog1 + field-name + (setq field-name (symbol-name field-name))) + (intern (capitalize field-name))))) + (cond ((eq sym 'Content-Type) + (mime-entity-content-type entity) + ) + ((eq sym 'Content-Disposition) + (mime-entity-content-disposition entity) + ) + ((eq sym 'Content-Transfer-Encoding) + (mime-entity-encoding entity) + ) + (t + (let* ((header (mime-entity-parsed-header-internal entity)) + (field (cdr (assq sym header)))) + (or field + (let ((field-body (mime-entity-fetch-field entity field-name)) + parser) + (when field-body + (setq parser + (cdr (assq sym mime-field-parser-alist))) + (setq field + (if parser + (funcall parser + (eword-lexical-analyze field-body)) + (mime-decode-field-body field-body sym 'plain) + )) + (mime-entity-set-parsed-header-internal + entity (put-alist sym field header)) + field)))))))) + +;; (defun mime-read-field (field-name &optional entity) +;; (or entity +;; (setq entity mime-message-structure)) +;; (mime-entity-read-field entity field-name) +;; ) +;; (make-obsolete 'mime-read-field 'mime-entity-read-field) + +(luna-define-generic mime-insert-header (entity &optional invisible-fields + visible-fields) + "Insert before point a decoded header of ENTITY.") + + +;;; @ Entity Attributes +;;; + +(luna-define-generic mime-entity-name (entity) + "Return name of the ENTITY.") + +(defun mime-entity-uu-filename (entity) + (if (member (mime-entity-encoding entity) mime-uuencode-encoding-name-list) + (with-temp-buffer + (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)) + ))))) + +(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) + (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) + "Return primary media-type of ENTITY." + (mime-content-type-primary-type (mime-entity-content-type entity))) + +(defsubst mime-entity-media-subtype (entity) + "Return media-subtype of ENTITY." + (mime-content-type-subtype (mime-entity-content-type entity))) + +(defsubst mime-entity-parameters (entity) + "Return parameters of Content-Type of ENTITY." + (mime-content-type-parameters (mime-entity-content-type entity))) + +(defsubst mime-entity-type/subtype (entity-info) + "Return type/subtype of Content-Type of ENTITY." + (mime-type/subtype-string (mime-entity-media-type entity-info) + (mime-entity-media-subtype entity-info))) + +(defun mime-entity-set-content-type (entity content-type) + "Set ENTITY's content-type to CONTENT-TYPE." + (mime-entity-set-content-type-internal entity content-type)) + +(defun mime-entity-set-encoding (entity encoding) + "Set ENTITY's content-transfer-encoding to ENCODING." + (mime-entity-set-encoding-internal entity encoding)) + + +;;; @ end +;;; + +(provide 'mime) + +;;; mime.el ends here diff --git a/flim-1.14.9/mmbuffer.el b/flim-1.14.9/mmbuffer.el new file mode 100644 index 0000000..c605a59 --- /dev/null +++ b/flim-1.14.9/mmbuffer.el @@ -0,0 +1,359 @@ +;;; mmbuffer.el --- MIME entity module for binary buffer + +;; Copyright (C) 1998,1999,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko <tomo@m17n.org> +;; Keywords: MIME, multimedia, mail, news + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'mmgeneric) +(require 'mime) + +(eval-and-compile + (luna-define-class mime-buffer-entity (mime-entity) + (buffer + header-start + header-end + body-start + body-end)) + + (luna-define-internal-accessors 'mime-buffer-entity) + ) + +(luna-define-method initialize-instance :after ((entity mime-buffer-entity) + &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)) + (let ((header-start + (or (mime-buffer-entity-header-start-internal entity) + (mime-buffer-entity-set-header-start-internal + entity (point-min)))) + (header-end (mime-buffer-entity-header-end-internal entity)) + (body-start (mime-buffer-entity-body-start-internal entity)) + (body-end + (or (mime-buffer-entity-body-end-internal entity) + (mime-buffer-entity-set-body-end-internal entity (point-max))))) + (goto-char header-start) + (unless (and header-end body-start) + (if (re-search-forward "^$" body-end t) + (setq header-end (match-end 0) + body-start (if (= header-end body-end) + body-end + (1+ header-end))) + (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) + ) + (or (mime-entity-content-type-internal entity) + (save-restriction + (narrow-to-region header-start header-end) + (mime-entity-set-content-type-internal + entity + (let ((str (std11-fetch-field "Content-Type"))) + (if 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)) + ) + + +;;; @ entity +;;; + +(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)) + ) + +(luna-define-method mime-write-entity ((entity mime-buffer-entity) filename) + (save-excursion + (set-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) + filename)))) + + +;;; @ entity header +;;; + + +;;; @ entity body +;;; + +(luna-define-method mime-entity-body ((entity mime-buffer-entity)) + (save-excursion + (set-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)) + ) + +(luna-define-method mime-write-entity-body ((entity mime-buffer-entity) + filename) + (save-excursion + (set-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) + filename))) + + +;;; @ entity content +;;; + +(luna-define-method mime-entity-content ((entity mime-buffer-entity)) + (save-excursion + (set-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)) + (mime-entity-encoding entity)))) + +(luna-define-method mime-insert-entity-content ((entity mime-buffer-entity)) + (insert (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)) + (mime-entity-encoding entity))))) + +(luna-define-method mime-write-entity-content ((entity mime-buffer-entity) + filename) + (save-excursion + (set-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")) + )) + + +;;; @ header field +;;; + +(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)) + (save-restriction + (narrow-to-region (mime-buffer-entity-header-start-internal entity) + (mime-buffer-entity-header-end-internal entity)) + (let ((ret (std11-fetch-field field-name))) + (when ret + (or (symbolp field-name) + (setq field-name (intern (capitalize field-name)))) + (mime-entity-set-original-header-internal + entity + (put-alist field-name ret + (mime-entity-original-header-internal entity))) + ret)))))) + +(luna-define-method mime-insert-header ((entity mime-buffer-entity) + &optional invisible-fields + visible-fields) + (mime-insert-header-from-buffer + (mime-buffer-entity-buffer-internal entity) + (mime-buffer-entity-header-start-internal entity) + (mime-buffer-entity-header-end-internal entity) + invisible-fields visible-fields) + ) + + +;;; @ header buffer +;;; + +;; (luna-define-method mime-entity-header-buffer ((entity mime-buffer-entity)) +;; (mime-buffer-entity-buffer-internal entity) +;; ) + +;; (luna-define-method mime-goto-header-start-point ((entity mime-buffer-entity)) +;; (set-buffer (mime-buffer-entity-buffer-internal entity)) +;; (goto-char (mime-buffer-entity-header-start-internal entity)) +;; ) + +;; (luna-define-method mime-entity-header-start-point ((entity +;; mime-buffer-entity)) +;; (mime-buffer-entity-header-start-internal entity) +;; ) + +;; (luna-define-method mime-entity-header-end-point ((entity +;; mime-buffer-entity)) +;; (mime-buffer-entity-header-end-internal entity) +;; ) + + +;;; @ body buffer +;;; + +;; (luna-define-method mime-entity-body-buffer ((entity mime-buffer-entity)) +;; (mime-buffer-entity-buffer-internal entity) +;; ) + +;; (luna-define-method mime-goto-body-start-point ((entity mime-buffer-entity)) +;; (set-buffer (mime-buffer-entity-buffer-internal entity)) +;; (goto-char (mime-buffer-entity-body-start-internal entity)) +;; ) + +;; (luna-define-method mime-goto-body-end-point ((entity mime-buffer-entity)) +;; (set-buffer (mime-buffer-entity-buffer-internal entity)) +;; (goto-char (mime-buffer-entity-body-end-internal entity)) +;; ) + +;; (luna-define-method mime-entity-body-start-point ((entity mime-buffer-entity)) +;; (mime-buffer-entity-body-start-internal entity) +;; ) + +;; (luna-define-method mime-entity-body-end-point ((entity mime-buffer-entity)) +;; (mime-buffer-entity-body-end-internal entity) +;; ) + + +;;; @ buffer (obsolete) +;;; + +;; (luna-define-method mime-entity-buffer ((entity mime-buffer-entity)) +;; (mime-buffer-entity-buffer-internal entity) +;; ) + +;; (luna-define-method mime-entity-point-min ((entity mime-buffer-entity)) +;; (mime-buffer-entity-header-start-internal entity) +;; ) + +;; (luna-define-method mime-entity-point-max ((entity mime-buffer-entity)) +;; (mime-buffer-entity-body-end-internal entity) +;; ) + + +;;; @ children +;;; + +(defun mmbuffer-parse-multipart (entity &optional representation-type) + (with-current-buffer (mime-buffer-entity-buffer-internal entity) + (or representation-type + (setq representation-type + (mime-entity-representation-type-internal entity))) + (let* ((content-type (mime-entity-content-type-internal entity)) + (dash-boundary + (concat "--" + (mime-content-type-parameter content-type "boundary"))) + (delimiter (concat "\n" (regexp-quote dash-boundary))) + (close-delimiter (concat delimiter "--[ \t]*$")) + (rsep (concat delimiter "[ \t]*\n")) + (dc-ctl + (if (eq (mime-content-type-subtype content-type) 'digest) + (make-mime-content-type 'message 'rfc822) + (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 + (goto-char body-end) + (narrow-to-region body-start + (if (re-search-backward close-delimiter nil t) + (match-beginning 0) + body-end)) + (goto-char body-start) + (if (re-search-forward + (concat "^" (regexp-quote dash-boundary) "[ \t]*\n") + nil t) + (let ((cb (match-end 0)) + ce ncb ret children + (node-id (mime-entity-node-id-internal entity)) + (i 0)) + (while (re-search-forward rsep nil t) + (setq ce (match-beginning 0)) + (setq ncb (match-end 0)) + (save-restriction + (narrow-to-region cb ce) + (setq ret (mime-parse-message representation-type dc-ctl + entity (cons i node-id))) + ) + (setq children (cons ret children)) + (goto-char (setq cb ncb)) + (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))) + ) + (setq children (cons ret children)) + (mime-entity-set-children-internal entity (nreverse children)) + ) + (mime-entity-set-content-type-internal + entity (make-mime-content-type 'message 'x-broken)) + nil) + )))) + +(defun mmbuffer-parse-encapsulated (entity &optional external + representation-type) + (mime-entity-set-children-internal + entity + (with-current-buffer (mime-buffer-entity-buffer-internal entity) + (save-restriction + (narrow-to-region (mime-buffer-entity-body-start-internal entity) + (mime-buffer-entity-body-end-internal entity)) + (list (mime-parse-message + (if external + (progn + (require 'mmexternal) + 'mime-external-entity) + (or representation-type + (mime-entity-representation-type-internal entity))) + nil + entity (cons 0 (mime-entity-node-id-internal entity)))))))) + +(luna-define-method mime-entity-children ((entity mime-buffer-entity)) + (let* ((content-type (mime-entity-content-type entity)) + (primary-type (mime-content-type-primary-type content-type)) + sub-type) + (cond ((eq primary-type 'multipart) + (mmbuffer-parse-multipart entity)) + ((eq primary-type 'message) + (setq sub-type (mime-content-type-subtype content-type)) + (cond ((eq sub-type 'external-body) + (mmbuffer-parse-encapsulated entity 'external)) + ((memq sub-type '(rfc822 news)) + (mmbuffer-parse-encapsulated entity))))))) + + +;;; @ end +;;; + +(provide 'mmbuffer) + +;;; mmbuffer.el ends here diff --git a/flim-1.14.9/mmcooked.el b/flim-1.14.9/mmcooked.el new file mode 100644 index 0000000..c2b3066 --- /dev/null +++ b/flim-1.14.9/mmcooked.el @@ -0,0 +1,92 @@ +;;; mmcooked.el --- MIME entity implementation for binary buffer + +;; Copyright (C) 1998,1999 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> +;; Keywords: MIME, multimedia, mail, news + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'mmbuffer) + +(mm-define-backend cooked (buffer)) + +(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)) + (let ((encoding (or (mime-entity-encoding entity) "7bit"))) + (if (member encoding '("7bit" "8bit" "binary")) + (write-region (mime-buffer-entity-body-start-internal entity) + (mime-buffer-entity-body-end-internal entity) filename) + (mime-write-decoded-region + (mime-buffer-entity-body-start-internal entity) + (mime-buffer-entity-body-end-internal entity) + filename encoding) + )))) + +(mm-define-method write-entity ((entity cooked) filename) + (save-excursion + (set-buffer (mime-buffer-entity-buffer-internal entity)) + (write-region (mime-buffer-entity-header-start-internal entity) + (mime-buffer-entity-body-end-internal entity) + filename) + )) + +(mm-define-method write-entity-body ((entity cooked) filename) + (save-excursion + (set-buffer (mime-buffer-entity-buffer-internal entity)) + (write-region (mime-buffer-entity-body-start-internal entity) + (mime-buffer-entity-body-end-internal entity) + filename) + )) + +(luna-define-method mime-insert-header ((entity mime-cooked-entity) + &optional invisible-fields + visible-fields) + (let (default-mime-charset) + (funcall (car (luna-class-find-functions + (luna-find-class 'mime-buffer-entity) + 'mime-insert-header)) + entity invisible-fields visible-fields) + )) + +(mm-define-method insert-text-content ((entity cooked)) + (let ((str (mime-entity-content entity))) + (insert + (if (member (mime-entity-encoding entity) + '(nil "7bit" "8bit" "binary")) + str + (decode-mime-charset-string str + (or (mime-content-type-parameter + (mime-entity-content-type entity) + "charset") + default-mime-charset) + 'CRLF) + )))) + + +;;; @ end +;;; + +(provide 'mmcooked) + +;;; mmcooked.el ends here diff --git a/flim-1.14.9/mmexternal.el b/flim-1.14.9/mmexternal.el new file mode 100644 index 0000000..c107e64 --- /dev/null +++ b/flim-1.14.9/mmexternal.el @@ -0,0 +1,186 @@ +;;; mmexternal.el --- MIME entity module for external buffer + +;; Copyright (C) 1998,1999,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko <tomo@m17n.org> +;; Keywords: MIME, multimedia, mail, news + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'mmgeneric) +(require 'mime) + +(eval-and-compile + (luna-define-class mime-external-entity (mime-entity) + (body-buffer + body-file)) + (luna-define-internal-accessors 'mime-external-entity) + + ;; In an external entity, information of media-type or other + ;; information which are represented in a header in a non-external + ;; entity are in the body of the parent entity. + ) + +(luna-define-method mime-entity-name ((entity mime-external-entity)) + (concat "child of " + (mime-entity-name + (mime-entity-parent-internal entity)))) + + +(defun mmexternal-require-file-name (entity) + (condition-case nil + (or (mime-external-entity-body-file-internal entity) + (let* ((ct (mime-entity-content-type + (mime-entity-parent-internal entity))) + (access-type + (mime-content-type-parameter ct "access-type"))) + (if (and access-type + (string= access-type "anon-ftp")) + (let ((site (mime-content-type-parameter ct "site")) + (directory + (mime-content-type-parameter ct "directory")) + (name (mime-content-type-parameter ct "name"))) + (mime-external-entity-set-body-file-internal + entity + (expand-file-name + name + (concat "/anonymous@" site ":" + (file-name-as-directory directory)))))))) + (error (message "Can't make file-name of external-body.")))) + +(defun mmexternal-require-buffer (entity) + (unless (and (mime-external-entity-body-buffer-internal entity) + (buffer-live-p + (mime-external-entity-body-buffer-internal entity))) + (condition-case nil + (progn + (mmexternal-require-file-name entity) + (mime-external-entity-set-body-buffer-internal + entity + (with-current-buffer (get-buffer-create + (concat " *Body of " + (mime-entity-name entity) + "*")) + (binary-insert-encoded-file + (mime-external-entity-body-file-internal entity)) + (current-buffer)))) + (error (message "Can't get external-body."))))) + + +;;; @ entity +;;; + +(luna-define-method mime-insert-entity ((entity mime-external-entity)) + (mime-insert-entity-body (mime-entity-parent-internal entity)) + (insert "\n") + (mime-insert-entity-body entity)) + +(luna-define-method mime-write-entity ((entity mime-external-entity) filename) + (with-temp-buffer + (mime-insert-entity entity) + (let ((coding-system-for-write 'raw-text-dos)) + (write-region (point-min) (point-max) filename)))) + + +;;; @ entity header +;;; + + +;;; @ entity body +;;; + +(luna-define-method mime-entity-body ((entity mime-external-entity)) + (mmexternal-require-buffer entity) + (with-current-buffer (mime-external-entity-body-buffer-internal entity) + (buffer-string))) + +(luna-define-method mime-insert-entity-body ((entity mime-external-entity)) + (mmexternal-require-buffer entity) + (insert-buffer-substring + (mime-external-entity-body-buffer-internal entity))) + +(luna-define-method mime-write-entity-body ((entity mime-external-entity) + filename) + (mmexternal-require-buffer entity) + (with-current-buffer (mime-external-entity-body-buffer-internal entity) + (binary-write-decoded-region (point-min) (point-max) filename))) + + +;;; @ entity content +;;; + +(luna-define-method mime-entity-content ((entity mime-external-entity)) + (let ((ret (mime-entity-body entity))) + (if ret + (mime-decode-string ret (mime-entity-encoding entity)) + (message "Cannot get content") + nil))) + +(luna-define-method mime-insert-entity-content ((entity mime-external-entity)) + (insert (mime-entity-content entity))) + +(luna-define-method mime-write-entity-content ((entity mime-external-entity) + filename) + (mmexternal-require-buffer entity) + (with-current-buffer (mime-external-entity-body-buffer-internal entity) + (mime-write-decoded-region (point-min) (point-max) + filename + (or (mime-entity-encoding entity) "7bit")))) + + +;;; @ header field +;;; + +(luna-define-method mime-entity-fetch-field :around + ((entity mime-external-entity) field-name) + (or (luna-call-next-method) + (with-temp-buffer + (mime-insert-entity-body (mime-entity-parent-internal entity)) + (let ((ret (std11-fetch-field field-name))) + (when ret + (or (symbolp field-name) + (setq field-name (intern (capitalize field-name)))) + (mime-entity-set-original-header-internal + entity + (put-alist field-name ret + (mime-entity-original-header-internal entity))) + ret))))) + +(luna-define-method mime-insert-header ((entity mime-external-entity) + &optional invisible-fields + visible-fields) + (let ((the-buf (current-buffer)) + buf p-min p-max) + (with-temp-buffer + (mime-insert-entity-body (mime-entity-parent-internal entity)) + (setq buf (current-buffer) + p-min (point-min) + p-max (point-max)) + (set-buffer the-buf) + (mime-insert-header-from-buffer buf p-min p-max + invisible-fields visible-fields)))) + + +;;; @ end +;;; + +(provide 'mmexternal) + +;;; mmexternal.el ends here diff --git a/flim-1.14.9/mmgeneric.el b/flim-1.14.9/mmgeneric.el new file mode 100644 index 0000000..d215dc6 --- /dev/null +++ b/flim-1.14.9/mmgeneric.el @@ -0,0 +1,178 @@ +;;; mmgeneric.el --- MIME generic entity module + +;; Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko <tomo@m17n.org> +;; Keywords: definition, MIME, multimedia, mail, news + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'luna) + +(eval-when-compile + (require 'eword-decode) ; mime-find-field-presentation-method + ) + + +;;; @ MIME entity +;;; + +(autoload 'mime-entity-content-type "mime") +(autoload 'mime-parse-multipart "mime-parse") +(autoload 'mime-parse-message "mime-parse") +;; (autoload 'mime-parse-encapsulated "mime-parse") +;; (autoload 'mime-parse-external "mime-parse") +(autoload 'mime-entity-content "mime") + +(eval-and-compile + (luna-define-class mime-entity () + (location + content-type children parent + node-id + content-disposition encoding + ;; for other fields + original-header parsed-header)) + + (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) + +(luna-define-method mime-entity-fetch-field ((entity mime-entity) + field-name) + (or (symbolp field-name) + (setq field-name (intern (capitalize field-name)))) + (cdr (assq field-name + (mime-entity-original-header-internal entity)))) + +(luna-define-method mime-insert-text-content ((entity mime-entity)) + (insert + (decode-mime-charset-string (mime-entity-content entity) + (or (mime-content-type-parameter + (mime-entity-content-type entity) + "charset") + default-mime-charset) + 'CRLF) + )) + + +;;; @ for mm-backend +;;; + +(defmacro mm-expand-class-name (type) + `(intern (format "mime-%s-entity" ,type))) + +(defmacro mm-define-backend (type &optional parents) + `(luna-define-class ,(mm-expand-class-name type) + ,(nconc (mapcar (lambda (parent) + (mm-expand-class-name parent) + ) + parents) + '(mime-entity)))) + +(defmacro mm-define-method (name args &rest body) + (or (eq name 'initialize-instance) + (setq name (intern (format "mime-%s" name)))) + (let ((spec (car args))) + (setq args + (cons (list (car spec) + (mm-expand-class-name (nth 1 spec))) + (cdr args))) + `(luna-define-method ,name ,args ,@body) + )) + +(put 'mm-define-method 'lisp-indent-function 'defun) + +(def-edebug-spec mm-define-method + (&define name ((arg symbolp) + [&rest arg] + [&optional ["&optional" arg &rest arg]] + &optional ["&rest" arg] + ) + def-body)) + + +;;; @ header filter +;;; + +;; [tomo] We should think about specification of better filtering +;; 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))) + +(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") + ))))))) + + +;;; @ end +;;; + +(provide 'mmgeneric) + +;;; mmgeneric.el ends here diff --git a/flim-1.14.9/ntlm.el b/flim-1.14.9/ntlm.el new file mode 100644 index 0000000..7d43684 --- /dev/null +++ b/flim-1.14.9/ntlm.el @@ -0,0 +1,536 @@ +;;; ntlm.el --- NTLM (NT LanManager) authentication support + +;; Copyright (C) 2001 Taro Kawagishi +;; Author: Taro Kawagishi <tarok@transpulse.org> +;; Keywords: NTLM, SASL +;; Version: 1.00 +;; Created: February 2001 + +;; 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 2, 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 library is a direct translation of the Samba release 2.2.0 +;; implementation of Windows NT and LanManager compatible password +;; encryption. +;; +;; Interface functions: +;; +;; ntlm-build-auth-request +;; This will return a binary string, which should be used in the +;; base64 encoded form and it is the caller's responsibility to encode +;; the returned string with base64. +;; +;; ntlm-build-auth-response +;; It is the caller's responsibility to pass a base64 decoded string +;; (which will be a binary string) as the first argument and to +;; encode the returned string with base64. The second argument user +;; should be given in user@domain format. +;; +;; ntlm-get-password-hashes +;; +;; +;; NTLM authentication procedure example: +;; +;; 1. Open a network connection to the Exchange server at the IMAP port (143) +;; 2. Receive an opening message such as: +;; "* OK Microsoft Exchange IMAP4rev1 server version 5.5.2653.7 (XXXX) ready" +;; 3. Ask for IMAP server capability by sending "NNN capability" +;; 4. Receive a capability message such as: +;; "* CAPABILITY IMAP4 IMAP4rev1 IDLE LITERAL+ LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE AUTH=NTLM" +;; 5. Ask for NTLM authentication by sending a string +;; "NNN authenticate ntlm" +;; 6. Receive continuation acknowledgment "+" +;; 7. Send NTLM authentication request generated by 'ntlm-build-auth-request +;; 8. Receive NTLM challenge string following acknowledgment "+" +;; 9. Generate response to challenge by 'ntlm-build-auth-response +;; (here two hash function values of the user password are encrypted) +;; 10. Receive authentication completion message such as +;; "NNN OK AUTHENTICATE NTLM completed." + +;;; Code: + +(require 'md4) + +;;; +;;; NTLM authentication interface functions + +(defun ntlm-build-auth-request (user &optional domain) + "Return the NTLM authentication request string for USER and DOMAIN. +USER is a string representing a user name to be authenticated and +DOMAIN is a NT domain. USER can include a NT domain part as in +user@domain where the string after @ is used as the domain if DOMAIN +is not given." + (interactive) + (let ((request-ident (concat "NTLMSSP" (make-string 1 0))) + (request-msgType (concat (make-string 1 1) (make-string 3 0))) + ;0x01 0x00 0x00 0x00 + (request-flags (concat (make-string 1 7) (make-string 1 178) + (make-string 2 0))) + ;0x07 0xb2 0x00 0x00 + lu ld off-d off-u) + (when (string-match "@" user) + (unless domain + (setq domain (substring user (1+ (match-beginning 0))))) + (setq user (substring user 0 (match-beginning 0)))) + ;; set fields offsets within the request struct + (setq lu (length user)) + (setq ld (length domain)) + (setq off-u 32) ;offset to the string 'user + (setq off-d (+ 32 lu)) ;offset to the string 'domain + ;; pack the request struct in a string + (concat request-ident ;8 bytes + request-msgType ;4 bytes + request-flags ;4 bytes + (md4-pack-int16 lu) ;user field, count field + (md4-pack-int16 lu) ;user field, max count field + (md4-pack-int32 (cons 0 off-u)) ;user field, offset field + (md4-pack-int16 ld) ;domain field, count field + (md4-pack-int16 ld) ;domain field, max count field + (md4-pack-int32 (cons 0 off-d)) ;domain field, offset field + user ;bufer field + domain ;bufer field + ))) + +(eval-when-compile + (defmacro ntlm-string-as-unibyte (string) + (if (fboundp 'string-as-unibyte) + `(string-as-unibyte ,string) + string))) + +(defun ntlm-build-auth-response (challenge user password-hashes) + "Return the response string to a challenge string CHALLENGE given by +the NTLM based server for the user USER and the password hash list +PASSWORD-HASHES. NTLM uses two hash values which are represented +by PASSWORD-HASHES. PASSWORD-HASHES should be a return value of + (list (ntlm-smb-passwd-hash password) (ntlm-md4hash password))" + (let* ((rchallenge (ntlm-string-as-unibyte challenge)) + ;; get fields within challenge struct + ;;(ident (substring rchallenge 0 8)) ;ident, 8 bytes + ;;(msgType (substring rchallenge 8 12)) ;msgType, 4 bytes + (uDomain (substring rchallenge 12 20)) ;uDomain, 8 bytes + (flags (substring rchallenge 20 24)) ;flags, 4 bytes + (challengeData (substring rchallenge 24 32)) ;challengeData, 8 bytes + uDomain-len uDomain-offs + ;; response struct and its fields + lmRespData ;lmRespData, 24 bytes + ntRespData ;ntRespData, 24 bytes + domain ;ascii domain string + lu ld off-lm off-nt off-d off-u off-w off-s) + ;; extract domain string from challenge string + (setq uDomain-len (md4-unpack-int16 (substring uDomain 0 2))) + (setq uDomain-offs (md4-unpack-int32 (substring uDomain 4 8))) + (setq domain + (ntlm-unicode2ascii (substring challenge + (cdr uDomain-offs) + (+ (cdr uDomain-offs) uDomain-len)) + (/ uDomain-len 2))) + ;; overwrite domain in case user is given in <user>@<domain> format + (when (string-match "@" user) + (setq domain (substring user (1+ (match-beginning 0)))) + (setq user (substring user 0 (match-beginning 0)))) + + ;; generate response data + (setq lmRespData + (ntlm-smb-owf-encrypt (car password-hashes) challengeData)) + (setq ntRespData + (ntlm-smb-owf-encrypt (cadr password-hashes) challengeData)) + + ;; get offsets to fields to pack the response struct in a string + (setq lu (length user)) + (setq ld (length domain)) + (setq off-lm 64) ;offset to string 'lmResponse + (setq off-nt (+ 64 24)) ;offset to string 'ntResponse + (setq off-d (+ 64 48)) ;offset to string 'uDomain + (setq off-u (+ 64 48 (* 2 ld))) ;offset to string 'uUser + (setq off-w (+ 64 48 (* 2 (+ ld lu)))) ;offset to string 'uWks + (setq off-s (+ 64 48 (* 2 (+ ld lu lu)))) ;offset to string 'sessionKey + ;; pack the response struct in a string + (concat "NTLMSSP\0" ;response ident field, 8 bytes + (md4-pack-int32 '(0 . 3)) ;response msgType field, 4 bytes + + ;; lmResponse field, 8 bytes + ;;AddBytes(response,lmResponse,lmRespData,24); + (md4-pack-int16 24) ;len field + (md4-pack-int16 24) ;maxlen field + (md4-pack-int32 (cons 0 off-lm)) ;field offset + + ;; ntResponse field, 8 bytes + ;;AddBytes(response,ntResponse,ntRespData,24); + (md4-pack-int16 24) ;len field + (md4-pack-int16 24) ;maxlen field + (md4-pack-int32 (cons 0 off-nt)) ;field offset + + ;; uDomain field, 8 bytes + ;;AddUnicodeString(response,uDomain,domain); + ;;AddBytes(response, uDomain, udomain, 2*ld); + (md4-pack-int16 (* 2 ld)) ;len field + (md4-pack-int16 (* 2 ld)) ;maxlen field + (md4-pack-int32 (cons 0 off-d)) ;field offset + + ;; uUser field, 8 bytes + ;;AddUnicodeString(response,uUser,u); + ;;AddBytes(response, uUser, uuser, 2*lu); + (md4-pack-int16 (* 2 lu)) ;len field + (md4-pack-int16 (* 2 lu)) ;maxlen field + (md4-pack-int32 (cons 0 off-u)) ;field offset + + ;; uWks field, 8 bytes + ;;AddUnicodeString(response,uWks,u); + (md4-pack-int16 (* 2 lu)) ;len field + (md4-pack-int16 (* 2 lu)) ;maxlen field + (md4-pack-int32 (cons 0 off-w)) ;field offset + + ;; sessionKey field, 8 bytes + ;;AddString(response,sessionKey,NULL); + (md4-pack-int16 0) ;len field + (md4-pack-int16 0) ;maxlen field + (md4-pack-int32 (cons 0 (- off-s off-lm))) ;field offset + + ;; flags field, 4 bytes + flags ; + + ;; buffer field + lmRespData ;lmResponse, 24 bytes + ntRespData ;ntResponse, 24 bytes + (ntlm-ascii2unicode domain ;unicode domain string, 2*ld bytes + (length domain)) ; + (ntlm-ascii2unicode user ;unicode user string, 2*lu bytes + (length user)) ; + (ntlm-ascii2unicode user ;unicode user string, 2*lu bytes + (length user)) ; + ))) + +(defun ntlm-get-password-hashes (password) + "Return a pair of SMB hash and NT MD4 hash of the given password PASSWORD" + (list (ntlm-smb-passwd-hash password) + (ntlm-md4hash password))) + +(defun ntlm-ascii2unicode (str len) + "Convert an ASCII string into a NT Unicode string, which is +little-endian utf16." + (let ((utf (make-string (* 2 len) 0)) (i 0) val) + (while (and (< i len) + (not (eq (setq val (aref str i)) ?\0))) + (aset utf (* 2 i) val) + (aset utf (1+ (* 2 i)) 0) + (setq i (1+ i))) + utf)) + +(defun ntlm-unicode2ascii (str len) + "Extract 7 bits ASCII part of a little endian utf16 string STR of length LEN." + (let ((buf (make-string len 0)) (i 0) (j 0)) + (while (< i len) + (aset buf i (logand (aref str j) 127)) ;(string-to-number "7f" 16) + (setq i (1+ i) + j (+ 2 j))) + buf)) + +(defun ntlm-smb-passwd-hash (passwd) + "Return the SMB password hash string of 16 bytes long for the given password +string PASSWD. PASSWD is truncated to 14 bytes if longer." + (let ((len (min (length passwd) 14))) + (ntlm-smb-des-e-p16 + (concat (substring (upcase passwd) 0 len) ;fill top 14 bytes with passwd + (make-string (- 15 len) 0))))) + +(defun ntlm-smb-owf-encrypt (passwd c8) + "Return the response string of 24 bytes long for the given password +string PASSWD based on the DES encryption. PASSWD is of at most 14 +bytes long and the challenge string C8 of 8 bytes long." + (let ((len (min (length passwd) 16)) p22) + (setq p22 (concat (substring passwd 0 len) ;fill top 16 bytes with passwd + (make-string (- 22 len) 0))) + (ntlm-smb-des-e-p24 p22 c8))) + +(defun ntlm-smb-des-e-p24 (p22 c8) + "Return a 24 bytes hashed string for a 21 bytes string P22 and a 8 bytes +string C8." + (concat (ntlm-smb-hash c8 p22 t) ;hash first 8 bytes of p22 + (ntlm-smb-hash c8 (substring p22 7) t) + (ntlm-smb-hash c8 (substring p22 14) t))) + +(defconst ntlm-smb-sp8 [75 71 83 33 64 35 36 37]) + +(defun ntlm-smb-des-e-p16 (p15) + "Return a 16 bytes hashed string for a 15 bytes string P15." + (concat (ntlm-smb-hash ntlm-smb-sp8 p15 t) ;hash of first 8 bytes of p15 + (ntlm-smb-hash ntlm-smb-sp8 ;hash of last 8 bytes of p15 + (substring p15 7) t))) + +(defun ntlm-smb-hash (in key forw) + "Return the hash string of length 8 for a string IN of length 8 and +a string KEY of length 8. FORW is t or nil." + (let ((out (make-string 8 0)) + outb ;string of length 64 + (inb (make-string 64 0)) + (keyb (make-string 64 0)) + (key2 (ntlm-smb-str-to-key key)) + (i 0) aa) + (while (< i 64) + (unless (zerop (logand (aref in (/ i 8)) (lsh 1 (- 7 (% i 8))))) + (aset inb i 1)) + (unless (zerop (logand (aref key2 (/ i 8)) (lsh 1 (- 7 (% i 8))))) + (aset keyb i 1)) + (setq i (1+ i))) + (setq outb (ntlm-smb-dohash inb keyb forw)) + (setq i 0) + (while (< i 64) + (unless (eq (aref outb i) ?\0) + (setq aa (aref out (/ i 8))) + (aset out (/ i 8) + (logior aa (lsh 1 (- 7 (% i 8)))))) + (setq i (1+ i))) + out)) + +(defun ntlm-smb-str-to-key (str) + "Return a string of length 8 for the given string STR of length 7." + (let ((key (make-string 8 0)) + (i 7)) + (aset key 0 (lsh (aref str 0) -1)) + (aset key 1 (logior + (lsh (logand (aref str 0) 1) 6) + (lsh (aref str 1) -2))) + (aset key 2 (logior + (lsh (logand (aref str 1) 3) 5) + (lsh (aref str 2) -3))) + (aset key 3 (logior + (lsh (logand (aref str 2) 7) 4) + (lsh (aref str 3) -4))) + (aset key 4 (logior + (lsh (logand (aref str 3) 15) 3) + (lsh (aref str 4) -5))) + (aset key 5 (logior + (lsh (logand (aref str 4) 31) 2) + (lsh (aref str 5) -6))) + (aset key 6 (logior + (lsh (logand (aref str 5) 63) 1) + (lsh (aref str 6) -7))) + (aset key 7 (logand (aref str 6) 127)) + (while (>= i 0) + (aset key i (lsh (aref key i) 1)) + (setq i (1- i))) + key)) + +(defconst ntlm-smb-perm1 [57 49 41 33 25 17 9 + 1 58 50 42 34 26 18 + 10 2 59 51 43 35 27 + 19 11 3 60 52 44 36 + 63 55 47 39 31 23 15 + 7 62 54 46 38 30 22 + 14 6 61 53 45 37 29 + 21 13 5 28 20 12 4]) + +(defconst ntlm-smb-perm2 [14 17 11 24 1 5 + 3 28 15 6 21 10 + 23 19 12 4 26 8 + 16 7 27 20 13 2 + 41 52 31 37 47 55 + 30 40 51 45 33 48 + 44 49 39 56 34 53 + 46 42 50 36 29 32]) + +(defconst ntlm-smb-perm3 [58 50 42 34 26 18 10 2 + 60 52 44 36 28 20 12 4 + 62 54 46 38 30 22 14 6 + 64 56 48 40 32 24 16 8 + 57 49 41 33 25 17 9 1 + 59 51 43 35 27 19 11 3 + 61 53 45 37 29 21 13 5 + 63 55 47 39 31 23 15 7]) + +(defconst ntlm-smb-perm4 [32 1 2 3 4 5 + 4 5 6 7 8 9 + 8 9 10 11 12 13 + 12 13 14 15 16 17 + 16 17 18 19 20 21 + 20 21 22 23 24 25 + 24 25 26 27 28 29 + 28 29 30 31 32 1]) + +(defconst ntlm-smb-perm5 [16 7 20 21 + 29 12 28 17 + 1 15 23 26 + 5 18 31 10 + 2 8 24 14 + 32 27 3 9 + 19 13 30 6 + 22 11 4 25]) + +(defconst ntlm-smb-perm6 [40 8 48 16 56 24 64 32 + 39 7 47 15 55 23 63 31 + 38 6 46 14 54 22 62 30 + 37 5 45 13 53 21 61 29 + 36 4 44 12 52 20 60 28 + 35 3 43 11 51 19 59 27 + 34 2 42 10 50 18 58 26 + 33 1 41 9 49 17 57 25]) + +(defconst ntlm-smb-sc [1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 1]) + +(defconst ntlm-smb-sbox [[[14 4 13 1 2 15 11 8 3 10 6 12 5 9 0 7] + [ 0 15 7 4 14 2 13 1 10 6 12 11 9 5 3 8] + [ 4 1 14 8 13 6 2 11 15 12 9 7 3 10 5 0] + [15 12 8 2 4 9 1 7 5 11 3 14 10 0 6 13]] + [[15 1 8 14 6 11 3 4 9 7 2 13 12 0 5 10] + [ 3 13 4 7 15 2 8 14 12 0 1 10 6 9 11 5] + [ 0 14 7 11 10 4 13 1 5 8 12 6 9 3 2 15] + [13 8 10 1 3 15 4 2 11 6 7 12 0 5 14 9]] + [[10 0 9 14 6 3 15 5 1 13 12 7 11 4 2 8] + [13 7 0 9 3 4 6 10 2 8 5 14 12 11 15 1] + [13 6 4 9 8 15 3 0 11 1 2 12 5 10 14 7] + [ 1 10 13 0 6 9 8 7 4 15 14 3 11 5 2 12]] + [[ 7 13 14 3 0 6 9 10 1 2 8 5 11 12 4 15] + [13 8 11 5 6 15 0 3 4 7 2 12 1 10 14 9] + [10 6 9 0 12 11 7 13 15 1 3 14 5 2 8 4] + [ 3 15 0 6 10 1 13 8 9 4 5 11 12 7 2 14]] + [[ 2 12 4 1 7 10 11 6 8 5 3 15 13 0 14 9] + [14 11 2 12 4 7 13 1 5 0 15 10 3 9 8 6] + [ 4 2 1 11 10 13 7 8 15 9 12 5 6 3 0 14] + [11 8 12 7 1 14 2 13 6 15 0 9 10 4 5 3]] + [[12 1 10 15 9 2 6 8 0 13 3 4 14 7 5 11] + [10 15 4 2 7 12 9 5 6 1 13 14 0 11 3 8] + [ 9 14 15 5 2 8 12 3 7 0 4 10 1 13 11 6] + [ 4 3 2 12 9 5 15 10 11 14 1 7 6 0 8 13]] + [[ 4 11 2 14 15 0 8 13 3 12 9 7 5 10 6 1] + [13 0 11 7 4 9 1 10 14 3 5 12 2 15 8 6] + [ 1 4 11 13 12 3 7 14 10 15 6 8 0 5 9 2] + [ 6 11 13 8 1 4 10 7 9 5 0 15 14 2 3 12]] + [[13 2 8 4 6 15 11 1 10 9 3 14 5 0 12 7] + [ 1 15 13 8 10 3 7 4 12 5 6 11 0 14 9 2] + [ 7 11 4 1 9 12 14 2 0 6 10 13 15 3 5 8] + [ 2 1 14 7 4 10 8 13 15 12 9 0 3 5 6 11]]]) + +(defsubst ntlm-string-permute (in perm n) + "Return a string of length N for a string IN and a permutation vector +PERM of size N. The length of IN should be height of PERM." + (let ((i 0) (out (make-string n 0))) + (while (< i n) + (aset out i (aref in (- (aref perm i) 1))) + (setq i (1+ i))) + out)) + +(defsubst ntlm-string-lshift (str count len) + "Return a string by circularly shifting a string STR by COUNT to the left. +length of STR is LEN." + (let ((c (% count len))) + (concat (substring str c len) (substring str 0 c)))) + +(defsubst ntlm-string-xor (in1 in2 n) + "Return exclusive-or of sequences in1 and in2" + (let ((w (make-string n 0)) (i 0)) + (while (< i n) + (aset w i (logxor (aref in1 i) (aref in2 i))) + (setq i (1+ i))) + w)) + +(defun ntlm-smb-dohash (in key forw) + "Return the hash value for a string IN and a string KEY. +Length of IN and KEY are 64. FORW non nill means forward, nil means +backward." + (let (pk1 ;string of length 56 + c ;string of length 28 + d ;string of length 28 + cd ;string of length 56 + (ki (make-vector 16 0)) ;vector of string of length 48 + pd1 ;string of length 64 + l ;string of length 32 + r ;string of length 32 + rl ;string of length 64 + (i 0) (j 0) (k 0)) + (setq pk1 (ntlm-string-permute key ntlm-smb-perm1 56)) + (setq c (substring pk1 0 28)) + (setq d (substring pk1 28 56)) + + (setq i 0) + (while (< i 16) + (setq c (ntlm-string-lshift c (aref ntlm-smb-sc i) 28)) + (setq d (ntlm-string-lshift d (aref ntlm-smb-sc i) 28)) + (setq cd (concat (substring c 0 28) (substring d 0 28))) + (aset ki i (ntlm-string-permute cd ntlm-smb-perm2 48)) + (setq i (1+ i))) + + (setq pd1 (ntlm-string-permute in ntlm-smb-perm3 64)) + + (setq l (substring pd1 0 32)) + (setq r (substring pd1 32 64)) + + (setq i 0) + (let (er ;string of length 48 + erk ;string of length 48 + (b (make-vector 8 0)) ;vector of strings of length 6 + cb ;string of length 32 + pcb ;string of length 32 + r2 ;string of length 32 + jj m n bj sbox-jmn) + (while (< i 16) + (setq er (ntlm-string-permute r ntlm-smb-perm4 48)) + (setq erk (ntlm-string-xor er + (aref ki (if forw i (- 15 i))) + 48)) + (setq j 0) + (while (< j 8) + (setq jj (* 6 j)) + (aset b j (substring erk jj (+ jj 6))) + (setq j (1+ j))) + (setq j 0) + (while (< j 8) + (setq bj (aref b j)) + (setq m (logior (lsh (aref bj 0) 1) (aref bj 5))) + (setq n (logior (lsh (aref bj 1) 3) + (lsh (aref bj 2) 2) + (lsh (aref bj 3) 1) + (aref bj 4))) + (setq k 0) + (setq sbox-jmn (aref (aref (aref ntlm-smb-sbox j) m) n)) + (while (< k 4) + (aset bj k + (if (zerop (logand sbox-jmn (lsh 1 (- 3 k)))) + 0 1)) + (setq k (1+ k))) + (setq j (1+ j))) + + (setq j 0) + (setq cb nil) + (while (< j 8) + (setq cb (concat cb (substring (aref b j) 0 4))) + (setq j (1+ j))) + + (setq pcb (ntlm-string-permute cb ntlm-smb-perm5 32)) + (setq r2 (ntlm-string-xor l pcb 32)) + (setq l r) + (setq r r2) + (setq i (1+ i)))) + (setq rl (concat r l)) + (ntlm-string-permute rl ntlm-smb-perm6 64))) + +(defun ntlm-md4hash (passwd) + "Return the 16 bytes MD4 hash of a string PASSWD after converting it +into a Unicode string. PASSWD is truncated to 128 bytes if longer." + (let (len wpwd) + ;; Password cannot be longer than 128 characters + (setq len (length passwd)) + (if (> len 128) + (setq len 128)) + ;; Password must be converted to NT unicode + (setq wpwd (ntlm-ascii2unicode passwd len)) + ;; Calculate length in bytes + (setq len (* len 2)) + (md4 wpwd len))) + +(provide 'ntlm) + +;;; ntlm.el ends here diff --git a/flim-1.14.9/qmtp.el b/flim-1.14.9/qmtp.el new file mode 100644 index 0000000..b1f1072 --- /dev/null +++ b/flim-1.14.9/qmtp.el @@ -0,0 +1,143 @@ +;;; qmtp.el --- basic functions to send mail with QMTP server + +;; Copyright (C) 2000 Free Software Foundation, Inc. + +;; Author: Daiki Ueno <ueno@unixuser.org> +;; Keywords: QMTP, qmail + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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: + +;; Installation: + +;; To send mail using QMTP instead of SMTP, do + +;; (fset 'smtp-send-buffer 'qmtp-send-buffer) + +;;; Code: + +(require 'custom) +(require 'mel) ; binary-funcall + +(defgroup qmtp nil + "QMTP protocol for sending mail." + :group 'mail) + +(defcustom qmtp-default-server nil + "Specify default QMTP server." + :type '(choice (const nil) string) + :group 'qmtp) + +(defvar qmtp-server qmtp-default-server + "The name of the host running QMTP server. +It can also be a function +called from `qmtp-via-qmtp' with arguments SENDER and RECIPIENTS.") + +(defcustom qmtp-service "qmtp" + "QMTP service port number. \"qmtp\" or 209." + :type '(choice (integer :tag "209" 209) + (string :tag "qmtp" "qmtp")) + :group 'qmtp) + +(defcustom qmtp-timeout 30 + "Timeout for each QMTP session." + :type 'integer + :group 'qmtp) + +;;;###autoload +(defvar qmtp-open-connection-function (function open-network-stream)) + +(defvar qmtp-error-response-alist + '((?Z "Temporary failure") + (?D "Permanent failure"))) + +(defvar qmtp-read-point nil) + +(defun qmtp-encode-netstring-string (string) + (format "%d:%s," (length string) string)) + +(defun qmtp-send-package (process sender recipients buffer) + (with-temp-buffer + (buffer-disable-undo) + (erase-buffer) + (set-buffer-multibyte nil) + (insert + (format "%d:\n" + (with-current-buffer buffer + (1+ (point-max));; for the "\n" + ))) + (insert-buffer-substring buffer) + (insert + "\n," + (qmtp-encode-netstring-string sender) + (qmtp-encode-netstring-string + (mapconcat #'qmtp-encode-netstring-string + recipients ""))) + (process-send-region process (point-min)(point-max))) + (goto-char qmtp-read-point) + (while (and (memq (process-status process) '(open run)) + (not (re-search-forward "^[0-9]+:" nil 'noerror))) + (unless (accept-process-output process qmtp-timeout) + (error "timeout expired: %d" qmtp-timeout)) + (goto-char qmtp-read-point)) + (let ((response (char-after (match-end 0)))) + (unless (eq response ?K) + (error (nth 1 (assq response qmtp-error-response-alist)))) + (setq recipients (cdr recipients)) + (beginning-of-line 2) + (setq qmtp-read-point (point)))) + +;;;###autoload +(defun qmtp-via-qmtp (sender recipients buffer) + (condition-case nil + (progn + (qmtp-send-buffer sender recipients buffer) + t) + (error))) + +(make-obsolete 'qmtp-via-qmtp "It's old API.") + +;;;###autoload +(defun qmtp-send-buffer (sender recipients buffer) + (save-excursion + (set-buffer + (get-buffer-create + (format "*trace of QMTP session to %s*" qmtp-server))) + (buffer-disable-undo) + (erase-buffer) + (make-local-variable 'qmtp-read-point) + (setq qmtp-read-point (point-min)) + (let (process) + (unwind-protect + (progn + (setq process + (binary-funcall qmtp-open-connection-function + "QMTP" (current-buffer) + qmtp-server qmtp-service)) + (qmtp-send-package process sender recipients buffer)) + (when (and process + (memq (process-status process) '(open run))) + ;; QUIT + (process-send-eof process) + (delete-process process)))))) + +(provide 'qmtp) + +;;; qmtp.el ends here diff --git a/flim-1.14.9/sasl-cram.el b/flim-1.14.9/sasl-cram.el new file mode 100644 index 0000000..caaaa73 --- /dev/null +++ b/flim-1.14.9/sasl-cram.el @@ -0,0 +1,51 @@ +;;; sasl-cram.el --- CRAM-MD5 module for the SASL client framework + +;; Copyright (C) 2000 Free Software Foundation, Inc. + +;; Author: Daiki Ueno <ueno@unixuser.org> +;; Kenichi OKADA <okada@opaopa.org> +;; Keywords: SASL, CRAM-MD5 + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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: + +(require 'sasl) +(require 'hmac-md5) + +(defconst sasl-cram-md5-steps + '(ignore ;no initial response + sasl-cram-md5-response)) + +(defun sasl-cram-md5-response (client step) + (let ((passphrase + (sasl-read-passphrase + (format "CRAM-MD5 passphrase for %s: " + (sasl-client-name client))))) + (unwind-protect + (concat (sasl-client-name client) " " + (encode-hex-string + (hmac-md5 (sasl-step-data step) passphrase))) + (fillarray passphrase 0)))) + +(put 'sasl-cram 'sasl-mechanism + (sasl-make-mechanism "CRAM-MD5" sasl-cram-md5-steps)) + +(provide 'sasl-cram) + +;;; sasl-cram.el ends here diff --git a/flim-1.14.9/sasl-digest.el b/flim-1.14.9/sasl-digest.el new file mode 100644 index 0000000..e7610a1 --- /dev/null +++ b/flim-1.14.9/sasl-digest.el @@ -0,0 +1,156 @@ +;;; sasl-digest.el --- DIGEST-MD5 module for the SASL client framework + +;; Copyright (C) 2000 Free Software Foundation, Inc. + +;; Author: Daiki Ueno <ueno@unixuser.org> +;; Kenichi OKADA <okada@opaopa.org> +;; Keywords: SASL, DIGEST-MD5 + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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. + +;; This program is implemented from draft-leach-digest-sasl-05.txt. +;; +;; It is caller's responsibility to base64-decode challenges and +;; base64-encode responses in IMAP4 AUTHENTICATE command. +;; +;; Passphrase should be longer than 16 bytes. (See RFC 2195) + +;;; Commentary: + +(require 'sasl) +(require 'hmac-md5) + +(defvar sasl-digest-md5-nonce-count 1) +(defvar sasl-digest-md5-unique-id-function + sasl-unique-id-function) + +(defvar sasl-digest-md5-syntax-table + (let ((table (make-syntax-table))) + (modify-syntax-entry ?= "." table) + (modify-syntax-entry ?, "." table) + table) + "A syntax table for parsing digest-challenge attributes.") + +(defconst sasl-digest-md5-steps + '(ignore ;no initial response + sasl-digest-md5-response + ignore)) ;"" + +(defun sasl-digest-md5-parse-string (string) + "Parse STRING and return a property list. +The value is a cons cell of the form \(realm nonce qop-options stale maxbuf +charset algorithm cipher-opts auth-param)." + (with-temp-buffer + (set-syntax-table sasl-digest-md5-syntax-table) + (save-excursion + (insert string) + (goto-char (point-min)) + (insert "(") + (while (progn (forward-sexp) (not (eobp))) + (delete-char 1) + (insert " ")) + (insert ")") + (read (point-min-marker))))) + +(defun sasl-digest-md5-digest-uri (serv-type host &optional serv-name) + (concat serv-type "/" host + (if (and serv-name + (not (string= host serv-name))) + (concat "/" serv-name)))) + +(defun sasl-digest-md5-cnonce () + (let ((sasl-unique-id-function sasl-digest-md5-unique-id-function)) + (sasl-unique-id))) + +(defun sasl-digest-md5-response-value (username + realm + nonce + cnonce + nonce-count + qop + digest-uri + authzid) + (let ((passphrase + (sasl-read-passphrase + (format "DIGEST-MD5 passphrase for %s: " + username)))) + (unwind-protect + (encode-hex-string + (md5-binary + (concat + (encode-hex-string + (md5-binary (concat (md5-binary + (concat username ":" realm ":" passphrase)) + ":" nonce ":" cnonce + (if authzid + (concat ":" authzid))))) + ":" nonce + ":" (format "%08x" nonce-count) ":" cnonce ":" qop ":" + (encode-hex-string + (md5-binary + (concat "AUTHENTICATE:" digest-uri + (if (member qop '("auth-int" "auth-conf")) + ":00000000000000000000000000000000"))))))) + (fillarray passphrase 0)))) + +(defun sasl-digest-md5-response (client step) + (let* ((plist + (sasl-digest-md5-parse-string (sasl-step-data step))) + (realm + (or (sasl-client-property client 'realm) + (plist-get plist 'realm))) ;need to check + (nonce-count + (or (sasl-client-property client 'nonce-count) + sasl-digest-md5-nonce-count)) + (qop + (or (sasl-client-property client 'qop) + "auth")) + (digest-uri + (sasl-digest-md5-digest-uri + (sasl-client-service client)(sasl-client-server client))) + (cnonce + (or (sasl-client-property client 'cnonce) + (sasl-digest-md5-cnonce)))) + (sasl-client-set-property client 'nonce-count (1+ nonce-count)) + (unless (string= qop "auth") + (sasl-error (format "Unsupported \"qop-value\": %s" qop))) + (concat + "username=\"" (sasl-client-name client) "\"," + "realm=\"" realm "\"," + "nonce=\"" (plist-get plist 'nonce) "\"," + "cnonce=\"" cnonce "\"," + (format "nc=%08x," nonce-count) + "digest-uri=\"" digest-uri "\"," + "qop=" qop "," + "response=" + (sasl-digest-md5-response-value + (sasl-client-name client) + realm + (plist-get plist 'nonce) + cnonce + nonce-count + qop + digest-uri + (plist-get plist 'authzid))))) + +(put 'sasl-digest 'sasl-mechanism + (sasl-make-mechanism "DIGEST-MD5" sasl-digest-md5-steps)) + +(provide 'sasl-digest) + +;;; sasl-digest.el ends here diff --git a/flim-1.14.9/sasl-ntlm.el b/flim-1.14.9/sasl-ntlm.el new file mode 100644 index 0000000..7f6d439 --- /dev/null +++ b/flim-1.14.9/sasl-ntlm.el @@ -0,0 +1,65 @@ +;;; sasl-ntlm.el --- NTLM (NT Lan Manager) module for the SASL client framework + +;; Copyright (C) 2000 Free Software Foundation, Inc. + +;; Author: Taro Kawagishi <tarok@transpulse.org> +;; Keywords: SASL, NTLM +;; Version: 1.00 +;; Created: February 2001 + +;; 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 2, 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 NTLM authentication message +;; generation by ntlm.el + +;;; Code: + +(require 'sasl) +(require 'ntlm) + +(defconst sasl-ntlm-steps + '(ignore ;nothing to do before making + sasl-ntlm-request ;authentication request + sasl-ntlm-response) ;response to challenge + "A list of functions to be called in sequnece for the NTLM +authentication steps. Ther are called by 'sasl-next-step.") + +(defun sasl-ntlm-request (client step) + "SASL step function to generate a NTLM authentication request to the server. +Called from 'sasl-next-step. +CLIENT is a vector [mechanism user service server sasl-client-properties] +STEP is a vector [<previous step function> <result of previous step function>]" + (let ((user (sasl-client-name client))) + (ntlm-build-auth-request user))) + +(defun sasl-ntlm-response (client step) + "SASL step function to generate a NTLM response against the server +challenge stored in the 2nd element of STEP. Called from 'sasl-next-step." + (let* ((user (sasl-client-name client)) + (passphrase + (sasl-read-passphrase (format "NTLM passphrase for %s: " user))) + (challenge (sasl-step-data step))) + (ntlm-build-auth-response challenge user + (ntlm-get-password-hashes passphrase)))) + +(put 'sasl-ntlm 'sasl-mechanism + (sasl-make-mechanism "NTLM" sasl-ntlm-steps)) + +(provide 'sasl-ntlm) + +;;; sasl-ntlm.el ends here diff --git a/flim-1.14.9/sasl-scram.el b/flim-1.14.9/sasl-scram.el new file mode 100644 index 0000000..20786fa --- /dev/null +++ b/flim-1.14.9/sasl-scram.el @@ -0,0 +1,260 @@ +;;; sasl-scram.el --- Compute SCRAM-MD5. + +;; Copyright (C) 1999 Shuhei KOBAYASHI + +;; Author: Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp> +;; Kenichi OKADA <okada@opaopa.org> +;; Keywords: SCRAM-MD5, HMAC-MD5, SASL, IMAP, POP, ACAP + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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 program is implemented from draft-newman-auth-scram-03.txt. +;; +;; It is caller's responsibility to base64-decode challenges and +;; base64-encode responses in IMAP4 AUTHENTICATE command. +;; +;; Passphrase should be longer than 16 bytes. (See RFC 2195) + +;; Examples. +;; +;; (sasl-scram-md5-make-security-info nil t 0) +;; => "^A^@^@^@" +;; +;; (base64-encode-string +;; (sasl-scram-md5-make-client-msg-2 +;; (base64-decode-string "dGVzdHNhbHQBAAAAaW1hcEBlbGVhbm9yLmlubm9zb2Z0LmNvbQBqaGNOWmxSdVBiemlGcCt2TFYrTkN3") +;; (base64-decode-string "AGNocmlzADx0NG40UGFiOUhCMEFtL1FMWEI3MmVnQGVsZWFub3IuaW5ub3NvZnQuY29tPg==") +;; (sasl-scram-md5-make-salted-pass +;; "secret stuff" "testsalt") +;; (sasl-scram-md5-make-security-info nil t 0))) +;; => "AQAAAMg9jU8CeB4KOfk7sUhSQPs=" +;; +;; (base64-encode-string +;; (sasl-scram-md5-make-server-msg-2 +;; (base64-decode-string "dGVzdHNhbHQBAAAAaW1hcEBlbGVhbm9yLmlubm9zb2Z0LmNvbQBqaGNOWmxSdVBiemlGcCt2TFYrTkN3") +;; (base64-decode-string "AGNocmlzADx0NG40UGFiOUhCMEFtL1FMWEI3MmVnQGVsZWFub3IuaW5ub3NvZnQuY29tPg==") +;; (sasl-scram-md5-make-security-info nil t 0) +;; "testsalt" +;; (sasl-scram-md5-make-salted-pass +;; "secret stuff" "testsalt"))) +;; => "U0odqYw3B7XIIW0oSz65OQ==" + +;;; Code: + +(require 'sasl) +(require 'hmac-md5) + +(defvar sasl-scram-md5-unique-id-function + sasl-unique-id-function) + +(defconst sasl-scram-md5-steps + '(ignore ;no initial response + sasl-scram-md5-response-1 + sasl-scram-md5-response-2 + sasl-scram-md5-authenticate-server)) + +(defmacro sasl-scram-md5-security-info-no-security-layer (security-info) + `(eq (logand (aref ,security-info 0) 1) 1)) +(defmacro sasl-scram-md5-security-info-integrity-protection-layer (security-info) + `(eq (logand (aref ,security-info 0) 2) 2)) +(defmacro sasl-scram-md5-security-info-buffer-size (security-info) + `(let ((ssecinfo ,security-info)) + (+ (lsh (aref ssecinfo 1) 16) + (lsh (aref ssecinfo 2) 8) + (aref ssecinfo 3)))) + +(defun sasl-scram-md5-make-security-info (integrity-protection-layer + no-security-layer buffer-size) + (let ((csecinfo (make-string 4 0))) + (when integrity-protection-layer + (aset csecinfo 0 2)) + (if no-security-layer + (aset csecinfo 0 (logior (aref csecinfo 0) 1)) + (aset csecinfo 1 + (lsh (logand buffer-size (lsh 255 16)) -16)) + (aset csecinfo 2 + (lsh (logand buffer-size (lsh 255 8)) -8)) + (aset csecinfo 3 (logand buffer-size 255))) + csecinfo)) + +(defun sasl-scram-md5-make-unique-nonce () ; 8*OCTET, globally unique. + ;; For example, concatenated string of process-identifier, system-clock, + ;; sequence-number, random-number, and domain-name. + (let* ((sasl-unique-id-function sasl-scram-md5-unique-id-function) + (id (sasl-unique-id))) + (unwind-protect + (concat "<" id "@" (system-name) ">") + (fillarray id 0)))) + +(defun sasl-scram-md5-xor-string (str1 str2) + ;; (length str1) == (length str2) == (length dst) == 16 (in SCRAM-MD5) + (let* ((len (length str1)) + (dst (make-string len 0)) + (pos 0)) + (while (< pos len) + (aset dst pos (logxor (aref str1 pos) (aref str2 pos))) + (setq pos (1+ pos))) + dst)) + +(defun sasl-scram-md5-make-client-msg-1 (authenticate-id &optional authorize-id nonce) + "Make an initial client message from AUTHENTICATE-ID and AUTHORIZE-ID. +If AUTHORIZE-ID is the same as AUTHENTICATE-ID, it may be omitted." + (concat authorize-id "\0" authenticate-id "\0" + (or nonce + (sasl-scram-md5-make-unique-nonce)))) + +(defun sasl-scram-md5-parse-server-msg-1 (server-msg-1) + "Parse SERVER-MSG-1 and return a list of (SALT SECURITY-INFO SERVICE-ID)." + (if (and (> (length server-msg-1) 16) + (eq (string-match "[^@]+@[^\0]+\0" server-msg-1 12) 12)) + (list (substring server-msg-1 0 8) ; salt + (substring server-msg-1 8 12) ; server-security-info + (substring server-msg-1 ; service-id + 12 (1- (match-end 0)))) + (sasl-error (format "Unexpected response: %s" server-msg-1)))) + +(defun sasl-scram-md5-server-salt (server-msg-1) + (car (sasl-scram-md5-parse-server-msg-1 server-msg-1))) + +(defun sasl-scram-md5-make-salted-pass (passphrase salt) + (hmac-md5 salt passphrase)) + +(defun sasl-scram-md5-make-client-key (salted-pass) + (md5-binary salted-pass)) + +(defun sasl-scram-md5-make-client-verifier (client-key) + (md5-binary client-key)) + +(defun sasl-scram-md5-make-shared-key (server-msg-1 + client-msg-1 + client-security-info + client-verifier) + (let (buff) + (unwind-protect + (hmac-md5 + (setq buff + (concat server-msg-1 client-msg-1 client-security-info)) + client-verifier) + (fillarray buff 0)))) + +(defun sasl-scram-md5-make-client-proof (client-key shared-key) + (sasl-scram-md5-xor-string client-key shared-key)) + +(defun sasl-scram-md5-make-client-msg-2 (server-msg-1 + client-msg-1 + salted-pass + client-security-info) + (let (client-proof client-key shared-key client-verifier) + (setq client-key + (sasl-scram-md5-make-client-key salted-pass)) + (setq client-verifier + (sasl-scram-md5-make-client-verifier client-key)) + (setq shared-key + (unwind-protect + (sasl-scram-md5-make-shared-key + server-msg-1 + client-msg-1 + client-security-info + client-verifier) + (fillarray client-verifier 0))) + (setq client-proof + (unwind-protect + (sasl-scram-md5-make-client-proof + client-key shared-key) + (fillarray client-key 0) + (fillarray shared-key 0))) + (unwind-protect + (concat + client-security-info + client-proof) + (fillarray client-proof 0)))) + +(defun sasl-scram-md5-make-server-msg-2 (server-msg-1 + client-msg-1 + client-security-info + salt salted-pass) + (let ((server-salt + (hmac-md5 salt salted-pass)) + buff) + (unwind-protect + (hmac-md5 + (setq buff + (concat + client-msg-1 + server-msg-1 + client-security-info)) + server-salt) + (fillarray server-salt 0) + (fillarray buff 0)))) + +(defun sasl-scram-md5-response-1 (client step) + (sasl-client-set-property + client 'client-msg-1 + (sasl-scram-md5-make-client-msg-1 + (sasl-client-name client) + (sasl-client-property client 'authorize-id) + (sasl-client-property client 'nonce)))) + +(defun sasl-scram-md5-response-2 (client step) + (let* ((server-msg-1 + (sasl-client-set-property + client 'server-msg-1 + (sasl-step-data step))) + (salted-pass + (sasl-client-set-property + client 'salted-pass + (sasl-scram-md5-make-salted-pass + (sasl-read-passphrase + (format "SCRAM-MD5 passphrase for %s: " + (sasl-client-name client))) + (sasl-scram-md5-server-salt server-msg-1))))) + (sasl-client-set-property + client 'client-msg-2 + (sasl-scram-md5-make-client-msg-2 + server-msg-1 + (sasl-client-property client 'client-msg-1) + salted-pass + (or (sasl-client-property client 'client-security-info) + (sasl-scram-md5-make-security-info nil t 0)))))) + +(defun sasl-scram-md5-authenticate-server (client step) + (let ((server-msg-2 + (sasl-client-set-property + client 'server-msg-2 + (sasl-step-data step))) + (server-msg-1 + (sasl-client-property client 'server-msg-1))) + (if (string= server-msg-2 + (sasl-scram-md5-make-server-msg-2 + server-msg-1 + (sasl-client-property client 'client-msg-1) + (or (sasl-client-property client 'client-security-info) + (sasl-scram-md5-make-security-info nil t 0)) + (sasl-scram-md5-server-salt server-msg-1) + (sasl-client-property client 'salted-pass))) + " " + (sasl-error "SCRAM-MD5: authenticate server failed.")))) + +(put 'sasl-scram 'sasl-mechanism + (sasl-make-mechanism "SCRAM-MD5" sasl-scram-md5-steps)) + +(provide 'sasl-scram) + +;;; sasl-scram.el ends here diff --git a/flim-1.14.9/sasl.el b/flim-1.14.9/sasl.el new file mode 100644 index 0000000..de1af88 --- /dev/null +++ b/flim-1.14.9/sasl.el @@ -0,0 +1,272 @@ +;;; sasl.el --- SASL client framework + +;; Copyright (C) 2000 Free Software Foundation, Inc. + +;; Author: Daiki Ueno <ueno@unixuser.org> +;; Keywords: SASL + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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 module provides common interface functions to share several +;; SASL mechanism drivers. The toplevel is designed to be mostly +;; compatible with [Java-SASL]. +;; +;; [SASL] J. Myers, "Simple Authentication and Security Layer (SASL)", +;; RFC 2222, October 1997. +;; +;; [Java-SASL] R. Weltman & R. Lee, "The Java SASL Application Program +;; Interface", draft-weltman-java-sasl-03.txt, March 2000. + +;;; Code: + +(defvar sasl-mechanisms + '("CRAM-MD5" "DIGEST-MD5" "PLAIN" "LOGIN" "ANONYMOUS" + "NTLM" "SCRAM-MD5")) + +(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))) + +(defvar sasl-unique-id-function #'sasl-unique-id-function) + +(put 'sasl-error 'error-message "SASL error") +(put 'sasl-error 'error-conditions '(sasl-error error)) + +(defun sasl-error (datum) + (signal 'sasl-error (list datum))) + +;;; @ SASL client +;;; + +(defun sasl-make-client (mechanism name service server) + "Return a newly allocated SASL client. +NAME is name of the authorization. SERVICE is name of the service desired. +SERVER is the fully qualified host name of the server to authenticate to." + (vector mechanism name service server (make-symbol "sasl-client-properties"))) + +(defun sasl-client-mechanism (client) + "Return the authentication mechanism driver of CLIENT." + (aref client 0)) + +(defun sasl-client-name (client) + "Return the authorization name of CLIENT, a string." + (aref client 1)) + +(defun sasl-client-service (client) + "Return the service name of CLIENT, a string." + (aref client 2)) + +(defun sasl-client-server (client) + "Return the server name of CLIENT, a string." + (aref client 3)) + +(defun sasl-client-set-properties (client plist) + "Destructively set the properties of CLIENT. +The second argument PLIST is the new property list." + (setplist (aref client 4) plist)) + +(defun sasl-client-set-property (client property value) + "Add the given property/value to CLIENT." + (put (aref client 4) property value)) + +(defun sasl-client-property (client property) + "Return the value of the PROPERTY of CLIENT." + (get (aref client 4) property)) + +(defun sasl-client-properties (client) + "Return the properties of CLIENT." + (symbol-plist (aref client 4))) + +;;; @ SASL mechanism +;;; + +(defun sasl-make-mechanism (name steps) + "Make an authentication mechanism. +NAME is a IANA registered SASL mechanism name. +STEPS is list of continuation function." + (vector name + (mapcar + (lambda (step) + (let ((symbol (make-symbol (symbol-name step)))) + (fset symbol (symbol-function step)) + symbol)) + steps))) + +(defun sasl-mechanism-name (mechanism) + "Return name of MECHANISM, a string." + (aref mechanism 0)) + +(defun sasl-mechanism-steps (mechanism) + "Return the authentication steps of MECHANISM, a list of functions." + (aref mechanism 1)) + +(defun sasl-find-mechanism (mechanisms) + "Retrieve an apropriate mechanism object from MECHANISMS hints." + (let* ((sasl-mechanisms sasl-mechanisms) + (mechanism + (catch 'done + (while sasl-mechanisms + (if (member (car sasl-mechanisms) mechanisms) + (throw 'done (nth 1 (assoc (car sasl-mechanisms) + sasl-mechanism-alist)))) + (setq sasl-mechanisms (cdr sasl-mechanisms)))))) + (if mechanism + (require mechanism)) + (get mechanism 'sasl-mechanism))) + +;;; @ SASL authentication step +;;; + +(defun sasl-step-data (step) + "Return the data which STEP holds, a string." + (aref step 1)) + +(defun sasl-step-set-data (step data) + "Store DATA string to STEP." + (aset step 1 data)) + +(defun sasl-next-step (client step) + "Evaluate the challenge and prepare an appropriate next response. +The data type of the value and optional 2nd argument STEP is nil or +opaque authentication step which holds the reference to the next action +and the current challenge. At the first time STEP should be set to nil." + (let* ((steps + (sasl-mechanism-steps + (sasl-client-mechanism client))) + (function + (if (vectorp step) + (nth 1 (memq (aref step 0) steps)) + (car steps)))) + (if function + (vector function (funcall function client step))))) + +(defvar sasl-read-passphrase nil) +(defun sasl-read-passphrase (prompt) + (if (not sasl-read-passphrase) + (if (functionp 'read-passwd) + (setq sasl-read-passphrase 'read-passwd) + (if (load "passwd" t) + (setq sasl-read-passphrase 'read-passwd) + (autoload 'ange-ftp-read-passwd "ange-ftp") + (setq sasl-read-passphrase 'ange-ftp-read-passwd)))) + (funcall sasl-read-passphrase prompt)) + +(defun sasl-unique-id () + "Compute a data string which must be different each time. +It contain at least 64 bits of entropy." + (concat (funcall sasl-unique-id-function)(funcall sasl-unique-id-function))) + +(defvar sasl-unique-id-char nil) + +;; stolen (and renamed) from message.el +(defun sasl-unique-id-function () + ;; 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))))) + ;; (current-time) returns 16-bit ints, + ;; and 2^16*25 just fits into 4 digits i base 36. + (* 25 25))) + (let ((tm (current-time))) + (concat + (sasl-unique-id-number-base36 + (+ (car tm) + (lsh (% sasl-unique-id-char 25) 16)) 4) + (sasl-unique-id-number-base36 + (+ (nth 1 tm) + (lsh (/ sasl-unique-id-char 25) 16)) 4)))) + +(defun sasl-unique-id-number-base36 (num len) + (if (if (< len 0) + (<= num 0) + (= len 0)) + "" + (concat (sasl-unique-id-number-base36 (/ num 36) (1- len)) + (char-to-string (aref "zyxwvutsrqponmlkjihgfedcba9876543210" + (% num 36)))))) + +;;; PLAIN (RFC2595 Section 6) +(defconst sasl-plain-steps + '(sasl-plain-response)) + +(defun sasl-plain-response (client step) + (let ((passphrase + (sasl-read-passphrase + (format "PLAIN passphrase for %s: " (sasl-client-name client)))) + (authenticator-name + (sasl-client-property + client 'authenticator-name)) + (name (sasl-client-name client))) + (unwind-protect + (if (and authenticator-name + (not (string= authenticator-name name))) + (concat authenticator-name "\0" name "\0" passphrase) + (concat "\0" name "\0" passphrase)) + (fillarray passphrase 0)))) + +(put 'sasl-plain 'sasl-mechanism + (sasl-make-mechanism "PLAIN" sasl-plain-steps)) + +(provide 'sasl-plain) + +;;; LOGIN (No specification exists) +(defconst sasl-login-steps + '(ignore ;no initial response + sasl-login-response-1 + sasl-login-response-2)) + +(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) +;;; (unless (string-match "^Password:" (sasl-step-data step)) +;;; (sasl-error (format "Unexpected response: %s" (sasl-step-data step)))) + (sasl-read-passphrase + (format "LOGIN passphrase for %s: " (sasl-client-name client)))) + +(put 'sasl-login 'sasl-mechanism + (sasl-make-mechanism "LOGIN" sasl-login-steps)) + +(provide 'sasl-login) + +;;; ANONYMOUS (RFC2245) +(defconst sasl-anonymous-steps + '(ignore ;no initial response + sasl-anonymous-response)) + +(defun sasl-anonymous-response (client step) + (or (sasl-client-property client 'trace) + (sasl-client-name client))) + +(put 'sasl-anonymous 'sasl-mechanism + (sasl-make-mechanism "ANONYMOUS" sasl-anonymous-steps)) + +(provide 'sasl-anonymous) + +(provide 'sasl) + +;;; sasl.el ends here diff --git a/flim-1.14.9/sasl.texi b/flim-1.14.9/sasl.texi new file mode 100644 index 0000000..8d73326 --- /dev/null +++ b/flim-1.14.9/sasl.texi @@ -0,0 +1,265 @@ +\input texinfo @c -*-texinfo-*- + +@setfilename sasl.info + +@set VERSION 0.2 + +@dircategory Emacs +@direntry +* SASL: (sasl). The Emacs SASL library. +@end direntry + +@settitle Emacs SASL Library @value{VERSION} + +@ifinfo +This file describes the Emacs SASL library. + +Copyright (C) 2000 Daiki Ueno. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation; with no +Invariant Sections, with no Front-Cover Texts, and with no Back-Cover +Texts. A copy of the license is included in the section entitled "GNU +Free Documentation License". +@end ifinfo + +@tex + +@titlepage +@title Emacs SASL Library + +@author by Daiki Ueno +@page + +@vskip 0pt plus 1filll +Copyright @copyright{} 2000 Daiki Ueno. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation; with no +Invariant Sections, with no Front-Cover Texts, and with no Back-Cover +Texts. A copy of the license is included in the section entitled "GNU +Free Documentation License". +@end titlepage +@page + +@end tex + +@node Top +@top Emacs SASL +This manual describes the Emacs SASL library. + +A common interface to share several authentication mechanisms between +applications using different protocols. + +@menu +* Overview:: What Emacs SASL library is. +* How to use:: Adding authentication support to your applications. +* Data types:: +* Backend drivers:: Writing your own drivers. +* Index:: +* Function Index:: +* Variable Index:: +@end menu + +@node Overview +@chapter Overview + +@sc{sasl} is short for @dfn{Simple Authentication and Security Layer}. +This standard is documented in RFC2222. It provides a simple method for +adding authentication support to various application protocols. + +The toplevel interface of this library is inspired by Java @sc{sasl} +Application Program Interface. It defines an abstraction over a series +of authentication mechanism drivers (@ref{Backend drivers}). + +Backend drivers are designed to be close as possible to the +authentication mechanism. You can access the additional configuration +information anywhere from the implementation. + +@node How to use +@chapter How to use + +(Not yet written). + +To use Emacs SASL library, please evaluate following expression at the +beginning of your application program. + +@lisp +(require 'sasl) +@end lisp + +If you want to check existence of sasl.el at runtime, instead you +can list autoload settings for functions you want. + +@node Data types +@chapter Data types + +There are three data types to be used for carrying a negotiated +security layer---a mechanism, a client parameter and an authentication +step. + +@menu +* Mechanisms:: +* Clients:: +* Steps:: +@end menu + +@node Mechanisms +@section Mechanisms + +A mechanism (@code{sasl-mechanism} object) is a schema of the @sc{sasl} +authentication mechanism driver. + +@defvar sasl-mechanisms +A list of mechanism names. +@end defvar + +@defun sasl-find-mechanism mechanisms + +Retrieve an apropriate mechanism. +This function compares @var{mechanisms} and @code{sasl-mechanisms} then +returns apropriate @code{sasl-mechanism} object. + +@example +(let ((sasl-mechanisms '("CRAM-MD5" "DIGEST-MD5"))) + (setq mechanism (sasl-find-mechanism server-supported-mechanisms))) +@end example + +@end defun + +@defun sasl-mechanism-name mechanism +Return name of mechanism, a string. +@end defun + +If you want to write an authentication mechanism driver (@ref{Backend +drivers}), use @code{sasl-make-mechanism} and modify +@code{sasl-mechanisms} and @code{sasl-mechanism-alist} correctly. + +@defun sasl-make-mechanism name steps +Allocate a @code{sasl-mechanism} object. +This function takes two parameters---name of the mechanism, and a list +of authentication functions. + +@example +(defconst sasl-anonymous-steps + '(identity ;no initial response + sasl-anonymous-response)) + +(put 'sasl-anonymous 'sasl-mechanism + (sasl-make-mechanism "ANONYMOUS" sasl-anonymous-steps)) +@end example + +@end defun + +@node Clients +@section Clients + +A client (@code{sasl-client} object) initialized with four +parameters---a mechanism, a user name, name of the service and name of +the server. + +@defun sasl-make-client mechanism name service server +Prepare a @code{sasl-client} object. +@end defun + +@defun sasl-client-mechanism client +Return the mechanism (@code{sasl-mechanism} object) of client. +@end defun + +@defun sasl-client-name client +Return the authorization name of client, a string. +@end defun + +@defun sasl-client-service client +Return the service name of client, a string. +@end defun + +@defun sasl-client-server client +Return the server name of client, a string. +@end defun + +If you want to specify additional configuration properties, please use +@code{sasl-client-set-property}. + +@defun sasl-client-set-property client property value +Add the given property/value to client. +@end defun + +@defun sasl-client-property client property +Return the value of the property of client. +@end defun + +@defun sasl-client-set-properties client plist +Destructively set the properties of client. +The second argument is the new property list. +@end defun + +@defun sasl-client-properties client +Return the whole property list of client configuration. +@end defun + +@node Steps +@section Steps + +A step (@code{sasl-step} object) is an abstraction of authentication +``step'' which holds the response value and the next entry point for the +authentication process (the latter is not accessible). + +@defun sasl-step-data step +Return the data which @var{step} holds, a string. +@end defun + +@defun sasl-step-set-data step data +Store @var{data} string to @var{step}. +@end defun + +To get the initial response, you should call the function +@code{sasl-next-step} with the second argument @code{nil}. + +@example +(setq name (sasl-mechanism-name mechanism)) +@end example + +At this point we could send the command which starts a SASL +authentication protocol exchange. For example, + +@example +(process-send-string + process + (if (sasl-step-data step) ;initial response + (format "AUTH %s %s\r\n" name (base64-encode-string (sasl-step-data step) t)) + (format "AUTH %s\r\n" name))) +@end example + +To go on with the authentication process, all you have to do is call +@code{sasl-next-step} consecutively. + +@defun sasl-next-step client step +Perform the authentication step. +At the first time @var{step} should be set to @code{nil}. +@end defun + +@node Backend drivers +@chapter Backend drivers + +(Not yet written). + +@node Index +@chapter Index +@printindex cp + +@node Function Index +@chapter Function Index +@printindex fn + +@node Variable Index +@chapter Variable Index +@printindex vr + +@summarycontents +@contents +@bye + +@c End: diff --git a/flim-1.14.9/sha1-dl.el b/flim-1.14.9/sha1-dl.el new file mode 100644 index 0000000..1da5481 --- /dev/null +++ b/flim-1.14.9/sha1-dl.el @@ -0,0 +1,57 @@ +;;; sha1-dl.el --- SHA1 Secure Hash Algorithm using DL module. + +;; Copyright (C) 1999, 2001, 2004 Free Software Foundation, Inc. + +;; Author: Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp> +;; Keywords: SHA1, FIPS 180-1 + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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: + +;;; Code: + +(provide 'sha1-dl) ; beware of circular dependency. +(eval-when-compile (require 'sha1)) ; sha1-dl-module. + +;;; This file is loaded (from "sha1.el") only when sha1-dl-module exists. +(defvar sha1-dl-handle (dynamic-link sha1-dl-module)) + +;;; sha1-dl-module provides `sha1-string' and `sha1-binary'. +(dynamic-call "emacs_sha1_init" sha1-dl-handle) + +(defun sha1-region (beg end &optional binary) + (if binary + (sha1-binary (buffer-substring-no-properties beg end)) + (sha1-string (buffer-substring-no-properties beg end)))) + +(defun sha1 (object &optional beg end binary) + "Return the SHA1 (Secure Hash Algorithm) of an object. +OBJECT is either a string or a buffer. +Optional arguments BEG and END denote buffer positions for computing the +hash of a portion of OBJECT. +If BINARY is non-nil, return a string in binary form." + (if (stringp object) + (if binary + (sha1-binary object) + (sha1-string object)) + (save-excursion + (set-buffer object) + (sha1-region (or beg (point-min)) (or end (point-max)) binary)))) + +;;; sha1-dl.el ends here diff --git a/flim-1.14.9/sha1-el.el b/flim-1.14.9/sha1-el.el new file mode 100644 index 0000000..82657b8 --- /dev/null +++ b/flim-1.14.9/sha1-el.el @@ -0,0 +1,442 @@ +;;; sha1-el.el --- SHA1 Secure Hash Algorithm in Emacs-Lisp + +;; Copyright (C) 1999, 2001, 2003, 2004 Free Software Foundation, Inc. + +;; Author: Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp> +;; Keywords: SHA1, FIPS 180-1 + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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 program is implemented from the definition of SHA-1 in FIPS PUB +;; 180-1 (Federal Information Processing Standards Publication 180-1), +;; "Announcing the Standard for SECURE HASH STANDARD". +;; <URL:http://www.itl.nist.gov/div897/pubs/fip180-1.htm> +;; (EXCEPTION; two optimizations taken from GnuPG/cipher/sha1.c) +;; +;; Test cases from FIPS PUB 180-1. +;; +;; (sha1 "abc") +;; => a9993e364706816aba3e25717850c26c9cd0d89d +;; +;; (sha1 "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq") +;; => 84983e441c3bd26ebaae4aa1f95129e5e54670f1 +;; +;; (sha1 (make-string 1000000 ?a)) +;; => 34aa973cd4c4daa4f61eeb2bdbad27316534016f +;; +;; BUGS: +;; * It is assumed that length of input string is less than 2^29 bytes. +;; * It is caller's responsibility to make string (or region) unibyte. +;; +;; TODO: +;; * Rewrite from scratch! +;; This version is much faster than Keiichi Suzuki's another sha1.el, +;; but it is too dirty. + +;;; Code: + +(require 'hex-util) + +(autoload 'executable-find "executable") + +;;; +;;; external SHA1 function. +;;; + +(defgroup sha1 nil + "Elisp interface for SHA1 hash computation." + :group 'extensions) + +(defcustom sha1-maximum-internal-length 500 + "*Maximum length of message to use Lisp version of SHA1 function. +If message is longer than this, `sha1-program' is used instead. + +If this variable is set to 0, use external program only. +If this variable is set to nil, use internal function only." + :type 'integer + :group 'sha1) + +(defcustom sha1-program '("sha1sum") + "*Name of program to compute SHA1. +It must be a string \(program name\) or list of strings \(name and its args\)." + :type '(repeat string) + :group 'sha1) + +(defcustom sha1-use-external (condition-case () + (executable-find (car sha1-program)) + (error)) + "*Use external SHA1 program. +If this variable is set to nil, use internal function only." + :type 'boolean + :group 'sha1) + +(defun sha1-string-external (string &optional binary) + (let (prog args digest default-enable-multibyte-characters) + (if (consp sha1-program) + (setq prog (car sha1-program) + args (cdr sha1-program)) + (setq prog sha1-program + args nil)) + (with-temp-buffer + (insert string) + (apply (function call-process-region) + (point-min)(point-max) + prog t t nil args) + ;; SHA1 is 40 bytes long in hexadecimal form. + (setq digest (buffer-substring (point-min)(+ (point-min) 40)))) + (if binary + (decode-hex-string digest) + digest))) + +(defun sha1-region-external (beg end &optional binary) + (sha1-string-external (buffer-substring-no-properties beg end) binary)) + +;;; +;;; internal SHA1 function. +;;; + +(eval-when-compile + ;; optional second arg of string-to-number is new in v20. + (defconst sha1-K0-high 23170) ; (string-to-number "5A82" 16) + (defconst sha1-K0-low 31129) ; (string-to-number "7999" 16) + (defconst sha1-K1-high 28377) ; (string-to-number "6ED9" 16) + (defconst sha1-K1-low 60321) ; (string-to-number "EBA1" 16) + (defconst sha1-K2-high 36635) ; (string-to-number "8F1B" 16) + (defconst sha1-K2-low 48348) ; (string-to-number "BCDC" 16) + (defconst sha1-K3-high 51810) ; (string-to-number "CA62" 16) + (defconst sha1-K3-low 49622) ; (string-to-number "C1D6" 16) + +;;; original definition of sha1-F0. +;;; (defmacro sha1-F0 (B C D) +;;; (` (logior (logand (, B) (, C)) +;;; (logand (lognot (, B)) (, D))))) +;;; a little optimization from GnuPG/cipher/sha1.c. + (defmacro sha1-F0 (B C D) + (` (logxor (, D) (logand (, B) (logxor (, C) (, D)))))) + (defmacro sha1-F1 (B C D) + (` (logxor (, B) (, C) (, D)))) +;;; original definition of sha1-F2. +;;; (defmacro sha1-F2 (B C D) +;;; (` (logior (logand (, B) (, C)) +;;; (logand (, B) (, D)) +;;; (logand (, C) (, D))))) +;;; a little optimization from GnuPG/cipher/sha1.c. + (defmacro sha1-F2 (B C D) + (` (logior (logand (, B) (, C)) + (logand (, D) (logior (, B) (, C)))))) + (defmacro sha1-F3 (B C D) + (` (logxor (, B) (, C) (, D)))) + + (defmacro sha1-S1 (W-high W-low) + (` (let ((W-high (, W-high)) + (W-low (, W-low))) + (setq S1W-high (+ (% (* W-high 2) 65536) + (/ W-low (, (/ 65536 2))))) + (setq S1W-low (+ (/ W-high (, (/ 65536 2))) + (% (* W-low 2) 65536)))))) + (defmacro sha1-S5 (A-high A-low) + (` (progn + (setq S5A-high (+ (% (* (, A-high) 32) 65536) + (/ (, A-low) (, (/ 65536 32))))) + (setq S5A-low (+ (/ (, A-high) (, (/ 65536 32))) + (% (* (, A-low) 32) 65536)))))) + (defmacro sha1-S30 (B-high B-low) + (` (progn + (setq S30B-high (+ (/ (, B-high) 4) + (* (% (, B-low) 4) (, (/ 65536 4))))) + (setq S30B-low (+ (/ (, B-low) 4) + (* (% (, B-high) 4) (, (/ 65536 4)))))))) + + (defmacro sha1-OP (round) + (` (progn + (sha1-S5 sha1-A-high sha1-A-low) + (sha1-S30 sha1-B-high sha1-B-low) + (setq sha1-A-low (+ ((, (intern (format "sha1-F%d" round))) + sha1-B-low sha1-C-low sha1-D-low) + sha1-E-low + (, (symbol-value + (intern (format "sha1-K%d-low" round)))) + (aref block-low idx) + (progn + (setq sha1-E-low sha1-D-low) + (setq sha1-D-low sha1-C-low) + (setq sha1-C-low S30B-low) + (setq sha1-B-low sha1-A-low) + S5A-low))) + (setq carry (/ sha1-A-low 65536)) + (setq sha1-A-low (% sha1-A-low 65536)) + (setq sha1-A-high (% (+ ((, (intern (format "sha1-F%d" round))) + sha1-B-high sha1-C-high sha1-D-high) + sha1-E-high + (, (symbol-value + (intern (format "sha1-K%d-high" round)))) + (aref block-high idx) + (progn + (setq sha1-E-high sha1-D-high) + (setq sha1-D-high sha1-C-high) + (setq sha1-C-high S30B-high) + (setq sha1-B-high sha1-A-high) + S5A-high) + carry) + 65536))))) + + (defmacro sha1-add-to-H (H X) + (` (progn + (setq (, (intern (format "sha1-%s-low" H))) + (+ (, (intern (format "sha1-%s-low" H))) + (, (intern (format "sha1-%s-low" X))))) + (setq carry (/ (, (intern (format "sha1-%s-low" H))) 65536)) + (setq (, (intern (format "sha1-%s-low" H))) + (% (, (intern (format "sha1-%s-low" H))) 65536)) + (setq (, (intern (format "sha1-%s-high" H))) + (% (+ (, (intern (format "sha1-%s-high" H))) + (, (intern (format "sha1-%s-high" X))) + carry) + 65536))))) + ) + +;;; buffers (H0 H1 H2 H3 H4). +(defvar sha1-H0-high) +(defvar sha1-H0-low) +(defvar sha1-H1-high) +(defvar sha1-H1-low) +(defvar sha1-H2-high) +(defvar sha1-H2-low) +(defvar sha1-H3-high) +(defvar sha1-H3-low) +(defvar sha1-H4-high) +(defvar sha1-H4-low) + +(defun sha1-block (block-high block-low) + (let (;; step (c) --- initialize buffers (A B C D E). + (sha1-A-high sha1-H0-high) (sha1-A-low sha1-H0-low) + (sha1-B-high sha1-H1-high) (sha1-B-low sha1-H1-low) + (sha1-C-high sha1-H2-high) (sha1-C-low sha1-H2-low) + (sha1-D-high sha1-H3-high) (sha1-D-low sha1-H3-low) + (sha1-E-high sha1-H4-high) (sha1-E-low sha1-H4-low) + (idx 16)) + ;; step (b). + (let (;; temporary variables used in sha1-S1 macro. + S1W-high S1W-low) + (while (< idx 80) + (sha1-S1 (logxor (aref block-high (- idx 3)) + (aref block-high (- idx 8)) + (aref block-high (- idx 14)) + (aref block-high (- idx 16))) + (logxor (aref block-low (- idx 3)) + (aref block-low (- idx 8)) + (aref block-low (- idx 14)) + (aref block-low (- idx 16)))) + (aset block-high idx S1W-high) + (aset block-low idx S1W-low) + (setq idx (1+ idx)))) + ;; step (d). + (setq idx 0) + (let (;; temporary variables used in sha1-OP macro. + S5A-high S5A-low S30B-high S30B-low carry) + (while (< idx 20) (sha1-OP 0) (setq idx (1+ idx))) + (while (< idx 40) (sha1-OP 1) (setq idx (1+ idx))) + (while (< idx 60) (sha1-OP 2) (setq idx (1+ idx))) + (while (< idx 80) (sha1-OP 3) (setq idx (1+ idx)))) + ;; step (e). + (let (;; temporary variables used in sha1-add-to-H macro. + carry) + (sha1-add-to-H H0 A) + (sha1-add-to-H H1 B) + (sha1-add-to-H H2 C) + (sha1-add-to-H H3 D) + (sha1-add-to-H H4 E)))) + +(defun sha1-binary (string) + "Return the SHA1 of STRING in binary form." + (let (;; prepare buffers for a block. byte-length of block is 64. + ;; input block is split into two vectors. + ;; + ;; input block: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ... + ;; block-high: +-0-+ +-1-+ +-2-+ +-3-+ + ;; block-low: +-0-+ +-1-+ +-2-+ +-3-+ + ;; + ;; length of each vector is 80, and elements of each vector are + ;; 16bit integers. elements 0x10-0x4F of each vector are + ;; assigned later in `sha1-block'. + (block-high (eval-when-compile (make-vector 80 nil))) + (block-low (eval-when-compile (make-vector 80 nil)))) + (unwind-protect + (let* (;; byte-length of input string. + (len (length string)) + (lim (* (/ len 64) 64)) + (rem (% len 4)) + (idx 0)(pos 0)) + ;; initialize buffers (H0 H1 H2 H3 H4). + (setq sha1-H0-high 26437 ; (string-to-number "6745" 16) + sha1-H0-low 8961 ; (string-to-number "2301" 16) + sha1-H1-high 61389 ; (string-to-number "EFCD" 16) + sha1-H1-low 43913 ; (string-to-number "AB89" 16) + sha1-H2-high 39098 ; (string-to-number "98BA" 16) + sha1-H2-low 56574 ; (string-to-number "DCFE" 16) + sha1-H3-high 4146 ; (string-to-number "1032" 16) + sha1-H3-low 21622 ; (string-to-number "5476" 16) + sha1-H4-high 50130 ; (string-to-number "C3D2" 16) + sha1-H4-low 57840) ; (string-to-number "E1F0" 16) + ;; loop for each 64 bytes block. + (while (< pos lim) + ;; step (a). + (setq idx 0) + (while (< idx 16) + (aset block-high idx (+ (* (aref string pos) 256) + (aref string (1+ pos)))) + (setq pos (+ pos 2)) + (aset block-low idx (+ (* (aref string pos) 256) + (aref string (1+ pos)))) + (setq pos (+ pos 2)) + (setq idx (1+ idx))) + (sha1-block block-high block-low)) + ;; last block. + (if (prog1 + (< (- len lim) 56) + (setq lim (- len rem)) + (setq idx 0) + (while (< pos lim) + (aset block-high idx (+ (* (aref string pos) 256) + (aref string (1+ pos)))) + (setq pos (+ pos 2)) + (aset block-low idx (+ (* (aref string pos) 256) + (aref string (1+ pos)))) + (setq pos (+ pos 2)) + (setq idx (1+ idx))) + ;; this is the last (at most) 32bit word. + (cond + ((= rem 3) + (aset block-high idx (+ (* (aref string pos) 256) + (aref string (1+ pos)))) + (setq pos (+ pos 2)) + (aset block-low idx (+ (* (aref string pos) 256) + 128))) + ((= rem 2) + (aset block-high idx (+ (* (aref string pos) 256) + (aref string (1+ pos)))) + (aset block-low idx 32768)) + ((= rem 1) + (aset block-high idx (+ (* (aref string pos) 256) + 128)) + (aset block-low idx 0)) + (t ;; (= rem 0) + (aset block-high idx 32768) + (aset block-low idx 0))) + (setq idx (1+ idx)) + (while (< idx 16) + (aset block-high idx 0) + (aset block-low idx 0) + (setq idx (1+ idx)))) + ;; last block has enough room to write the length of string. + (progn + ;; write bit length of string to last 4 bytes of the block. + (aset block-low 15 (* (% len 8192) 8)) + (setq len (/ len 8192)) + (aset block-high 15 (% len 65536)) + ;; XXX: It is not practical to compute SHA1 of + ;; such a huge message on emacs. + ;; (setq len (/ len 65536)) ; for 64bit emacs. + ;; (aset block-low 14 (% len 65536)) + ;; (aset block-high 14 (/ len 65536)) + (sha1-block block-high block-low)) + ;; need one more block. + (sha1-block block-high block-low) + (fillarray block-high 0) + (fillarray block-low 0) + ;; write bit length of string to last 4 bytes of the block. + (aset block-low 15 (* (% len 8192) 8)) + (setq len (/ len 8192)) + (aset block-high 15 (% len 65536)) + ;; XXX: It is not practical to compute SHA1 of + ;; such a huge message on emacs. + ;; (setq len (/ len 65536)) ; for 64bit emacs. + ;; (aset block-low 14 (% len 65536)) + ;; (aset block-high 14 (/ len 65536)) + (sha1-block block-high block-low)) + ;; make output string (in binary form). + (let ((result (make-string 20 0))) + (aset result 0 (/ sha1-H0-high 256)) + (aset result 1 (% sha1-H0-high 256)) + (aset result 2 (/ sha1-H0-low 256)) + (aset result 3 (% sha1-H0-low 256)) + (aset result 4 (/ sha1-H1-high 256)) + (aset result 5 (% sha1-H1-high 256)) + (aset result 6 (/ sha1-H1-low 256)) + (aset result 7 (% sha1-H1-low 256)) + (aset result 8 (/ sha1-H2-high 256)) + (aset result 9 (% sha1-H2-high 256)) + (aset result 10 (/ sha1-H2-low 256)) + (aset result 11 (% sha1-H2-low 256)) + (aset result 12 (/ sha1-H3-high 256)) + (aset result 13 (% sha1-H3-high 256)) + (aset result 14 (/ sha1-H3-low 256)) + (aset result 15 (% sha1-H3-low 256)) + (aset result 16 (/ sha1-H4-high 256)) + (aset result 17 (% sha1-H4-high 256)) + (aset result 18 (/ sha1-H4-low 256)) + (aset result 19 (% sha1-H4-low 256)) + result)) + ;; do not leave a copy of input string. + (fillarray block-high nil) + (fillarray block-low nil)))) + +(defun sha1-string-internal (string &optional binary) + (if binary + (sha1-binary string) + (encode-hex-string (sha1-binary string)))) + +(defun sha1-region-internal (beg end &optional binary) + (sha1-string-internal (buffer-substring-no-properties beg end) binary)) + +;;; +;;; application interface. +;;; + +(defun sha1-region (beg end &optional binary) + (if (and sha1-use-external + sha1-maximum-internal-length + (> (abs (- end beg)) sha1-maximum-internal-length)) + (sha1-region-external beg end binary) + (sha1-region-internal beg end binary))) + +(defun sha1-string (string &optional binary) + (if (and sha1-use-external + sha1-maximum-internal-length + (> (length string) sha1-maximum-internal-length)) + (sha1-string-external string binary) + (sha1-string-internal string binary))) + +;;;###autoload +(defun sha1 (object &optional beg end binary) + "Return the SHA1 (Secure Hash Algorithm) of an object. +OBJECT is either a string or a buffer. +Optional arguments BEG and END denote buffer positions for computing the +hash of a portion of OBJECT. +If BINARY is non-nil, return a string in binary form." + (if (stringp object) + (sha1-string object binary) + (save-excursion + (set-buffer object) + (sha1-region (or beg (point-min)) (or end (point-max)) binary)))) + +(provide 'sha1-el) + +;;; sha1-el.el ends here diff --git a/flim-1.14.9/sha1.el b/flim-1.14.9/sha1.el new file mode 100644 index 0000000..6fca525 --- /dev/null +++ b/flim-1.14.9/sha1.el @@ -0,0 +1,64 @@ +;;; sha1.el --- SHA1 Secure Hash Algorithm. + +;; Copyright (C) 1999, 2001 Free Software Foundation, Inc. + +;; Author: Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp> +;; Keywords: SHA1, FIPS 180-1 + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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: + +;; Examples from FIPS PUB 180-1. +;; <URL:http://www.itl.nist.gov/div897/pubs/fip180-1.htm> +;; +;; (sha1 "abc") +;; => a9993e364706816aba3e25717850c26c9cd0d89d +;; +;; (sha1 "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq") +;; => 84983e441c3bd26ebaae4aa1f95129e5e54670f1 +;; +;; (sha1 (make-string 1000000 ?a)) +;; => 34aa973cd4c4daa4f61eeb2bdbad27316534016f + +;;; 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))) + +(provide 'sha1) + +;;; sha1.el ends here diff --git a/flim-1.14.9/smtp.el b/flim-1.14.9/smtp.el new file mode 100644 index 0000000..994bb47 --- /dev/null +++ b/flim-1.14.9/smtp.el @@ -0,0 +1,754 @@ +;;; smtp.el --- basic functions to send mail with SMTP server + +;; Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001 ,2002, 2004 +;; Free Software Foundation, Inc. + +;; Author: Tomoji Kagatani <kagatani@rbc.ncl.omron.co.jp> +;; Simon Leinen <simon@switch.ch> (ESMTP support) +;; Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp> +;; Daiki Ueno <ueno@unixuser.org> +;; Keywords: SMTP, mail + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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: +;; + +;;; Code: + +(require 'custom) +(require 'mail-utils) ; mail-strip-quoted-names +(require 'sasl) +(require 'luna) +(require 'mel) ; binary-funcall + +(defgroup smtp nil + "SMTP protocol for sending mail." + :group 'mail) + +(defgroup smtp-extensions nil + "SMTP service extensions (RFC1869)." + :group 'smtp) + +(defcustom smtp-default-server nil + "Specify default SMTP server." + :type '(choice (const nil) string) + :group 'smtp) + +(defcustom smtp-server (or (getenv "SMTPSERVER") smtp-default-server) + "The name of the host running SMTP server. +It can also be a function +called from `smtp-via-smtp' with arguments SENDER and RECIPIENTS." + :type '(choice (string :tag "Name") + (function :tag "Function")) + :group 'smtp) + +(defcustom smtp-send-by-myself nil + "If non-nil, smtp.el send a mail by myself without smtp-server. +This option requires \"dig.el\"." + :type 'boolean + :group 'smtp) + +(defcustom smtp-service "smtp" + "SMTP service port number. \"smtp\" or 25." + :type '(choice (integer :tag "25" 25) + (string :tag "smtp" "smtp")) + :group 'smtp) + +(defcustom smtp-local-domain nil + "Local domain name without a host name. +If the function (system-name) returns the full internet address, +don't define this value." + :type '(choice (const nil) string) + :group 'smtp) + +(defcustom smtp-fqdn nil + "Fully qualified domain name used for Message-ID." + :type '(choice (const nil) string) + :group 'smtp) + +(defcustom smtp-use-8bitmime t + "If non-nil, use ESMTP 8BITMIME (RFC1652) if available." + :type 'boolean + :group 'smtp-extensions) + +(defcustom smtp-use-size t + "If non-nil, use ESMTP SIZE (RFC1870) if available." + :type 'boolean + :group 'smtp-extensions) + +(defcustom smtp-use-starttls nil + "If non-nil, use STARTTLS (RFC2595) if available." + :type 'boolean + :group 'smtp-extensions) + +(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-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'" + :group 'smtp-extensions) + +(defcustom smtp-use-sasl nil + "If non-nil, use SMTP Authentication (RFC2554) if available." + :type 'boolean + :group 'smtp-extensions) + +(defcustom smtp-sasl-user-name (user-login-name) + "Identification to be used for authorization." + :type 'string + :group 'smtp-extensions) + +(defcustom smtp-sasl-properties nil + "Properties set to SASL client." + :type 'string + :group 'smtp-extensions) + +(defcustom smtp-sasl-mechanisms nil + "List of authentication mechanisms." + :type '(repeat string) + :group 'smtp-extensions) + +(defcustom smtp-debug nil + "*If non-nil, smtp debug info printout into messages." + :type 'boolean + :group 'smtp) + +(defvar sasl-mechanisms) + +;;;###autoload +(defvar smtp-open-connection-function #'open-network-stream + "*Function used for connecting to a SMTP server. +The function will be called with the same four arguments as +`open-network-stream' and should return a process object. +Here is an example: + +\(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)))) + +It connects to a SMTP server using \"ssh\" before actually connecting +to the SMTP port. Where the command \"nc\" is the netcat executable; +see http://www.atstake.com/research/tools/index.html#network_utilities +for details.") + +(defvar smtp-read-point nil) + +(defvar smtp-connection-alist nil) + +(defvar smtp-submit-package-function #'smtp-submit-package) + +;;; @ SMTP package +;;; A package contains a mail message, an envelope sender address, +;;; and one or more envelope recipient addresses. In ESMTP model +;;; the current sending package should be guaranteed to be accessible +;;; anywhere from the hook methods (or SMTP commands). + +(eval-and-compile + (luna-define-class smtp-package () + (sender + recipients + buffer)) + + (luna-define-internal-accessors 'smtp-package)) + +(defun smtp-make-package (sender recipients buffer) + "Create a new package structure. +A package is a unit of SMTP message +SENDER specifies the package sender, a string. +RECIPIENTS is a list of recipients. +BUFFER may be a buffer or a buffer name which contains mail message." + (luna-make-entity 'smtp-package :sender sender :recipients recipients :buffer buffer)) + +(defun smtp-package-buffer-internal-size (package) + "Return the size of PACKAGE, an integer." + (save-excursion + (set-buffer (smtp-package-buffer-internal package)) + (let ((size + (+ (buffer-size) + ;; Add one byte for each change-of-line + ;; because or CR-LF representation: + (count-lines (point-min) (point-max)) + ;; For some reason, an empty line is + ;; added to the message. Maybe this + ;; is a bug, but it can't hurt to add + ;; those two bytes anyway: + 2))) + (goto-char (point-min)) + (while (re-search-forward "^\\." nil t) + (setq size (1+ size))) + size))) + +;;; @ SMTP connection +;;; We should consider the function `open-network-stream' is a emulation +;;; for another network stream. They are likely to be implemented with an +;;; external program and the function `process-contact' returns the +;;; process id instead of `(HOST SERVICE)' pair. + +(eval-and-compile + (luna-define-class smtp-connection () + (process + server + service + extensions + encoder + decoder)) + + (luna-define-internal-accessors 'smtp-connection)) + +(defun smtp-make-connection (process server service) + "Create a new connection structure. +PROCESS is an internal subprocess-object. SERVER is name of the host +to connect to. SERVICE is name of the service desired." + (luna-make-entity 'smtp-connection :process process :server server :service service)) + +(luna-define-generic smtp-connection-opened (connection) + "Say whether the CONNECTION to server has been opened.") + +(luna-define-generic smtp-close-connection (connection) + "Close the CONNECTION to server.") + +(luna-define-method smtp-connection-opened ((connection smtp-connection)) + (let ((process (smtp-connection-process-internal connection))) + (if (memq (process-status process) '(open run)) + t))) + +(luna-define-method smtp-close-connection ((connection smtp-connection)) + (let ((process (smtp-connection-process-internal connection))) + (delete-process process))) + +(defun smtp-make-fqdn () + "Return user's fully qualified domain name." + (if smtp-fqdn + smtp-fqdn + (let ((system-name (system-name))) + (cond + (smtp-local-domain + (concat system-name "." smtp-local-domain)) + ((string-match "[^.]\\.[^.]" system-name) + system-name) + (t + (error "Cannot generate valid FQDN")))))) + +(defun smtp-find-connection (buffer) + "Find the connection delivering to BUFFER." + (let ((entry (assq buffer smtp-connection-alist)) + connection) + (when entry + (setq connection (nth 1 entry)) + (if (smtp-connection-opened connection) + connection + (setq smtp-connection-alist + (delq entry smtp-connection-alist)) + nil)))) + +(eval-and-compile + (autoload 'starttls-open-stream "starttls") + (autoload 'starttls-negotiate "starttls")) + +(defun smtp-open-connection (buffer server service) + "Open a SMTP connection for a service to a host. +Return a newly allocated connection-object. +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)) + connection) + (when process + (setq connection (smtp-make-connection process server service)) + (set-process-filter process 'smtp-process-filter) + (setq smtp-connection-alist + (cons (list buffer connection) + smtp-connection-alist)) + connection))) + +(eval-and-compile + (autoload 'dig-invoke "dig") + (autoload 'dig-extract-rr "dig")) + +(defun smtp-find-mx (domain &optional doerror) + (let (server) + ;; dig.el resolves only primally MX. + (cond ((setq server (smtp-dig domain "MX")) + (progn (string-match " \\([^ ]*\\)$" server) + (match-string 1 server))) + ((smtp-dig domain "A") + domain) + (t + (if doerror + (error (format "SMTP cannot resolve %s" domain))))))) + +(defun smtp-dig (domain type) + (let (dig-buf) + (set-buffer + (setq dig-buf (dig-invoke domain type))) + (prog1 + (dig-extract-rr domain type) + (kill-buffer dig-buf)))) + +(defun smtp-find-server (recipients) + (save-excursion + (let ((rec + (mapcar (lambda (recipient) + (let (server) + (if (and (string-match "@\\([^\t\n ]*\\)" recipient) + (setq server + (smtp-find-mx + (match-string 1 recipient)))) + (cons server (list recipient)) + (error (format "cannot find server for %s." recipient))))) + recipients)) + ret rets rlist) + (while (setq rets (pop rec)) + (if (setq ret (assoc (car rets) rec)) + (setcdr ret + (append (cdr ret) (cdr rets))) + (setq rlist + (append rlist (list rets))))) + rlist))) + +;;;###autoload +(defun smtp-via-smtp (sender recipients buffer) + "Like `smtp-send-buffer', but sucks in any errors." + (condition-case nil + (progn + (smtp-send-buffer sender recipients buffer) + t) + (smtp-error))) + +(make-obsolete 'smtp-via-smtp "It's old API.") + +;;;###autoload +(defun smtp-send-buffer (sender recipients buffer) + "Send a message. +SENDER is an envelope sender address. +RECIPIENTS is a list of envelope recipient addresses. +BUFFER may be a buffer or a buffer name which contains mail message." + (if smtp-send-by-myself + (smtp-send-buffer-by-myself sender recipients buffer) + (let* ((server + (if (functionp smtp-server) + (funcall smtp-server sender recipients) + (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))) + (erase-buffer) + (buffer-disable-undo) + (unless (smtp-find-connection (current-buffer)) + (smtp-open-connection (current-buffer) server smtp-service)) + (make-local-variable 'smtp-read-point) + (setq smtp-read-point (point-min)) + (funcall smtp-submit-package-function package))))) + +(defun smtp-submit-package (package) + (unwind-protect + (progn + (smtp-primitive-greeting package) + (condition-case nil + (smtp-primitive-ehlo package) + (smtp-response-error + (smtp-primitive-helo package))) + (if smtp-use-starttls + (if (assq 'starttls + (smtp-connection-extensions-internal + (smtp-find-connection (current-buffer)))) + (progn + (smtp-primitive-starttls package) + (smtp-primitive-ehlo package)) + (unless smtp-use-starttls-ignore-error + (error "STARTTLS is not supported on this server")))) + (if smtp-use-sasl + (smtp-primitive-auth package)) + (smtp-primitive-mailfrom package) + (smtp-primitive-rcptto package) + (smtp-primitive-data package)) + (let ((connection (smtp-find-connection (current-buffer)))) + (when (smtp-connection-opened connection) + (condition-case nil + (smtp-primitive-quit package) + (smtp-error)) + (smtp-close-connection connection))))) + +(defun smtp-send-buffer-by-myself (sender recipients buffer) + "Send a message by myself. +SENDER is an envelope sender address. +RECIPIENTS is a list of envelope recipient addresses. +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)) + (setq recipients (cdar servers)) + (if (not (and server recipients)) + ;; MAILER-DAEMON is required. :) + (error (format "Cannot send <%s>" + (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))) + (erase-buffer) + (buffer-disable-undo) + (unless (smtp-find-connection (current-buffer)) + (smtp-open-connection (current-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))) + (setq servers (cdr servers))))) + +;;; @ hook methods for `smtp-submit-package' +;;; + +(defun smtp-primitive-greeting (package) + (let* ((connection + (smtp-find-connection (current-buffer))) + (response + (smtp-read-response connection))) + (if (/= (car response) 220) + (smtp-response-error response)))) + +(defun smtp-primitive-ehlo (package) + (let* ((connection + (smtp-find-connection (current-buffer))) + response) + (smtp-send-command connection (format "EHLO %s" (smtp-make-fqdn))) + (setq response (smtp-read-response connection)) + (if (/= (car response) 250) + (smtp-response-error response)) + (smtp-connection-set-extensions-internal + connection (mapcar + (lambda (extension) + (let ((extensions + (split-string extension))) + (setcar extensions + (car (read-from-string + (downcase (car extensions))))) + extensions)) + (cdr response))))) + +(defun smtp-primitive-helo (package) + (let* ((connection + (smtp-find-connection (current-buffer))) + response) + (smtp-send-command connection (format "HELO %s" (smtp-make-fqdn))) + (setq response (smtp-read-response connection)) + (if (/= (car response) 250) + (smtp-response-error response)))) + +(defun smtp-primitive-auth (package) + (let* ((connection + (smtp-find-connection (current-buffer))) + (mechanisms + (cdr (assq 'auth (smtp-connection-extensions-internal connection)))) + (sasl-mechanisms + (or smtp-sasl-mechanisms sasl-mechanisms)) + (mechanism + (sasl-find-mechanism mechanisms)) + client + name + step + response) + (unless mechanism + (error "No authentication mechanism available")) + (setq client (sasl-make-client mechanism smtp-sasl-user-name "smtp" + (smtp-connection-server-internal connection))) + (if smtp-sasl-properties + (sasl-client-set-properties client smtp-sasl-properties)) + (setq name (sasl-mechanism-name mechanism) + ;; Retrieve the initial response + step (sasl-next-step client nil)) + (smtp-send-command + connection + (if (sasl-step-data step) + (format "AUTH %s %s" name (base64-encode-string (sasl-step-data step) t)) + (format "AUTH %s" name))) + (catch 'done + (while t + (setq response (smtp-read-response connection)) + (when (= (car response) 235) + ;; The authentication process is finished. + (setq step (sasl-next-step client step)) + (if (null step) + (throw 'done nil)) + (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))) + (setq step (sasl-next-step client step)) + (smtp-send-command + connection + (if (sasl-step-data step) + (base64-encode-string (sasl-step-data step) t) + "")))) +;;; (smtp-connection-set-encoder-internal +;;; connection (sasl-client-encoder client)) +;;; (smtp-connection-set-decoder-internal +;;; connection (sasl-client-decoder client)) + )) + +(defun smtp-primitive-starttls (package) + (let* ((connection + (smtp-find-connection (current-buffer))) + 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)))) + +(defun smtp-primitive-mailfrom (package) + (let* ((connection + (smtp-find-connection (current-buffer))) + (extensions + (smtp-connection-extensions-internal + connection)) + (sender + (smtp-package-sender-internal package)) + extension + response) + ;; SIZE --- Message Size Declaration (RFC1870) + (if (and smtp-use-size + (assq 'size extensions)) + (setq extension (format "SIZE=%d" (smtp-package-buffer-internal-size package)))) + ;; 8BITMIME --- 8bit-MIMEtransport (RFC1652) + (if (and smtp-use-8bitmime + (assq '8bitmime extensions)) + (setq extension (concat extension " BODY=8BITMIME"))) + (smtp-send-command + connection + (if extension + (format "MAIL FROM:<%s> %s" sender extension) + (format "MAIL FROM:<%s>" sender))) + (setq response (smtp-read-response connection)) + (if (/= (car response) 250) + (smtp-response-error response)))) + +(defun smtp-primitive-rcptto (package) + (let* ((connection + (smtp-find-connection (current-buffer))) + (recipients + (smtp-package-recipients-internal package)) + response) + (while recipients + (smtp-send-command + connection (format "RCPT TO:<%s>" (pop recipients))) + (setq response (smtp-read-response connection)) + (unless (memq (car response) '(250 251)) + (smtp-response-error response))))) + +(defun smtp-primitive-data (package) + (let* ((connection + (smtp-find-connection (current-buffer))) + response) + (smtp-send-command connection "DATA") + (setq response (smtp-read-response connection)) + (if (/= (car response) 354) + (smtp-response-error response)) + (save-excursion + (set-buffer (smtp-package-buffer-internal package)) + (goto-char (point-min)) + (while (not (eobp)) + (smtp-send-data + connection (buffer-substring (point) (progn (end-of-line)(point)))) + (beginning-of-line 2))) + (smtp-send-command connection ".") + (setq response (smtp-read-response connection)) + (if (/= (car response) 250) + (smtp-response-error response)))) + +(defun smtp-primitive-quit (package) + (let* ((connection + (smtp-find-connection (current-buffer))) + response) + (smtp-send-command connection "QUIT") + (setq response (smtp-read-response connection)) + (if (/= (car response) 221) + (smtp-response-error response)))) + +;;; @ low level process manipulating function +;;; +(defun smtp-process-filter (process output) + (save-excursion + (set-buffer (process-buffer process)) + (goto-char (point-max)) + (insert output))) + +(put 'smtp-error 'error-message "SMTP error") +(put 'smtp-error 'error-conditions '(smtp-error error)) + +(put 'smtp-response-error 'error-message "SMTP response error") +(put 'smtp-response-error 'error-conditions '(smtp-response-error smtp-error error)) + +(defun smtp-response-error (response) + (signal 'smtp-response-error response)) + +(defun smtp-read-response (connection) + (let ((decoder + (smtp-connection-decoder-internal connection)) + (response-continue t) + response) + (while response-continue + (goto-char smtp-read-point) + (while (not (re-search-forward "\r?\n" nil t)) + (unless (smtp-connection-opened connection) + (signal 'smtp-error "Connection closed")) + (accept-process-output (smtp-connection-process-internal connection)) + (goto-char smtp-read-point)) + (let ((bol smtp-read-point) + (eol (match-beginning 0))) + (when decoder + (let ((string (buffer-substring bol eol))) + (delete-region bol (point)) + (insert (funcall decoder string)) + (setq eol (point)) + (insert "\r\n"))) + (setq smtp-read-point (point)) + (goto-char bol) + (cond + ((looking-at "[1-5][0-9][0-9]\\([ -]\\)") + (setq response + (nconc response + (list (buffer-substring (match-end 0) eol)))) + (when (string= (match-string 1) " ") + (setq response (cons (read (point-marker)) response) + response-continue nil))) + (smtp-debug + (message "Invalid response: %s" (buffer-substring bol eol)))))) + 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)) + (goto-char (point-max)) + (setq command (concat command "\r\n")) + (insert command) + (setq smtp-read-point (point)) + (if encoder + (setq command (funcall encoder command))) + (process-send-string process command)))) + +(defun smtp-send-data (connection data) + (let ((process + (smtp-connection-process-internal connection)) + (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"))) + (if encoder + (setq data (funcall encoder data))) + (process-send-string process data))) + +(defun smtp-deduce-address-list (smtp-text-buffer header-start header-end) + "Get address list suitable for smtp RCPT TO:<address>." + (let ((simple-address-list "") + this-line + this-line-end + addr-regexp + (smtp-address-buffer (generate-new-buffer " *smtp-mail*"))) + (unwind-protect + (save-excursion + ;; + (set-buffer smtp-address-buffer) + (setq case-fold-search t) + (erase-buffer) + (insert (save-excursion + (set-buffer smtp-text-buffer) + (buffer-substring-no-properties header-start header-end))) + (goto-char (point-min)) + ;; RESENT-* fields should stop processing of regular fields. + (save-excursion + (if (re-search-forward "^RESENT-TO:" header-end t) + (setq addr-regexp + "^\\(RESENT-TO:\\|RESENT-CC:\\|RESENT-BCC:\\)") + (setq addr-regexp "^\\(TO:\\|CC:\\|BCC:\\)"))) + + (while (re-search-forward addr-regexp header-end t) + (replace-match "") + (setq this-line (match-beginning 0)) + (forward-line 1) + ;; get any continuation lines. + (while (and (looking-at "^[ \t]+") (< (point) header-end)) + (forward-line 1)) + (setq this-line-end (point-marker)) + (setq simple-address-list + (concat simple-address-list " " + (mail-strip-quoted-names + (buffer-substring this-line this-line-end))))) + (erase-buffer) + (insert " " simple-address-list "\n") + ;; newline --> blank + (subst-char-in-region (point-min) (point-max) 10 ? t) + ;; comma --> blank + (subst-char-in-region (point-min) (point-max) ?, ? t) + ;; tab --> blank + (subst-char-in-region (point-min) (point-max) 9 ? t) + + (goto-char (point-min)) + ;; tidyness in case hook is not robust when it looks at this + (while (re-search-forward "[ \t]+" header-end t) (replace-match " ")) + + (goto-char (point-min)) + (let (recipient-address-list) + (while (re-search-forward " \\([^ ]+\\) " (point-max) t) + (backward-char 1) + (setq recipient-address-list + (cons (buffer-substring (match-beginning 1) (match-end 1)) + recipient-address-list))) + recipient-address-list)) + (kill-buffer smtp-address-buffer)))) + +(provide 'smtp) + +;;; smtp.el ends here diff --git a/flim-1.14.9/smtpmail.el b/flim-1.14.9/smtpmail.el new file mode 100644 index 0000000..1adc168 --- /dev/null +++ b/flim-1.14.9/smtpmail.el @@ -0,0 +1,326 @@ +;;; smtpmail.el --- SMTP interface for mail-mode + +;; Copyright (C) 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc. + +;; Author: Tomoji Kagatani <kagatani@rbc.ncl.omron.co.jp> +;; Keywords: mail + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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: + +;; Send Mail to smtp host from smtpmail temp buffer. + +;; Please add these lines in your .emacs(_emacs). +;; +;;(setq send-mail-function 'smtpmail-send-it) +;;(setq smtp-default-server "YOUR SMTP HOST") +;;(setq smtp-service "smtp") +;;(setq smtp-local-domain "YOUR DOMAIN NAME") +;;(setq smtp-debug-info t) +;;(autoload 'smtpmail-send-it "smtpmail") +;;(setq user-full-name "YOUR NAME HERE") + +;; To queue mail, set smtpmail-queue-mail to t and use +;; smtpmail-send-queued-mail to send. + + +;;; Code: + +(require 'custom) +(require 'smtp) +(require 'sendmail) +(require 'time-stamp) +(require 'mel) ; binary-write-decoded-region, binary-find-file-noselect + +(eval-when-compile (require 'static)) + +(static-when (featurep 'xemacs) + (define-obsolete-variable-alias 'smtpmail-default-smtp-server + 'smtp-default-server) + (define-obsolete-variable-alias 'smtpmail-smtp-server 'smtp-server) + (define-obsolete-variable-alias 'smtpmail-smtp-service 'smtp-service) + (define-obsolete-variable-alias 'smtpmail-local-domain 'smtp-local-domain) + (define-obsolete-variable-alias 'smtpmail-debug-info 'smtp-debug-info) + ) + +;;; + +(defcustom smtpmail-queue-mail nil + "Specify if mail is queued (if t) or sent immediately (if nil). +If queued, it is stored in the directory `smtpmail-queue-dir' +and sent with `smtpmail-send-queued-mail'." + :type 'boolean + :group 'smtp) + +(defcustom smtpmail-queue-dir "~/Mail/queued-mail/" + "Directory where `smtpmail.el' stores queued mail." + :type 'directory + :group 'smtp) + +(defvar smtpmail-queue-index-file "index" + "File name of queued mail index, +This is relative to `smtpmail-queue-dir'.") + +(defvar smtpmail-queue-index + (concat (file-name-as-directory smtpmail-queue-dir) + smtpmail-queue-index-file)) + +(defvar smtpmail-recipient-address-list nil) + + +;;; +;;; +;;; + +;;;###autoload +(defun smtpmail-send-it () + (require 'mail-utils) + (let ((errbuf (if mail-interactive + (generate-new-buffer " smtpmail errors") + 0)) + (tembuf (generate-new-buffer " smtpmail temp")) + (case-fold-search nil) + resend-to-addresses + delimline + (mailbuf (current-buffer))) + (unwind-protect + (save-excursion + (set-buffer tembuf) + (erase-buffer) + (insert-buffer-substring mailbuf) + (goto-char (point-max)) + ;; require one newline at the end. + (or (= (preceding-char) ?\n) + (insert ?\n)) + ;; Change header-delimiter to be what sendmail expects. + (goto-char (point-min)) + (re-search-forward + (concat "^" (regexp-quote mail-header-separator) "\n")) + (replace-match "\n") + (backward-char 1) + (setq delimline (point-marker)) +;; (sendmail-synch-aliases) + (if (and mail-aliases (fboundp 'expand-mail-aliases)) ; XEmacs + (expand-mail-aliases (point-min) delimline)) + (goto-char (point-min)) + ;; ignore any blank lines in the header + (while (and (re-search-forward "\n\n\n*" delimline t) + (< (point) delimline)) + (replace-match "\n")) + (let ((case-fold-search t)) + (goto-char (point-min)) + (goto-char (point-min)) + (while (re-search-forward "^Resent-to:" delimline t) + (setq resend-to-addresses + (save-restriction + (narrow-to-region (point) + (save-excursion + (forward-line 1) + (while (looking-at "^[ \t]") + (forward-line 1)) + (point))) + (append (mail-parse-comma-list) + resend-to-addresses)))) +;;; Apparently this causes a duplicate Sender. +;;; ;; If the From is different than current user, insert Sender. +;;; (goto-char (point-min)) +;;; (and (re-search-forward "^From:" delimline t) +;;; (progn +;;; (require 'mail-utils) +;;; (not (string-equal +;;; (mail-strip-quoted-names +;;; (save-restriction +;;; (narrow-to-region (point-min) delimline) +;;; (mail-fetch-field "From"))) +;;; (user-login-name)))) +;;; (progn +;;; (forward-line 1) +;;; (insert "Sender: " (user-login-name) "\n"))) + ;; Don't send out a blank subject line + (goto-char (point-min)) + (if (re-search-forward "^Subject:\\([ \t]*\n\\)+\\b" delimline t) + (replace-match "") + ;; This one matches a Subject just before the header delimiter. + (if (and (re-search-forward "^Subject:\\([ \t]*\n\\)+" delimline t) + (= (match-end 0) delimline)) + (replace-match ""))) + ;; Put the "From:" field in unless for some odd reason + ;; they put one in themselves. + (goto-char (point-min)) + (if (not (re-search-forward "^From:" delimline t)) + (let* ((login user-mail-address) + (fullname (user-full-name))) + (cond ((eq mail-from-style 'angles) + (insert "From: " fullname) + (let ((fullname-start (+ (point-min) 6)) + (fullname-end (point-marker))) + (goto-char fullname-start) + ;; Look for a character that cannot appear unquoted + ;; according to RFC 822. + (if (re-search-forward "[^- !#-'*+/-9=?A-Z^-~]" + fullname-end 1) + (progn + ;; Quote fullname, escaping specials. + (goto-char fullname-start) + (insert "\"") + (while (re-search-forward "[\"\\]" + fullname-end 1) + (replace-match "\\\\\\&" t)) + (insert "\"")))) + (insert " <" login ">\n")) + ((eq mail-from-style 'parens) + (insert "From: " login " (") + (let ((fullname-start (point))) + (insert fullname) + (let ((fullname-end (point-marker))) + (goto-char fullname-start) + ;; RFC 822 says \ and nonmatching parentheses + ;; must be escaped in comments. + ;; Escape every instance of ()\ ... + (while (re-search-forward "[()\\]" fullname-end 1) + (replace-match "\\\\\\&" t)) + ;; ... then undo escaping of matching parentheses, + ;; including matching nested parentheses. + (goto-char fullname-start) + (while (re-search-forward + "\\(\\=\\|[^\\]\\(\\\\\\\\\\)*\\)\\\\(\\(\\([^\\]\\|\\\\\\\\\\)*\\)\\\\)" + fullname-end 1) + (replace-match "\\1(\\3)" t) + (goto-char fullname-start)))) + (insert ")\n")) + ((null mail-from-style) + (insert "From: " login "\n"))))) + ;; Insert an extra newline if we need it to work around + ;; Sun's bug that swallows newlines. + (goto-char (1+ delimline)) + (if (eval mail-mailer-swallows-blank-line) + (newline)) + ;; Find and handle any FCC fields. + (goto-char (point-min)) + (if (re-search-forward "^FCC:" delimline t) + (mail-do-fcc delimline)) + (if mail-interactive + (save-excursion + (set-buffer errbuf) + (erase-buffer)))) + ;; + ;; + ;; + (setq smtpmail-recipient-address-list + (or resend-to-addresses + (smtp-deduce-address-list tembuf (point-min) delimline))) + + (smtpmail-do-bcc delimline) + ; Send or queue + (if (not smtpmail-queue-mail) + (if smtpmail-recipient-address-list + (smtp-send-buffer user-mail-address + smtpmail-recipient-address-list + tembuf) + (error "Sending failed; no recipients")) + (let* ((file-data (convert-standard-filename + (concat + (file-name-as-directory smtpmail-queue-dir) + (time-stamp-yyyy-mm-dd) + "_" (time-stamp-hh:mm:ss)))) + (file-elisp (concat file-data ".el")) + (buffer-data (create-file-buffer file-data)) + (buffer-elisp (create-file-buffer file-elisp)) + (buffer-scratch "*queue-mail*")) + (save-excursion + (set-buffer buffer-data) + (erase-buffer) + (insert-buffer tembuf) + (or (file-directory-p smtpmail-queue-dir) + (make-directory smtpmail-queue-dir t)) + (binary-write-decoded-region (point-min) (point-max) file-data) + (set-buffer buffer-elisp) + (erase-buffer) + (insert (concat + "(setq smtpmail-recipient-address-list '" + (prin1-to-string smtpmail-recipient-address-list) + ")\n")) + (write-file file-elisp) + (set-buffer (generate-new-buffer buffer-scratch)) + (insert (concat file-data "\n")) + (append-to-file (point-min) + (point-max) + smtpmail-queue-index) + ) + (kill-buffer buffer-scratch) + (kill-buffer buffer-data) + (kill-buffer buffer-elisp)))) + (kill-buffer tembuf) + (if (bufferp errbuf) + (kill-buffer errbuf))))) + +(defun smtpmail-send-queued-mail () + "Send mail that was queued as a result of setting `smtpmail-queue-mail'." + (interactive) + ;;; Get index, get first mail, send it, get second mail, etc... + (let ((buffer-index (find-file-noselect smtpmail-queue-index)) + (file-msg "") + (tembuf nil)) + (save-excursion + (set-buffer buffer-index) + (beginning-of-buffer) + (while (not (eobp)) + (setq file-msg (buffer-substring (point) (save-excursion + (end-of-line) + (point)))) + (load file-msg) + (setq tembuf (binary-find-file-noselect file-msg)) + (if smtpmail-recipient-address-list + (smtp-send-buffer user-mail-address + smtpmail-recipient-address-list tembuf) + (error "Sending failed; no recipients")) + (delete-file file-msg) + (delete-file (concat file-msg ".el")) + (kill-buffer tembuf) + (kill-line 1)) + (set-buffer buffer-index) + (save-buffer smtpmail-queue-index) + (kill-buffer buffer-index) + ))) + + +(defun smtpmail-do-bcc (header-end) + "Delete BCC: and their continuation lines from the header area. +There may be multiple BCC: lines, and each may have arbitrarily +many continuation lines." + (let ((case-fold-search t)) + (save-excursion + (goto-char (point-min)) + ;; iterate over all BCC: lines + (while (re-search-forward "^BCC:" header-end t) + (delete-region (match-beginning 0) (progn (forward-line 1) (point))) + ;; get rid of any continuation lines + (while (and (looking-at "^[ \t].*\n") (< (point) header-end)) + (replace-match "")) + ) + ) ;; save-excursion + ) ;; let + ) + + +;;; + +(provide 'smtpmail) + +;;; smtpmail.el ends here diff --git a/flim-1.14.9/std11.el b/flim-1.14.9/std11.el new file mode 100644 index 0000000..14aa54b --- /dev/null +++ b/flim-1.14.9/std11.el @@ -0,0 +1,941 @@ +;;; std11.el --- STD 11 functions for GNU Emacs + +;; Copyright (C) 1995,96,97,98,99,2000,01,02 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko <tomo@m17n.org> +;; Keywords: mail, news, RFC 822, STD 11 + +;; This file is part of FLIM (Faithful Library about Internet Message). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +(require 'custom) ; std11-lexical-analyzer + + +;;; @ fetch +;;; + +(defconst std11-field-name-regexp "[!-9;-~]+") +(defconst std11-field-head-regexp + (concat "^" std11-field-name-regexp ":")) +(defconst std11-next-field-head-regexp + (concat "\n" std11-field-name-regexp ":")) + +(defun std11-field-end (&optional bound) + "Move to end of field and return this point. +The optional argument BOUNDs the search; it is a buffer position." + (if (re-search-forward std11-next-field-head-regexp bound t) + (goto-char (match-beginning 0)) + (if (re-search-forward "^$" bound t) + (goto-char (1- (match-beginning 0))) + (end-of-line) + (point)))) + +;;;###autoload +(defun std11-fetch-field (name) + "Return the value of the header field NAME. +The buffer is expected to be narrowed to just the headers of the message." + (save-excursion + (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)) + )))) + +;;;###autoload +(defun std11-narrow-to-header (&optional boundary) + "Narrow to the message header. +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) + ))) + +;;;###autoload +(defun std11-field-body (name &optional boundary) + "Return the value of the header field NAME. +If BOUNDARY is not nil, it is used as message header separator." + (save-excursion + (save-restriction + (inline (std11-narrow-to-header boundary) + (std11-fetch-field name)) + ))) + +(defun std11-find-field-body (field-names &optional boundary) + "Return the first found field-body specified by FIELD-NAMES +of the message header in current buffer. If BOUNDARY is not nil, it is +used as message header separator." + (save-excursion + (save-restriction + (std11-narrow-to-header boundary) + (let ((case-fold-search t) + field-name) + (catch 'tag + (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)) + )))))) + +(defun std11-field-bodies (field-names &optional default-value boundary) + "Return list of each field-bodies of FIELD-NAMES of the message header +in current buffer. If BOUNDARY is not nil, it is used as message +header separator." + (save-excursion + (save-restriction + (std11-narrow-to-header boundary) + (let* ((case-fold-search t) + (dest (make-list (length field-names) default-value)) + (s-rest field-names) + (d-rest dest) + field-name) + (while (setq field-name (car s-rest)) + (goto-char (point-min)) + (if (re-search-forward (concat "^" field-name ":[ \t]*") nil t) + (setcar d-rest + (buffer-substring-no-properties + (match-end 0) (std11-field-end))) + ) + (setq s-rest (cdr s-rest) + d-rest (cdr d-rest)) + ) + dest)))) + +(defun std11-header-string (regexp &optional boundary) + "Return string of message header fields matched by REGEXP. +If BOUNDARY is not nil, it is used as message header separator." + (let ((case-fold-search t)) + (save-excursion + (save-restriction + (std11-narrow-to-header boundary) + (goto-char (point-min)) + (let (field header) + (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) + )))) + +(defun std11-header-string-except (regexp &optional boundary) + "Return string of message header fields not matched by REGEXP. +If BOUNDARY is not nil, it is used as message header separator." + (let ((case-fold-search t)) + (save-excursion + (save-restriction + (std11-narrow-to-header boundary) + (goto-char (point-min)) + (let (field header) + (while (re-search-forward std11-field-head-regexp nil t) + (setq field + (buffer-substring (match-beginning 0) (std11-field-end))) + (if (not (string-match regexp field)) + (setq header (concat header field "\n")) + )) + header) + )))) + +(defun std11-collect-field-names (&optional boundary) + "Return list of all field-names of the message header in current buffer. +If BOUNDARY is not nil, it is used as message header separator." + (save-excursion + (save-restriction + (std11-narrow-to-header boundary) + (goto-char (point-min)) + (let (dest name) + (while (re-search-forward std11-field-head-regexp nil t) + (setq name (buffer-substring-no-properties + (match-beginning 0)(1- (match-end 0)))) + (or (member name dest) + (setq dest (cons name dest)) + ) + ) + dest)))) + + +;;; @ unfolding +;;; + +;;;###autoload +(defun std11-unfold-string (string) + "Unfold STRING as message header field." + (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)) + )) + + +;;; @ quoted-string +;;; + +(defun std11-wrap-as-quoted-pairs (string specials) + (let (dest + (i 0) + (b 0) + (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)) + )) + +(defconst std11-non-qtext-char-list '(?\" ?\\ ?\r ?\n)) + +(defun std11-wrap-as-quoted-string (string) + "Wrap STRING as RFC 822 quoted-string." + (concat "\"" + (std11-wrap-as-quoted-pairs string std11-non-qtext-char-list) + "\"")) + +(defun std11-strip-quoted-pair (string) + "Strip quoted-pairs in STRING." + (let (dest + (b 0) + (i 0) + (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)) + )) + +(defun std11-strip-quoted-string (string) + "Strip quoted-string STRING." + (let ((len (length string))) + (or (and (>= len 2) + (let ((max (1- len))) + (and (eq (aref string 0) ?\") + (eq (aref string max) ?\") + (std11-strip-quoted-pair (substring string 1 max)) + ))) + string))) + + +;;; @ lexical analyze +;;; + +(defcustom std11-lexical-analyzer + '(std11-analyze-quoted-string + std11-analyze-domain-literal + std11-analyze-comment + std11-analyze-spaces + std11-analyze-special + std11-analyze-atom) + "*List of functions to return result of lexical analyze. +Each function must have two arguments: STRING and START. +STRING is the target string to be analyzed. +START is start position of STRING to analyze. + +Previous function is preferred to next function. If a function +returns nil, next function is used. Otherwise the return value will +be the result." + :group 'news + :group 'mail + :type '(repeat function)) + +(eval-and-compile + (defconst std11-space-char-list '(? ?\t ?\n)) + (defconst std11-special-char-list '(?\] ?\[ + ?\( ?\) ?< ?> ?@ + ?, ?\; ?: ?\\ ?\" + ?.)) + ) +;; (defconst std11-spaces-regexp +;; (eval-when-compile (concat "[" std11-space-char-list "]+"))) + +(defconst std11-non-atom-regexp + (eval-when-compile + (concat "[" std11-special-char-list std11-space-char-list "]"))) + +(defconst std11-atom-regexp + (eval-when-compile + (concat "[^" std11-special-char-list std11-space-char-list "]+"))) + +(defun std11-analyze-spaces (string start) + (if (and (string-match (eval-when-compile + (concat "[" std11-space-char-list "]+")) + string start) + (= (match-beginning 0) start)) + (let ((end (match-end 0))) + (cons (cons 'spaces (substring string start end)) + ;;(substring string 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)) + )) + +(defun std11-analyze-atom (string start) + (if (string-match std11-non-atom-regexp string start) + (if (> (match-beginning 0) start) + (cons (cons 'atom (substring string start (match-beginning 0))) + (match-beginning 0)) + nil) + (cons (cons 'atom (substring string start)) + (length string))) + ;; (if (and (string-match std11-atom-regexp string start) + ;; (= (match-beginning 0) start)) + ;; (let ((end (match-end 0))) + ;; (cons (cons 'atom (substring string start end)) + ;; ;;(substring string end) + ;; end) + ;; )) + ) + +(defun std11-check-enclosure (string open close &optional recursive from) + (let ((len (length string)) + (i (or from 0)) + ) + (if (and (> len i) + (eq (aref string i) open)) + (let (p chr) + (setq i (1+ i)) + (catch 'tag + (while (< i len) + (setq chr (aref string i)) + (cond ((eq chr ?\\) + (setq i (1+ i)) + (if (>= i len) + (throw 'tag nil) + ) + (setq i (1+ i)) + ) + ((eq chr close) + (throw 'tag (1+ i)) + ) + ((eq chr open) + (if (and recursive + (setq p (std11-check-enclosure + string open close recursive i)) + ) + (setq i p) + (throw 'tag nil) + )) + (t + (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) + ))) + +(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) + ))) + +(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) + ))) + +;;;###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) + )) + + +;;; @ parser +;;; + +(defun std11-ignored-token-p (token) + (let ((type (car token))) + (or (eq type 'spaces)(eq type 'comment)) + )) + +(defun std11-parse-token (lal) + (let (token itl) + (while (and lal + (progn + (setq token (car lal)) + (std11-ignored-token-p token) + )) + (setq lal (cdr lal)) + (setq itl (cons token itl)) + ) + (cons (nreverse (cons token itl)) + (cdr lal)) + )) + +(defun std11-parse-ascii-token (lal) + (let (token itl parsed token-value) + (while (and lal + (setq token (car lal)) + (or (std11-ignored-token-p token) + (if (and (setq token-value (cdr token)) + (delq 'ascii (find-charset-string token-value))) + (setq token nil) + ))) + (setq lal (cdr lal)) + (setq itl (cons token itl)) + ) + (if (and token + (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) + )) + (setq lal (cdr lal)) + (setq itl (cons token itl)) + ) + (cons (nreverse (cons token itl)) + (cdr lal)) + )) + +(defun std11-parse-word (lal) + (let ((ret (std11-parse-ascii-token lal))) + (if ret + (let ((elt (car ret)) + (rest (cdr ret)) + ) + (if (or (assq 'atom elt) + (assq 'quoted-string elt)) + (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)) + ) + (cond ((or (assq 'atom elt) + (assq 'quoted-string elt)) + (cons (cons 'word elt) rest) + ) + ((assq 'comment elt) + (cons (cons 'comment-word elt) rest) + ) + ((string-equal (cdr (assq 'specials elt)) ".") + (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)) + ) + (if phrase + (cons (cons 'phrase phrase) lal) + ))) + +(defun std11-parse-local-part (lal) + (let ((ret (std11-parse-word lal))) + (if ret + (let ((local-part (cdr (car ret))) dot) + (setq lal (cdr ret)) + (while (and (setq ret (std11-parse-ascii-token lal)) + (setq dot (car ret)) + (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) + )))) + +(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) + ) + (cons (cons 'sub-domain sub-domain) + (cdr ret) + ) + ))))) + +(defun std11-parse-domain (lal) + (let ((ret (std11-parse-sub-domain lal))) + (if ret + (let ((domain (cdr (car ret))) dot) + (setq lal (cdr ret)) + (while (and (setq ret (std11-parse-ascii-token lal)) + (setq dot (car ret)) + (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) + )))) + +(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))) + ) + (cons (cons 'at-domain (append at-sign (cdr (car ret)))) + (cdr ret)) + ))) + +(defun std11-parse-addr-spec (lal) + (let ((ret (std11-parse-local-part lal)) + addr) + (if (and ret + (prog1 + (setq addr (cdr (car ret))) + (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) + ))) + +(defun std11-parse-route (lal) + (let ((ret (std11-parse-at-domain lal)) + route comma colon) + (if (and ret + (progn + (setq route (cdr (car ret))) + (setq lal (cdr ret)) + (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 route (append route comma (cdr (car 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)) + ) + )) + (cons (cons 'route route) + (cdr ret) + ) + ))) + +(defun std11-parse-route-addr (lal) + (let ((ret (std11-parse-ascii-token lal)) + < route addr-spec >) + (if (and ret + (setq < (car ret)) + (string-equal (cdr (assq 'specials <)) "<") + (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 addr-spec (cdr (car ret))) + (setq lal (cdr ret)) + (setq ret (std11-parse-ascii-token lal)) + (setq > (car ret)) + (string-equal (cdr (assq 'specials >)) ">") + ) + (cons (cons 'route-addr (append route addr-spec)) + (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)) + )) + (if (setq ret (std11-parse-route-addr lal)) + (cons (list 'phrase-route-addr + phrase + (cdr (car ret))) + (cdr ret)) + ))) + +(defun std11-parse-mailbox (lal) + (let ((ret (or (std11-parse-phrase-route-addr lal) + (std11-parse-addr-spec lal))) + mbox comment) + (if (and ret + (prog1 + (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)) + ))) + (cons (list 'mailbox mbox comment) + lal) + ))) + +(defun std11-parse-group (lal) + (let ((ret (std11-parse-phrase lal)) + phrase colon comma mbox semicolon) + (if (and ret + (setq phrase (cdr (car ret))) + (setq lal (cdr ret)) + (setq ret (std11-parse-ascii-token lal)) + (setq colon (car ret)) + (string-equal (cdr (assq 'specials colon)) ":") + (setq lal (cdr ret)) + (progn + (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)) + ) + ))) + (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) + ) + ))) + +(defun std11-parse-address (lal) + (or (std11-parse-group lal) + (std11-parse-mailbox lal) + )) + +(defun std11-parse-addresses (lal) + (let ((ret (std11-parse-address lal))) + (if ret + (let ((dest (list (car ret)))) + (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 dest (cons (car ret) dest)) + (setq lal (cdr ret)) + ) + (nreverse dest) + )))) + +(defun std11-parse-msg-id (lal) + (let ((ret (std11-parse-ascii-token lal)) + < addr-spec >) + (if (and ret + (setq < (car ret)) + (string-equal (cdr (assq 'specials <)) "<") + (setq lal (cdr ret)) + (setq ret (std11-parse-addr-spec lal)) + (setq addr-spec (car ret)) + (setq lal (cdr ret)) + (setq ret (std11-parse-ascii-token lal)) + (setq > (car ret)) + (string-equal (cdr (assq 'specials >)) ">") + ) + (cons (cons 'msg-id (cdr addr-spec)) + (cdr ret)) + ))) + +(defun std11-parse-msg-ids (tokens) + "Parse lexical TOKENS as `*(phrase / msg-id)', and return the result." + (let ((ret (or (std11-parse-msg-id tokens) + (std11-parse-phrase tokens)))) + (if ret + (let ((dest (list (car ret)))) + (setq tokens (cdr ret)) + (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) + )))) + +(defalias 'std11-parse-in-reply-to 'std11-parse-msg-ids) +(make-obsolete 'std11-parse-in-reply-to 'std11-parse-msg-ids) + + +;;; @ composer +;;; + +(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 "") + ) + +;;;###autoload +(defun std11-address-string (address) + "Return string of address part from parsed ADDRESS of RFC 822." + (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) + ) + ))))) + +(defun std11-comment-value-to-string (value) + (if (stringp value) + (std11-strip-quoted-pair value) + (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))) + +;;;###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) "") + ) + ((eq (car address) 'mailbox) + (let ((addr (nth 1 address)) + (comment (nth 2 address)) + phrase) + (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) "")) + ) + (cond ((> (length phrase) 0) phrase) + (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)) ">") + ) + +;;;###autoload +(defun std11-fill-msg-id-list-string (string &optional column) + "Fill list of msg-id in STRING, and return the result." + (or column + (setq column 12)) + (let ((lal (std11-lexical-analyze string)) + dest) + (let ((ret (std11-parse-msg-id lal))) + (if ret + (let* ((str (std11-msg-id-string (car ret))) + (len (length str))) + (setq lal (cdr ret)) + (if (> (+ len column) 76) + (setq dest (concat dest "\n " str) + column (1+ len)) + (setq dest str + column (+ column len)) + )) + (setq dest (concat dest (cdr (car lal))) + lal (cdr lal)) + )) + (while lal + (let ((ret (std11-parse-msg-id lal))) + (if ret + (let* ((str (std11-msg-id-string (car ret))) + (len (1+ (length str)))) + (setq lal (cdr ret)) + (if (> (+ len column) 76) + (setq dest (concat dest "\n " str) + column len) + (setq dest (concat dest " " str) + column (+ column len)) + )) + (setq dest (concat dest (cdr (car lal))) + lal (cdr lal)) + ))) + dest)) + + +;;; @ parser with lexical analyzer +;;; + +;;;###autoload +(defun std11-parse-address-string (string) + "Parse STRING as mail address." + (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)) + ) + +;;;###autoload +(defun std11-parse-msg-id-string (string) + "Parse STRING as msg-id." + (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)) + ) + +;;;###autoload +(defun std11-extract-address-components (string) + "Extract full name and canonical address from STRING. +Returns a list of the form (FULL-NAME CANONICAL-ADDRESS). +If no name can be extracted, FULL-NAME will be nil." + (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) + )) + + +;;; @ end +;;; + +(provide 'std11) + +;;; std11.el ends here diff --git a/flim-1.14.9/tests/test-hmac-md5.el b/flim-1.14.9/tests/test-hmac-md5.el new file mode 100644 index 0000000..a93a423 --- /dev/null +++ b/flim-1.14.9/tests/test-hmac-md5.el @@ -0,0 +1,63 @@ +(require 'lunit) +(require 'hmac-md5) + +(luna-define-class test-hmac-md5 (lunit-test-case)) + +(luna-define-method test-hmac-md5-1 ((case test-hmac-md5)) + (lunit-assert + (string= + (encode-hex-string (hmac-md5 "Hi There" (make-string 16 ?\x0b))) + "9294727a3638bb1c13f48ef8158bfc9d"))) + +(luna-define-method test-hmac-md5-2 ((case test-hmac-md5)) + (lunit-assert + (string= + (encode-hex-string (hmac-md5 "what do ya want for nothing?" "Jefe")) + "750c783e6ab0b503eaa86e310a5db738"))) + +(luna-define-method test-hmac-md5-3 ((case test-hmac-md5)) + (lunit-assert + (string= + (encode-hex-string (hmac-md5 (make-string 50 ?\xdd) (make-string 16 ?\xaa))) + "56be34521d144c88dbb8c733f0e8b3f6"))) + +(luna-define-method test-hmac-md5-4 ((case test-hmac-md5)) + (lunit-assert + (string= + (encode-hex-string + (hmac-md5 + (make-string 50 ?\xcd) + (decode-hex-string "0102030405060708090a0b0c0d0e0f10111213141516171819"))) + "697eaf0aca3a3aea3a75164746ffaa79"))) + +(luna-define-method test-hmac-md5-5 ((case test-hmac-md5)) + (lunit-assert + (string= + (encode-hex-string + (hmac-md5 "Test With Truncation" (make-string 16 ?\x0c))) + "56461ef2342edc00f9bab995690efd4c"))) + +(luna-define-method test-hmac-md5-6 ((case test-hmac-md5)) + (lunit-assert + (string= + (encode-hex-string + (hmac-md5-96 "Test With Truncation" (make-string 16 ?\x0c))) + "56461ef2342edc00f9bab995"))) + +(luna-define-method test-hmac-md5-7 ((case test-hmac-md5)) + (lunit-assert + (string= + (encode-hex-string + (hmac-md5 + "Test Using Larger Than Block-Size Key - Hash Key First" + (make-string 80 ?\xaa))) + "6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd"))) + +(luna-define-method test-hmac-md5-8 ((case test-hmac-md5)) + (lunit-assert + (string= + (encode-hex-string + (hmac-md5 + "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data" + (make-string 80 ?\xaa))) + "6f630fad67cda0ee1fb1f562db3aa53e"))) diff --git a/flim-1.14.9/tests/test-hmac-sha1.el b/flim-1.14.9/tests/test-hmac-sha1.el new file mode 100644 index 0000000..e329e80 --- /dev/null +++ b/flim-1.14.9/tests/test-hmac-sha1.el @@ -0,0 +1,63 @@ +(require 'lunit) +(require 'hmac-sha1) + +(luna-define-class test-hmac-sha1 (lunit-test-case)) + +(luna-define-method test-hmac-sha1-1 ((case test-hmac-sha1)) + (lunit-assert + (string= + (encode-hex-string (hmac-sha1 "Hi There" (make-string 20 ?\x0b))) + "b617318655057264e28bc0b6fb378c8ef146be00"))) + +(luna-define-method test-hmac-sha1-2 ((case test-hmac-sha1)) + (lunit-assert + (string= + (encode-hex-string (hmac-sha1 "what do ya want for nothing?" "Jefe")) + "effcdf6ae5eb2fa2d27416d5f184df9c259a7c79"))) + +(luna-define-method test-hmac-sha1-3 ((case test-hmac-sha1)) + (lunit-assert + (string= + (encode-hex-string (hmac-sha1 (make-string 50 ?\xdd) (make-string 20 ?\xaa))) + "125d7342b9ac11cd91a39af48aa17b4f63f175d3"))) + +(luna-define-method test-hmac-sha1-4 ((case test-hmac-sha1)) + (lunit-assert + (string= + (encode-hex-string + (hmac-sha1 + (make-string 50 ?\xcd) + (decode-hex-string "0102030405060708090a0b0c0d0e0f10111213141516171819"))) + "4c9007f4026250c6bc8414f9bf50c86c2d7235da"))) + +(luna-define-method test-hmac-sha1-5 ((case test-hmac-sha1)) + (lunit-assert + (string= + (encode-hex-string + (hmac-sha1 "Test With Truncation" (make-string 20 ?\x0c))) + "4c1a03424b55e07fe7f27be1d58bb9324a9a5a04"))) + +(luna-define-method test-hmac-sha1-6 ((case test-hmac-sha1)) + (lunit-assert + (string= + (encode-hex-string + (hmac-sha1-96 "Test With Truncation" (make-string 20 ?\x0c))) + "4c1a03424b55e07fe7f27be1"))) + +(luna-define-method test-hmac-sha1-7 ((case test-hmac-sha1)) + (lunit-assert + (string= + (encode-hex-string + (hmac-sha1 + "Test Using Larger Than Block-Size Key - Hash Key First" + (make-string 80 ?\xaa))) + "aa4ae5e15272d00e95705637ce8a3b55ed402112"))) + +(luna-define-method test-hmac-sha1-8 ((case test-hmac-sha1)) + (lunit-assert + (string= + (encode-hex-string + (hmac-sha1 + "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data" + (make-string 80 ?\xaa))) + "e8e99d0f45237d786d6bbaa7965c7808bbff1a91"))) diff --git a/flim-1.14.9/tests/test-rfc2231.el b/flim-1.14.9/tests/test-rfc2231.el new file mode 100644 index 0000000..62a3b4b --- /dev/null +++ b/flim-1.14.9/tests/test-rfc2231.el @@ -0,0 +1,218 @@ +(require 'lunit) +(require 'mime) + +(luna-define-class test-rfc2231 (lunit-test-case)) + +;;; +;;; Parameter Value Continuations +;;; + +;; The content-type field +;; +;; Content-Type: message/external-body; access-type=URL; +;; URL*0="ftp://"; +;; URL*1="cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar" +;; +;; is semantically identical to +;; +;; Content-Type: message/external-body; access-type=URL; +;; URL="ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar" +;; +(luna-define-method test-rfc2231-continuation-1 ((case test-rfc2231)) + (lunit-assert + (eq + (mime-content-type-primary-type + (mime-parse-Content-Type "message/external-body; access-type=URL; + URL*0=\"ftp://\"; + URL*1=\"cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"")) + (mime-content-type-primary-type + (mime-parse-Content-Type "message/external-body; access-type=URL; + URL=\"ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\""))))) + +(luna-define-method test-rfc2231-continuation-2 ((case test-rfc2231)) + (lunit-assert + (eq + (mime-content-type-subtype + (mime-parse-Content-Type "message/external-body; access-type=URL; + URL*0=\"ftp://\"; + URL*1=\"cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"")) + (mime-content-type-subtype + (mime-parse-Content-Type "message/external-body; access-type=URL; + URL=\"ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\""))))) + +(luna-define-method test-rfc2231-continuation-3 ((case test-rfc2231)) + (lunit-assert + (string= + (mime-content-type-parameter + (mime-parse-Content-Type "message/external-body; access-type=URL; + URL*0=\"ftp://\"; + URL*1=\"cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"") + "access-type") + (mime-content-type-parameter + (mime-parse-Content-Type "message/external-body; access-type=URL; + URL=\"ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"") + "access-type")))) + +(luna-define-method test-rfc2231-continuation-4 ((case test-rfc2231)) + (lunit-assert + (string= + (mime-content-type-parameter + (mime-parse-Content-Type "message/external-body; access-type=URL; + URL*0=\"ftp://\"; + URL*1=\"cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"") + "url") + (mime-content-type-parameter + (mime-parse-Content-Type "message/external-body; access-type=URL; + URL=\"ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"") + "url")))) + +;;; +;;; Parameter Value Character Set and Language Information +;;; + +;; Content-Type: application/x-stuff; +;; title*=us-ascii'en-us'This%20is%20%2A%2A%2Afun%2A%2A%2A +(luna-define-method test-rfc2231-charset-language-1 ((case test-rfc2231)) + (lunit-assert + (string= + (mime-content-type-parameter + (mime-parse-Content-Type "application/x-stuff; + title*=us-ascii'en-us'This%20is%20%2A%2A%2Afun%2A%2A%2A") + "title") + "This is ***fun***"))) + +(luna-define-method test-rfc2231-charset-language-2 ((case test-rfc2231)) + (lunit-assert + (string= + (mime-content-type-parameter + (mime-parse-Content-Type "application/x-stuff; + title*=''This%20is%20%2A%2A%2Afun%2A%2A%2A") + "title") + "This is ***fun***"))) + +;;; +;;; Combining Character Set, Language, and Parameter Continuations +;;; + +;; Content-Type: application/x-stuff; +;; title*0*=us-ascii'en'This%20is%20even%20more%20; +;; title*1*=%2A%2A%2Afun%2A%2A%2A%20; +;; title*2="isn't it!" +(luna-define-method test-rfc2231-charset-language-continuation-1 ((case test-rfc2231)) + (lunit-assert + (string= + (mime-content-type-parameter + (mime-parse-Content-Type "application/x-stuff; + title*0*=us-ascii'en'This%20is%20even%20more%20; + title*1*=%2A%2A%2Afun%2A%2A%2A%20; + title*2=\"isn't it!\"") + "title") + "This is even more ***fun*** isn't it!"))) + +;; MIME states that parameters are not order sensitive. +(luna-define-method test-rfc2231-charset-language-continuation-2 ((case test-rfc2231)) + (lunit-assert + (string= + (mime-content-type-parameter + (mime-parse-Content-Type "application/x-stuff; + title*2=\"isn't it!\"; + title*1*=%2A%2A%2Afun%2A%2A%2A%20; + title*0*=us-ascii'en'This%20is%20even%20more%20") + "title") + "This is even more ***fun*** isn't it!"))) + +;; ABNF states that `ext-octet' is case-insensitive. +(luna-define-method test-rfc2231-charset-language-continuation-3 ((case test-rfc2231)) + (lunit-assert + (let ((case-fold-search nil)) + (string= + (mime-content-type-parameter + (mime-parse-Content-Type "application/x-stuff; + title*=us-ascii'en-us'This%20is%20%2a%2a%2afun%2a%2a%2a") + "title") + "This is ***fun***")))) + +;; unencoded segments MUST NOT be decoded. +(luna-define-method test-rfc2231-charset-language-continuation-4 ((case test-rfc2231)) + (lunit-assert + (string= + (mime-content-type-parameter + (mime-parse-Content-Type "application/x-stuff; + title*0*=us-ascii'en'This%20is%20even%20more%20; + title*1*=%2A%2A%2Afun%2A%2A%2A%20; + title*2=\"isn%27t%20it!\"") + "title") + "This is even more ***fun*** isn%27t%20it!"))) + +;;; +;;; Language specification in Encoded Words +;;; + +(luna-define-method test-rfc2231-encoded-word-1 ((case test-rfc2231)) + (lunit-assert + (string= + (eword-decode-encoded-word "=?US-ASCII?Q?Keith_Moore?=") + "Keith Moore"))) + +(luna-define-method test-rfc2231-encoded-word-2 ((case test-rfc2231)) + (lunit-assert + (string= + (eword-decode-encoded-word "=?US-ASCII*EN?Q?Keith_Moore?=") + "Keith Moore"))) + +(luna-define-method test-rfc2231-encoded-word-3 ((case test-rfc2231)) + (lunit-assert + (eq + (get-text-property + 0 'mime-language + (eword-decode-encoded-word "=?US-ASCII*EN?Q?Keith_Moore?=")) + 'en))) + +;;; +;;; Language specification in FLIM +;;; + +;; both flim-1_13-rfc2231 and flim-1_14-rfc2231 choose to put language +;; info to the `mime-language' text-property of the parameter value. + +(luna-define-method test-rfc2231-mime-language-1 ((case test-rfc2231)) + (lunit-assert + (eq + (get-text-property + 0 'mime-language + (mime-content-type-parameter + (mime-parse-Content-Type "application/x-stuff; + title*=us-ascii'en-us'This%20is%20%2A%2A%2Afun%2A%2A%2A") + "title")) + 'en-us))) + +(luna-define-method test-rfc2231-mime-language-2 ((case test-rfc2231)) + (lunit-assert + (eq + (get-text-property + 0 'mime-language + (mime-content-type-parameter + (mime-parse-Content-Type "application/x-stuff; + title*=US-ASCII'EN-US'This%20is%20%2A%2A%2Afun%2A%2A%2A") + "title")) + 'en-us))) + +(luna-define-method test-rfc2231-mime-language-3 ((case test-rfc2231)) + (lunit-assert + (null + (get-text-property + 0 'mime-language + (mime-content-type-parameter + (mime-parse-Content-Type "application/x-stuff; + title*=us-ascii''This%20is%20%2A%2A%2Afun%2A%2A%2A") + "title"))))) + +(luna-define-method test-rfc2231-mime-language-4 ((case test-rfc2231)) + (lunit-assert + (null + (get-text-property + 0 'mime-language + (mime-content-type-parameter + (mime-parse-Content-Type "application/x-stuff; + title*=''This%20is%20%2A%2A%2Afun%2A%2A%2A") + "title"))))) diff --git a/flim-1.14.9/tests/test-sasl.el b/flim-1.14.9/tests/test-sasl.el new file mode 100644 index 0000000..75452ef --- /dev/null +++ b/flim-1.14.9/tests/test-sasl.el @@ -0,0 +1,118 @@ +(require 'lunit) +(require 'sasl) + +(luna-define-class test-sasl (lunit-test-case)) + +(luna-define-method test-sasl-find-mechanism ((case test-sasl)) + (let ((mechanisms sasl-mechanisms)) + (while mechanisms + (let* ((sasl-mechanisms (list (car mechanisms)))) + (lunit-assert + (sasl-find-mechanism (list (car mechanisms))))) + (setq mechanisms (cdr mechanisms))))) + +(luna-define-method test-sasl-digest-md5-imap ((case test-sasl)) + (let* ((sasl-mechanisms '("DIGEST-MD5")) + (mechanism + (sasl-find-mechanism '("DIGEST-MD5"))) + (client + (sasl-make-client mechanism "chris" "imap" "elwood.innosoft.com")) + (sasl-read-passphrase + #'(lambda (prompt) + "secret")) + step + response) + (sasl-client-set-property client 'realm "elwood.innosoft.com") + (sasl-client-set-property client 'cnonce "OA6MHXh6VqTrRk") + (setq step (sasl-next-step client nil)) + (sasl-step-set-data + step "realm=\"elwood.innosoft.com\",nonce=\"OA6MG9tEQGm2hh\",\ +qop=\"auth\",algorithm=md5-sess,charset=utf-8") + (setq step (sasl-next-step client step)) + (sasl-step-data step) + (setq response (sasl-digest-md5-parse-string (sasl-step-data step))) + (lunit-assert + (string= + (plist-get response 'response) "d388dad90d4bbd760a152321f2143af7")))) + +(luna-define-method test-sasl-digest-md5-acap ((case test-sasl)) + (let* ((sasl-mechanisms '("DIGEST-MD5")) + (mechanism + (sasl-find-mechanism '("DIGEST-MD5"))) + (client + (sasl-make-client mechanism "chris" "acap" "elwood.innosoft.com")) + (sasl-read-passphrase + #'(lambda (prompt) + "secret")) + step + response) + (sasl-client-set-property client 'realm "elwood.innosoft.com") + (sasl-client-set-property client 'cnonce "OA9BSuZWMSpW8m") + (setq step (sasl-next-step client nil)) + (sasl-step-set-data + step "realm=\"elwood.innosoft.com\",nonce=\"OA9BSXrbuRhWay\",qop=\"auth\",\ +algorithm=md5-sess,charset=utf-8") + (setq step (sasl-next-step client step)) + (sasl-step-data step) + (setq response (sasl-digest-md5-parse-string (sasl-step-data step))) + (lunit-assert + (string= + (plist-get response 'response) "6084c6db3fede7352c551284490fd0fc")))) + +(luna-define-method test-sasl-scram-md5-imap ((case test-sasl)) + (let* ((sasl-mechanisms '("SCRAM-MD5")) + (mechanism + (sasl-find-mechanism '("SCRAM-MD5"))) + (client + (sasl-make-client mechanism "chris" "imap" "eleanor.innosoft.com")) + (sasl-read-passphrase + #'(lambda (prompt) + "secret stuff")) + step + response) + (sasl-client-set-property client 'nonce + "<t4n4Pab9HB0Am/QLXB72eg@eleanor.innosoft.com>") + (setq step (sasl-next-step client nil)) + (sasl-step-set-data step "") + (setq step (sasl-next-step client step)) + (sasl-step-set-data + step + (base64-decode-string + "dGVzdHNhbHQBAAAAaW1hcEBlbGVhbm9yLmlubm9zb2Z0LmNvbQBqaGNOWmxSdVBiemlGcCt2TFYrTkN3")) + (setq step (sasl-next-step client step)) + (lunit-assert + (string= (sasl-step-data step) + (base64-decode-string "AQAAAMg9jU8CeB4KOfk7sUhSQPs="))))) + +(luna-define-method test-sasl-ntlm-imap ((case test-sasl)) + (let* ((sasl-mechanisms '("NTLM")) + (mechanism + (sasl-find-mechanism '("NTLM"))) + (client + (sasl-make-client mechanism "kawagish@nokiaseap" "imap" "xxx.yyy.com")) + (sasl-read-passphrase + #'(lambda (passphrase) + "!\"#456secret")) + step + response) + ;; init + (setq step (sasl-next-step client nil)) + ;; generate authentication request + (sasl-step-set-data step "") + (setq step (sasl-next-step client step)) + (sasl-step-data step) + ;; (base64-encode-string (sasl-step-data step) t) is sent to server + ;; generate response to challenge + (sasl-step-set-data + step + (string-as-unibyte + (base64-decode-string + "TlRMTVNTUAACAAAADAAMADAAAAAFggEApmEjGvh9M8YAAAAAAAAAAAAAAAA8AAAATgBPAEsARQBYAEMA"))) + (setq step (sasl-next-step client step)) + (sasl-step-data step) + (setq response (base64-encode-string (sasl-step-data step) t)) + (lunit-assert + (string= + response "TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAABIAEgBwAAAAEAAQAIIAAAAQABAAkgAAAAAAAABiAAAABYIBAIwN9i7qK/9Y31dIDR6JQTaBbjcLJm8Sc6VogMe7fnHP96+eQ5Yf3ys2nIY4rx+iQG4AbwBrAGkAYQBzAGUAYQBwAGsAYQB3AGEAZwBpAHMAaABrAGEAdwBhAGcAaQBzAGgA")) +;;response +)) diff --git a/semi-1.14.6/ChangeLog b/semi-1.14.6/ChangeLog new file mode 100644 index 0000000..7598afd --- /dev/null +++ b/semi-1.14.6/ChangeLog @@ -0,0 +1,7079 @@ +2003-12-24 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * SEMI: Version 1.14.6 (Maruoka) released. + +2003-12-18 Daiki Ueno <ueno@unixuser.org> + + * pgg-gpg.el (pgg-gpg-process-region): Set environment variable + LANGUAGE as well. GNU gettext gives precedence to LANGUAGE over + LC_ALL, when different language code is specified. Thanks to + Tatsuya Kinoshita <tats@vega.ocn.ne.jp>. + [cf. <emacs-mime-ja:1599>] + +2003-12-17 Daiki Ueno <ueno@unixuser.org> + + * pgg-gpg.el (pgg-gpg-messages-locale): New user option. + (pgg-gpg-process-region): Set environment variable LC_ALL when + pgg-gpg-messages-locale is specified. + + * pgg-def.el (pgg-messages-locale): New user option. + + * mime-pgp.el (mime-verify-application/pgp-signature): Copy + messages from pgg-errors-buffer. + (mime-add-application/pgp-keys): Ditto. + +2003-12-16 Katsumi Yamaoka <yamaoka@jpl.org> + + * mime-edit.el (mime-edit-normalize-body): Don't use the + `(replace-match "\\1\r\n")' form since it may convert the unibyte + string into multibyte in Emacs 21.4. + +2003-12-14 Yoichi NAKAYAMA <yoichi@geiin.org> + + * mime-play.el (mime-mailcap-method-sentinel): Restore deleting + directory routine and protection of 1st arg of `message' dropped + in the last change. + (mime-mailcap-delete-played-files): Ditto. + +2003-12-12 ARISAWA Akihiro <ari@mbf.sphere.ne.jp> + + * mime-play.el (mime-play-delete-file-immediately): New user option. + (mime-mailcap-method-sentinel): Use it. + (mime-mailcap-delete-played-files): New function; set up for + `kill-emacs-hook'. + +2002-05-18 ARISAWA Akihiro <ari@mbf.sphere.ne.jp> + + * mime-play.el (mime-activate-mailcap-method): Don't use + `binary-to-text-funcall'. (Thanks to TANAKA Shingo) + +2003-12-14 Tatsuya Kinoshita <tats@vega.ocn.ne.jp> + + * mime-edit.el (mime-charset-type-list): Add entry for iso-8859-1[45]. + +2003-12-12 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * mime-edit.el (mime-edit-user-agent-value): Add a setting for + XEmacs CHISE. + +2003-12-07 Yuuichi Teranishi <teranisi@gohome.org> + + * mime-play.el (mime-require-safe-directory): Check the owner of the + directory if it already exists. + +2003-12-06 Yuuichi Teranishi <teranisi@gohome.org> + + * mime-play.el (mime-require-safe-directory): New function. + (mime-store-message/partial-piece): Use it. + +2003-12-05 Katsumi Yamaoka <yamaoka@jpl.org> + + * mime-play.el (mime-store-message/partial-piece): Fix + mis-designed parenthesis in the `let' form. + +2001-11-27 Daiki Ueno <ueno@unixuser.org> + + * mime-w3.el: Don't use `url-register-protocol' if it is not + fboundp; announce `url-cid' feature instead. + [cf. <Wanderlust:8566>] + + (url-cid): Change return value for the current URL package. + +2003-06-09 Yuuichi Teranishi <teranisi@gohome.org> + + * pgg-gpg.el (pgg-gpg-process-region): Undo the last change; + Add --yes option to overwrite existing output file; + Remove needless set-default-file-modes. + +2003-05-29 Yuuichi Teranishi <teranisi@gohome.org> + + * pgg-gpg.el (pgg-gpg-process-region): Undo the last change. + +2003-05-15 Yuuichi Teranishi <teranisi@gohome.org> + + * pgg-gpg.el (pgg-gpg-process-region): Use `make-temp-file' instead of + `make-temp-name'. + + * pgg-pgp5.el (pgg-pgp5-process-region): Ditto. + (pgg-scheme-verify-region): Ditto. + (pgg-scheme-snarf-keys-region): Ditto. + + * pgg-pgp.el (pgg-pgp-process-region): Ditto. + (pgg-scheme-verify-region): Ditto. + (pgg-scheme-snarf-keys-region): Ditto. + + * smime.el (smime-process-region): Ditto. + (smime-verify-region): Ditto. + + * mime-pgp.el (mime-verify-application/pgp-signature): Ditto. + (mime-verify-application/pkcs7-signature): Ditto. + + * mime-play.el (mime-activate-mailcap-method): Make a temporary + directory of a temporary file for the mailcap application. + (mime-mailcap-method-sentinel): Follow the change above. + (mime-store-message/partial-piece): Set `default-file-modes' for + `make-directory'. + + * mime-edit.el (mime-edit-split-and-send): Remove local variable + `mime-edit-draft-file-name'. + +2003-05-12 Yoichi NAKAYAMA <yoichi@geiin.org> + + * mime-edit.el (turn-on-mime-edit): Protect 1st arg of `message'. + * mime-view.el (mime-preview-follow-current-entity): Ditto. + +2003-05-11 Yoichi NAKAYAMA <yoichi@geiin.org> + + * mime-w3.el (mime-preview-text/html): Protect 1st arg of `message'. + * mime-play.el (mime-mailcap-method-sentinel): Ditto. + (mime-view-message/external-anon-ftp): Ditto. + (mime-view-message/external-url): Ditto. + +2003-04-05 Yoichi NAKAYAMA <yoichi@geiin.org> + + * mime-view.el (mime-preview-toggle-display): Use boundary with + children. + +2003-02-08 Yoichi NAKAYAMA <yoichi@eken.phys.nagoya-u.ac.jp> + + * semi-def.el (mime-should-use-popup-menu): New function. + (mime-select-menu-alist): Renamed from select-menu-alist, change + its behavior according to mime-should-use-popup-menu. + * mime-play.el (mime-play-entity): Change accordingly. + +2003-02-08 Yoichi NAKAYAMA <yoichi@eken.phys.nagoya-u.ac.jp> + + * mime-view.el (mime-save-situation-examples): Bind print-length + and print-level. + +2003-01-10 NAKAJI Hiroyuki <nakaji@tutrp.tut.ac.jp> + + * README.ja: new file, Japanese translation of README.en. + Spaces between ascii and Japanese characters are added. + + +2002-11-15 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * SEMI: Version 1.14.5 (Awara-Onsen) released. + +2002-11-05 Yoichi NAKAYAMA <yoichi@eken.phys.nagoya-u.ac.jp> + + * mime-view.el (mime-preview-find-boundary-info): Change the name of + the argument from get-mother to with-children along its effect. + +2002-11-03 Yoichi NAKAYAMA <yoichi@eken.phys.nagoya-u.ac.jp> + + * mime-edit.el (mime-edit-decode-single-part-in-buffer): Decode text + part only. + +2002-04-16 Daiki Ueno <ueno@unixuser.org> + + * mime-edit.el (mime-file-types): Add setting of *.jpeg for image/jpeg. + +2002-10-26 Yoichi NAKAYAMA <yoichi@eken.phys.nagoya-u.ac.jp> + + * mime-view.el (mime-preview-find-boundary-info): Fix logic. Do not + refer next to next part before examining the next part. + +2002-08-28 Katsumi Yamaoka <yamaoka@jpl.org> + + * mime-edit.el (mime-edit-user-agent-value): Add + `xemacs-extra-name'. + + +2002-07-08 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * SEMI: Version 1.14.4 (Hosorogi) released. + + * Makefile (ARC_DIR_PREFIX): New variable. + (ARC_DIR): Use `ARC_DIR_PREFIX'. + +2001-08-10 Kenichi OKADA <okada@opaopa.org> + + * semi-def.el (mime-browse-url-regexp): Allow nntps and ftps. + +2001-06-12 Yuuichi Teranishi <teranisi@gohome.org> + + * mime-view.el (mime-display-multipart/related): When "start" + parameter specifies part, treat the part as root. + +2001-06-12 Akihiro Arisawa <ari@mbf.sphere.ne.jp> + + * mime-view.el (mime-display-multipart/related): New function; set up + for `mime-preview-condition'. + +2001-04-19 Katsumi Yamaoka <yamaoka@jpl.org> + + * mime-bbdb.el: Load "bbdb-hooks" when the symbol function + `bbdb-extract-field-value' is not bound or it is set up as an + autoloaded function. [cf. <emacs-mime-ja:799,842,843,844,845,846>] + +2001-04-17 YAMASHITA Junji <ysjj@unixuser.org> + + * semi-def.el (mime-browse-url-regexp): Allow https. + +2001-03-06 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp> + + * mime-edit.el (mime-edit-set-parameter): Get rid of the duplicated + optional fields. + +2000-12-28 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * mime-view.el: Revert to use `static'. + + +2000-12-28 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * SEMI: Version 1.14.3 (Ushinoya) released. + + * mime-view.el (mime-view-read-situation-examples-file): Don't try + to read situation-examples-file is it is nil. + (mime-situation-examples-file): Avoid to read + situation-examples-file at compile time. + +2000-12-28 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * mime-view.el (mime-view-read-situation-examples-file): Display + warning. [cf. <emacs-mime-ja:680>] + +2000-12-27 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * mime-view.el (mime-view-mailcap-files): New user option. + (mime-view-read-mailcap-files): Renamed from + `mime-view-read-mailcap'; read `mime-view-mailcap-files'. + + * mime-view.el (mime-view-read-situation-examples-file): New + function; don't occur error. + (mime-view-read-mailcap): New function. + +2000-12-27 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * mime-play.el (mime-play-messages-coding-system): Renamed from + `mime-mailcap-method-messages-coding-system'. + + * pgg-def.el (pgg-messages-coding-system): Change default value to + nil. + +2000-12-27 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * mime-play.el (mime-activate-mailcap-method): Fix typo. + +2000-12-26 Daiki Ueno <ueno@unixuser.org> + + * mime-play.el (mime-mailcap-method-messages-coding-system): New + variable. + (mime-activate-mailcap-method): Use it. + +2000-12-26 Daiki Ueno <ueno@unixuser.org> + + * pgg-def.el (pgg-messages-coding-system): Use `defvar' to define. + + * pgg-pgp.el (pgg-pgp-messages-coding-system): Abolish. + (pgg-pgp-process-region): Use `binary-funcall' instead of + `binary-to-text-funcall'. + + * pgg-pgp5.el (pgg-pgp5-messages-coding-system): Abolish. + (pgg-pgp5-process-region): Use `binary-funcall' instead of + `binary-to-text-funcall'. + + +2000-12-25 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * SEMI: Version 1.14.2 (Daish-Dji)-A released. + + * README.en (Required environment): Update to FLIM 1.14.2. + + * mail-mime-setup.el (mail-setup-hook): Don't add + `eword-decode-header'. + +2000-12-23 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * mime-view.el (mime-view-define-keymap): Return + `mime-view-mode-map' instead of set up as local keymap; don't call + `mime-view-define-keymap-hook'. + (mime-display-message): Add new optional argument `keymap'. + + * mime-play.el (mime-store-message/partial-piece): Use + `binary-insert-encoded-file' and `binary-write-decoded-region' + instead of `binary-insert-file-contents' and + `binary-write-region'. + +2000-12-23 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * smime.el (smime-process-region): Use `binary-funcall' instead of + `binary-start-process-shell-command'. + (smime-verify-region): Use `binary-write-decoded-region' and + `binary-insert-encoded-file' instead of `binary-write-region' and + `binary-insert-file-contents'. + + * pgg-pgp5.el (pgg-pgp5-messages-coding-system): New variable. + (pgg-pgp5-process-region): Use `binary-to-text-funcall' instead of + `binary-start-process-shell-command'. + (pgg-scheme-verify-region): Use `binary-write-decoded-region' + instead of `binary-write-region'. + + * pgg-pgp.el (pgg-pgp-messages-coding-system): New variable. + (pgg-pgp-process-region): Use `binary-to-text-funcall' instead of + `binary-start-process-shell-command'. + (pgg-scheme-verify-region): Use `binary-write-decoded-region' + instead of `binary-write-region'. + + * pgg-gpg.el (pgg-gpg-process-region): Use + `binary-to-text-funcall' instead of `binary-start-process'. + + +2000-12-22 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * SEMI: Version 1.14.1 (Kaga-Onsen) released. + + * README.en (Required environment): Require FLIM 1.14.1 or later; + update required emacsen. + +2000-12-22 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * pgg-gpg.el (pgg-gpg-process-region): Use + `pgg-gpg-messages-coding-system'. + +2000-12-21 Tadashi Watanabe <watanabe@sigmaitec.co.jp> + + * pgg-gpg.el (pgg-scheme-verify-region): Use a "-" as the name for + the file with the signed material. + +2000-12-21 Daiki Ueno <ueno@unixuser.org> + + * pgg-def.el (pgg-messages-coding-system): New user option. + +2000-12-20 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * mime-view.el: Don't use `static-cond'. + + +2000-12-20 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * SEMI: Version 1.14.0 (Iburihashi) released. + +2000-12-19 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * mime-edit.el (mime-edit-mime-version-field-for-message/partial): + Use `mime-encode-field-body' instead of `eword-encode-field-body'. + +2000-12-19 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * mime-edit.el (mime-edit-translate-header): Use + `mime-encode-header-in-buffer' instead of `eword-encode-header'. + (mime-edit-encrypt-pgp-mime): Likewise. + (mime-edit-translate-single-part-tag): Likewise. + +2000-12-17 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * postpet.el: Require `mime'. + + * pgg-parse.el (pgg-format-key-identifier): Don't use + `string-to-int-list'. + (pgg-read-bytes): Likewise. + (pgg-read-body): Likewise. + +2000-12-16 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * smime.el: Require `raw-io'. + (smime-process-region): Use `binary-start-process-shell-command'. + + * pgg-pgp5.el (pgg-pgp5-process-region): Use + `binary-start-process-shell-command'. + + * pgg-pgp.el (pgg-pgp-process-region): Use + `binary-start-process-shell-command'. + + * pgg-gpg.el (pgg-gpg-process-region): Use `binary-start-process'. + +2000-12-15 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * pgg-def.el: Require `custom' instead of `pcustom'. + +2000-12-15 TAKAHASHI Kaoru <kaoru@kaisei.org> + + * Makefile (tar): Use `cvs tag -R' instead of `cvs tag -RF'. + +2000-12-15 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * smime.el (smime-process-region): Don't use `as-binary-process'. + (smime-verify-region): Use `binary-write-region' instead of + `write-region-as-binary'; use `binary-insert-file-contents' + instead of `insert-file-contents-as-binary'. + + * semi-def.el: Don't require `poe'. + + * pgg-pgp5.el (pgg-pgp5-process-region): Don't use + `as-binary-process'. + (pgg-scheme-verify-region): Use `binary-write-region' instead of + `write-region-as-binary'. + (pgg-scheme-snarf-keys-region): Don't use + `write-region-as-raw-text-CRLF'. + + * pgg-pgp.el (pgg-pgp-process-region): Don't use + `as-binary-process'. + (pgg-scheme-verify-region): Use `binary-write-region' instead of + `write-region-as-binary'. + (pgg-scheme-snarf-keys-region): Don't use + `write-region-as-raw-text-CRLF'. + + * pgg-parse.el: Don't require `poem'; require `custom' instead of + `pcustom'. + + * pgg-gpg.el (pgg-gpg-process-region): Don't use + `as-binary-output-file' and + `insert-file-contents-as-raw-text-CRLF'. + + * mime-view.el: Don't require `emu'. + (mouse-button-3): New variable. + + * mime-play.el (mime-store-message/partial-piece): Use + `binary-insert-file-contents' instead of + `insert-file-contents-as-binary'; don't use + `as-binary-input-file'; use `binary-write-region' instead of + `write-region-as-binary'. + +2000-12-07 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * mime-w3.el: Avoid error even if `w3' is not found. + +2000-11-26 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * mime-view.el: Use `mime-conf' instead of `mailcap'. + + * mime-play.el (mime-activate-mailcap-method): Use + `mime-format-mailcap-command' instead of `mailcap-format-command'. + +2000-10-19 Takanori Saneto <sanewo@ba2.so-net.ne.jp> + + * pgg-pgp.el (pgg-pgp-process-region): bind process-environment + locally so that setenv's effect won't last forever. + pgg-pgp5.el (pgg-pgp5-process-region): Ditto. + +2000-09-29 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * mime-edit.el (mime-file-types): Fix to use application/msword + instead of application/winword. + +2000-08-11 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-display-text/plain): Display warning message + when `mime-insert-text-content' fails. + +2000-08-04 Daiki Ueno <ueno@unixuser.org> + + * pgg-gpg.el (pgg-gpg-process-region): Don't bind + coding-system-for-read. + +2000-07-04 Yuuichi Teranishi <teranisi@gohome.org> + + * mime-image.el (mime-image-insert) [XEmacs]: + Insert `string' only if it is non-nil. + +2000-06-27 Daiki Ueno <ueno@unixuser.org> + + * mime-image.el (mime-image-insert): Synch with the latest image.el. + (mime-display-image): Don't pass underlying string "x". + +2000-06-09 Daiki Ueno <ueno@unixuser.org> + + * mime-edit.el (mime-edit-insert-key): Insert a text tag when + the buffer has any trailing text. + +2000-06-05 Shugo Maeda <shugo@ruby-lang.org> + + * pgg-gpg.el (pgg-scheme-insert-key): Don't quote user id. + +2000-05-21 Daiki Ueno <ueno@unixuser.org> + + * pgg-gpg.el (pgg-gpg-process-region): Abolish redundant nconc. + +2000-05-16 Daiki Ueno <ueno@unixuser.org> + + * mime-image.el (mime-image-create) [XEmacs]: Don't call + `make-image-instance' directly. + +2000-05-02 Daiki Ueno <ueno@unixuser.org> + + * pgg-gpg.el (pgg-scheme-encrypt-region): Don't quote recipient; + concatenate all arguments destructively. + +2000-04-13 Daiki Ueno <ueno@unixuser.org> + + * pgg-gpg.el: Fix author's mailing address. + (pgg-gpg-process-region): Add --output option; set status fd to 2. + (pgg-gpg-possibly-cache-passphrase): New function. + (pgg-gpg-shell-file-name): Abolish. + (pgg-gpg-shell-command-switch): Abolish. + (pgg-scheme-lookup-key): Work on temp buffer. + +2000-03-01 Yoshiki Hayashi <yoshiki@xemacs.org> + + * mime-image.el (mime-display-image): Don't wait for redisplay. + + +2000-07-12 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * REMI: Version 1.14.2 (Hokuhoku--Dshima)-A released. + + * README.en (Required environment): Modify for FLIM-Chao 1.14.1. + +2000-07-11 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * mime-pgp.el (mime-view-application/pgp): Setup local variable + `mime-view-temp-message-buffer' of preview-buffer. + (mime-view-application/pkcs7-mime): Likewise. + + * mime-play.el + (mime-preview-quitting-method-for-mime-show-message-mode): Don't + use `mime-entity-buffer'; refer `mime-view-temp-message-buffer'. + (mime-store-message/partial-piece): Use + `insert-file-contents-as-binary' instead of + `(as-binary-input-file (insert-file-contents ...))'; use + `write-region-as-binary' instead of + `(as-binary-output-file (write-region ...)); setup local variable + `mime-view-temp-message-buffer' of preview-buffer. + +2000-06-23 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * mime-edit.el (mime-edit-preview-message): Set up local variable + `mime-edit-temp-message-buffer'. + (mime-edit-quitting-method): Refer `mime-edit-temp-message-buffer' + to avoid to use `mime-entity-buffer'. + +2000-06-21 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * mime-view.el (mime-view-mode): Use + `mime-entity-set-content-type' and `mime-entity-set-encoding' + instead of `mime-entity-set-content-type-internal' and + `mime-entity-set-encoding-internal'. + + * mime-w3.el (mime-preview-text/html): Use + `mime-find-root-entity'. + +2000-05-25 Tanaka Akira <akr@m17n.org> + + * README.en: Update for CVS via SSH. + +2000-04-28 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> + + * mime-edit.el (mime-charset-type-list): Add `iso-2022-jp-3'. + + +2000-03-01 MORIOKA Tomohiko <tomo@m17n.org> + + * REMI: Version 1.14.1 (Mushigawa-Dsugi)-A released. + +2000-03-01 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-view-define-keymap): Add new binding + `mime-preview-show-header' for C-c C-v C-f and C-c C-v h; add new + binding `mime-preview-show-content' for C-c C-v C-c; add new + binding `mime-preview-hide-header' for C-c C-d C-f and C-c C-d h; + add new binding `mime-preview-hide-content' for C-c C-d C-c. + (mime-preview-toggle-display): New function. + (mime-preview-toggle-header): Add new optional argument + `force-visible'; use `mime-preview-toggle-display'. + (mime-preview-toggle-content): Likewise. + (mime-preview-show-header): New function. + (mime-preview-show-content): New function. + (mime-preview-hide-header): New function. + (mime-preview-hide-content): New function. + +2000-02-25 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-situation-examples-file-coding-system): New + variable. + (mime-save-situation-examples): Use `with-temp-buffer'; try to + save as `mime-situation-examples-file-coding-system'. + - Use with-temp-buffer to load `mime-situation-examples-file'; + setup `mime-situation-examples-file-coding-system' when + mime-situation-examples-file is loaded; + +2000-02-25 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-view-define-keymap): Change keybind for + `mime-preview-toggle-header' to C-c C-t h and C-c C-t C-f. + +2000-02-24 Mito <mit@nines.nec.co.jp> + + * mime-edit.el (mime-edit-normalize-body): Fix number of arguments + against enriched-encode. + +2000-02-23 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * mime-image.el (mime-image-normalize-xbm-buffer): New inline + function. + (mime-image-create) [XEmacs || Emacs21]: Use it for XBM data. + (mime-display-image): Don't create temporary file. + +2000-02-22 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-delq-null-situation): Accept multiple ignored + values. + (mime-unify-situations): t is also regarded as an ignored-value. + (mime-preview-follow-current-entity): Eliminate unused local + variable `str'. + +2000-02-22 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-play.el (mime-play-find-every-situations): Renamed from + `mime-view-find-every-situations'. + + * mime-view.el (mime-view-find-every-situations): Moved to + mime-play.el. + +2000-02-22 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-play.el (mime-play-entity): Specify + `mime-view-find-every-situations' as an optional argument + `every-situations'. + + * mime-view.el (mime-unify-situations): Add new optional argument + `every-situations'; use it instead of + `mime-view-find-every-situations'. + (mime-display-multipart/alternative): Modify `body' property + instead of `body-presentation-method' property of + preview-situation. + + * semi-setup.el: Use `eval-after-load' for text/html related + setting. + +2000-02-21 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * semi-def.el (mime-user-interface-product): Bump up to + EMIKO 1.13.12. + + * pgg.el (pgg-temp-buffer-show-function): Use + `shrink-window-if-larger-than-buffer'. + + * pgg-gpg.el (pgg-gpg-process-region): Fix cleanup form. + + * pgg-pgp.el (pgg-pgp-process-region): Ditto. + + * pgg-pgp5.el (pgg-pgp5-process-region): Ditto. + + * semi-setup.el (mime-setup-enable-inline-image): Remove checking + of bitmap-mule; use `eval-after-load' instead of + `call-after-loaded' to require `mime-image'. + + * mime-image.el (mime-display-image): Set default umask to 077. + (mime-image-create): Use `nothing-image-instance-p'. + + * mime-pgp.el: When it is compiled, define `smime-output-buffer' + and `smime-errors-buffer' to avoid compiler warning. + + * mime-edit.el: Ditto. + + * mime-pgp.el + (mime-view-application/pkcs7-mime): Regard smime-type as + "enveloped-data" unless it is specified. + + * smime.el (smime-directory-files): Abolish. + (smime-verify-region): Abolish local variable `args'. + +2000-02-20 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * mime-image.el: Remove X-Face setting; require cl when compiling. + (mime-image-format-alist): Remove image/x-mag and image/x-pic. + (mime-image-type-available-p): New function. + (mime-image-create): New function. + (mime-image-insert): New function. + (mime-display-image): Rewrite. + + * mime-edit.el + (mime-edit-define-charset): Handle 'mime-charset-comment. + +2000-02-18 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-view-define-keymap): Change binding of + `mime-preview-toggle-content' from C-c C-t C-b to C-c C-t C-c. + (mime-preview-toggle-content): Renamed from + `mime-preview-toggle-body'. + + +2000-02-17 MORIOKA Tomohiko <tomo@m17n.org> + + * REMI: Version 1.14.0 (Uragawara) released. + +2000-02-17 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-view-define-keymap): Add new binding + `mime-preview-toggle-body' for C-c C-t C-b. + (mime-preview-toggle-body): New command. + + * semi-def.el (mime-add-button): Don't use overlay. + +2000-02-17 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-preview-condition): Add default setting of + multipart; declare body of message/partial, message/rfc822 and + message/news are visible. + (mime-display-entity): Check `*body' or `body' property of + situation. + +2000-02-17 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-display-entity): Find + `header-presentation-method' only if `header-is-visible'. + +2000-02-10 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-display-entity): Don't use + `mime-goto-header-start-point'. + +2000-02-10 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-display-message): Use `major-mode' of + current-buffer as default value of `original-major-mode'; don't + use `mime-entity-header-buffer'. + (mime-preview-follow-current-entity): Use `mime-insert-header' to + insert header; don't use `mime-entity-header-buffer', + `mime-entity-header-start-point' and + `mime-entity-header-end-point'. + +2000-02-10 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-preview-follow-current-entity): Use + `mime-view-entity-body' to find body. + +2000-02-10 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-preview-find-boundary-info): Fix problem when + entity is in boundary of mother entity. + (mime-preview-follow-current-entity): Check header information of + `mime-view-situation' property. + +2000-02-09 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-preview-find-boundary-info): Use <last point> + - 1 instead of <last point> to get `mime-view-entity' property. + + * mime-view.el (mime-preview-follow-current-entity): Fix problem + in multipart entity. + +2000-02-07 Yoshiki Hayashi <yoshiki@xemacs.org> + + * mime-pgp.el: Fix doc string. + * pgg-def.el: Ditto. + * pgg-gpg.el: Ditto. + * pgg-parse.el: Ditto. + * pgg-pgp.el: Ditto. + * pgg-pgp5.el: Ditto. + * pgg.el: Ditto. + +2000-02-02 Nakagawa, Makoto <Makoto.Nakagawa@jp.compaq.com> + + * pgg-pgp5.el (pgg-scheme-verify-region): Copy the contents of + `pgg-errors-buffer' to `pgg-output-buffer'. + +2000-02-02 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg.el (pgg-temp-buffer-show-function): Don't check if the + selected window is the only window. + +2000-02-01 MORIOKA Tomohiko <tomo@m17n.org> + + * semi-setup.el (mime-setup-enable-inline-image): Use "(fboundp + 'create-image)" to detect Emacs 21. + Use `eval-after-load' instead of `call-after-loaded' to require + `mime-image'. + +2000-02-01 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-view-define-keymap): Change keybind for + `mime-preview-toggle-header' to "\C-c\C-t\C-h". + +2000-02-01 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * mime-image.el: Add checking for `x-face-mule'. + + * pgg.el,pgp-gpg.el,pgg-pgp.el,pgg-pgp5.el + (pgg-scheme-lookup-key): Rename from + `pgg-scheme-lookup-key-string'. + (pgg-scheme-decrypt-region): Use `pgg-scheme-lookup-key'. + (pgg-scheme-sign-region): Ditto. + + * pgg-gpg.el (pgg-scheme-lookup-key): Generate *PGG-output* buffer + if it does not exist. + +2000-01-24 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * semi-def.el (mime-user-interface-product): Bump up to + EMIKO 1.13.10. + + * mime-image.el [Emacs21]: Require `image' when compiling. + (image-normalize): Use `create-image' with 3rd arg `data-p'. + (create-image): Advice it to accept 3rd arg `data-p'. + + * pgg-pgp.el. pgg-pgp5.el + (pgg-scheme-verify-region): Don't send buffer contents. + + * mime-pgp.el (mime-view-application/pkcs7-mime): Rename from + `mime-decrypt-application/pkcs7-mime'; handle `smime-type' + parameter; abolish local variable `representation-type'. + + * semi-setup.el: Rename `mime-decrypt-application/pkcs7-mime' to + `mime-view-application/pkcs7-mime'. + +2000-01-18 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg.el,pgp-gpg.el,pgg-pgp.el,pgg-pgp5.el + (pgg-scheme-lookup-key-string,pgg-scheme-encrypt-region, + pgg-scheme-decrypt-region,pgg-scheme-sign-region, + pgg-scheme-verify-region,pgg-scheme-insert-key, + pgg-scheme-snarf-keys-region): Prepend `pgg-scheme' to each symbol. + + * pgg.el + (pgg-encrypt-region,pgg-decrypt-region,pgg-sign-region, + pgg-verify-region,pgg-insert-key,pgg-snarf-keys-region, + pgg-lookup-key-string): Don't use `luna-send'. + +2000-01-17 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-view-entity-button-visible-p): Comment out. + (mime-display-entity): Don't use + `mime-view-entity-button-visible-p'. + +2000-01-17 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-find-entity-preview-situation): New function. + (mime-display-multipart/alternative): Use + `mime-find-entity-preview-situation'. + (mime-display-entity): Likewise; prefer`*entity-button' and + `*header'. + (mime-preview-toggle-header): Modify `*header' instead of + `header'; update `mime-preview-situation-example-list'. + +2000-01-17 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-unify-situations): Fixed. + (mime-view-define-keymap): Add new binding + `mime-preview-toggle-header' for C-c h. + (mime-preview-find-boundary-info): New function. + (mime-preview-follow-current-entity): Use + `mime-preview-find-boundary-info'. + (mime-preview-toggle-header): New command. + +2000-01-16 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-play.el (mime-play-entity): Modify for + `mime-unify-situations'. + + * mime-view.el (mime-unify-situations): Add new optional argument + `required-name'; use it instead of `method'. + (mime-display-multipart/alternative): Use `mime-unify-situations'. + (mime-display-entity): Likewise. + +2000-01-16 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-reduce-situation-examples): New function; + delete `mime-reduce-acting-situation-examples'. + +2000-01-16 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-view-find-every-situations): Renamed from + `mime-view-find-every-acting-situation'; changed to variable. + (mime-situation-examples-file): Renamed from + `mime-acting-situation-examples-file'. + (mime-preview-situation-example-list-max-size): New variable. + (mime-save-situation-examples): Renamed from + `mime-save-acting-situation-examples'; save + `mime-preview-situation-example-list' if it is not null. + +2000-01-16 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-play.el (mime-acting-situation-example-list): Moved to + mime-view.el. + (mime-acting-situation-example-list-max-size): Likewise. + (mime-save-acting-situation-examples): Likewise. + (mime-reduce-acting-situation-examples): Likewise. + + * mime-view.el (mime-preview-situation-example-list): New + variable. + (mime-acting-situation-example-list): Moved from mime-play.el. + (mime-acting-situation-example-list-max-size): Likewise. + (mime-save-acting-situation-examples): Likewise. + (mime-reduce-acting-situation-examples): Likewise. + (mime-view-load-hook): Abolished. + +2000-01-16 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-play.el (mime-play-entity): Use `mime-unify-situations'. + + * mime-view.el (mime-unify-situations): New function. + +2000-01-16 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-play.el (mime-compare-situation-with-example): Moved to + mime-view.el. + (mime-sort-situation): Likewise. + + * mime-view.el (mime-compare-situation-with-example): Moved from + mime-play.el. + (mime-sort-situation): Likewise. + +2000-01-16 MORIOKA Tomohiko <tomo@m17n.org> + + * postpet.el: New module. + + * SEMI-ELS (semi-modules-to-compile): Add `postpet'. + + * mime-play.el (mime-delq-null-situation): Moved to mime-view.el. + + * mime-view.el: Add setting for + `mime-display-application/x-postpet' to autoload "postpet". + (mime-delq-null-situation): Moved from mime-play.el. + (unpack): Moved to postpet.el. + (unpack-skip): Likewise. + (unpack-fixed): Likewise. + (unpack-byte): Likewise. + (unpack-short): Likewise. + (unpack-long): Likewise. + (unpack-string): Likewise. + (unpack-string-sjis): Likewise. + (postpet-decode): Likewise. + (mime-display-application/x-postpet): Likewise. + +2000-01-11 Nakagawa, Makoto <Makoto.Nakagawa@jp.compaq.com> + + * pgg-pgp.el, pgg-pgp5.el + (pgg-scheme-lookup-key-string): Fix number of arguments against + call-process. + + * pgg-pgp5.el (pgg-scheme-verify-region): Analize process output + to see whether verify successed or not. + +2000-01-05 Katsumi Yamaoka <yamaoka@jpl.org> + + * Makefile, README.en: Update for the new CVS server. + +1999-12-28 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * mime-edit.el (mime-edit-user-agent-value): Don't require + `apel-ver' directly. + +1999-12-28 Katsumi Yamaoka <yamaoka@jpl.org> + + * mime-edit.el (mime-edit-user-agent-value): Use `error' instead of + `file-error' for the handler of `condition-case' because XEmacs + does not signal an error named `file-error' if the required feature + is not provided. + +1999-12-16 MORIOKA Tomohiko <tomo@m17n.org> + + * semi-setup.el (mime-setup-decode-message-header): Comment out. + (mime-edit-mode-hook): Don't use + `mime-setup-decode-message-header'. + (mu-cite/pre-cite-hook): Don't use `eword-decode-header'. + +1999-12-14 Akihiro Arisawa <ari@atesoft.advantest.co.jp> + + * mime-view.el (mime-preview-follow-current-entity): Fetch field of + `mime-view-following-required-fields-list' from parent entity if it + is not exist in current entity. + +1999-12-13 Katsumi Yamaoka <yamaoka@jpl.org> + + * README.en: Update for the recent ML address and ftp site. + +1999-12-11 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * smime.el (smime-encrypt-region): Delete entity header. + (smime-sign-region): Ditto. + + * mime-edit.el: Fix autoload settings for `smime-sign-region' and + `smime-encrypt-region. + (mime-edit-sign-smime): Set Content-Type + `application/pkcs7-signature' instead of + `application/x-pkcs7-signature'; add Content-Description. + (mime-edit-encrypt-smime): Set content-type + `application/pkcs7-mime' instead of `x-application/pkcs7-mime'. + + * mime-pgp.el: Fix autoload settings for `smime-verify-region' and + `smime-decrypt-region. + (mime-decrypt-application/pkcs7-mime): + Bind `inhibit-read-only' to t. + +1999-12-09 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * semi-def.el (mime-user-interface-product): Bump up to + EMIKO 1.13.9. + + * smime.el: Require `static' when compiling. + (smime-directory-files): New macro. + (smime-find-certificate): Use it. + +1999-12-08 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * smime.el (smime-verify-region): Abolish local variable `cert-file'. + (smime-find-certificate): Rename from `smime-search-certificate'. + + * mime-edit.el: Add autoload settings for `smime-encrypt-region' and + `smime-sign-region'. + (mime-edit-process-multipart-1): Handle type "smime-signed" and + "smime-encrypted". + (mime-edit-sign-smime): New function. + (mime-edit-encrypt-smime): New function. + (mime-edit-enclose-smime-signed-region): New function. + (mime-edit-enclose-smime-encrypted-region): New function. + + * mime-pgp.el: Add autoload settings for `smime-decrypt-region' and + `smime-verify-region'. + (mime-verify-application/pkcs7-signature): New function. + (mime-decrypt-application/pkcs7-mime): New function. + + * semi-setup.el: Set up for `mime-verify-application/pkcs7-signature' + and `mime-decrypt-application/pkcs7-mime'. + +1999-12-08 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * smime.el (smime-x509-hash): Use `call-process' instead of + `call-process-region'. + (smime-x509-subject): Ditto. + +1999-12-08 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * SEMI-ELS (semi-modules-to-compile): Add smime.el. + + * smime.el: New file. + +1999-11-30 Tsukamoto Tetsuo <czkmt@remus.dti.ne.jp> + + * mime-edit.el (mime-edit-decode-message-in-buffer): Don't decode + the message header twice. + +1999-11-30 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg.el (pgg-remove-passphrase-cache): Add checking whether + the passphrase has already been expired. + +1999-11-26 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * mime-edit.el (mime-edit-pgp-user-id): New variable. + (mime-edit-sign-pgp-mime): Undo last change; refer + `mime-edit-pgp-user-id'. + (mime-edit-encrypt-pgp-mime): Ditto. + + * pgg-gpg.el, pgg-pgp.el, pgg-pgp5.el + (encrypt-region): Refer `pgg-<impl>-user-id' if specified. + (sign-region): Ditto. + (decrypt-region): Ditto. + (insert-key): Ditto. + +1999-11-26 Nakagawa, Makoto <Makoto.Nakagawa@jp.compaq.com> + + * mime-edit.el (mime-edit-sign-pgp-mime): Regard + `pgg-default-user-id' as more preferrable if it's specified. + (mime-edit-encrypt-pgp-mime): Ditto. + +1999-11-22 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * semi-def.el (mime-user-interface-product): Bump up to + EMIKO 1.13.8. + + * pgg.el (pgg-remove-passphrase-cache): Don't unbind passphrase. + +1999-11-20 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * mime-edit.el (mime-edit-sign-pgp-mime): Bind + `pgg-default-user-id' to the canonical address of From field. + + * pgg-def.el (pgg-cache-passphrase): New user option. + + * pgg.el (pgg-read-passphrase): Refer `pgg-cache-passphrase'. + (pgg-remove-passphrase-cache): Fill cached passphrase with `_'. + + * pgg-gpg.el, pgg-pgp.el, pgg-pgp5.el (sign-region): Refer + `pgg-cache-passphrase'. + +1999-11-17 Katsumi Yamaoka <yamaoka@jpl.org> + + * mime-image.el (mime-display-image): Use + `mime-image-normalize-xbm' if the feature `xemacs' is provided or + the variable `image-types' is bound. + +1999-11-17 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * mime-image.el (mime-image-normalize-xbm): Work for the future + FSF Emacsen as well. + (mime-display-image): Always use `mime-image-normalize-xbm'. + +1999-11-17 Katsumi Yamaoka <yamaoka@jpl.org> + + * mime-image.el (mime-image-normalize-xbm): New macro. + (mime-display-image): Use it. + +1999-11-13 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg.el (pgg-temp-buffer-show-function): New function. + (pgg-display-output-buffer): Use it. + (pgg-save-coding-system): Use buffer narrowing. + (pgg-encrypt-region, pgg-decrypt-region, pgg-sign-region, + pgg-verify-region): Assume that the current region has already + been narrowed. + +1999-11-13 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg-def.el (pgg-default-keyserver-address): Default to + `wwwkeys.pgp.net'. + + * pgg.el (pgg-save-coding-system): New macro. + (pgg-display-output-buffer): New function. + (pgg-encrypt-region, pgg-decrypt-region, pgg-sign-region, + pgg-verify-region, pgg-insert-key, pgg-snarf-keys-region): + Add documentation string; use `pgg-save-coding-system'. + (pgg-fetch-key): Fix documentation. + +1999-11-11 Akihiro Arisawa <ari@atesoft.advantest.co.jp> + + * mime-image.el (image-normalize): Use `write-region-as-binary'. + +1999-11-11 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg-pgp.el, pgg-pgp5.el (verify-region): Set default umask to 077. + +1999-11-10 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg-gpg.el (pgg-gpg-process-region): Enclose `start-process' + with `as-binary-process'. + + * pgg-pgp.el (pgg-pgp-process-region): Enclose `start-process' + with `as-binary-process'. + + * pgg-pgp5.el (pgg-pgp5-process-region): Enclose `start-process' + with `as-binary-process'. + + * mime-edit.el (mime-edit-set-sign): Remove duplication. + (mime-edit-set-encrypt): Ditto. + (mime-edit-encrypt-pgp-mime): Encode header before encrypting. + + * mime-image.el (image-insert-at-point): Check the number of the + arguments of `insert-image'. + (mime-display-image): Rewrite. + +1999-11-10 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> + + * mime-play.el: (mime-save-directory): New variable. + (mime-save-content): Don't force filename parameter to be used. + +1999-11-09 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg-pgp.el, pgg-pgp5.el + (sign-region): Don't convert line break code. + +1999-11-07 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * mime-pgp.el (mime-verify-application/pgp-signature): Don't + scroll MIME-echo buffer, just set window starting point. + (mime-add-application/pgp-keys): Ditto. + +1999-11-06 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg.el (pgg-sign-region): Add optional argument `cleartext'. + + * mime-ui-en.sgml, mime-ui-ja.sgml: Remove description about + `pgp-functions-alist' and `pgp-function'; add description about + `pgg-default-scheme' and `pgg-scheme'. + + * NEWS (PGP 5.0i and GnuPG are now supported for PGP/MIME): + New section. + + * pgg-gpg.el, pgg-pgp.el, pgg-pgp5.el (encrypt-region): Add + sender's user id to the recipients list if `pgg-encrypt-for-me' is + specified. + + * pgg-def.el (pgg-encrypt-for-me): New user option. + + * mime-edit.el: + (mime-edit-decode-multipart-in-buffer): Sync up with semi-pgpgpg_20. + (mime-edit-decode-message-in-buffer): Ditto. + (mime-edit-decode-single-part-in-buffer): Ditto. + +1999-11-06 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg.el (pgg-verify-region): Bind `pgg-scheme' in the predicate + of whether to fetch signer's public key. + (pgg-convert-lbt-region): New macro. + (pgg-as-lbt): New macro. + + * mime-edit.el (mime-edit-encrypt-pgp-mime): Extract canonical + address of From field to use it as default user id; tokenize + bodies of the recipient fields. + (mime-edit-make-encrypt-recipient-header): Undo last change. + (mime-edit-translate-buffer): Do `undo-boundary' + before translating. + + * pgg-gpg.el (sign-region): Use `pgg-as-lbt'. + (pgg-gpg-process-region): Use `pgg-convert-lbt-region'. + (encrypt-region): Don't ask passphrase. + + * pgg-pgp5.el (sign-region): Use `pgg-as-lbt'. + (pgg-pgp5-process-region): Use `pgg-convert-lbt-region'. + (encrypt-region): Don't ask passphrase. + + * pgg-pgp.el (verify-region): Fill errors buffer. + (pgg-pgp-process-region): Use `pgg-convert-lbt-region'. + (sign-region): Use `pgg-as-lbt'. + (encrypt-region): Don't ask passphrase. + +1999-11-06 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg-parse.el (pgg-byte-after): Always pass the first argument + of `char-after'. + +1999-11-05 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg-pgp.el (sign-region): Fix regexp for the beginning of armor. + + * pgg-gpg.el (encrypt-region): Don't use "--textmode" in GPG + arguments, replace line break code with CRLF while signing + instead. + +1999-11-05 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * mime-pgp.el (mime-verify-application/pgp-signature): Copy the + messages in PGG buffers to MIME-echo buffer instead of binding + `pgg-output-buffer'. + (mime-add-application/pgp-keys): Likewise. + + * pgg-gpg.el (verify-region): Fill errors buffer whether + verification has succeeded or not. + +1999-11-05 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg-gpg.el, pgg-pgp.el, pgg-pgp5.el (snarf-keys-region): + Use `pgg-process-when-success'. + + * pgg.el (pgg-encrypt-region): Add autoload cookie. + (pgg-decrypt-region): Ditto. + (pgg-sign-region): Ditto. + (pgg-verify-region): Don't modify the buffer; add autload cookie. + (pgg-snarf-keys-region): Add interactive spec; add autload cookie. + (pgg-insert-key): Add interactive spec; add autload cookie. + +1999-11-05 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg-gpg.el (pgg-gpg-shell-command-switch): New user option. + (pgg-gpg-process-region): Bind `shell-command-switch' to the value + of `pgg-gpg-shell-command-switch'. + + * pgg-pgp.el (pgg-pgp-shell-command-switch): New user option. + (pgg-pgp-process-region): Bind `shell-command-switch' to the value + of `pgg-pgp-shell-command-switch'. + + * pgg-pgp5.el (pgg-pgp5-shell-command-switch): New user option. + (pgg-pgp5-process-region): Bind `shell-command-switch' to the value + of `pgg-pgp5-shell-command-switch'. + + * pgg-gpg.el, pgg-pgp.el, pgg-pgp5.el (sign-region): Use fixed end + position of the signature. + + * mime-pgp.el: Add autoload for `pgg-decrypt-region', + `pgg-verify-region', `pgg-snarf-keys-region'. + (mime-view-application/pgp): Don't use `pgp-function'. + (mime-verify-application/pgp-signature): Ditto. + (mime-add-application/pgp-keys): Ditto. + (mime-pgp-command): Abolish. + (mime-pgp-default-language): Abolish. + (mime-pgp-good-signature-regexp-alist): Abolish. + (mime-pgp-key-expected-regexp-alist): Abolish + (mime-pgp-check-signature): Abolish. + + * semi-def.el (pgp-function-alist): Abolish. + (pgp-function): Abolish. + + * mime-edit.el: Add autoload for `pgg-encrypt-region', + `pgg-sign-region', `pgg-insert-key'. + (mime-edit-sign-pgp-mime): Throw an error when + `pgg-sign-region' returns nil; don't use `pgp-function'. + (mime-edit-encrypt-pgp-mime): Throw an error when + `pgg-encrypt-region' returns nil; don't use `pgp-function'. + (mime-edit-sign-pgp-kazu): Don't use `pgp-function'. + (mime-edit-encrypt-pgp-mime): Ditto. + +1999-11-05 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * mime-pgp.el (mime-add-application/pgp-keys): Don't display + public key block; snarf keys immediately. + + * pgg.el (pgg-insert-url-with-program): Call program asynchronously. + +1999-11-05 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg-def.el (pgg-echo-buffer): New variable. + + * pgg.el (pgg-process-when-success): New macro. + (pgg-insert-url-with-w3): New function. + (pgg-insert-url-program): New variable. + (pgg-insert-url-extra-arguments): New variable. + (pgg-insert-url-function): New variable. + (pgg-fetch-key): Use it. + (pgg-encrypt-region): If called interactively, popup + `pgg-echo-buffer' to display encryption status. + (pgg-decrypt-region): Likewise. + (pgg-sign-region): Likewise. + (pgg-verify-region): Likewise. + + * pgg-gpg.el (lookup-key-string): Use `call-process' instead of + `pgg-gpg-process-region'. + (encrypt-region): Use `pgg-process-when-success'; if the output + buffer is empty, don't copy errors, just return nil. + (decrypt-region): Likewise. + (verify-region): Check the contents of status buffer to looking + for `GOODSIG' response. + (sign-region): Accept optional argument `clearsign'. + + * pgg-pgp.el (lookup-key-string): Use `call-process' instead of + `pgg-pgp-process-region'. + (encrypt-region): Use `pgg-process-when-success'; if the output + buffer is empty, don't copy errors, just return nil. + (decrypt-region): Likewise. + (verify-region): Likewise. + (sign-region): Accept optional argument `clearsign'. + + * pgg-pgp5.el (lookup-key-string): Use `call-process' instead of + `pgg-pgp5-process-region'. + (encrypt-region): Use `pgg-process-when-success'; if the output + buffer is empty, don't copy errors, just return nil. + (decrypt-region): Likewise. + (verify-region): Likewise. + (sign-region): Accept optional argument `clearsign'. + +1999-11-04 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg.el (pgg-verify-region): Ignore all errors encountered on + calling `pgg-fetch-key'. + +1999-11-04 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * mime-pgp.el (mime-verify-application/pgp-signature): Enclose + with `unwind-protect' to be sure of deleting *.asc files. + + * pgg-pgp.el (pgg-pgp-process-region): Set `PGPPASSFD' before + starting PGP process. + + * pgg-pgp5.el (pgg-pgp5-process-region): Ditto. + +1999-11-04 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg-parse.el (pgg-parse-crc24): Don't use any `write' ops. + (pgg-parse-crc24-string): Use `ccl-execute-on-string'. + +1999-11-04 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * mime-edit.el (mime-edit-set-sign): Preserve last status of + `mime-edit-pgp-processing'. + (mime-edit-set-encrypt): Ditto. + (mime-edit-pgp-enclose-buffer): Process + `mime-edit-pgp-enclose-buffer' consequently. + + * pgg-parse.el (pgg-decode-packets): Don't use + `mime-encode-string'. + (pgg-ignore-packet-checksum): Default to t. + +1999-11-04 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg.el: Rename the field name `cipher-algorithm' to + `symmetric-key-algorithm'. + (pgg-verify-condition): Fix documentation. + (pgg-decrypt-condition): Ditto. + +1999-11-04 Katsumi Yamaoka <yamaoka@jpl.org> + + * mime-edit.el (mime-edit-preview-message): Inherit the value of + `mime-edit-pgp-processing'. + +1999-11-04 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg.el (pgg-encrypt-region): Add interactive spec. + (pgg-decrypt-region): Ditto. + (pgg-sign-region): Ditto. + (pgg-verify-region): Add optional argument `fetch' to fetch + signer's public key. + + * pgg-def.el (pgg-default-keyserver-address): New variable. + + * semi-def.el (pgp-function-alist): Remove `lookup-key'. + + * mime-pgp.el (mime-display-application/pgp-signature): Abolish. + (mime-display-application/pgp-encrypted): Abolish. + (mime-display-application/pgp-keys): Abolish. + (mime-pgp-keyserver-url-template): Abolish. + (mime-pgp-keyserver-address): Abolish. + (mime-pgp-keyserver-port): Abolish. + (mime-pgp-keyserver-protocol): Abolish. + (mime-pgp-fetch-key): Abolish. + + * semi-setup.el: Delete default setting of + `mime-display-application/pgp-signature', + `mime-display-application/pgp-encrypted', + `mime-display-application/pgp-keys' + +1999-11-03 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg.el (pgg-fetch-key): Protect `buffer-file-name'. + + * pgg-gpg.el (snarf-keys-region): Add `-' as extra argument of + gpg --import; convert status code into an integer. + +1999-11-03 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * semi-def.el (pgp-function-alist): Add `lookup-key'. + + * pgg.el, pgg-gpg.el, pgg-pgp5.el, pgg-pgp.el: + Rename generic function `lookup-key' to `lookup-key-string'; + add optional argument `type'. + + * pgg-def.el (pgg-truncate-key-identifier): New macro. + + * pgg.el: Rename generic function `lookup-key' to + `lookup-key-string'; add optional argument `type'. + (pgg-fetch-key): New function. + (pgg-snarf-keys-region): Fix typo. + (pgg-lookup-key-string): New function. + (pgg-read-passphrase): Use `pgg-truncate-key-identifier'. + (pgg-add-passphrase-cache): Ditto. + + * mime-pgp.el (mime-pgp-keyserver-url-template): New variable + imported from semi-pgpgpg. + (mime-pgp-keyserver-address): Ditto. + (mime-pgp-keyserver-port): Ditto. + (mime-pgp-keyserver-protocol): New variable. + (mime-pgp-fetch-key): New function. + (mime-verify-application/pgp-signature): Prompt user to fetch + signer's public key. + +1999-11-03 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg.el (pgg-fetch-public-key): New function. + + * pgg-pgp.el (lookup-key): New generic function. + (encrypt-region): Use `lookup-key'; cache passphrase if the + encryption has done successfully. + (sign-region): Likewise. + (decrypt-region): Use `lookup-key'. + + * pgg.el (pgg-scheme): Remove all slots. + (pgg-decrypt-codition): Rename tag `cipher-algorithm' to + `symmetric-key-algorithm'. + (lookup-key): Add documentation about the new generic function. + + * pgg-parse.el (pgg-decode-armor-region): Remove autoload cookie. + (pgg-armor-header-lines): New variable. + +1999-11-02 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg.el (pgg-add-passphrase-cache): Use only four octets of the key. + (pgg-read-passphrase): Ditto. + + * pgg-pgp5.el (lookup-key): New generic function. + (encrypt-region): Use `lookup-key'; cache passphrase if the + encryption has done successfully. + (sign-region): Likewise. + (decrypt-region): Use `lookup-key'. + +1999-11-02 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg-parse.el + (pgg-parse-public-key-encrypted-session-key-packet): + Rename tag `public-key-identifier' to `key-identifier'. + + * mime-pgp.el + (mime-display-application/pgp-encrypted): Refer it. + + * pgg.el (pgg-passphrase-cache-expiry): New variable. + (pgg-passphrase-cache): New variable. + (pgg-read-passphrase): Add optional argument `key'. + (pgg-add-passphrase-cache): New function. + (pgg-remove-passphrase-cache): New function. + + * pgg-gpg.el (lookup-key): New generic function. + (encrypt-region): Use `lookup-key'; cache passphrase if the + encryption has done successfully. + (sign-region): Likewise. + (decrypt-region): Use `lookup-key'. + +1999-11-02 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * pgg-parse.el (pgg-parse-length-type): Fix typo. + (pgg-parse-public-key-encrypted-session-key-packet): Use + `pgg-read-bytes-string' instead of `pgg-read-bytes'. + +1999-11-02 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * mime-edit.el (mime-edit-sign-pgp-mime): Rewrite with PGG functions. + (mime-edit-encrypt-pgp-mime): Likewise. + (mime-edit-encrypt-recipient-fields-list): Return recipients as list. + + * mime-pgp.el: Add comment that this module is based on + draft-yamamoto-openpgp-mime-00.txt (OpenPGP/MIME) and RFC 2440 + (OpenPGP Message Format) as well. + (mime-verify-application/pgp-signature): Use + `pgg-verify-region' instead of `mime-pgp-check-signature'. + (mime-display-application/pgp-signature): New function. + (mime-display-application/pgp-encrypted): New function. + (mime-display-application/pgp-keys): New function. + + * semi-setup.el: Set up for + `mime-display-application/pgp-signature', + `mime-display-application/pgp-encrypted', + `mime-display-application/pgp-keys'. + (mime-setup-enable-pgp): Default to t. + + * SEMI-ELS (semi-modules-to-compile): Add `pgg', `pgg-parse', + `pgg-gpg', `pgg-pgp' and `pgg-pgp5' instead of `mime-mc'. + + * EMIKO-VERSION, pgg-def.el, pgg.el, pgg-gpg.el, + pgg-pgp5.el, pgg-pgp.el, pgg-parse.el: New file. + + * mime-image.el (mime-display-image): Rewrite. + + * semi-def.el (mime-user-interface-product): Modify for EMIKO. + (pgp-function-alist): Replace each method with PGG function. + + * mime-view.el (mime-view-popup-menu): New variable. + (mime-view-popup-menu): New function. + (mime-view-define-keymap): Bind `mime-view-popup-menu' to + `mouse-button-3'. + +1999-11-01 Tanaka Akira <akr@jaist.ac.jp> + + * mime-view.el (mime-display-application/x-postpet): New function. + (mime-preview-condition): Set up for + 'mime-preview-application/x-postpet. + (unpack): New macro. + (unpack-skip): New function. + (unpack-fixed): New function. + (unpack-byte): New function. + (unpack-short): New function. + (unpack-long): New function. + (unpack-string): New function. + (unpack-string-sjis): New function. + (postpet-decode): New function. + +1999-10-17 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> + + * SEMI-MK (install-semi-package): Delte auto-autoloads.el + and custom-load.el + + +1999-10-16 MORIOKA Tomohiko <tomo@m17n.org> + + * SEMI: Version 1.13.7 (Awazu) released. + +1999-10-06 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> + + * mime-view.el (mime-preview-move-to-upper): Scroll + according to mime-preview-move-scroll. + +1999-10-05 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> + + * mime-view.el (mime-preview-scroll-down-entity, + mime-preview-scroll-up-entity): Recenter when moving to + a next entity. + (mime-preview-move-scroll): New variable. + (mime-preview-move-to-previous, mime-preview-move-to-next): + Recenter according to the variable mime-preview-move-scroll. + +1999-10-04 Katsumi Yamaoka <yamaoka@jpl.org> + + * mime-view.el (mime-preview-move-to-next): Attempt to go to the + next page if the return value of `next-single-property-change' is + greater than `point-max'. + (mime-preview-move-to-previous): Don't move backward at the + beginning of the buffer; attempt to go to the previous page if the + return value of `previous-single-property-change' is less than + `point-min'. + +1999-09-29 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-display-multipart/mixed): Share cell of + `major-mode'. + (mime-display-multipart/alternative): Likewise. + (mime-display-entity): Refer `major-mode' value of a situation + instead of buffer-local-variable `major-mode'. + +1999-09-29 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-play.el (mime-preview-play-current-entity): Use + text-property `mime-view-situation' as the initial value of + acting-situation to add major-mode. + +1999-09-29 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-edit.el (mime-content-types): Delete text/x-rot13-47-48 in + default definition. [cf. <tm-ja:4904>, <tm-ja:4907>] + +1999-09-27 Katsumi Yamaoka <yamaoka@jpl.org> + + * mime-edit.el (mime-edit-user-agent-value): Include + `emacs-patch-level'. It exists in XEmacs 21.1.1 or later. + +1999-09-20 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> + + * mime-view.el (mime-preview-scroll-up-entitiy, + mime-preview-scroll-down-entity): Use scroll-up and scroll-down + instead of forward-line. + (mime-preview-next-line-entity, + mime-preview-previous-line-entity): Add optional argument LINES + and scroll LINES lines if specified. Add doc-string. + + +1999-09-13 MORIOKA Tomohiko <tomo@m17n.org> + + * SEMI: Version 1.13.6 (Komatsu) released. + +1999-08-30 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-edit.el (mime-edit-mime-version-field-for-message/partial): + Encode `mime-edit-version'. + +1999-08-28 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-play.el (mime-store-message/partial-piece): Use + `directory-files' to check number of pieces. + +1999-08-26 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-play.el (mime-store-message/partial-piece): Don't refer + `mime-preview-buffer'. + +1999-08-25 Katsumi Yamaoka <yamaoka@jpl.org> + + * SEMI-CFG: Use `if' instead of `when'. + + +1999-08-18 MORIOKA Tomohiko <tomo@m17n.org> + + * REMI: Version 1.13.2 (-Dike-Ikoinomori)-A released. + +1999-08-17 Katsumi Yamaoka <yamaoka@jpl.org> + + * mime-view.el (mime-preview-original-major-mode): Modify the way + of checking for the end of the buffer. + +1999-08-17 Katsumi Yamaoka <yamaoka@jpl.org> + + * mime-view.el (mime-preview-original-major-mode): Don't use + `get-text-property' at the end of the buffer. + +1999-08-02 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-preview-follow-current-entity): Don't use + `mime-entity-buffer'. + +1999-05-17 KOSEKI Yoshinori <kose@yk.NetLaputa.ne.jp> + + * mime-pgp.el (mime-verify-application/pgp-signature): Specify the + name of `sig-file' explicitly for `mime-pgp-check-signature'. + (mime-pgp-check-signature): Accept new arg `sig-file' and feed its + value to the verify command. + +1999-07-29 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-play.el (mime-play-entity): Get media-type from situation + instead of entity; display prompt and call `mime-save-content' if + method is not found. + (mime-detect-content): Call `mime-play-entity' even if media-type + specification is not found in `mime-magic-type-alist'. + +1999-07-28 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-view-entity-title): Use + `mime-entity-read-field' instead of `mime-read-field'. + (mime-display-message): Use `major-mode' of + mime-entity-header-buffer as the default value of + original-major-mode. + + * mime-play.el (mime-entity-safe-filename): Use + `mime-entity-read-field' instead of `mime-read-field'. + (mime-view-message/rfc822): New implementation. + + * mime-pgp.el (mime-add-application/pgp-keys): Use + `mime-entity-number' instead of `mime-raw-point-to-entity-number'. + + * mime-partial.el + (mime-combine-message/partial-pieces-automatically): Use + `mime-entity-read-field' instead of `mime-read-field'. + + * mime-bbdb.el (mime-bbdb/update-record): Use + `mime-entity-read-field' instead of `mime-read-field'; use + `mime-entity-fetch-field' instead of `mime-fetch-field'. + +1999-07-28 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-raw-find-entity-from-point): Deleted. + (mime-raw-buffer): Deleted. + (mime-preview-original-major-mode): Add new optional argument + `point'; refer text-property `mime-view-situation' instead of + using `mime-entity-buffer'. + (mime-raw-point-to-entity-node-id): Deleted. + (mime-raw-point-to-entity-number): Deleted. + (mime-raw-flatten-message-info): Deleted. + (mime-display-entity): Add text-property `mime-view-situation' to + each entity. + + +1999-07-27 MORIOKA Tomohiko <tomo@m17n.org> + + * SEMI: Version 1.13.5 (Meih-D)-A released. + +1999-07-27 MORIOKA Tomohiko <tomo@m17n.org> + + * NEWS (Don't expect raw-buffer): New subsection. + (Now acting-method must not expect to run in raw-buffer): Changed + as a subsubsection of subsection `Don't expect raw-buffer'. + (Don't refer variable `mime-raw-buffer'): New subsubsection. + (Don't refer variable `mime-preview-buffer'): New subsubsection. + + * NEWS (Requires FLIM 1.13 API): New subsection. + +1999-07-23 MORIOKA Tomohiko <tomo@m17n.org> + + * README.en (Required environment): Change required FLIM to + 1.13.1; change location of APEL and FLIM. + + +1999-07-22 MORIOKA Tomohiko <tomo@m17n.org> + + * REMI: Version 1.13.1 (Kubiki) released. + +1999-07-22 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-play.el + (mime-preview-quitting-method-for-mime-show-message-mode): Don't + refer `mime-raw-buffer'. + +1999-07-21 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-play.el (mime-store-message/partial-piece): Don't refer + `mime-preview-buffer'. + + +1999-07-21 MORIOKA Tomohiko <tomo@m17n.org> + + * REMI: Version 1.13.0 (Saigata) released. + +1999-07-21 MORIOKA Tomohiko <tomo@m17n.org> + + * Makefile (EXEC_PREFIX): Deleted. + (elc): Change command-line interface to delete `EXEC_PREFIX'. + (install-elc): Likewise. + + * SEMI-MK (config-semi): Change command-line interface to delete + `EXEC_PREFIX'. + + * SEMI-CFG (EXEC_PREFIX): Deleted. + +1999-07-07 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + + * mime-edit.el (mime-edit-quitting-method): Don't refer + `mime-raw-buffer'. + + * mime-view.el (mime-preview-follow-current-entity): Don't refer + `mime-raw-buffer'. + +1999-06-17 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-edit.el (mime-edit-user-agent-value): Modify for XEmacs + UTF-2000-MULE. + +1999-06-04 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-edit.el (mime-edit-user-agent-value): Modify code to get + version number of XEmacs. [cf. <tm-ja:4561>] + +1999-05-22 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-entity-situation): Don't refer `major-mode' + of a mime-entity-buffer. + (mime-display-multipart/mixed): Add `major-mode' of SITUATION to + default-situation of children. + (mime-display-multipart/alternative): Likewise. + (mime-display-entity): Don't refer `raw-buffer'; use + `mime-goto-header-start-point'. + (mime-display-message): Add new optional argument + `original-major-mode'; don't refer `raw-buffer'; use + `mime-entity-name' to make name of `preview-buffer'; don't set up + `mime-raw-buffer' of `preview-buffer'; use `original-major-mode' + as value of `major-mode' field of default-situation; don't pop up + `preview-buffer' in suitable window; return `preview-buffer'. + (mime-view-buffer): Pop up `preview-buffer' in suitable window. + +1999-05-31 Keiichi Suzuki <keiichi@nanap.org> + + * mime-play.el (mime-show-echo-buffer): Bind `buffer-read-only' to + nil, while insert messages. + +1999-05-28 MORIOKA Tomohiko <tomo@m17n.org> + + * README.en (Required environment): Require APEL 9.20. + +1999-05-27 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-play.el (mime-play-entity): Enter to the calist-package + `mime-view' before call `ctree-find-calist'. + + * mime-view.el (mime-view): New calist-package. + (mime-display-entity): Enter to the calist-package `mime-view' + before call `ctree-match-calist'. + +1999-05-23 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-edit.el (mime-edit-mime-version-value): Don't use + `eval-when-compile' to avoid problem with XEmacs-MULE. + (mime-edit-mime-version-field-for-message/partial): Likewise. + +1999-05-20 MORIOKA Tomohiko <tomo@m17n.org> + + * NEWS (Text property `mime-view-entity-{header|body}'): New + subsection. + (Behavior change about `mime-display-header-hook'): Likewise. + + * mime-view.el (mime-display-entity): Don't move to (point-max) + before run `mime-display-header-hook)'. + +1999-05-19 MORIOKA Tomohiko <tomo@m17n.org> + + * mime-view.el (mime-display-entity): Put text-property + `mime-view-entity-header' and `mime-view-entity-body' to header + and body; run `mime-display-header-hook' before insert "\n". + (mime-preview-follow-current-entity): Use text-property + `mime-view-entity-header'. + + +1999-05-12 MORIOKA Tomohiko <tomo@m17n.org> + + * SEMI: Version 1.13.4 (Terai) released. + +1999-04-06 Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp> + + * mime-edit.el (mime-delete-field): Use `std11-field-end'. + +1999-03-30 Keiichi Suzuki <kei-suzu@mail.wbs.ne.jp> + + * mime-edit.el (mime-edit-decode-single-part-in-buffer): Normalize + EOL code in MIME encoded text part. + +1999-03-27 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-preview-follow-current-entity): Don't copy + header if current entity is root. + +1999-03-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-charset-type-list): Add `tis-620'. + + +1999-02-28 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.13.3 (Komaiko) released. + +1999-02-26 Katsumi Yamaoka <yamaoka@jpl.org> + + * SEMI-MK (install-semi-package): Install mime-setup.el(c). + (compile-semi-package): Compile mime-setup.el as well. + +1999-02-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-content-types): Add definition of + application/vnd.ms-powerpoint for myself :-P + (mime-file-types): Add setting of *.ppt for + application/vnd.ms-powerpoint. + +1999-02-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-partial.el + (mime-combine-message/partial-pieces-automatically): Call + `mime-store-message/partial-piece' in the buffer when it is + called. + + * mime-play.el (mime-store-message/partial-piece): Don't move to + point-min. + + * mime-play.el (mime-store-message/partial-piece): Don't expect + called in raw-buffer. + + +1999-01-27 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.13.2 (Mikawa) released. + +1999-01-26 Katsumi Yamaoka <yamaoka@jpl.org> + + * README.en: Notice that 1.12.5 or later of FLIM is required. + +1999-01-26 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-preview-play-current-entity): Add autoload + cookie. + (mime-play-entity): Likewise. + + * mime-view.el (mime-display-message): Add autoload cookie; add + DOC-string. + (mime-view-buffer): Add autoload cookie. + +1999-01-26 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-reduce-acting-situation-examples): New + implementation. + +1999-01-26 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-view-caesar): Select window which displays + current-buffer if it is not selected <to fix problem with mouse + operations>. + +1999-01-26 Katsumi Yamaoka <yamaoka@jpl.org> + + * mime-edit.el (mime-edit-decode-single-part-in-buffer): Limit the + search bound for the end of "Content-Transfer-Encoding" field. + +1999-01-26 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-view-caesar): New implementation. + +1999-01-26 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-view-caesar): Don't expect called in + raw-buffer; use `mime-insert-entity'. + +1999-01-25 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-w3.el (mime-preview-text/html): Display err if error occurs + in `w3-region'. + + * mime-w3.el (mime-preview-text/html): Guard from error of + `w3-region'. + + +1999-01-24 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.13.1 (Kaga-Kasama) released. + +1999-01-24 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * TODO (Don't expect raw-buffer): New item. + (lazy generating of situations from mime-entity information): New + item. + + * TODO (Don't use filter-model): finished. + + * TODO (multipart/related support): virtually finished. + +1999-01-24 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * Delete README.ja until it is fixed. + + * mime-w3.el (url-cid): Use `mime-insert-entity-content'. + + * README.ja, README.en (Required environment): Require FLIM + 1.12.4. + + * mime-w3.el (mime-w3-message-structure): New variable. + (mime-preview-text/html): Set up `mime-w3-message-structure'. + (url-cid): New function; set up as registered-protocol of url. + +1999-01-23 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * README.ja: Modify title. + + * README.ja: Add notice about translation. + + * README.ja, README.en (Required environment): Require FLIM + 1.12.3; delete description about enriched.el because anything + older than Emacs 19.28 are not supported. + + * mime-pgp.el (mime-view-application/pgp): Don't expect called in + raw-buffer; use `mime-insert-entity'. + + * mime-play.el (mime-view-message/rfc822): Use + `mime-insert-entity'. + +1999-01-22 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * NEWS (Function `mime-play-entity'): Sync with latest + specification. + + * mime-pgp.el (mime-verify-multipart/signed): Modify for interface + change of `mime-play-entity'. + + * mime-play.el (mime-preview-play-current-entity): Modify for + interface change of `mime-play-entity'. + (mime-play-entity): Change interface; abolish optional arguments + `mode' and `ignore-example'. + (mime-detect-content): Modify for interface change of + `mime-play-entity'. + + * mime-view.el (mime-entity-situation): Add new optional argument + `situation'; it is preferred to attributes of entity. + +1999-01-22 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-version): Don't use `eval-when-compile' + to avoid to break product-code-name. + + * mime-edit.el (mime-edit-version): Don't use `eval-when-compile' + to avoid to break product-code-name. + + +1999-01-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.13.0 (Matt-D)-A released. + +1999-01-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-view-message/rfc822): Don't expect called in + raw-buffer. + +1999-01-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * NEWS (Function `mime-play-entity'): Add description about + interface change of `mime-play-entity'. + + * mime-play.el (mime-play-entity): Change interface. + +1999-01-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * NEWS (Changes in SEMI 1.13): New section. + + * NEWS (Changes in SEMI 1.12): New section. + +1999-01-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el (mime-view-application/pgp): Don't expect called in + raw-buffer. + (mime-verify-application/pgp-signature): Likewise. + + * mime-play.el: Abolish variable + `mime-preview-after-decoded-position'. + (mime-preview-play-current-entity): Use `mime-play-entity' simply; + don't switch to raw-buffer. + (mime-play-entity): renamed from `mime-raw-play-entity'; don't + expect called in raw-buffer. + (mime-activate-mailcap-method): Don't expect called in raw-buffer. + (mime-show-echo-buffer): Permit to run in preview-buffer. + + +1999-01-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.12.1 ([JR] Nonoichi) released. + + * mime-play.el (mime-detect-content): Use `mime-entity-content' + not to refer to buffer directly. + +1999-01-15 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: Must require `emu'. + +1999-01-04 OKUNISHI Fujikazu <fuji0924@mbox.kyoto-inet.or.jp> + + * mime-view.el (mime-view-insert-entity-button): Use URL if it + exists in Content-Type field. + + * mime-play.el (mime-raw-browse-url-function): Default to + `mime-browse-url-function' instead of `mime-browse-url'. + +1998-12-24 Katsumi Yamaoka <yamaoka@jpl.org> + + * mime-view.el (mime-preview-move-to-next): Don't move forward at + the end of buffer. + +1998-12-03 Katsumi Yamaoka <yamaoka@jpl.org> + + * mime-edit.el (mime-edit-user-agent-value): Include + `xemacs-betaname'. + + +1998-12-02 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.12.0 (Nishi-Kanazawa) released. + +1998-11-30 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (eliminate-top-spaces): New function (moved from + mime-def.el of FLIM). + +1998-11-17 Kazuhiro Ohta <ohta@ele.cst.nihon-u.ac.jp> + + * mime-partial.el + (mime-combine-message/partial-pieces-automatically): Fix + DOC-string. + + * mime-view.el (mime-view-buffer): Fix DOC-string. + +1998-11-25 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * NEWS (Changes in SEMI 1.11): New section. + +1998-11-18 Katsumi Yamaoka <yamaoka@jpl.org> + + * semi-setup.el (mime-setup-decode-message-header): Use + `mime-decode-header-in-buffer' instead of `eword-decode-header'. + + * mime-view.el (mime-preview-follow-current-entity): Likewise. + +1998-11-18 Keiichi Suzuki <kei-suzu@mail.wbs.ne.jp> + + * mime-edit.el (mime-content-transfer-encoding-priority-list): New + variable. + (mime-edit-translate-single-part-tag): Change return value to + `nil' or a cons which include content-type and encoding. + (mime-edit-translate-region): Generate `encodeing' from + return value of `mime-edit-translate-single-part-tag'. + + +1998-11-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.11.0 (Kanazawa) released. + + * README.ja, README.en (Required environment): Modify for APEL + 9.11 and FLIM 1.12.0. + +1998-11-12 Katsumi Yamaoka <yamaoka@jpl.org> + + * mime-edit.el (mime-edit-split-ignored-field-regexp): Add "^". + +1998-11-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-bbdb.el (mime-bbdb/update-record): Use + `mime-decode-field-body' instead of + `eword-decode-structured-field-body'. + +1998-10-31 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-decode-message-in-buffer): Delete fields + match with `mime-edit-again-ignored-field-regexp' then call + `mime-decode-header-in-buffer'. + (mime-edit-again): Delete header filter. + +1998-10-31 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-decode-multipart-in-buffer): Change + interface. + (mime-edit-decode-single-part-in-buffer): New function. + (mime-edit-decode-message-in-buffer): Swap arguments; use function + `mime-edit-decode-single-part-in-buffer'. + (mime-edit-again): Modify for + `mime-edit-decode-message-in-buffer'. + +1998-10-31 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-decode-multipart-in-buffer): New + function. + (mime-edit-decode-message-in-buffer): Add new optional argument + `default-content-type'; use function + `mime-edit-decode-multipart-in-buffer'; add autoload cookie. + (mime-edit-again): Add autoload cookie. + + * mime-edit.el (mime-edit-decode-message-in-buffer): Renamed from + `mime-edit-decode-buffer'; change `not-decode-text' to optional + argument. + + +1998-10-31 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.10.2 (Higashi-Kanazawa) released. + +1998-10-29 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * NEWS (Abolish variable `mime-temp-directory'): New subsection. + +1998-10-27 Katsumi Yamaoka <yamaoka@jpl.org> + + * mime-edit.el (mime-edit-decode-buffer): Limit search bound for + "Content-Transfer-Encoding:". + + +1998-10-26 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.10.1 (Morimoto) released. + + * README.ja, README.en (Required environment): Modify for APEL 9.6 + and FLIM 1.11.2. + +1998-10-24 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el, mime-pgp.el, mime-partial.el, mime-image.el, + mime-edit.el: Use `temporary-file-directory' instead of + `mime-temp-directory'. + + +1998-10-23 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.10.0 (Tsubata) released. + +1998-10-22 Yoshiki Hayashi <g740685@komaba.ecc.u-tokyo.ac.jp> + + * README.ja: New file. + +1998-10-22 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el, mime-view.el: Use `(featurep 'xemacs)' instead of + `running-xemacs'. + +1998-10-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el, SEMI-ELS: Move function `mime-display-text/plain', + `mime-display-text/enriched' and `mime-display-text/richtext' from + mime-text to mime-view.el; abolish mime-text.el. + + * mime-play.el: Don't Require `mime-text' when compiling. + + * mime-w3.el: Require `mime' instead of `mime-text'. + +1998-10-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * semi-setup.el (mime-setup-enable-inline-image): Use `(featurep + 'xemacs)' instead of `running-xemacs'. + +1998-10-20 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * README.en (Required environment): Modify to require APEL 9.5 and + FLIM 1.11.1. + + * mime-edit.el: - Don't require emu. + - Require invisible. + + * semi-def.el: Require poe instead of emu. + +1998-10-20 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-decode-buffer): Convert encoding to + lower case. + +1998-10-19 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-ignored-field-list): Modify each element + of initial value to include `:'. + (mime-view-visible-field-list): Likewise. + (mime-display-entity): Use `mime-insert-header' instead of + `mime-insert-decoded-header'. + +1998-10-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-decode-buffer): Call + `mule-caesar-region' for text/x-rot13-47-48 entity. + +1998-09-22 Shozo UEHARA <uehara@eken.phys.nagoya-u.ac.jp> + + * mime-play.el (mime-raw-play-entity): Initialize `max-escore' by + 0. <cf. [tm-ja:3432]> + +1998-10-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * NEWS (Changes in SEMI 1.10): New section. + + * NEWS (Changes in SEMI 1.9): New section. + + * NEWS (User-Agent field): New subsection. + +1998-10-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-view-caesar): Use `mime-insert-text-content' + instead of `mime-text-insert-decoded-body'. + + * mime-w3.el (mime-preview-text/html): Use + `mime-insert-text-content' instead of + `mime-text-insert-decoded-body'. + + * mime-text.el: Abolish function `mime-text-insert-decoded-body'. + (mime-display-text/plain): Use `mime-insert-text-content' instead + of `mime-text-insert-decoded-body'. + (mime-display-text/richtext): Likewise. + (mime-display-text/enriched): Likewise. + + +1998-10-14 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.9.1 (Kurikara) released. + +1998-10-14 Jari Aalto <jari.aalto@poboxes.com> + + * mime-edit.el (mime-file-types): Add some new mime types, and + rearrange the types to logical sections: text; octext text and + binary. <cf. [tm-en:1856]> + +1998-10-12 Katsumi Yamaoka <yamaoka@jpl.org> + + * README.en: Add explanation about `VERSION_SPECIFIC_LISPDIR'. + + * Makefile (install): Add new arg `VERSION_SPECIFIC_LISPDIR'. + (install-elc): Likewise. + + * SEMI-MK (config-semi): Refer to `VERSION_SPECIFIC_LISPDIR'. + + * SEMI-CFG (VERSION_SPECIFIC_LISPDIR): New variable. + +1998-10-09 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-CFG: Abolish variable `SHELL' and `SHELLOPTION'. + +1998-10-08 Katsumi Yamaoka <yamaoka@jpl.org> + + * SEMI-CFG: Use `add-latest-path' for adding "custom" to + load-path. + +1998-10-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-CFG: Don't use `when' before install is required; don't + require cl. + +1998-10-08 Katsumi Yamaoka <yamaoka@jpl.org> + + * SEMI-CFG: Add "custom" to load-path. + + +1998-10-07 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.9.0 (Isurugi) released. + +1998-10-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * README.en (Required environment): Modify for APEL 9.1 and FLIM + 1.10.1. + +1998-10-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-version): Enclose with + `eval-and-compile'. + + * mime-edit.el (mime-edit-version): Renamed from + `mime-edit-version-string'; use `mime-user-interface-product', + `mime-product-name', `mime-product-version' and + `mime-product-code-name'. + (mime-edit-user-agent-value): Use `mime-user-interface-product', + `mime-library-product', `mime-product-name', + `mime-product-version' and `mime-product-code-name'. + (mime-edit-mime-version-value): Rename `mime-edit-version-string' + -> `mime-edit-version'. + (mime-edit-mime-version-field-for-message/partial): Likewise. + + * mime-play.el (mime-save-acting-situation-examples): Rename + `mime-view-version-string' -> `mime-view-version'. + + * mime-view.el (mime-view-version): Renamed from + `mime-view-version-string'; use `mime-user-interface-product', + `mime-product-name', `mime-product-version' and + `mime-product-code-name'. + + * semi-def.el (mime-user-interface-product): New constant; abolish + `mime-user-interface-version'. + +1998-10-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-echo-window-is-shared-with-bbdb): Check bbdb + is install or not to define default value. + (mime-show-echo-buffer): New implementation about + `mime-echo-window-is-shared-with-bbdb'. + +1998-10-01 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-charset-type-list): Use `cn-gb' instead of + `cn-gb2312' because `cn-gb2312' is typo. + +1998-09-29 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-file-types): Use function + `mime-encoding-list' instead of variable + `mime-file-encoding-method-alist' to define default value. + (mime-edit-insert-voice): Use function `mime-encoding-alist' + instead of variable `mime-file-encoding-method-alist' for + completion. + (mime-prompt-for-encoding): Likewise. + +1998-09-20 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-user-agent-value): Add + system-configuration for Emacs and XEmacs. + +1998-09-20 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-normalize-body): Use "7bit" for nil + encoding as an argument of `mime-encode-region'. + + +1998-09-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.8.6 (Fukuoka) released. + +1998-09-15 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * README.en (Installation): Add description for `run in expanded + place' and `install as a XEmacs package'. + + * README.en (Required environment): Require FLIM 1.9.2 or later. + +1998-09-13 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-file-types): Abolish setting for + text/richtext. + (mime-edit-insert-text): Likewise. + + * mime-edit.el (mime-content-types): Modify comment style. + +1998-09-13 Shin'ichiro Tanaka <tanaka@ifos.se.fujitsu.co.jp> + + * mime-edit.el (mime-content-types): Delete text/richtext and add + text/css and text/xml (cf. [tm-ja:3387]). + +1998-09-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-insert-user-agent-field): New variable + (abolish `mime-edit-insert-x-emacs-field'). + (mime-edit-user-agent-value): New variable (abolish + `mime-edit-x-emacs-value'). + (mime-edit-translate-body): Insert User-Agent field instead of + `X-Emacs' field. + (mime-edit-again-ignored-field-regexp): Add `User-Agent' instead + of `X-Emacs' field conditionally. + +1998-09-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-MK (config-semi-package): New function. + (compile-semi-package): New function. + (install-semi-package): New function. + + * SEMI-CFG (PACKAGEDIR): New variable. + + * Makefile: Abolish variable `SHELL', `MAKE', `CC' and `CFLAGS'. + (XEMACS): New variable. + (FLAGS): Add `-l SEMI-MK'. + (PACKAGEDIR): New variable. + (elc): Delete `-l SEMI-MK'. + (install-elc): Delete `-l SEMI-MK'. Abolish target `all', `tex', + `dvi' and `ps'. + (package): New target. + (install-package): New target. + (clean): Delete historical setting. + + +1998-08-31 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.8.5 (Nishi-Takaoka) released. + + * README.en (Required environment): Modify APEL and FLIM version. + + * mime-ui-en.sgml (Introduction): Translate. + +1998-08-31 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-type-subtype-score-alist): Fix + mismatched. + +1998-08-10 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-text.el (mime-text-insert-decoded-body): Specify line break + code type as CRLF. + +1998-08-10 Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> + + * mime-edit.el (mime-edit-normalize-body): Failed to canonicalize + empty lines. + +1998-08-09 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-w3.el (mime-preview-text/html): Insert dummy "\n" into end + of entity to avoid keymap text-property problem. + +1998-07-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * NEWS (Don't use "file" command to detect content of entity): New + section. + + * mime-play.el (mime-magic-type-alist): New variable; abolish + `mime-file-content-type-alist'. + (mime-detect-content): New implementation (don't use "file" + command). + + +1998-07-15 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.8.4 (Takaoka) released. + +1998-07-14 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-ui-en.sgml, mime-ui-ja.sgml (message/partial sending): New + section. + + * mime-edit.el (mime-edit-split-blind-field-regexp): Add + DOC-string; change to user option. + + +1998-07-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * REMI: Version 1.8.4 (Takaoka) released. + +1998-07-09 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el: Reduce `mime-acting-situation-example-list' while + it is bigger than `mime-acting-situation-example-list-max-size'. + +1998-07-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-preview-message): Use `mime-view-buffer' + instead of `mime-view-mode'. + + +1998-07-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * REMI: Version 1.8.3 (Ecch-D-Nakagawa)-A released. + + * mime-play.el (mime-delq-null-situation): Add new optional + argument `ignored-value'. + (mime-raw-play-entity): Add new optional argument + `ignored-method'; add `ignore-examples' to acting-situation. + (mime-detect-content): Specify `ignore-examples' of + acting-situation as `ignore-examples' of `mime-raw-play-entity'; + specify `mime-detect-content' as `ignored-method' of + `mime-raw-play-entity'. + +1998-07-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-preview-extract-current-entity): Change + interface to add `ignore-examples'. + (mime-preview-print-current-entity): Likewise. + + * mime-play.el (mime-acting-situation-example-list-max-size): New + variable. + (mime-reduce-acting-situation-examples): New function. + (mime-preview-play-current-entity): Change interface to add + `ignore-examples'. + (mime-raw-play-entity): Add new optional argument + `ignore-examples'. Reduce `mime-acting-situation-example-list' + when loading example file. + + +1998-07-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * REMI: Version 1.8.2 (N-Dmachi)-A released. + +1998-07-07 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-acting-situation-example-list): New variable; + abolish `mime-acting-situation-examples'. + (mime-save-acting-situation-examples): Modify for + `mime-acting-situation-example-list'. + (mime-compare-situation-with-example): New function. + (mime-raw-play-entity): Change algorithm to compare with + acting-situation-examples. + (mime-store-message/partial-piece): Use `mime-view-buffer' instead + of `mime-view-mode'. + +1998-07-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-preview-play-current-entity): Fix problem + when `mode' is omitted with non-interactive mode (maybe for button + dispatcher). + + +1998-07-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * REMI: Version 1.8.1 (Fushiki) released. + +1998-07-05 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-ui-en.texi, mime-ui-en.sgml: New files. + + * mime-ui-ja.sgml: Modify node names about MIME-Edit. + (file-type specification): Fix typo. + +1998-07-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-file-content-type-alist): Add "Standard + MIDI". + + * mime-play.el (mime-detect-content): Fixed. + +1998-07-03 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-activate-mailcap-method): Check filename is + null string. + +1998-07-03 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-ui-ja.sgml, mime-ui-ja.texi: New files; delete + mime-view-ja.sgml and mime-view-ja.texi. + + +1998-07-01 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.8.2 (Kosugi) released. + + * README.en (Required environment): Modify for FLIM 1.8.0. + + * mime-view.el (mime-display-entity): Modify for + `mime-insert-decoded-header'. + +1998-06-30 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-activate-mailcap-method): Use + `mime-write-entity-content'. + + +1998-06-30 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.8.1 (Kureha) released. + +1998-06-29 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-save-content): Use + `mime-write-entity-content'. + +1998-06-29 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: + - Abolish local variable `mime-raw-representation-type'. + - Abolish function `mime-entity-representation-type'. + + * mime-pgp.el (mime-view-application/pgp): Use + `mime-entity-cooked-p'. + + * mime-play.el (mime-view-message/rfc822): Use + `mime-entity-cooked-p'. + +1998-06-28 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el: Abolish function `mime-raw-write-region'. + + * mime-play.el (mime-store-message/partial-piece): Use + `mime-write-entity-body'. + + * mime-pgp.el (mime-verify-application/pgp-signature): Use + `mime-write-entity'. + +1998-06-28 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el (mime-view-application/pgp): Specify + representation-type by argument of `mime-view-buffer'. + +1998-06-28 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-view-message/rfc822): New implementation. + + * mime-view.el (mime-display-message): Try use window of mother + buffer to display mime-preview-buffer. + +1998-06-28 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: Abolish `mime-entity-cooked-p'; use + `mime-entity-cooked-p' of FLIM. + (mime-view-buffer): New optional argument `representation-type'; + use `mime-open-entity'. + (mime-view-mode): New implementation. + + +1998-06-28 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * REMI: Version 1.8.0 (Ecch-D-Kokubu)-A released. + +1998-06-26 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * README.en (Required environment): Modify for FLIM 1.7.0. + + * mime-view.el (mime-view-mode): New implementation. + +1998-06-25 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-text.el (mime-display-text/plain): Must rename + `mime-browse-add-url-button' to `mime-add-url-buttons'. + +1998-06-25 Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> + + * semi-def.el: Don't require 'browse-url. + Abolish `mime-browse-add-url-buttons-maybe' and `mime-browse-url'. + (mime-browse-url-function): New variable. + (mime-add-url-buttons): Renamed from `mime-browse-add-url-button'. + Use `mime-browse-url-function'. + +1998-06-24 Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> + + * mime-view.el: (mime-preview-condition): Renamed method for + "anon-ftp" access-type to `mime-view-message/external-anon-ftp' + and added new method `mime-view-message/external-url' for "url" + access-type. + +1998-06-24 Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> + + * mime-play.el (mime-preview-play-current-entity): Use + optional arg of `interactive'. + (mime-view-message/external-anon-ftp): Renamed from + `mime-view-message/external-ftp'. + (mime-raw-browse-url-function): New variable. + (mime-view-message/external-url): New function. + +1998-06-24 Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> + + * semi-def.el (mime-browse-url-regexp): Renamed from + `mime-text-url-regexp'. + (mime-browse-url): Renamed from `mime-text-browse-url'. + (mime-browse-add-url-buttons): Renamed from + `mime-text-add-url-buttons'. + (mime-browse-add-url-buttons-maybe): Renamed from + `mime-text-add-url-buttons-maybe'. + + * mime-text.el: Moved URL stuff to semi-def.el. + + +1998-06-24 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.8.0 (Toyama) released. + + * SEMI-CFG: Modify for FLIM 1.6.0. + + * README.en (Required environment): Modify for FLIM 1.6.0. + +1998-06-24 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: + - Abolish function `mime-raw-find-entity-from-node-id', + `mime-raw-find-entity-from-number'. + - Move function `mime-entity-parent' to mime.el of FLIM. + - Abolish variable `mime-view-uuencode-encoding-name-list'. + - Move function `mime-entity-uu-filename' and + `mime-entity-filename' to mime.el of FLIM. + (mime-preview-follow-current-entity): Use function + `mime-find-entity-from-node-id' instead of + `mime-raw-find-entity-from-node-id'. + (mime-preview-move-to-upper): Don't use + `mime-raw-find-entity-from-node-id'. + + * mime-pgp.el (mime-verify-application/pgp-signature): Don't use + `mime-raw-find-entity-from-node-id'. + (mime-decrypt-application/pgp-encrypted): Likewise. + + * mime-view.el, mime-play.el (mime-entity-safe-filename): Use + `mime-read-field' instead of `mime-entity-read-field'. + + * mime-partial.el + (mime-combine-message/partial-pieces-automatically): Use + `mime-read-field' instead of `mime-entity-read-field'. + + * mime-bbdb.el (mime-bbdb/update-record): Use `mime-fetch-field' + and `mime-read-field' instead of `mime-entity-fetch-field' and + `mime-entity-read-field'. + +1998-06-23 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-display-message): Use window of + preview-buffer or preview-buffer to display preview-buffer. + (mime-view-buffer): fixed. + (mime-view-mode): fixed. + + * MIME-View-API-ja.ol: Delete MIME-View-API-ja.ol. + +1998-06-22 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * NEWS (Changes in SEMI 1.8): New chapter. + +1998-06-22 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: Abolish external x-face viewer. + +1998-06-22 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * semi-def.el: Abolish function `tm:set-fields', `tm:add-fields' + and `tm:delete-fields'. + + * mime-partial.el: Abolish variable + `mime-view-partial-message-method-alist' and function + `mime-view-partial-message'. + (mime-combine-message/partial-pieces-automatically): Use + `request-partial-message-method' in acting-situation. + +1998-06-22 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-display-message): Delete unnecessary + `mime-parse-buffer'. + + +1998-06-22 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.7.1 (Higashi-Toyama) released. + + * README.en (Required environment): Delete description about + `enable-multibyte-characters'; modify for FLIM 1.5.0. + +1998-06-22 Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> + + * mime-edit.el (mime-content-types): Add "url" access-type and + "subject" parameter of "mail-server" access-type to + message/external-body media-type. + (mime-edit-define-menu-for-xemacs): Doc-string fix. + +1998-06-22 Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> + + * SEMI-CFG: Support run-in-place installation of BBDB and + Emacs/W3. + +1998-06-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: Don't require `std11'. + + * mime-view.el: Require `mime' instead of `mime-lib'. + (mime-entity-filename): Don't use `std11-strip-quoted-string'. + + * mime-edit.el: Don't require `eword-encode'. + +1998-06-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-partial.el + (mime-combine-message/partial-pieces-automatically): Fixed. + + * mime-pgp.el (mime-view-application/pgp): Use function + `mime-entity-representation-type'. + + * mime-play.el (mime-view-message/rfc822): Use function + `mime-entity-representation-type'. + (mime-store-message/partial-piece): `mime-entity-body-start' and + `mime-entity-body-end'. + + * mime-text.el (mime-text-insert-decoded-body): Use function + `mime-entity-cooked-p'. + + * mime-view.el (mime-entity-representation-type): New function. + (mime-entity-cooked-p): New function. + (mime-display-entity): Use function `mime-entity-cooked-p'. + +1998-06-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-text.el (mime-text-insert-decoded-body): Use + `mime-entity-content'. + + * mime-image.el (mime-display-image): Use `mime-entity-content'. + +1998-06-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-entity-safe-filename): New implementation. + +1998-06-20 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-text.el (mime-text-insert-decoded-body): Delete unnecessary + `save-restriction'. + +1998-06-20 Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> + + * semi-def.el: Require 'custom. + +1998-06-19 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: Don't require `mime-parse'. + +1998-06-19 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-CFG: - Modify for FLIM 1.5.0. + - Don't signal error if tm is found in load-path. + +1998-06-19 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-save-content): Use `mime-entity-body-start' + and `mime-entity-body-end'. + +1998-06-19 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el (mime-view-application/pgp): fixed. + (mime-verify-application/pgp-signature): Use + `mime-message-structure' instead of `mime-raw-message-info'. + (mime-decrypt-application/pgp-encrypted): Use + `mime-message-structure' instead of `mime-raw-message-info'. + + * mime-view.el (mime-display-message): Use `mime-parse-buffer'; + abolish variable `mime-raw-message-info'; use + `mime-message-structure' instead of `mime-raw-message-info'. + +1998-06-19 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-bbdb.el (mime-bbdb/update-record): Use + `mime-entity-fetch-field' and `mime-entity-read-field'. + +1998-06-19 Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> + + * SEMI-CFG: Require 'cl first. + + +1998-06-18 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.7.0 (Mizuhashi) released. + +1998-06-17 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el, mime-view.el, semi-def.el: Rename + `mime-module-version' to `mime-user-interface-version'. + + * mime-parse.el, SEMI-ELS: Move mime-parse.el to FLIM layer. + +1998-06-17 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * semi-setup.el (call-after-loaded): Moved from semi-def.el. + + * semi-def.el: Move `call-after-loaded' to semi-setup.el. + +1998-06-17 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-insert-entity-button): Change interface. + +1998-06-17 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-entity-filename): Moved from mime-play.el. + (mime-view-entity-title): Use `mime-entity-filename'. + + * mime-play.el: Move `mime-entity-filename' to mime-view.el. + +1998-06-17 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-entity-filename): New function; abolish + `mime-raw-get-original-filename'. + (mime-entity-safe-filename): New function; abolish + `mime-raw-get-filename'. + (mime-activate-mailcap-method): Use `mime-entity-safe-filename'. + (mime-save-content): Use `mime-entity-safe-filename'. + (mime-detect-content): Use `mime-entity-safe-filename'. + + * mime-view.el (mime-entity-uu-filename): New function; abolish + `mime-raw-get-uu-filename'. + +1998-06-17 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-entity-title): Renamed from + `mime-raw-get-subject'; use `mime-entity-read-field'. + +1998-06-17 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * NEWS (Changes in SEMI 1.7): New chapter. + (Changes in SEMI 1.6): Add description of entity-detection. + +1998-06-17 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: Rename `mime-view-following-method-alist' to + `mime-preview-following-method-alist'. + +1998-06-17 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * semi-setup.el, mime-pgp.el: Rename + `mime-method-to-add-application/pgp-keys' to + `mime-add-application/pgp-keys'. + + * semi-setup.el, mime-pgp.el: Rename + `mime-method-to-decrypt-application/pgp-encrypted' to + `mime-decrypt-application/pgp-encrypted'. + + * semi-setup.el, mime-pgp.el: Rename + `mime-method-to-verify-application/pgp-signature' to + `mime-verify-application/pgp-signature'. + + * semi-setup.el, mime-pgp.el: Rename + `mime-method-to-verify-multipart/signed' to + `mime-verify-multipart/signed'. + + * semi-setup.el, mime-pgp.el: Rename + `mime-method-for-application/pgp' to `mime-view-application/pgp'. + + * SEMI-naming.ol: New file. + +1998-06-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-partial.el: Rename + `mime-method-to-combine-message/partial-pieces' to + `mime-combine-message/partial-pieces-automatically'. + +1998-06-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el, mime-view.el: Rename + `mime-method-to-display-caesar' to `mime-view-caesar'. + + * mime-play.el, mime-view.el: Rename + `mime-method-to-display-message/external-ftp' to + `mime-view-message/external-ftp'. + +1998-06-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el, mime-partial.el, mime-play.el: Rename + `mime-method-to-store-message/partial' to + `mime-store-message/partial-piece'. + +1998-06-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el, mime-view.el: Rename + `mime-method-to-display-message/rfc822' to + `mime-view-message/rfc822'. + +1998-06-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el, mime-view.el: Rename `mime-method-to-detect' to + `mime-detect-content'. + +1998-06-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-display-entity): Abolish body-filter support. + + * mime-play.el, mime-view.el: Rename `mime-method-to-save' to + `mime-save-content'. + +1998-06-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-activate-mailcap-method): Fixed. + +1998-06-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-image.el (mime-display-image): New function; abolish + function `mime-preview-filter-for-image'. + + * mime-image.el: Rename `mime-view-content-header-filter-hook' to + `mime-display-header-hook'. + + * mime-view.el (mime-display-entity): Run + `mime-display-header-hook'. + + * mime-text.el, mime-view.el: Rename `mime-preview-text/enriched' + to `mime-display-text/enriched'. + + * mime-text.el, mime-view.el: Rename `mime-preview-text/richtext' + to `mime-display-text/richtext'. + + * mime-text.el, mime-view.el: Rename `mime-preview-text/plain' to + `mime-display-text/plain'. + + * mime-view.el (mime-display-multipart/mixed): Renamed from + `mime-preview-multipart/mixed'. + + * mime-view.el (mime-display-multipart/alternative): Renamed from + `mime-preview-multipart/alternative'. + + * mime-view.el (mime-display-message/partial-button): Renamed from + `mime-preview-message/partial-button'. + + * mime-view.el (mime-display-entity): Renamed from + `mime-view-display-entity'; change interface. + (mime-display-message): Renamed from `mime-view-display-message'. + +1998-06-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * README.en (Required environment): Modify for FLIM 1.4.0. + +1998-06-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el: Move function `mime-entity-number' to FLIM layer. + +1998-06-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-header-presentation-method-alist): New + variable; abolish variable + `mime-view-content-header-filter-alist'; abolish function + `mime-view-cut-header'; abolish variable + `mime-view-ignored-field-regexp'. + (mime-view-display-entity): Use + `mime-header-presentation-method-alist'. + + * mime-parse.el: Move definition of structure `mime-entity' to + FLIM layer. + +1998-06-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el: Change order of `mime-entity'. + + +1998-06-15 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.6.0 (Namerikawa) released. + +1998-06-15 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view-ja.texi, mime-view-ja.sgml: New files. + + * mime-view.el (mime-view-mode): Fix DOC-string. + +1998-06-15 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-file-content-type-alist): Renamed from + `mime-file-type-regexp-type-subtype-alist'. + +1998-06-14 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * NEWS: Add description about + `mime-preview-over-to-{previous|next}-method-alist'. + + * mime-view.el (mime-preview-over-to-previous-method-alist): + Add DOC-string. + (mime-preview-over-to-next-method-alist): Add DOC-string. + + * mime-view.el (mime-preview-over-to-previous-method-alist): + Renamed from `mime-view-over-to-previous-method-alist'. + (mime-preview-over-to-next-method-alist): Renamed from + `mime-view-over-to-next-method-alist'. + +1998-06-13 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-w3.el (mime-save-background-color): Fixed. + + * mime-view.el (mime-acting-condition): Set up + `mime-method-to-detect' for application/octet-stream in "play" + mode. + + * mime-play.el (mime-file-type-regexp-type-subtype-alist): New + variable. + (mime-method-to-detect): New function. + +1998-06-13 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-sort-situation): Modify for + Content-Disposition information. + +1998-06-13 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: Abolish variable `mime-view-show-summary-method' + and function `mime-preview-show-summary'. + +1998-06-13 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-entity-situation): Add information of + Content-Disposition. + +1998-06-12 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * MIME-View-API-ja.ol (mime-preview-buffer): Add description about + `mime-preview-original-major-mode'. + + * mime-view.el (mime-preview-original-major-mode): Modify + DOC-string. + + * NEWS: Add description about abolishment of tm-compatible + external method support. + + * mime-play.el (mime-raw-play-entity): Abolish tm-compatible + external method support; abolish function + `mime-activate-external-method' and + `mime-make-external-method-args'. + +1998-06-12 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-activate-mailcap-method): Use + `mime-entity-body-start'. + + * mime-play.el (mime-activate-external-method): Change interface. + + * mime-play.el (mime-activate-mailcap-method): Change interface. + +1998-06-12 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * MIME-View-API-ja.ol (mime-preview-buffer): Delete description + about text-property `mime-view-raw-buffer'. + + * mime-play.el (mime-preview-play-current-entity): Don't refer + text-property `mime-view-raw-buffer'. + + * mime-view.el (mime-view-display-entity): Don't set up + text-property `mime-view-raw-buffer'. + +1998-06-12 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * MIME-View-API-ja.ol: Abolish description about + `mime-preview-original-major-mode'. + + * NEWS (Changes in SEMI 1.6): New chapter. + + * TODO (multipart/related support): New item. + +1998-06-12 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * NEWS: Add description about mime-w3.el. + +1998-06-12 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-w3.el (mime-save-background-color): New macro. + (mime-preview-text/html): Use `mime-save-background-color'. + +1998-06-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el: Abolish variable `mime-edit-signing-type' and + `mime-edit-encrypting-type'. + (mime-edit-process-multipart-1): Separate "signed" to "pgp-signed" + and "kazu-signed"; separate "encrypted" to "pgp-encrypted" and + "kazu-encrypted". + (mime-edit-enclose-signed-region): Renamed from + `mime-edit-enclose-pgp-signed-region'. + (mime-edit-enclose-pgp-encrypted-region): Renamed from + `mime-edit-enclose-encrypted-region'. + (mime-edit-enclose-kazu-signed-region): New function. + (mime-edit-enclose-kazu-encrypted-region): New function. + (mime-edit-set-sign): Don't refer `mime-edit-signing-type'. + (mime-edit-set-encrypt): Don't refer `mime-edit-encrypting-type'. + +1998-06-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-sign-pgp-kazu): Abolish unused local + variable. + (mime-edit-encrypt-pgp-kazu): Abolish unused local variables. + +1998-06-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el (mime-method-for-application/pgp): Change interface. + (mime-method-to-verify-multipart/signed): Change interface. + (mime-method-to-verify-application/pgp-signature): Change + interface. + (mime-method-to-decrypt-application/pgp-encrypted): Change + interface. + (mime-method-to-add-application/pgp-keys): Change interface. + + * mime-partial.el (mime-method-to-combine-message/partial-pieces): + Change interface. + + * mime-play.el (mime-raw-play-entity): Change interface of + internal-method. + (mime-method-to-save): Change interface. + (mime-method-to-display-message/rfc822): Change interface. + (mime-method-to-store-message/partial): Change interface. + (mime-method-to-display-message/external-ftp): Change interface. + (mime-method-to-display-caesar): Change interface. + +1998-06-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-normalize-body): Use + `mime-charset-type-list' directly; abolish local variable + `mime-edit-charset-default-encoding-alist' and function + `mime-make-charset-default-encoding-alist'. + (mime-edit-toggle-transfer-level): Don't set up + `mime-edit-charset-default-encoding-alist'. + +1998-06-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-display-message): Set up + `mime-raw-message-info'. + (mime-view-buffer): New function. + (mime-view-mode): Don't set up `mime-raw-message-info'. + +1998-06-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-charset-type-list): Use base64 for cn-gb2312 + and gb2312. + (mime-edit-normalize-body): If encoding is not specified for + charset, use quoted-printable or 8bit for mime-transfer-level is 7 + or 8. + + * mime-edit.el (mime-charset-type-list): Add `shift_jis'. + +1998-06-10 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-display-message): Use + `mime-maybe-hide-echo-buffer'. + (mime-view-mode): Don't use `mime-maybe-hide-echo-buffer'. + + * mime-view.el (mime-view-display-message): Move point to top of + body; run `mime-view-mode-hook'. + (mime-view-mode): Don't move point; don't run + `mime-view-mode-hook'. + + * mime-view.el (mime-view-display-message): Add new optional + argument `default-keymap-or-function'. + (mime-view-mode): Modify for `mime-view-display-message'. + + * mime-view.el (mime-view-display-message): Add new optional + argument `mother'; set to `mime-mother-buffer'. + (mime-view-mode): Modify for `mime-view-display-message'. + +1998-06-10 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-mc.el: Use `eval-and-compile' to load "mc-pgp". + + * mime-view.el (mime-preview-multipart/mixed): Modify for + `mime-view-display-entity'; don't refer `mime-raw-buffer'. + (mime-preview-multipart/alternative): Modify for + `mime-view-display-entity'; don't refer `mime-raw-buffer'. + (mime-view-display-entity): Change interface to abolish argument + for raw-buffer; don't refer `mime-raw-buffer'. + (mime-view-display-message): Abolish variable + `mime-preview-original-major-mode'; modify for + `mime-view-display-entity'. + (mime-preview-original-major-mode): New implementation; add + optional argument `recursive'. + (mime-preview-follow-current-entity): Modify for + `mime-preview-original-major-mode'. + (mime-preview-move-to-next): Use function + `mime-preview-original-major-mode'. + (mime-preview-scroll-up-entity): Use function + `mime-preview-original-major-mode'. + (mime-preview-scroll-down-entity): Use function + `mime-preview-original-major-mode'. + (mime-preview-quit): Use function + `mime-preview-original-major-mode'. + (mime-preview-show-summary): Use function + `mime-preview-original-major-mode'. + + * mime-view.el (mime-view-display-message): New function; abolish + function `mime-view-setup-buffers'. + (mime-view-mode): Use `mime-view-display-message'. + +1998-06-10 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-raw-play-entity): Use + `mime-entity-situation'. + + * mime-view.el (mime-entity-situation): New function. + (mime-preview-multipart/alternative): Use `mime-entity-situation'. + (mime-view-display-entity): Use `mime-entity-situation'. + +1998-06-10 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-enclose-region-internal): Abolish unused + local variable. + +1998-06-09 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * MIME-View-API-ja.ol (entity): Add description of + `mime-entity-number'. + + * mime-play.el (mime-method-to-display-caesar): Use + `mime-entity-number'. + + * mime-parse.el (mime-entity-number): New function. + +1998-06-09 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * MIME-View-API-ja.ol (entity-button): Modify description of + `mime-view-insert-entity-button'. + + * mime-view.el (mime-view-insert-entity-button): Change interface. + (mime-view-display-entity): Modify for + `mime-view-insert-entity-button'. + +1998-06-09 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * MIME-View-API-ja.ol (entity-button): Modify description of + `mime-view-entity-button-visible-p'. + + * mime-view.el (mime-view-entity-button-visible-p): Change + interface. + (mime-view-display-entity): Modify for + `mime-view-entity-button-visible-p'. + +1998-06-09 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * MIME-View-API-ja.ol: Add description of `mime-entity-parent' and + abolish description `mime-raw-entity-parent'. + + * mime-view.el (mime-entity-parent): New function; abolish + `mime-raw-entity-parent'. + (mime-view-entity-button-visible-p): Use `mime-entity-parent' + instead of `mime-raw-entity-parent'. + + +1998-06-09 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.5.4 (Higashi-Namerikawa) released. + + * mime-edit.el (mime-edit-normalize-body): Abolish unused local + variable. + +1998-06-09 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-translate-single-part-tag): Add new + argument `boundary'. + (mime-edit-translate-region): Modify for + `mime-edit-translate-single-part-tag'. + +1998-06-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-w3.el (mime-put-keymap-region): New macro. + (mime-preview-text/html): Use macro `mime-put-keymap-region'. + +1998-06-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-ELS (semi-modules-to-compile): Add 'mime-w3 if w3 is found. + + * semi-setup.el (mime-setup-enable-inline-html): New variable; add + setting for mime-w3.el conditionally. + + * mime-w3.el: New module. + +1998-06-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-preview-multipart/alternative): Fix typo. + +1998-06-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-x-emacs-value): Check + `enable-multibyte-characters' is bound or not. + + +1998-06-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.5.3 (Uozu) released. + + * NEWS (`pgp-elkins' -> `pgp-mime'): New section. + + * mime-edit.el: Rename `pgp-elkins' -> `pgp-mime'. + +1998-06-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-sign-pgp-elkins): Abolish unused local + variable. + (mime-edit-encrypt-pgp-elkins): Abolish unused local variable. + +1998-06-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el (mime-parse-multipart): fixed. + + +1998-06-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.5.2 (Kurobe) released. + + * mime-play.el (mime-delq-null-situation): New function. + (mime-raw-play-entity): Use `mime-delq-null-situation'. + +1998-06-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * TODO (Better implementation for multipart/alternative): done. + + * NEWS (type-subtype-score): New section. + +1998-06-07 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-raw-message-info): Modify DOC-string. + + * MIME-View-API-ja.ol: Modify for SEMI 1.5. + +1998-06-07 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-touched-flag): Define by `defvar'. + (mime-edit-mode): Don't check `mime-edit-touched-flag' is bound or + not. + + * mime-edit.el (mime-edit-find-inmost): Abolish unused local + variables. + +1998-06-07 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-text.el (mime-text-insert-decoded-body): Don't refer + `mime-raw-buffer'. + + * mime-parse.el: Change format of `mime-entity' to add `buffer'. + +1998-06-07 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el: When it is compiled, require 'bbdb or define + `bbdb-buffer-name' to avoid compiler warning. + + (mime-method-to-display-caesar): Abolish unused local variable. + + Use `eval-buffer' to eval contents of + `mime-acting-situation-examples-file'. + +1998-06-07 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-text.el: Move definition of variable + `mime-raw-representation-type' to mime-view.el. + + * mime-view.el: Move definition of variable + `mime-raw-representation-type' from mime-text.el. + (mime-raw-message-info): Modify DOC-string. + + * MIME-View-API-ja.ol: New file. + + +1998-06-05 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.5.1 (Ikuji) released. + + * mime-view.el (mime-raw-message-info): Fix typo. + (mime-view-type-subtype-score-alist): New variable. + (mime-preview-multipart/alternative): New function; set up for + `mime-preview-condition'. + (mime-view-display-entity): Add optional argument `situation'. + +1998-06-05 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-display-entity): Call + body-presentation-method to display multipart if it is function. + + * NEWS: Add news about SEMI 1.5. + +1998-06-05 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-preview-multipart/mixed): New function. + (mime-view-display-entity): Use `mime-preview-multipart/mixed'. + +1998-06-05 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-display-entity): Display entity-button + in body if button is invisible and body-presentation-method is not + found. + + +1998-06-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.5.0 (Nishi-Ny-Dzen)-A released. + + * README.en (Required environment): Modify for FLIM 1.3.0. + +1998-06-03 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-raw-write-region): New implementation; refer + `mime-raw-representation-type' or + `mime-raw-representation-type-alist' instead of + `mime-raw-buffer-coding-system-alist'. + + * mime-view.el: Abolish variable + `mime-raw-buffer-coding-system-alist'. + +1998-06-02 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el (mime-method-for-application/pgp): Use + `mime-raw-representation-type-alist' instead of + `mime-text-decoder-alist'; set up to + `mime-raw-representation-type' instead of `mime-text-decoder'. + + * mime-play.el (mime-method-to-display-message/rfc822): Use + `mime-raw-representation-type-alist' instead of + `mime-text-decoder-alist'; set up to + `mime-raw-representation-type' instead of `mime-text-decoder'. + (mime-method-to-display-caesar): Use + `mime-text-insert-decoded-body'. + + * mime-text.el (mime-raw-representation-type): New variable; + abolish `mime-text-decoder'. + (mime-text-insert-decoded-body): Change interface; refer + `mime-raw-representation-type' or + `mime-raw-representation-type-alist' instead of + `mime-text-decoder' or `mime-text-decoder-alist'; abolish function + `mime-text-decode-buffer' and `mime-text-decode-buffer-maybe'. + (mime-preview-text/plain): Modify for new interface of + `mime-text-insert-decoded-body'. + (mime-preview-text/richtext): Modify for new interface of + `mime-text-insert-decoded-body'. + (mime-preview-text/enriched): Modify for new interface of + `mime-text-insert-decoded-body'. + + * mime-view.el (mime-raw-representation-type-alist): New variable; + abolish `mime-text-decoder-alist'. + +1998-05-31 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el (mime-parse-multipart): fixed. + + +1998-06-01 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.4.6 (Ny-Dzen)-A released. + +1998-05-28 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-text.el (mime-text-insert-decoded-body): New function; + abolish 'mime-text-decode-body. + (mime-preview-text/plain): Use 'mime-text-insert-decoded-body. + (mime-preview-text/richtext): Use 'mime-text-insert-decoded-body. + (mime-preview-text/enriched): Use 'mime-text-insert-decoded-body. + +1998-05-28 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-preview-condition): Set up for + 'mime-preview-text/enriched instead of + 'mime-preview-filter-for-text/enriched. + + * mime-text.el (mime-preview-text/enriched): New function; abolish + 'mime-preview-filter-for-text/enriched. + +1998-05-28 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-preview-condition): Set up for + 'mime-preview-text/richtext instead of + 'mime-preview-filter-for-text/richtext. + + * mime-text.el (mime-preview-text/richtext): New function; abolish + 'mime-preview-filter-for-text/richtext. + +1998-05-28 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: Rename 'mime-view-insert-message/partial-button to + 'mime-preview-message/partial-button. + +1998-05-28 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-preview-condition): Set up for + 'mime-preview-text/plain instead of + 'mime-preview-filter-for-text/plain. + (mime-view-insert-message/partial-button): Change interface for + new spec of body-presentation-method. + (mime-view-display-entity): Change interface of + body-presentation-method. + + * mime-text.el (mime-preview-text/plain): New function; abolish + 'mime-preview-filter-for-text/plain. + +1998-05-28 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el (make-mime-entity): Change format. + (mime-entity-header-start): New function. + (mime-entity-header-end): New function. + (mime-entity-body-start): New function. + (mime-entity-body-end): New function. + (mime-entity-content-type): Modify for new format. + (mime-entity-content-disposition): Modify for new format. + (mime-entity-encoding): Modify for new format. + (mime-entity-children): Modify for new format. + (mime-entity-point-min): Change to alias of + 'mime-entity-header-start. + (mime-entity-point-max): Change to alias of 'mime-entity-body-end. + (mime-parse-multipart): Modify for 'make-mime-entity. + (mime-parse-message): Modify for 'make-mime-entity. + +1998-05-28 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el (mime-parse-multipart): Change interface; abolish + local variable 'beg and 'end. + (mime-parse-message): Modify for 'mime-parse-multipart. + +1998-05-28 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el (mime-parse-multipart): Use + 'mime-content-type-parameter. + +1998-05-28 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el (mime-parse-Content-Transfer-Encoding): New + function. + (mime-read-Content-Transfer-Encoding): Use function + 'mime-parse-Content-Transfer-Encoding. + (mime-parse-message): Use 'mime-parse-* instead of 'mime-read-*. + +1998-05-28 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el: Move 'regexp-* and 'regexp-or to mime-def.el of + FLIM (Chao); move 'std11-quoted-pair-regexp, 'std11-qtext-regexp + and 'std11-quoted-string-regexp to mime-def.el of FLIM (Chao). + +1998-05-28 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el: Rename 'rfc822/quoted-string-regexp -> + 'std11-quoted-string-regexp. + + * mime-parse.el: Rename 'rfc822/qtext-regexp -> + 'std11-qtext-regexp. + + * mime-parse.el: Rename 'rfc822/quoted-pair-regexp -> + 'std11-quoted-pair-regexp. + +1998-05-29 Katsumi Yamaoka <yamaoka@jpl.org> + + * mime-view.el (mime-preview-scroll-down-entity): Use (not (bobp)) + instead of (> (point) 1). + +1998-05-25 Katsumi Yamaoka <yamaoka@jpl.org> + + * mime-play.el (mime-preview-play-current-entity): Don't widen. + +1998-05-25 Katsumi Yamaoka <yamaoka@jpl.org> + + * mime-play.el (mime-raw-play-entity): Abolish point correcting + procedures for VM. + + * mime-play.el (mime-preview-play-current-entity): Do widen befor + playing the entity. + + +1998-05-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.4.5 (Tomari) released. + + * README.en (Mailing lists): Add notice about direct-mail for + authors. + +1998-05-19 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-raw-dired-function): Don't refer + 'mime/use-multi-frame. + + * semi-def.el: Abolish variable 'mime/use-multi-frame. + + * semi-def.el (mime-insert-button): Merge arguments of two + 'insert. + + * semi-def.el: Abolish function 'get-version-string because it is + not used. + + * TODO (Don't use filter-model): New item. + + * TODO (Fix problem of dynamic configuration for + 'mime-acting-condition): Done. + + * TODO (Mother entity should modify preview-situation of + children): Done. + +1998-05-17 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-setup-buffers): Use + 'mime-view-display-entity; abolish 'mime-view-display-message. + (mime-view-display-entity): fixed. + +1998-05-17 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-display-message): fixed. + +1998-05-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-raw-get-subject): Use + 'mime-content-disposition-filename. + + * mime-parse.el (mime-content-type-parameter): New function. + + * mime-parse.el (mime-content-disposition-parameter): New + function. + (mime-content-disposition-filename): New function. + +1998-05-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-raw-get-original-filename): Abolish optional + argument 'encoding; modify for 'mime-raw-get-uu-filename. + + * mime-view.el (mime-raw-get-uu-filename): Change interface; don't + check encoding. + (mime-raw-get-subject): Change interface; new implementation. + +1998-05-15 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-display-entity): fixed. + + * mime-parse.el (mime-parse-multipart): Change interface. + +1998-05-15 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el (make-mime-entity): Add 'content-disposition. + (mime-entity-content-disposition): New function. + (mime-parse-multipart): Modify for 'make-mime-entity. + (mime-parse-message): Modify for 'make-mime-entity. + +1998-05-15 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-raw-play-entity): Don't use + 'mime-entity-media-type, 'mime-entity-media-subtype and + 'mime-entity-parameters. + +1998-05-15 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-display-entity): Don't use + 'mime-entity-media-type, 'mime-entity-media-subtype and + 'mime-entity-parameters. + +1998-05-15 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-display-message): Don't use + 'mime-entity-media-type, 'mime-entity-media-subtype and + 'mime-entity-parameters. + +1998-05-17 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-setup.el: Avoid warning message of byte-compiler. + + +1998-05-15 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.4.4 (Ecch-D-Miyazaki)-A released. + + * mime-play.el (mime-mailcap-method-filename-alist): New variable. + (mime-mailcap-method-sentinel): New function. + (mime-activate-mailcap-method): Use 'mime-mailcap-method-sentinel; + don't use 'mime-show-echo-buffer. + +1998-05-14 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-activate-mailcap-method): Regard + 'mime-temp-directory. + +1998-05-14 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el (make-mime-entity): Change interface and + data-format. + (mime-entity-content-type): New access function. + (mime-entity-media-type): New implementation. + (mime-entity-subtype): New implementation. + (mime-entity-parameters): New implementation. + (mime-parse-multipart): Change interface; modify for + 'make-mime-entity. + (mime-parse-message): Modify for 'make-mime-entity. + + +1998-05-13 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.4.3 (Ichiburi) released. + +1998-05-12 Kazuhiro Ohta <ohta@ele.cst.nihon-u.ac.jp> + + * mime-partial.el: start and end of the region fixed. + +1998-05-12 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el (make-mime-content-type): New function. + (mime-parse-Content-Type): Use 'make-mime-content-type. + (mime-parse-multipart): Use 'make-mime-content-type. + +1998-05-12 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el: Change data format of mime-content-disposition. + +1998-05-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el: Rename 'mime/Content-Transfer-Encoding -> + 'mime-read-Content-Transfer-Encoding. + +1998-05-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-raw-get-subject): Use + 'mime-content-disposition-parameters. + + * mime-play.el (mime-raw-get-original-filename): Use + 'mime-content-disposition-parameters. + + * mime-parse.el (mime-content-disposition-type): New function. + (mime-content-disposition-parameters): New function. + +1998-05-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el, mime-play.el, mime-view.el: Rename + 'mime/Content-Disposition -> 'mime-read-Content-Disposition. + +1998-05-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * Makefile (PACKAGE): New variable. + (tar): Use $(PACKAGE). + +1998-05-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el: Change data format of mime-content-type. + +1998-05-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-decode-buffer): Use + 'mime-content-type-primary-type, 'mime-content-type-subtype and + 'mime-content-type-parameters. + +1998-05-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el (mime-content-type-primary-type): New function. + (mime-content-type-subtype): New function. + (mime-content-type-parameters): New function. + (mime-parse-message): Use 'mime-content-type-primary-type, + 'mime-content-type-subtype and 'mime-content-type-parameters. + +1998-05-10 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el: Abolish function 'symbol-concat because it is not + used. + + +1998-05-10 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.4.2 (Oyashirazu) released. + +1998-05-07 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * README.en (Authors): New section. + + * README.en (CVS based development): New section. + +1998-05-07 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-preview-move-to-previous): Must regard + previous entity separated by null property region. + (mime-preview-move-to-next): Must regard next entity separated by + null property region. + +1998-05-03 Simon Josefsson <jas@pdc.kth.se> + + * mime-view.el (mime-preview-move-to-previous): check that new + prop is non-null + + * mime-view.el (mime-preview-move-to-next): skip leading null + props, check that new prop is non-null + +1998-05-07 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: Use 'ctree-set-calist-with-default instead of + 'ctree-set-calist-strictly to set up mailcap entries. + + +1998-05-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.4.1 (-Dmi)-A released. + + * README.en (Required environment): Modify for FLIM 1.2.0. + +1998-05-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el: Move 'mime-type/subtype-string to + flim/mime-def.el. + +1998-05-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-sort-situation): New function. + (mime-raw-play-entity): Use 'mime-sort-situation. + +1998-05-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-activate-mailcap-method): Use + 'mailcap-format-command. + +1998-05-05 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * README.en (What's SEMI?): Add description about mailcap. + (Documentation): Add RFC 1524; change location of RFC. + + +1998-05-05 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.4.0 (Itoigawa) released. + + * README.en (Required environment): Modify for FLIM 1.1.0. + + * SEMI-CFG: Modify error message for FLIM 1.1.0. + +1998-05-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * semi-def.el: Abolish 'mime/find-file-function because it is not + used. + +1998-05-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * TODO (keymap-prefix): done. + (mailcap support): done. + (Change 'mime-acting-condition to condition-tree format): done. + (Unify entity display specifications to 'mime-preview-condition): + done. + +1998-05-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * NEWS: Add description for SEMI 1.4. + +1998-05-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: Abolish setting for tm-sh-scripts. + + * semi-setup.el: Abolish MUA depended signature setting. + + * mail-mime-setup.el: Move setting for 'mail-signature from + semi-setup.el. + +1998-05-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * semi-setup.el: Use 'mime-add-condition to set up for mime-pgp. + + * mime-pgp.el: Abolish setting for 'mime-preview-condition and + mime-acting-condition. + + * semi-def.el (mime-condition-type-alist): New variable. + (mime-condition-mode-alist): New variable. + (mime-add-condition): New function. + +1998-05-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-acting-condition): Use + 'ctree-set-calist-with-default to set up 'mime-method-to-save. + +1998-05-03 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-acting-condition): Delete setting for + metamail. + +1998-05-03 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-activate-mailcap-method): New function. + (mime-raw-play-entity): Use 'mime-activate-mailcap-method for + mailcap method. + + * mime-view.el (mime-acting-condition): Read mailcap. + +1998-05-03 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mailcap.el: Move mailcap.el to FLIM. + +1998-05-02 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-raw-play-entity): Sort before registering to + 'mime-acting-situation-examples. + + +1998-04-30 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.3.4 (Kajiyashiki) released. + +1998-04-29 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-CFG: Modify messages for APEL 8.7. + + * README.en (Required environment): Modify for APEL 8.7. + +1998-04-29 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-find-every-acting-situation): Change + default value to 't. + +1998-04-29 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-save-acting-situation-examples): New + function; set up for 'kill-emacs-hook. + + * mime-play.el (mime-acting-situation-examples): Renamed from + 'mime-user-acting-condition. + + * mime-play.el: Load MIME acting-example file. + + * mime-view.el (mime-acting-situation-examples-file): New + variable. + +1998-04-29 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-raw-play-entity): Use + 'ctree-match-calist-partially. + + +1998-04-28 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.3.3 (Uramoto) released. + +1998-04-27 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-raw-play-entity): Refer + 'mime-view-find-every-acting-situation. + + * mime-view.el (mime-view): New customize group. + (mime-view-find-every-acting-situation): New variable. + +1998-04-27 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-user-acting-condition): New variable. + (mime-raw-play-entity): Refer it. + +1998-04-27 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-raw-play-entity): Get all available + acting-situations; display menu of methods to select + acting-situation to activate. + + * semi-def.el (select-menu-alist): New function. + + +1998-04-25 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.3.2 (N-D)-A was released. + + * mime-edit.el (mime-edit-mode-entity-prefix): New variable. + (mime-edit-mode-entity-map): New variable. + (mime-edit-mode-enclosure-prefix): New variable. + (mime-edit-mode-enclosure-map): New variable. + (mime-edit-mode-map): Use 'mime-edit-mode-entity-map and + 'mime-edit-mode-enclosure-map. + + * mime-view.el (mime-acting-condition): Fix setting. + +1998-04-24 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-raw-play-entity): Use 'ctree-match-calist + directly; abolish 'mime/get-content-decoding-alist. + + +1998-04-22 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.3.1 (Tsutsuishi) was released. + + * mime-view.el (mime-preview-follow-current-entity): Abolish + unused local variable 'message-info. + +1998-04-22 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-split-ignored-field-regexp): Add + Message-Id field. + +1998-04-22 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mail-mime-setup.el: Must require 'alist. + + +1998-04-22 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.3.0 (Nadachi) was released. + +1998-04-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * semi-def.el: Don't require 'atype; abolish function + 'field-unifier-for-mode. + +1998-04-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el: Use 'ctree-set-calist-strictly instead of + 'set-atype to set up for 'mime-acting-condition. + + * mime-play.el (mime/get-content-decoding-alist): Use + 'ctree-match-calist instead of 'get-unified-alist. + + * mime-view.el (mime-acting-condition): Change format from list of + atype to ctree. + + +1998-04-19 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.2.4 (Arimagawa) was released. + + * NEWS: Modify for SEMI 1.2.4 (Arimagawa). + + * mime-view.el (mime-view-display-message): Check 'message-button + is 'visible. + (mime-view-display-entity): Check 'header is 'visible. + +1998-04-19 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: Abolish variable + 'mime-view-childrens-header-showing-Content-Type-list and function + 'mime-view-header-visible-p. + (mime-preview-follow-current-entity): Don't use + 'mime-view-header-visible-p. + +1998-04-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-preview-condition): Don't display body of + message/rfc822 and message/news; add '(entity-button . invisible) + to default situation of child entity. + (mime-view-display-entity): Don't display entity-button if + 'entity-button field value of preview-condition is 'invisible. + + +1998-04-15 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.2.3 (Tanihama) was released. + + * mime-view.el: Abolish function 'mime-view-body-visible-p and + 'mime-view-entity-separator-visible-p. + (mime-view-display-entity): Don't use + 'mime-view-entity-separator-visible-p. + +1998-04-14 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-preview-condition): Specify + 'childrens-situation field for message/rfc822 and message/news. + (mime-view-display-message): Use value of 'childrens-situation + field of preview-situation as default-situation of children. + (mime-view-display-entity): Add new argument 'default-situation; + use it as elements of draft of preview-situation; use value of + 'header field of preview-situation instead of + 'mime-view-header-visible-p; use value of 'childrens-situation + field of preview-situation as default-situation of children. + + +1998-04-13 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.2.2 (Naoetsu) was released. + + * README.en: Modify for FLIM. + +1998-04-13 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-CFG: Modify messages for FLIM and APEL 8.2. + +1998-04-13 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-CFG: Add "flim" instead of "rime" to 'load-path. + +1998-04-12 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-calist::field-match-method-as-default-rule): + New function; setup for calist-field-match-method for 'header and + 'body. + +1998-04-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el (mime-preview-condition): Add (message-button + . visible) to application/pgp again. + +1998-04-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-display-message): Abolish unused local + variable 'ctype. + (mime-view-display-entity): Abolish unused local variable 'ctype. + + * mime-view.el (mime-view-display-message): Don't use + 'mime-view-content-button-visible-ctype-list; abolish it. + +1998-04-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-entity-button-visible-p): Omit to check + entity is not message. + (mime-view-header-visible-p): Omit to check entity is message. + (mime-view-setup-buffers): Call 'mime-view-display-message instead + of 'mime-view-display-entity. + (mime-view-display-message): New function. + (mime-view-display-entity): Abolish local variable + 'entity-node-id; don't check entity is message or not. + +1998-04-10 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-CFG: Add "rime" instead of "mel" to 'load-path. + +1998-04-10 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-ELS (semi-modules-to-compile): Delete 'mime-def, + 'eword-encode and 'eword-decode. + + * mime-def.el, eword-encode.el, eword-decode.el: Abolish + mime-def.el, eword-decode.el and eword-encode.el; (moved to RIME). + +1998-04-10 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el (regexp-or): Moved from semi-def.el. + + * semi-def.el: Move 'regexp-or to mime-parse.el. + Move 'eliminate-top-spaces to mime-def.el. + + * mime-def.el (eliminate-top-spaces): Moved from semi-def.el. + +1998-04-09 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-ELS (semi-modules-to-compile): Add 'semi-def. + + * semi-setup.el: Require 'semi-def instead of 'mime-def. + + * mime-view.el: Require 'semi-def. + + * mime-def.el: Move SEMI depended definitions to semi-def.el. + + * semi-def.el: Move SEMI depended definitions from mime-def.el. + + * eword-decode.el (eword-decode-version): Don't use + `mime-module-version'. + + +1998-04-09 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.2.1 (Nomachi) was released. + +1998-04-09 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-setup-buffers): Don't use + 'mime-raw-flatten-message-info. + (mime-view-display-entity): Display recursively. + +1998-04-09 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * TODO: New file. + +1998-04-03 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-decode.el (eword-decode-version): Use + `mime-module-version' instead of `semi-version'. + + * mime-edit.el (mime-edit-version-string): Use + `mime-module-version' instead of `semi-version'. + + * mime-view.el (mime-view-version-string): Use + `mime-module-version' instead of `semi-version'. + + * mime-def.el (mime-module-version): New variable; abolish + `semi-version'. + + +1998-03-26 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.2.0 (Nishiizumi) was released. + + * NEWS: Update for SEMI 1.2. + +1998-03-25 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-text.el: Rename 'mime-view-plain-text-preview-hook -> + 'mime-preview-text/plain-hook. + + * mime-text.el (mime-text-add-url-buttons): New function. + (mime-text-add-url-buttons-maybe): New function. + +1998-03-25 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el, mime-text.el, mime-image.el: Rename + 'mime-view-filter-for-* -> 'mime-preview-filter-for-*. + +1998-03-25 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-text.el: Rename 'mime-decode-text-body -> + 'mime-text-decode-body. + +1998-03-25 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-text.el (mime-decode-text-body): Change interface; call + 'mime-text-decode-hook. + +1998-03-23 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * VERSION: New file. + + +1998-03-23 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.1.2 (Shin-Nishikanazawa) was released. + +1998-03-22 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * NEWS: Modify about 'image-format. + + * mime-image.el (mime-view-filter-for-image): Refer 'image-format + of preview-situation instead of 'mime-view-image-converter-alist; + abolish variable 'mime-view-image-converter-alist. + +1998-03-22 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * NEWS: Modify about 'body-filter. + +1998-03-22 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-image.el: Abolish 'mime-view-ps-to-gif-command. + + * mime-image.el (mime-view-filter-for-image): Change interface. + Abolish `mime-view-filter-for-application/postscript'. + + * mime-text.el (mime-view-filter-for-text/plain): Change + interface. + (mime-view-filter-for-text/richtext): Change interface. + (mime-view-filter-for-text/enriched): Change interface. + + * mime-view.el (mime-view-display-entity): Change interface of + body-filter. + +1998-03-22 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-image.el (mime-preview-condition): Set 'with-filter in + body-presentation-method for body-filter. + + * mime-view.el (mime-view-display-entity): Call body-filter only + when body-presentation-method is 'with-filter. + +1998-03-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-display-entity): Modify to omit check + for body-presentation-method. + +1998-03-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * NEWS: Modify about `mime-preview-condition'. + +1998-03-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-image.el: Set up for `mime-preview-condition' instead of + `mime-view-body-visible-condition' and + `mime-view-content-filter-alist'. + + * mime-view.el (mime-preview-condition): New variable. + (mime-view-body-visible-p): Use `mime-preview-condition' instead + of `mime-view-body-visible-condition'; abolish variable + `mime-view-body-visible-condition'. + (mime-view-insert-message/partial-button): Add argument + `situation'. + (mime-view-display-entity): Use `mime-preview-condition' instead + of `mime-view-content-filter-alist'; don't hard-coding for + `message/partial-button'; abolish variable + `mime-view-content-filter-alist'. + +1998-03-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el: Require 'mime-text when compiling. + +1998-03-21 Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> + + * eword-decode.el (eword-lexical-analyze-internal): Fixed return + value. + + * mime-view.el (mime-view-body-visible-condition): text media- + type is always visible. + + +1998-03-20 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.1.1 (Oshino) was released. + + * mime-play.el (mime-method-to-save): Must treat nil encoding as + 7bit. + +1998-03-20 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * NEWS: Update for latest version. + +1998-03-20 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-CFG: Must set up load-path before version check codes. + +1998-03-20 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: Don't require mime-text.el; add autoload setting + for mime-text.el. + (mime-text-decoder-alist): moved from mime-text.el. + (mime-view-entity-separator-visible-p): New function. + Abolish `mime-view-display-header', `mime-view-display-body' and + `mime-view-entity-separator-function'. + + * mime-text.el: Require mime-view (mime-text.el is autoloaded by + mime-view); variable `mime-text-decoder-alist' was moved to + mime-view.el. + + * mime-play.el (mime-method-to-save): fixed. + +1998-03-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * NEWS: New file. + + +1998-03-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.1.0 (Nonoichi) was released. + +1998-03-15 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el (mime-method-to-verify-application/pgp-signature): + Abolish unused local-variable `raw-buf'. + + * mime-play.el (mime-raw-play-entity): fixed. + + * mime-view.el (mime-preview-original-window-configuration): Use + `defvar' to avoid warning of byte-compiler. + + * mime-view.el (mime-view-display-entity): Don't use + `mime-view-entity-button-function' (abolish it); use + `mime-root-entity-p'. + +1998-03-15 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-entity-button-visible-p): New function. + (mime-view-entity-button-function): Use function + `mime-view-entity-button-visible-p'. + + * mime-view.el (mime-raw-entity-parent): New function. + (mime-view-entity-button-function): Use `mime-raw-entity-parent'. + + * mime-view.el (mime-view-entity-button-function): Use + `mime-root-entity-p'. + + * mime-parse.el (mime-root-entity-p): New function. + +1998-03-15 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-CFG: Insert version check code. + +1998-03-15 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-image.el: Set up `mime-view-body-visible-condition' instead + of `mime-view-visible-media-type-list'. + + * mime-view.el (mime-view-body-visible-condition): New variable. + (mime-view-body-visible-p): Use `mime-view-body-visible-condition' + instead of `mime-view-visible-media-type-list'. + Abolish `mime-view-visible-media-type-list'. + + * mime-parse.el (mime-type/subtype-string): New function. + (mime-entity-type/subtype): Use `mime-type/subtype-string'. + +1998-03-14 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el (mime-method-to-verify-application/pgp-signature): + Use `mime-raw-write-region'. + + * mime-view.el (mime-raw-buffer-coding-system-alist): Move setting + for mh-show-mode. + + * mime-play.el, mime-view.el: Rename + `mime-raw-coding-system-alist' -> + `mime-raw-buffer-coding-system-alist'. + + * mime-view.el, mime-play.el: Move `mime-raw-coding-system-alist' + from mime-play.el to mime-view.el. + +1998-03-14 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-raw-point-to-entity-node-id): Use + `mime-raw-find-entity-from-point'. + (mime-raw-point-to-entity-number): Likewise. + + * mime-view.el (mime-raw-find-entity-from-point): New function. + +1998-03-14 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-display-body): Change interface. + +1998-03-14 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el, mime-view.el: Rename `mime-view-entity-info' -> + `mime-view-entity'. + + * mime-view.el: Rename `mime-raw-entity-number-to-entity-info' -> + `mime-raw-find-entity-from-number'. + + * mime-pgp.el, mime-view.el: Rename + `mime-raw-entity-node-id-to-entity-info' -> + `mime-raw-find-entity-from-node-id'. + + * mime-pgp.el, mime-partial.el, mime-play.el, mime-view.el, + mime-parse.el: Rename `mime-entity-info' -> `mime-entity'. + +1998-03-14 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-header-visible-p): Change interface. + (mime-view-body-visible-p): Change interface. + + * mime-view.el (mime-view-insert-entity-button): Change interface. + (mime-view-entity-button-function): Change interface. + + * mime-view.el (mime-view-body-visible-p): Add DOC-string. + + * mime-view.el: `rcnum' -> `entity-node-id'. + +1998-03-14 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el (mime-method-to-verify-application/pgp-signature): + Don't use temporary buffer for signed entity. + + * mime-pgp.el (mime-method-to-verify-application/pgp-signature): + Don't use temporary buffer for PGP-signature. + +1998-03-14 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el (mime-method-to-verify-application/pgp-signature): + Use `write-region-as-binary'. + + * mime-pgp.el (mime-method-to-verify-application/pgp-signature): + Use `mime-write-decoded-region'. + + * mime-pgp.el: Rename `rmcnum' -> `mother-node-id'. + +1998-03-14 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el (mime-method-to-decrypt-application/pgp-encrypted): + Use `mime-raw-point-to-entity-node-id'; abolish `entity-number'. + + * (mime-method-to-verify-application/pgp-signature): Use + `mime-raw-point-to-entity-node-id'; abolish `entity-number'. + + * mime-pgp.el (mime-method-to-verify-multipart/signed): Use + `mime-raw-point-to-entity-node-id'. + + * mime-view.el (mime-raw-point-to-entity-node-id): New function. + + * mime-view.el, mime-pgp.el: Rename `reversed-entity-number' -> + `entity-node-id'. + + * mime-view.el, mime-parse.el: Rename `reversed-number' -> + `node-id'. + + * mime-pgp.el: `rcnum' -> `reversed-entity-number'. + + * mime-pgp.el: `cnum' -> `entity-number'. + + * mime-pgp.el: `beg' -> `start'. + +1998-03-13 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mailcap.el (mailcap-look-at-field): Change field-name to symbol. + +1998-03-13 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mailcap.el (mailcap-look-at-type-field): Must allow + "implicit-wild". + (mailcap-look-at-field): fixed. + +1998-03-13 Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> + + * README.en (Bug reports): Modify description of tm mailing list. + +1998-03-13 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el, mime-play.el: Rename + `mime-view-quitting-method-for-mime-show-message-mode' -> + `mime-preview-quitting-method-for-mime-show-message-mode'. + + * mime-play.el, mime-edit.el, mime-view.el: Rename + `mime-view-quitting-method-alist' -> + `mime-preview-quitting-method-alist'. + +1998-03-13 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el: Rename `mime-article::write-region' -> + `mime-raw-write-region'. + +1998-03-13 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el, mime-play.el: Rename `mime-playback-entity' -> + `mime-raw-play-entity'. + + * mime-play.el, mime-view.el: Rename `mime-view-cinfo' -> + `mime-view-entity-info'. + + * mime-view.el, mime-parse.el: Rename `mime-entity-info-rnum' -> + `mime-entity-info-reversed-number'. + + * mime-view.el: Rename `mime/flatten-content-info' -> + `mime-raw-flatten-message-info'. + + * mime-pgp.el, mime-view.el: Rename `mime-raw-rcnum-to-cinfo' -> + `mime-raw-reversed-entity-number-to-entity-info'. + + * mime-view.el: Rename `mime-raw-cnum-to-cinfo' -> + `mime-raw-entity-number-to-entity-info'. + + * mime-pgp.el, mime-partial.el, mime-view.el: Rename + `mime-raw-entity-info' -> `mime-raw-message-info'. + + * mime-play.el, mime-pgp.el, mime-view.el: Rename + `mime-raw-point-content-number' -> + `mime-raw-point-to-entity-number'. + +1998-03-13 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el, mime-pgp.el, mime-view.el: Rename ` mime-article/' + -> `mime-raw-'. + + * mime-view.el: Rename `mime-view-get-original-major-mode' -> + `mime-preview-original-major-mode'. + + * mime-view.el: Rename `mime-view-display-x-face' -> + `mime-preview-display-x-face'. + + * mime-play.el, mime-pgp.el, mime-bbdb.el, mime-view.el: Rename + `mime-view-buffer' -> `mime-preview-buffer'. + + * mime-play.el, mime-view.el: Rename `mime::preview/' -> + `mime-preview-'. + + * mime-view.el: Rename `mime-view-original-major-mode' -> + `mime-preview-original-major-mode'. + + * mime-play.el, mime-edit.el, mime-view.el: Rename + `mime-view-kill-buffer' -> `mime-preview-kill-buffer'. + + * mime-view.el: Rename `mime-view-show-summary' -> + `mime-preview-show-summary'. + + * mime-view.el: Rename `mime-view-quit' -> `mime-preview-quit'. + + * mime-view.el: Rename `mime-view-follow-current-entity' -> + `mime-preview-follow-current-entity'. + + * mime-view.el: Rename `mime-view-print-current-entity' -> + `mime-preview-print-current-entity'. + + * mime-view.el (mime-view-menu-list): Modify menu. + + * mime-view.el: Rename `mime-view-extract-current-entity' -> + `mime-preview-extract-current-entity'. + + * mime-def.el, mime-play.el, mime-view.el: Rename + `mime-view-play-current-entity' -> + `mime-preview-play-current-entity'. + + * mime-view.el: Rename `mime-view-previous-line-content' -> + `mime-preview-previous-line-entity'. + + * mime-view.el: Rename `mime-view-next-line-content' -> + `mime-preview-next-line-entity'. + + * mime-view.el: Rename `mime-view-scroll-' -> + `mime-preview-scroll-'. + + * mime-view.el: Rename `mime-view-move-to-' -> + `mime-preview-move-to-'. + + * mime-play.el, mime-image.el: Rename `mime-preview/' -> + `mime-preview-'. + +1998-03-13 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-partial.el (mime-method-to-combine-message/partial-pieces): + Rename `mime-raw-content-info' -> `mime-raw-entity-info'. + + * mime-pgp.el, mime-view.el: Rename `mime-raw-content-info' -> + `mime-raw-entity-info'. + +1998-03-13 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-raw-content-info): Modify DOC-string. + +1998-03-13 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-encode.el: Abolish `eword-encode-RCS-ID'. + +1998-03-12 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-partial.el: Rename + `mime-combine-message/partials-automatically' -> + `mime-method-to-combine-message/partial-pieces'. + +1998-03-12 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el (mime-acting-condition): Separate type and subtype. + + * mime-view.el (mime-acting-condition): Separate type and subtype. + + * mime-play.el (mime-playback-entity): Separate type and subtype. + + +1998-03-13 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.0.2 (Nonoichi-K-Ddaimae)-A was released. + +1998-03-12 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el: Rename `mime-pgp-add-keys' -> + `mime-method-to-add-application/pgp-keys'. + + * mime-pgp.el: Rename `mime-pgp-decrypt-application/pgp-encrypted' + -> `mime-method-to-decrypt-application/pgp-encrypted'. + + * mime-pgp.el: Rename `mime-pgp-check-application/pgp-signature' + -> `mime-method-to-verify-application/pgp-signature'. + + * mime-pgp.el: Rename `mime-check-multipart/signed' -> + `mime-method-to-verify-multipart/signed'. + + * mime-pgp.el: Rename `mime-process-application/pgp' -> + `mime-method-for-application/pgp'. + +1998-03-12 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mailcap.el (mailcap-look-at-type-field): Change type and subtype + to symbol. + + * mailcap.el (mailcap-file): New variable. + (mailcap-parse-file): New function. + +1998-03-12 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * README.en (What's SEMI?): Remove what does SEMI stand for. + +1998-03-12 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-acting-condition): Use `mime-method-to-save' + instead of external method "tm-file". + + * mime-play.el: Rename `mime-extract-current-entity' -> + `mime-method-to-save'. + +1998-03-12 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-ELS (semi-modules-to-compile): Abolish mime-file.el. + + * mime-play.el (mime-extract-current-entity): New function; copied + from mime-file.el; abolish mime-file.el. + + * mime-view.el (mime-acting-condition), mime-partial.el + (mime-combine-message/partials-automatically), mime-play.el: + Rename `mime-display-message/partial' -> + `mime-method-to-store-message/partial'. + +1998-03-12 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-acting-condition), mime-play.el: Rename + `mime-display-caesar' -> `mime-method-to-display-caesar'. + + * mime-view.el (mime-acting-condition), mime-play.el: Rename + `mime-display-message/external-ftp' -> + `mime-method-to-display-message/external-ftp'. + + * mime-view.el (mime-acting-condition), mime-play.el: Rename + `mime-display-message/rfc822' -> + `mime-method-to-display-message/rfc822'. + + * mime-play.el: Rename `mime-article/make-method-args' -> + `mime-make-external-method-args'. + + * mime-file.el: Fix setting. + +1998-03-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el: Rename `mime-article/start-external-method-region' + -> `mime-activate-external-method'. + + * mime-play.el, mime-pgp.el: Rename `mime-display-content' -> + `mime-playback-entity'. + + * mime-file.el (mime-extract-current-entity): Use + `mime-write-decoded-region'. + + * mime-file.el: Rename `mime-article/extract-file' -> + `mime-extract-current-entity'. + +1998-03-03 Franois Pinard <pinard@iro.umontreal.ca> + + * mime-edit.el (mime-edit-insert-signature): Function + `mime-edit-insert-tag' is sometimes called with more arguments + than it is ready to accept. (cf. [tm-en:1585]) + +1998-03-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-insert-text): New optional argument + `subtype'. + + +1998-02-28 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.0.1 (Magae) was released. + +1998-02-27 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el (mime-check-multipart/signed): New function. + +1998-02-26 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-decode.el (eword-decode-and-fold-structured-field): Fixed. + + * mime-edit.el (mime-file-types): Use `defcustom'. + + +1998-02-25 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 1.0.0 (Nukaj-Dtaku-mae)-A was released. + + * SEMI-ELS: Remove mime-tar.el. + +1998-02-25 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-decode.el (eword-decode-version): Use `semi-version'; + abolish `eword-decode-RCS-ID'. + + * mime-view.el (mime-view-version-string): Use `semi-version'; + abolish `mime-view-version' and `mime-view-RCS-ID'. + + * mime-edit.el (mime-edit-version-string): Use `semi-version'; + abolish `mime-edit-version' and `mime-edit-RCS-ID'. + + * mime-def.el (semi-version): New constant; abolish constant + `semi-version-name'. + + * mime-view.el: Rename `mime-view-version-name' -> + `mime-view-version-string'. + + * mime-edit.el: Rename `mime-edit-version-name' -> + `mime-edit-version-string'. + + * eword-decode.el (eword-lexical-analyzers): New variable. + (eword-analyze-quoted-string): Add second argument. + (eword-analyze-domain-literal): New function. + (eword-analyze-spaces): New function. + (eword-analyze-special): New function. + (eword-analyze-atom): Add second argument. + (eword-lexical-analyze-internal): Use `eword-lexical-analyzers'. + + +1998-02-17 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 0.118.2 (Otomaru) was released. + + * eword-decode.el (eword-decode-and-unfold-structured-field): New + function. + + * eword-decode.el (eword-decode-and-fold-structured-field): New + function. + (eword-decode-structured-field-body): Use it. + (eword-decode-header): Likewise. + + * eword-decode.el (eword-decode-structured-field-body): If + `START-COLUMN' is nil, it uses `mapconcat'. + + * eword-decode.el (eword-decode-token): New function. + (eword-decode-structured-field-body): Add new optional arguments + `START-COLUMN' and `MAX-COLUMN'; fill results; use function + `eword-decode-token'. + (eword-decode-header): Specify START-COLUMN for + `eword-decode-structured-field-body'. + +1998-02-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-decode.el (eword-decode-header): Unfold fields including + encoded-words. + + * eword-decode.el (eword-decode-ignored-field-list): New variable. + (eword-decode-structured-field-list): New variable. + (eword-decode-header): Refer them. + + * eword-decode.el (eword-decode-header): Don't use + `eword-decode-unstructured-field-body'. + +1998-02-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-decode.el (eword-decode-header): New implementation; add + new argument `CODE-CONVERSION' as first argument. Change + `SEPARATOR' as second argument. + + +1998-02-12 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 0.118.1 (Shijima) was released. + + * README.en (Bug reports): Modified for SEMI. + +1998-02-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-normalize-body): Must not ignore case to + search "From " in beginning of line. + +1998-01-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-image.el: Comment out setting for inline Postscript + feature. + +1998-01-11 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-decode.el (eword-analyze-atom): New function. + (eword-lexical-analyze-internal): Use `eword-analyze-atom' instead + of `std11-analyze-atom'. + +1997-11-26 Thierry Emery <Thierry.Emery@aar.alcatel-alsthom.fr> + + * mime-edit.el (mime-edit-insert-text): Fix to avoid unexpected + entering enriched-mode. (cf. [tm-ja:2697]) + + +1997-11-26 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 0.118 (Sodani) was released. + +1997-11-24 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-maybe-hide-echo-buffer): bury MIME echo + buffer. + +1997-11-23 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-maybe-hide-echo-buffer): New inline function; + abolish `mime-hide-echo-buffer'. + (mime-view-mode): Use `mime-maybe-hide-echo-buffer'. + +1997-11-20 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el: Rename `mime-article/add-pgp-keys' -> + `mime-pgp-add-keys'. + + * mime-pgp.el: Rename `mime-article/decrypt-pgp' -> + `mime-pgp-decrypt-application/pgp-encrypted'. + + * mime-pgp.el: Rename `mime-article/check-pgp-signature' -> + `mime-pgp-check-application/pgp-signature'. + + * mime-pgp.el: Rename `mime::article/call-pgp-to-check-signature' + -> `mime-pgp-check-signature'. + + * mime-pgp.el: Rename `mime-article/view-application/pgp' -> + `mime-process-application/pgp'. + + +1997-11-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 0.116 (D-Dhji)-A was released. + +1997-11-15 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el, mime-pgp.el, mime-partial.el: Rename + `mime::article/content-info' -> `mime-raw-content-info'. + +1997-11-11 Franois Pinard <pinard@iro.umontreal.ca> + + * mime-edit.el: Modify space in prompt and removespurious trailing + spaces in the files. (cf. [tm-en:1507]) + +1997-11-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el: Rename `mime-edit-enclose-region' -> + `mime-edit-enclose-region-internal'. + + * mime-edit.el (mime-edit-enclose-quote-region, + mime-edit-enclose-mixed-region, mime-edit-enclose-parallel-region, + mime-edit-enclose-digest-region, + mime-edit-enclose-alternative-region, + mime-edit-enclose-signed-region, + mime-edit-enclose-encrypted-region): Change subtype to symbol. + +1997-11-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-bbdb.el, semi-setup.el: Use path-util.el instead of + file-detect.el. + +1997-11-05 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-def.el: Add group `mime' to `default-mime-charset'. + +1997-11-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-encode.el (eword-encode-field): Must regard MIME-Version + field as structured field. + + +1997-11-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 0.115.2 (Inokuchi) was released. + +1997-11-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-split-message): Use `defcustom'. + (mime-edit-message-default-max-lines): Use `defcustom'. + (mime-edit-message-max-lines-alist): Use `defcustom'. + +1997-11-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * Makefile: Abolish `execs' and `install-execs'. + +1997-11-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit): New customize group. + (mime-ignore-preceding-spaces): Use `defcustom'. + (mime-ignore-trailing-spaces): Use `defcustom'. + (mime-ignore-same-text-tag): Use `defcustom'. + (mime-auto-hide-body): Use `defcustom'. + (mime-edit-voice-recorder): Use `defcustom'. + (mime-edit-mode-hook): Use `defcustom'. + (mime-edit-translate-hook): Use `defcustom'. + (mime-edit-exit-hook): Use `defcustom'. + + * mime-def.el (mime): New customize group. + (mime-button-face): Use `defcustom'. + (mime-button-mouse-face): Use `defcustom'. + +1997-11-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-x-emacs-value): Don't add mule-version + if enable-multibyte-characters is nil. + +1997-10-31 Kazuhiro Ohta <ohta@ele.cst.nihon-u.ac.jp> + + * mime-play.el (mime-article::write-region): fixed + (cf. [tm-ja:2641]). + +1997-10-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * semi-setup.el (mime-setup-set-signature-key): Check local keymap + is exist or not to fix problem about + `gnus-summary-resend-message'. + + +1997-10-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 0.115.1 (Oyanagi) was released. + +1997-10-03 Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> + + * mime-play.el (mime-display-message/partial): Use `write-region'. + + * mime-pgp.el (mime-article/check-pgp-signature): Use + `write-region'. + + * mime-file.el (mime-article/extract-file): Use `write-region'. + +1997-10-02 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-def.el: Don't use `third' (don't use cl function). + + * SEMI-CFG: Add current directory to load-path. + + * mime-def.el, mime-edit.el (mime-edit-insert-text): Rename + `second' -> `cadr' (Don't use cl function). + + +1997-09-28 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 0.115 (Hinomiko) was released. + + * README.en: Modify for Emacs 20.2. + +1997-09-25 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-def.el (butlast, nbutlast): Don't use `defun-maybe' for cl + functions. + +1997-09-25 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-def.el (butlast): New function; imported from cl.el. + (nbutlast): New function; imported from cl.el. + +1997-09-25 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-cut-header): Don't use `member-if'. + + * mime-def.el: Don't require cl. + + * eword-encode.el: Abolish variable `eword-generate-X-Nsubject'. + (eword-encode-header): Abolish X-Nsubject field generator. + + * eword-encode.el (eword-find-field-encoding-method): New inline + function. + (eword-encode-header): Use it. + +1997-09-25 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-image.el: Use `exec-installed-p' to search + `uncompface-program'. + +1997-09-24 Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> + + * signature.el: Add doc-string to `signature-file-alist'. + + * mime-bbdb.el: Remove Artur Pioro from the authors list; Recent + versions don't contain his code. + +1997-09-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: Don't use cl. + (mime-article/rcnum-to-cinfo): New implementation (use function + `mime-article/cnum-to-cinfo'); use `defsubst'. + +1997-09-18 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-x-emacs-value): Use `(featurep + 'xemacs)'; add DOC-string. + +1997-09-17 Hisashi Miyashita <himi@bird.scphys.kyoto-u.ac.jp> + + * mime-edit.el (mime-edit-x-emacs-value): Add `(Meadow-version)' + when running Meadow. (cf. [tm-ja:2567], [mule-win32:4339]) + +1997-09-15 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-mime-version-field-for-message/partial): + New constant. + (mime-edit-insert-partial-header): Use it. + + +1997-09-09 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 0.112 (Tsurugi) was released. + +1997-09-05 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-insert-entity-button): Change interface + to use `media-type' and `media-subtype' instead of `ctype'. + (mime-view-entity-button-function): ditto. + +1997-09-05 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-body-visible-p): Change interface to use + `media-type' and `media-subtype' instead of `ctype'. + (mime-view-entity-separator-function): ditto. + +1997-09-05 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-display-entity): Use `media-type' and + `media-subtype' instead of `ctype' to compare with + message/partial. + + * mime-view.el (mime-view-follow-current-entity, + mime-view-display-entity, mime-view-entity-button-function): Use + `mime-entity-info-media-type' and `mime-entity-info-media-subtype' + instead of `mime-entity-info-type/subtype'. + +1997-09-05 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el: Abolish macro `define-structure'. + + (make-mime-entity-info, mime-entity-info-rnum, + mime-entity-info-point-min, mime-entity-info-point-max, + mime-entity-info-parameters, mime-entity-info-encoding, + mime-entity-info-children): New implementation. + + (mime-entity-info-media-type, mime-entity-info-media-subtype): New + inline function. + + * mime-view.el (mime-view-display-entity, + mime-article/point-content-number, mime-article/cnum-to-cinfo, + mime/flatten-content-info): Use `mime-entity-info-children' + instead of `mime::content-info/children'. + + * mime-parse.el (mime-entity-info-children): New inline function. + +1997-09-05 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-body-visible-p, + mime-view-display-entity): Use `mime-entity-info-encoding' instead + of `mime::content-info/encoding'. + + * mime-play.el (mime-display-content): Use + `mime-entity-info-encoding' instead of + `mime::content-info/encoding'. + + * mime-parse.el (mime-entity-info-encoding): New inline function. + +1997-09-05 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-display-entity), mime-partial.el + (mime-combine-message/partials-automatically), mime-play.el + (mime-display-content): Use `mime-entity-info-parameters' instead + of `mime::content-info/parameters'. + + * mime-parse.el (mime-entity-info-parameters): New inline + function. + +1997-09-05 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-header-visible-p, + mime-view-body-visible-p, mime-view-entity-button-function, + mime-view-display-entity, mime-view-follow-current-entity), + mime-play.el (mime-display-content): Use + `mime-entity-info-type/subtype' instead of + `mime::content-info/type'. + + * mime-parse.el (mime-entity-info-type/subtype): New inline + function. + +1997-09-05 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-display-entity, + mime-article/rcnum-to-cinfo, mime-view-follow-current-entity, + mime-view-move-to-upper): Use `mime::content-info/rcnum' instead + of `mime-entity-info-rnum'. + + * mime-parse.el (mime-entity-info-rnum): New inline function. + +1997-09-05 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-display-entity, + mime-article/point-content-number, + mime-view-follow-current-entity), mime-play.el + (mime-display-content), mime-pgp.el + (mime-article/check-pgp-signature, mime-article/decrypt-pgp): Use + `mime-entity-info-point-{min|max}' instead of + `mime::content-info/point-{min|max}'. + + * mime-parse.el (mime-entity-info-point-min): New inline function. + (mime-entity-info-point-max): New inline function. + (mime-parse-multipart): Use `mime-entity-info-point-max' instead + of `mime::content-info/point-max'. + +1997-09-05 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mailcap.el (mailcap-skip-comment): Check `chr' is nil. + + * mime-edit.el (mime-edit-decode-buffer): Modify for new return + format of `mime-parse-Content-Type'. + + * mime-parse.el (mime-parse-Content-Type): Change return format. + (mime-read-Content-Type): Modify DOC-string. + (make-mime-entity-info): New inline function. + (mime-parse-multipart): Change interface. + (mime-parse-message): Rename names of arguments. + + * mime-def.el (mime-tspecials): Remove `.' and control-characters. + (mime-token-regexp): Add specification for control-characters. + +1997-09-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-cut-header): Use `defun' instead of + `defsubst'. + + * mime-view.el: Rename `mime-preview/display-body' -> + `mime-view-display-body'. + + * mime-view.el: Rename `mime-preview/display-header' -> + `mime-view-display-header'. + +1997-09-03 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el, mime-edit.el: Rename `mime/Content-Type' -> + `mime-read-Content-Type'. + + * mime-parse.el (symbol-concat): New implementation. + +1997-08-30 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-def.el: Abolish alias `last*'. + + * eword-decode.el (eword-lexical-analyze): `last' of Emacs 20.0.97 + allows two arguments. + +1997-08-25 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-decode.el (eword-lexical-analyze): Use `last*' instead of + `last' (for Emacs 20.0.96). + + * mime-def.el (last*): New alias for old emacsen. + +1997-07-26 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el, mime-def.el: Constant + `mime-disposition-type-regexp' was moved from mime-def.el to + mime-parse.el. + + +1997-07-25 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 0.97 (Naka-Tsurugi) was released. + +1997-07-24 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el: Delete unnecessary "[mime-edit.el]" from + DOC-strings. + +1997-07-23 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-decode.el (eword-analyze-encoded-word): cdr of return + value must not nil (cf.[tm-ja:2496]) + +1997-07-14 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el, mime-play.el: `mime-article/view-message/rfc822' + -> `mime-display-message/rfc822'. + +1997-07-13 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-encode.el (eword-phrase-route-addr-to-rwl): Use function + `eword-addr-seq-to-rwl'. + + * eword-encode.el: `tm-eword::phrase-route-addr-to-rwl' -> + `eword-phrase-route-addr-to-rwl'. + + * eword-encode.el (eword-addr-seq-to-rwl): New function. + (eword-addr-spec-to-rwl): Use function `eword-addr-seq-to-rwl'. + + * eword-encode.el (eword-addr-spec-to-rwl): New implementation. + + * eword-encode.el: `tm-eword::addr-spec-to-rwl' -> + `eword-addr-spec-to-rwl'. + +1997-07-07 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el: Constant `mime::ctype-regexp' was abolished. + + * mime-parse.el: Constant `mime::dtype-regexp' was abolished. + + * mime-parse.el, mime-def.el: `mime/disposition-type-regexp' -> + `mime-disposition-type-regexp'. + + +1997-07-07 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 0.96 (Kaga-Ichinomiya) was released. + +1997-07-05 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el: (mime-edit-normalize-body): + - Protect "From " in beginning of line (insert `ESC ( B' before it + if possible, otherwise encode by quoted-printable) + - canonicalize line break code for base64 + +1997-07-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * signature.el (signature-separator): New variable. + (insert-signature): Insert `signature-separator' when signature is + inserted at end of file. + +1997-07-03 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-version-name): Add `semi-version-name'. + + * mime-view.el (mime-view-version-name): New constant. + + * mime-def.el (semi-version-name): New constant. + +1997-07-02 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * README.en (Required environment): Updated. + +1997-07-02 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el, mime-def.el: `mime/content-type-subtype-regexp' + -> `mime-media-type/subtype-regexp'. + +1997-07-02 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el, mime-def.el, mailcap.el: `mime/token-regexp' -> + `mime-token-regexp'. + + * mime-def.el: `mime/tspecials' -> `mime-tspecials'. + +1997-07-02 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el, mime-pgp.el, mime-def.el: `mime/temp-buffer-name' + -> `mime-temp-buffer-name'. + +1997-07-02 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-text.el (mime-decode-text-body): Canonicalize line break + code. + +1997-06-27 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mailcap.el: New file. + +1997-06-26 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-encode.el (eword-field-encoding-method-alist): Add + "Message-ID" as ignored. + +1997-06-26 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-encode.el (tm-eword::encode-string-1): avoid infinite loop + caused by long non-encoded-word element. (cf. [tm-en:1356]) + +1997-06-24 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: `mime-preview/display-message/partial' -> + `mime-view-insert-message/partial-button'. + + * mime-view.el (mime-preview/display-message/partial): Use + `mime-add-button' again. + +1997-06-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-encode.el: `tm-eword::lc-words-to-words' -> + `eword-encode-charset-words-to-words'. + + * eword-encode.el (tm-eword::lc-words-to-words): New + implementation; function `tm-eword::parse-word' was abolished. + +1997-06-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-encode.el: `tm-eword::split-to-lc-words' -> + `eword-encode-divide-into-charset-words'. + + * eword-encode.el: Function `tm-eword::parse-lc-word' was + abolished. + (tm-eword::split-to-lc-words): New implementation. + +1997-06-21 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-encode.el: `tm-eword::char-type' -> + `eword-encode-char-type'. + + * eword-encode.el: `tm-eword::encode-encoded-text' -> + `eword-encode-text' + + * mime-view.el (mime-view-insert-entity-button, + mime-preview/display-message/partial): Use `mime-insert-button'. + + (mime-view-setup-buffers): Enclose codes to display preview-buffer + by `(let ((inhibit-read-only t)) ...)'. + + * mime-def.el (mime-insert-button): New inline function. + + * mime-def.el (mime-add-button): Argument `func' was renamed to + `function'; Use overlay for `mime-button-mouse-face'. + + +1997-06-19 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 0.92 was released. + + * mime-view.el, mime-play.el, mime-partial.el: + `mime-article/decode-' -> `mime-display-'. + + * mime-play.el (mime-display-caesar): fixed. + +1997-06-18 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-decode.el (eword-decode-structured-field-body): fixed. + +1997-06-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-decode.el (eword-lexical-analyze-cache): New variable. + (eword-lexical-analyze-cache-max): New variable. + (eword-analyze-quoted-string): New function. + (eword-analyze-comment): New function. + (eword-analyze-encoded-word): New function. + (eword-lexical-analyze-internal): New function. + (eword-lexical-analyze): New function. + (eword-decode-structured-field-body): New function. + (eword-decode-unstructured-field-body): New function. + (eword-extract-address-components): New function. + +1997-06-11 Steven L Baur <steve@xemacs.org> + + * eword-encode.el (tm-eword::char-type, tm-eword::encode-rwl, + tm-eword::encode-rwl): Clean up Ebola + infection. (cf.[tm-en:1346],[xemacs-beta:9333]) + + +1997-05-30 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 0.91 was released. + +Wed May 28 13:16:15 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-define-keymap): fixed problem about + [tab], [delete] and [backspace] keys. + +Tue May 27 03:26:23 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-sign-pgp-elkins): Enclose PGP-processing + by `as-binary-process'. + +1997-05-23 Steven L Baur <steve@altair.xemacs.org> + + * mime-view.el (mime-acting-condition): Add image/png + mime type. (cf.[tm-en:1334]) + + * mime-image.el: Add image/png mime type. (cf.[tm-en:1334]) + + * mime-edit.el (mime-file-types): Add png handling. + (mime-content-types): Ditto. (cf.[tm-en:1334]) + +Fri May 23 22:13:47 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-define-keymap): Doesn't bind + `beginning-of-buffer' and `end-of-buffer' for "<" and ">" keys. + + +1997-05-15 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 0.88 was released. + +Thu May 15 06:05:13 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * Makefile (tar): New implementation. + +Tue May 13 14:32:39 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-MK (config-semi): fixed. + + * SEMI-CFG: Add site-lisp/apel/ even if LISPDIR is specified. + +Tue May 13 14:11:48 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * README.en: Add `LISPDIR'. + + * Makefile (LISPDIR): New variable. + + * SEMI-CFG: Setting for load-path is modified. + +Mon May 12 12:30:42 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-tar.el, mime-play.el, mime-pgp.el, mime-file.el, + mime-view.el: `mime/content-decoding-condition' -> + `mime-acting-condition'. + + +1997-05-09 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 0.87 was released. + +Fri May 9 04:19:21 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-tar.el: `mime-viewer/uuencode-encoding-name-list' -> + `mime-view-uuencode-encoding-name-list'. + +Fri May 9 03:07:02 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el: Use "text/x-rot13-47-48" instead of + "text/x-rot13-47". + + * mime-view.el (mime/content-decoding-condition): Add + "text/x-rot13-47-48". + +Fri May 9 01:26:13 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-normalize-body): Use + `mule-caesar-region' instead of `caesar-region'. + + * mime-play.el (mime-display-caesar): Use `mule-caesar-region' + instead of `caesar-region'. + + * mime-def.el: Add autoload for mule-caesar.el. + + * mime-def.el: Function caesar-region was abolished. + +Thu May 8 23:31:45 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el, mime-edit.el, mime-def.el: `tm:caesar-region' -> + `caesar-region'. + +Thu May 8 22:37:47 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-define-keymap): Use + `set-keymap-default-binding' for XEmacs. + +Wed May 7 10:04:36 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-display-caesar): Don't use + `buffer-substring'. + + * mime-play.el (mime-display-caesar): Use `view-buffer' instead of + `view-mode-enter'. + +Wed May 7 09:37:54 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el: Don't require `view'. + + Constant `mime-view-text/plain-mode-map' was abolished. + + Function `mime-view-text/plain-mode' and + `mime-view-text/plain-exit' were abolished. + + (mime-display-caesar): Use `view-mode-enter mother' instead of + `mime-view-text/plain-mode'. + +Wed May 7 09:33:48 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el, mime-view.el (mime/content-decoding-condition): + `mime-article/decode-caesar' -> `mime-display-caesar'. + +Wed May 7 05:49:03 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-cut-header): fixed. (cf.[tm-ja:2386]) + + +1997-04-30 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI: Version 0.83 was released. + +Sat Apr 5 06:20:34 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-def.el: Overlay is required by emu. + +Thu Apr 3 18:09:35 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-image.el, mime-view.el, mime-text.el: + `mime-preview/filter-' -> `mime-view-filter-'. + + * mime-view.el: `mime-preview/get-original-major-mode' -> + `mime-view-get-original-major-mode'. + +Thu Mar 27 22:16:53 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-mode): Hide mime-echo window. + + * mime-view.el: Function `mime-hide-echo-buffer' was moved from + mime-play.el. + + * mime-play.el: Function `mime-hide-echo-buffer' was moved to + mime-view.el. + + * mime-play.el (mime-hide-echo-buffer): New inline function. + + * mime-play.el (mime-echo-window-height): New variable. + +Thu Mar 27 21:48:32 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-content-end): Abolish unused local + variable `beg'. + +Thu Mar 27 21:45:49 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-follow-current-entity): Abolish unused + local variable `rc'. + +Thu Mar 27 21:42:08 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-encode.el (eword-encode-field): Intern down-cased + field-name and use `memq' instead of `member' to detect a field is + address-list or not. + +Thu Mar 27 21:17:25 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el (mime-article/check-pgp-signature): Use + `insert-buffer-substring'. + +Thu Mar 27 20:59:00 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el (mime-article/check-pgp-signature): + `mime-article/show-output-buffer' -> `mime-show-echo-buffer'. + + * mime-play.el: `mime-article/show-output-buffer' -> + `mime-show-echo-buffer'. + + * mime-play.el: `mime/output-buffer-window-is-shared-with-bbdb' -> + `mime-echo-window-is-shared-with-bbdb'. + +Thu Mar 27 20:47:14 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el: Variable + `mime/output-buffer-window-is-shared-with-bbdb' was moved from + mime-def.el. + + * mime-def.el: Variable + `mime/output-buffer-window-is-shared-with-bbdb' was moved to + mime-play.el. + +Thu Mar 27 20:40:57 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-mode): `mime/output-buffer-name' -> + `mime-echo-buffer-name'. + + * mime-play.el: `mime/output-buffer-name' -> + `mime-echo-buffer-name'. + + * mime-pgp.el (mime-article/check-pgp-signature): + `mime/output-buffer-name' -> `mime-echo-buffer-name'. + + * mime-def.el (mime-echo-buffer-name): Renamed from + `mime/output-buffer-name'. + +Fri Mar 21 17:55:10 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-content-end): Abolish unused local + variable `top'. + + * mime-view.el: Function `mime-view-make-preview-buffer' was + abolished. + + * mime-view.el: `mime-view-setup-buffer' -> + `mime-view-setup-buffers'. + + +1997-03-18 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * MU: Version 0.40.2 was released. + * SEMI: Version 0.75 was released. + +Tue Mar 18 15:28:25 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-edit-translate-single-part-tag): Add + DOC-string. + +Tue Mar 18 15:21:28 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: `mime::preview/original-major-mode' -> + `mime-view-original-major-mode'. + +Tue Mar 18 15:17:48 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el, mime-view.el: `mime::preview/mother-buffer' -> + `mime-mother-buffer'. + +Tue Mar 18 15:12:10 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-text.el, mime-play.el, mime-edit.el, mime-view.el: + `mime::preview/article-buffer' -> `mime-raw-buffer'. + +Tue Mar 18 14:47:23 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-tar.el, mime-play.el, mime-pgp.el, mime-bbdb.el, + mime-view.el: `mime::article/preview-buffer' -> + `mime-view-buffer'. + +Tue Mar 18 14:32:53 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: Structure `mime::preview-content-info' was + abolished. + + (mime-view-setup-buffer): Return only + `mime::article/preview-buffer'. + + (mime-view-make-preview-buffer): Don't generate + preview-content-list; Return only `mime::article/preview-buffer'. + + (mime-view-display-entity): Don't create + `mime::preview-content-info'. + + (mime-view-mode): Don't set for `mime::preview/content-list'. + +Tue Mar 18 13:56:18 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-partial.el (mime-combine-message/partials-automatically): + Don't use preview-content-list. + +Tue Mar 18 13:06:09 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * semi-setup.el: Don't require mime-partial; It is autoloaded. + + * mime-partial.el: `mime-article/grab-message/partials' -> + `mime-combine-message/partials-automatically'. + + * mime-partial.el: `mime-partial/preview-article' -> + `mime-view-partial-message'. + + * mime-partial.el: `mime-partial/preview-article-method-alist' -> + `mime-view-partial-message-method-alist'. + + * mime-play.el + (mime-view-quitting-method-for-mime-show-message-mode): Don't use + preview-content-list. + + * mime-text.el (mime-text-decoder-alist): `mime/show-message-mode' + -> `mime-show-message-mode'. + + * mime-pgp.el (mime-article/view-application/pgp): + `mime/show-message-mode' -> `mime-show-message-mode'. + + * mime-view.el (mime-view-follow-current-entity): New + implementation. + +Tue Mar 18 08:24:07 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: `mime-view-follow-content' -> + `mime-view-follow-current-entity'. + + * mime-view.el (mime-view-mode): Don't use preview-content-list to + move to initial point. + + * mime-view.el: Function `mime-preview/cinfo-to-pcinfo' was + abolished. + + * mime-view.el: Function `mime-preview/point-pcinfo' was + abolished. + + * mime-view.el: Function `mime-preview/point-content-number' was + abolished. + + * mime-play.el (mime-view-play-current-entity): New + implementation. + +Mon Mar 17 17:18:29 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-quit): Use variable + `mime::preview/original-major-mode'. + + * mime-view.el (mime-view-show-summary): Use variable + `mime::preview/original-major-mode'. + + * mime-view.el (mime-view-scroll-down-entity): New implementation. + + * mime-view.el (mime-view-scroll-up-entity): New implementation. + +Mon Mar 17 16:19:30 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: `mime-view-scroll-down-content' -> + `mime-view-scroll-down-entity'. + + * mime-view.el: `mime-view-scroll-up-content' -> + `mime-view-scroll-up-entity'. + + * mime-view.el (mime-view-move-to-next): New implementation. + +Mon Mar 17 16:03:11 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: `mime-view-next-content' -> + `mime-view-move-to-next'. + + * mime-view.el (mime-view-move-to-previous): New implementation. + + * mime-view.el: `mime-view-previous-content' -> + `mime-view-move-to-previous'. + + * mime-view.el: `mime-view-up-content' -> + `mime-view-move-to-upper'. + +Mon Mar 17 15:39:17 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el, mime-play.el: `mime/show-message-mode' -> + `mime-show-message-mode'. + + * mime-view.el (mime-view-up-content): New implementation. + + * mime-view.el: `mime-preview/display-content' -> + `mime-view-display-entity'. + + * mime-view.el (mime-preview/display-content): Put + `mime-view-raw-buffer' and `mime-view-cinfo' as text-property. + + * mime-view.el: Variable `mime-view-visible-field-regexp' was + abolished. + + * mime-view.el: `mime-preview/cut-header' -> + `mime-view-cut-header'. + + * mime-view.el (mime-view-entity-separator-function): New + implementation. + + * mime-view.el: `mime-preview/default-content-separator' -> + `mime-view-entity-separator-function'. + +Mon Mar 17 13:49:27 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-view-header-visible-p): Abolish optional + argument `ctype'. + + * mime-view.el (mime-view-entity-button-function): New + implementation. + + * mime-view.el: Variable + `mime-view-content-button-ignored-ctype-list' was abolished. + + * mime-view.el: `mime-preview/default-content-button-function' -> + `mime-view-entity-button-function'. + + * mime-view.el: Variable `mime-preview/content-button-function' + was abolished. + + * mime-def.el (mime-add-button): New implementation. + + * mime-view.el (mime-view-insert-entity-button): modified. + + * mime-view.el: `mime-preview/insert-content-button' -> + `mime-view-insert-entity-button'. + + * mime-view.el (mime-view-header-visible-p): Don't calculate ctype + is optional argument `ctype' is not nil. + +Mon Mar 17 12:12:01 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: `mime-print-entity' -> + `mime-view-print-current-entity'. + + * mime-view.el: `mime-extract-entity' -> + `mime-view-extract-current-entity'. + + * mime-play.el, mime-view.el: `mime-play-entity' -> + `mime-view-play-current-entity'. + + * mime-view.el (mime-play-entity, mime-extract-entity, + mime-print-entity): Add DOC-string. + + * mime-view.el: `mime-view-print-content' -> `mime-print-entity'. + + * mime-view.el: `mime-view-extract-content' -> + `mime-extract-entity'. + + * mime-play.el: Variable `mime-view-decoding-mode' was abolished. + + * mime-play.el: Variable `mime-view-decoding-mode' was moved from + mime-view.el. + + * mime-view.el: Variable `mime-view-decoding-mode' was moved to + mime-play.el. + +Mon Mar 17 05:09:05 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el: Use `mime-play-entity' instead of + `mime-view-play-content'. + +Mon Mar 17 05:06:33 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el, mime-play.el: `mime-preview/decode-content' -> + `mime-play-entity'. + + * mime-view.el (mime-view-play-content, mime-view-extract-content, + mime-view-print-content): Modify to use optional argument `mode'. + +Mon Mar 17 04:41:21 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el (mime-preview/decode-content, + mime-article/decode-content): Add new optional argument `mode'. + +Sun Mar 16 02:23:31 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-text.el: `mime-charset/maybe-decode-buffer' -> + `mime-text-decode-buffer-maybe'. + + * mime-text.el: `mime-preview/decode-text-buffer' -> + `mime-decode-text-body'. + + * mime-view.el (mime-view-visible-media-type-list): Add + "text/rfc822-headers". + +Sun Mar 16 01:02:03 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-image.el, mime-view.el: + `mime-view-default-showing-Content-Type-list' -> + `mime-view-visible-media-type-list'. + +Sun Mar 16 00:22:03 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el: `mime-raw::text-decoder' -> `mime-text-decoder'. + + * mime-pgp.el (mime-article/view-application/pgp): + `mime-charset/decode-buffer' -> `mime-text-decode-buffer'. + + * mime-text.el: `mime-charset/decode-buffer' -> + `mime-text-decode-buffer'. + +Sat Mar 15 23:59:09 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el (mime-article/view-application/pgp): + `mime-raw::text-decoder' -> `mime-text-decoder'. + + * mime-text.el: `mime-raw::text-decoder' -> `mime-text-decoder'. + +Sat Mar 15 23:53:49 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-text.el: Variable `mime-raw::text-decoder' was moved from + mime-view.el. + + * mime-view.el: Variable `mime-raw::text-decoder' was moved to + mime-text.el. + +Sat Mar 15 22:40:50 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el (mime-article/view-application/pgp): Use + `insert-buffer-substring'. + +Sat Mar 15 22:27:53 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el (mime-article/view-application/pgp): + `mime::article/code-converter' -> `mime-raw::text-decoder'. + + * mime-play.el (mime-article/view-message/rfc822): + `mime::article/code-converter' -> `mime-raw::text-decoder'. + + * mime-text.el (mime-preview/decode-text-buffer): + `mime::article/code-converter' -> `mime-raw::text-decoder'. + + * mime-view.el: `mime::article/code-converter' -> + `mime-raw::text-decoder'. + +Sat Mar 15 21:20:02 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el (mime-article/add-pgp-keys): Abolish unused local + variables `charset' and `mime::article/preview-buffer'. + + * mime-pgp.el (mime-article/add-pgp-keys): Abolish unused local + variable `mode'. + +Sat Mar 15 21:10:43 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-image.el (mime-preview/filter-for-image): Abolish unused + local variable `charset'. + + * mime-pgp.el (mime-article/check-pgp-signature): Abolish unused + local variable `status'. + + * mime-pgp.el: (mime-article/view-application/pgp, + mime-article/add-pgp-keys): Abolish unused local variable + `cur-buf'. + + * mime-image.el (mime-preview/filter-for-image, + mime-preview/filter-for-application/postscript): Abolish unused + local variable `mode'. + +Sat Mar 15 20:56:19 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-text.el + (mime-preview/filter-for-text/richtext, + mime-preview/filter-for-text/enriched): Abolish unused local + variable `mode'. + + * mime-text.el (mime-preview/decode-text-buffer): New + implementation. + + * mime-view.el (mime-view-follow-content): Abolish unused + variables `f', `mid', `subj', `reply-to', `cc', `to', `from', `he' + and `hb'. + + * mime-edit.el (mime-edit-goto-tag): Abolish unused variable + `multipart'. + + * mime-file.el (mime-article/extract-file): Abolish unused local + variable `the-buf'. + + * mime-tar.el: Quote *autoconv*. + +Sat Mar 15 20:29:25 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-partial.el (mime-article/grab-message/partials): Unused + local variable `mother' was abolished. + + * mime-play.el (mime-article/decode-caesar): Unused local variable + `cur-buf' was abolished. + + * mime-play.el (mime-article/decode-message/external-ftp): Unused + local variable `access-type' was abolished; Comment out `mode'. + + * mime-play.el (mime-article/view-message/rfc822): Unused local + variable `cur-buf' was abolished. + + * mime-text.el (mime-preview/filter-for-text/richtext, + mime-preview/filter-for-text/enriched): Unused local variable `m' + was abolished. + + * mime-parse.el (mime-parse-multipart): + Unused local variable `ct' was abolished. + + * eword-encode.el: Require eword-decode. + + * mime-image.el (mime-preview/filter-for-application/postscript): + Unused local variable `m' was abolished. + +Sat Mar 15 19:47:27 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el: (mime-article/view-application/pgp): + `mime-viewer/code-converter-alist' -> `mime-text-decoder-alist'. + + * mime-pgp.el (mime-pgp-command): New variable. + + (mime::article/call-pgp-to-check-signature): Use variable + `mime-pgp-command'. (cf. [tm-en:1259]) + +Sat Mar 15 19:25:25 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-pgp.el: `mime/viewer-mode' -> `mime-view-mode'. + (cf. [tm-en:1259]) + + +1997-03-14 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * emu: Version 7.40.1 was released. + * APEL: Version 3.2 was released. + * bitmap-mule: Version 7.17 was released. + * MU: Version 0.40.1 was released. + * MEL: Version 6.3 was released. + * SEMI: Version 0.72 was released. + +Fri Mar 14 08:48:07 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-ELS (semi-modules-to-compile): Add mail-mime-setup.el. + +Fri Mar 14 08:47:06 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mail-mime-setup.el: New module. + + * mime-setup.el: Only loads MUA specific setup files. + + * semi-setup.el: Setting for mime-edit, signature and mu-cite were + moved from mime-setup.el. + + * semi-setup.el: Setting for gnus-mime was moved to + gnus-mime/gnus-mime-setup.el. + + * semi-setup.el: Setting for mh-e was moved to emh/emh-setup.el. + + * Makefile: modified for SEMI package. + +Fri Mar 14 07:42:44 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-MK: Don't compile and install other packages. + +Fri Mar 14 06:09:23 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el: Definition of `mime-edit-mode' must be previous to + `add-minor-mode'. + + * mime-image.el (mime-preview/filter-for-image): Don't use + `assoc-value'. + +Fri Mar 14 04:49:04 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el: Variable `mime-edit-prefix' and `mime-edit-map' + were abolished; Use `mime-edit-mode-map' directly. + + Use "C-c C-m" for enclosure commands. + + Add new binding "C-c C-x s" for `mime-edit-set-sign', "C-c C-x e" + for `mime-edit-set-encrypt'. + +Fri Mar 14 04:41:27 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * semi-setup.el: Require file-detect. + +Wed Mar 12 07:49:41 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-CFG: Delete variables about other packages. + +Mon Mar 10 15:16:26 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-def.el: Variable `mime-temp-directory' was moved to + mel/mel.el. + +1997-03-10 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-ELS (semi-modules-to-compile): Delete `mime-ftp'. + + * mime-view.el (mime/content-decoding-condition): Set up for + `mime-article/decode-message/external-ftp'. + + * semi-setup.el: tm-latex.el was abolished. + + * semi-setup.el: tm-ftp is merged to mime-play.el. + + * mime-play.el (mime-article/dired-function): New variable; copied + from tm-ftp.el. + + (mime-article/dired-function-for-one-frame, + mime-article/decode-message/external-ftp): New function; copied + from tm-ftp.el. + +1997-03-07 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-partial.el (mime-article/grab-message/partials): Don't use + `assoc-value'. + +1997-03-07 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-play.el: Require filename. + +1997-03-07 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-setup.el: Don't check `(boundp 'epoch::version)'. + + * mime-setup.el: Use `turn-on-mime-edit' instead of + `mime-edit-mode'. + + * mime-edit.el (mime-edit-decode-buffer): Renamed from + `mime-editor::edit-again'; optional argument `code-conversion' was + changed to `not-decode-text' (behavior was reversed). + (mime-edit-again): modified for `mime-edit-decode-buffer'. + + * mime-edit.el (mime-edit-again-ignored-field-regexp): New + variable. + + * mime-edit.el (mime-edit-again): optional argument + `code-conversion' was changed to `not-decode-text' (behavior was + reversed); optional argument `no-mode' was renamed to + `not-turn-on'; `mail-header-separator' was replaced to null line + before converting. + +1997-03-07 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el: `mime-edit-mode' -> `turn-on-mime-edit'; + `mime-edit-toggle-mode' -> `mime-edit-mode'. + + Alias `mime-mode' was abolished. + +1997-03-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-encode.el (eword-encode-header): fixed. + + * mime-edit.el: Comments was modified. + (mime-edit-mode): DOC-string was modified. + + * mime-edit.el: Function `mime-edit-define-menu-for-emacs19' was + abolished. Buffer local variable `mime-edit-mode-old-local-map' + was abolished. + + * mime-edit.el: `mime-edit-minor-mime-map' -> + `mime-edit-mode-map'. + + * mime-edit.el: `mime-edit-mime-map' -> `mime-edit-map'. + + * mime-edit.el: Function `mime-edit-define-keymap' was abolished. + +1997-03-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el: `mime-prefix' -> `mime-edit-prefix'. + +1997-03-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * semi-setup.el: tm-pgp.el was already renamed to mime-pgp.el. + +1997-03-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-def.el (pgp-function-alist): `tm:mc-' -> `mime-mc-'. + +1997-03-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-def.el (mime-temp-directory): Refer environment variable + "MIME_TMP_DIR" as default value. + +1997-03-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-ELS (semi-modules-to-compile): tm-latex.el and tm-html.el + were abolished. + + * mime-tar.el (mime-decode-message/tar), mime-play.el, mime-pgp.el + (mime-article/check-pgp-signature), mime-partial.el + (mime-article/grab-message/partials), mime-image.el, mime-edit.el + (mime-edit-split-and-send), mime-def.el: Variable `mime/tmp-dir' + was renamed to `mime-temp-directory'. + + * mime-edit.el: `mime/edit-again' was renamed to + `mime-edit-again'. + +1997-03-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-text.el, mime-edit.el: `mime/temporary-message-mode' was + renamed to `mime-temp-message-mode'. + + * mime-edit.el: Draft preview feature was abolished. + + * mime-edit.el (mime-transfer-level-string): Fixed DOC-string. + + Buffer local variable `mime/editing-buffer' was renamed to + `mime-edit-buffer'. + + * mime-edit.el (mime-edit-insert-x-emacs-field): New variable. + (mime-edit-x-emacs-value): New variable. + (mime-edit-translate-body): Insert X-Emacs field if variable + `mime-edit-insert-x-emacs-field' is not nil. + +1997-03-03 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-view.el (mime-preview/insert-content-button): Don't use + function `assoc-value'. + +1997-03-03 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-bbdb.el: `mime-bbdb-' -> `mime-bbdb/'. + +1997-03-03 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-MK: compile and install emu and apel. + +1997-03-03 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-ELS: tm-bbdb.el was renamed to mime-bbdb.el. + + * mime-bbdb.el: Renamed from tm-bbdb.el. + + * SEMI-CFG (EMU_PREFIX, EMU_DIR): New variable. + (APEL_PREFIX, APEL_DIR, APEL_RELATIVE_DIR): New variable. + (load-path): Add "../apel" instead of "../tl". + + * SEMI-ELS: alist.el was moved to ../apel/. + +1997-03-03 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-parse.el: Require emu; Function `char-list-to-string' was + abolished. + + * mime-edit.el: Require emu; definitions about visible/invisible + were abolished. + +1997-03-03 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-encode.el: Require emu; function + `find-non-ascii-charset-string' and + `find-non-ascii-charset-region' were abolished. + + * mime-def.el: Require atype; functions about atype were + abolished. + +1997-03-03 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-def.el: Require emu; Variable `running-xemacs' was + abolished; Macro `defun-maybe' was abolished; Function `functionp' + was abolished; Variable `charsets-mime-charset-alist', + `default-mime-charset' and `mime-charset-coding-system-alist' were + abolished; Function `mime-charset-to-coding-system', + `charsets-to-mime-charset', `detect-mime-charset-region', + `encode-mime-charset-region', `decode-mime-charset-region', + `encode-mime-charset-string' and `decode-mime-charset-string' were + abolished. + +Sat Mar 1 04:12:37 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-def.el (charsets-to-mime-charset): New function; copied + from emu.el. + + * eword-encode.el: Use `char-bytes' instead of `char-length'. + + * mime-def.el (eliminate-top-spaces): New inline-function; copied + from tl-str.el. + + * mime-edit.el: Fixed about definition of visible/invisible + functions for XEmacs. + +Sat Mar 1 03:39:01 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-edit.el (enable-invisible, end-of-invisible): New macro; + copied from emu-19.el. + (invisible-region, invisible-p, next-visible-point): New function; + copied from emu-19.el and emu-xemacs.el. + (visible-region): New function; copied from emu-19.el. + + * mime-edit.el (mime-edit-make-boundary): New function. + (mime-edit-translate-body, mime-edit-translate-region): Use + `mime-edit-make-boundary'. + + * mime-edit.el (replace-space-with-underline): New inline + function; copied from tl-str.el. + +Sat Mar 1 02:07:00 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * eword-encode.el (find-non-ascii-charset-region): New + inline-function; copied from emu-e20.el. + +Fri Feb 28 06:46:48 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-def.el: Require cl. + + * mime-view.el (mouse-button-2): New variable; copied from + emu-19.el and emu-xemacs.el. + + * mime-def.el (defun-maybe): New macro; copied from emu.el. + (functionp): New function; copied from emu.el. + +Fri Feb 28 05:14:54 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-play.el: Supports only Emacs/mule API. + + * mime-def.el (field-unify): Fixed. + + * semi-setup.el: Don't require mime-play. + + * mime-def.el: Function `put-fields' were abolished. + + * mime-def.el: atype functions were moved from mime-play.el. + + * mime-play.el: atype functions were moved to mime-def.el. + +Fri Feb 28 04:50:13 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-def.el (call-after-loaded): New function; moved from + semi-setup.el. + + * semi-setup.el: Function `call-after-loaded' was moved to + mime-def.el; require mime-def. + +Fri Feb 28 04:44:27 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * semi-setup.el: require mime-play instead of mime-view when + compiling. + +Fri Feb 28 04:21:43 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * SEMI-MK: BINS were abolished. + + * SEMI-CFG: require cl. + + * SEMI-CFG: Variable `BIN_SRC_DIR' and `BINS' were abolished. + +Fri Feb 28 04:08:12 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * SEMI-MK: Renamed from TM-MK. + + * SEMI-CFG: Don't require tl-misc. + + * SEMI-ELS (semi-modules-to-compile): Add alist.el. + +Fri Feb 28 02:33:20 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-play.el (field-unify): Fixed. + +Fri Feb 28 02:22:38 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-setup.el, mime-image.el, mime-edit.el, mime-play.el: + Require alist. + + * alist.el: New module; separated from tl-list.el. + + * mime-play.el: Function `put-alist' and `del-alist' were moved to + alist.el. + + * mime-play.el (mime-article/coding-system-alist): Use + `no-conversion' instead of *noconv*. + +Thu Feb 27 13:48:48 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-parse.el (char-list-to-string): New inline-function; copied + from emu-19.el. + +Thu Feb 27 13:43:38 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-parse.el (symbol-concat): New inline-function; copied from + tl-str.el. + + * semi-setup.el: require 'mime-view when compiling. + + * mime-parse.el (regexp-*): New inline-function; copied from + tl-str.el. + +Thu Feb 27 13:28:10 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * semi-setup.el (running-xemacs): New variable. + +Thu Feb 27 09:00:33 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-play.el: `mime/viewer-mode' -> `mime-view-mode'. + + * mime-def.el: fixed DOC string. + +Thu Feb 27 08:56:45 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * eword-decode.el: Don't require emu. + + * mime-def.el (charsets-mime-charset-alist, default-mime-charset, + mime-charset-coding-system-alist): New variable; copied from + emu-e20.el. + (mime-charset-to-coding-system, detect-mime-charset-region, + encode-mime-charset-region, decode-mime-charset-region, + encode-mime-charset-string, decode-mime-charset-string): New + function; copied from emu-e20.el. + + * eword-encode.el (find-non-ascii-charset-string): New + inline-function; copied from emu-e20.el. + +Thu Feb 27 08:36:01 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-tar.el: Don't require emu. + +Thu Feb 27 08:34:21 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-play.el (put-alist, del-alist): New function; copied from + tl-list.el. + (put-fields, field-unifier-for-default, field-unifier-for-mode, + field-unify, assoc-unify, get-unified-alist, delete-atype, + remove-atype, replace-atype, set-atype): New function; copied from + tl-atype.el. Don't require tl-atype. + +Thu Feb 27 08:18:16 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * semi-setup.el (call-after-loaded): New function; imported from + tl-misc.el; Don't require tl-misc. + +Thu Feb 27 08:10:24 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-pgp.el: Renamed from tm-pgp.el. + +Thu Feb 27 08:05:45 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-def.el (pgp-function-alist): tm-edit-mc.el was renamed to + mime-mc.el. + + * mime-mc.el: Renamed from tm-edit-mc.el. + +Thu Feb 27 06:38:44 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-text.el: `tm:mother-button-dispatcher' -> + `mime-button-mother-dispatcher'. + + * mime-def.el, mime-text.el (mime-preview/filter-for-text/plain), + mime-view.el, mime-tar.el (mime-tar-set-properties): + `tm:add-button' -> `mime-add-button'. + + * mime-file.el: Renamed from tm-file.el. + +Wed Feb 26 13:01:25 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * eword-decode.el: Must require emu. + + * eword-decode.el (eword-decode-region): Unused local variable + `charset', `encoding' and `text'. + +Wed Feb 26 07:58:29 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * eword-decode.el (eword-decode-encoded-word): Use + `add-text-properties' directly. + +Wed Feb 26 07:44:22 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-def.el (tm:add-button): Use `add-text-properties' directly. + + * mime-def.el (running-xemacs): New variable; if it is not nil, + require overlay. + + * mime-def.el (regexp-or): New function. + +Wed Feb 26 04:57:33 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-tar.el: Renamed from tm-tar.el. + + * mime-view.el (mime-view-define-keymap): `tm:button-dispatcher' + -> `mime-button-dispatcher'. + + * mime-def.el: `tm:button-dispatcher' -> `mime-button-dispatcher'. + + * mime-def.el: `tm:mother-button-dispatcher' -> + `mime-button-mother-dispatcher'. + + * mime-def.el: `semi-data' -> `mime-button-data'. + + * mime-def.el: `semi-callback' -> `mime-button-callback'. + + * mime-def.el: `tm:mouse-face' -> `mime-button-mouse-face'. + + * mime-def.el: `tm:button-face' -> `mime-button-face'. + + * mime-def.el (tm:add-button, tm:button-dispatcher): + `mime-callback' was renamed to `semi-callback'; `mime-data' was + renamed to `semi-data'. + +Wed Feb 26 03:54:17 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-def.el (tm:add-button): Use `make-overlay' directly. + + * mime-def.el (tm:add-button): Use `overlay-put' directly. + +Tue Feb 25 07:40:37 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-text.el: `tm:browse-url' was renamed to + `mime-text-browse-url'. + + * mime-text.el: Require browse-url. + + * mime-text.el: `tm:URL-regexp' was renamed to + `mime-text-url-regexp'. + + * mime-text.el: Variable `tm:URL-regexp', + `browse-url-browser-function' and function `tm:browse-url' were + moved from mime-def.el. + + * mime-def.el: Variable `tm:URL-regexp', + `browse-url-browser-function' and function `tm:browse-url' were + moved to mime-text.el. + + * eword-decode.el: Variable `tm:warning-face' was renamed to + `eword-warning-face'. + + * eword-decode.el: Variable `tm:warning-face' was moved from + mime-def.el. + + * mime-def.el: Variable `tm:warning-face' was moved to + eword-decode.el. + + * mime-def.el: Function `tm:set-face-region' was abolished. + + * mime-edit.el: `mime-edit-make-charset-default-encoding-alist' -> + `mime-make-charset-default-encoding-alist'. + + * mime-edit.el: `mime-edit-transfer-level' -> + `mime-transfer-level'. + + * mime-edit.el: Function `mime/encoding-name' was renamed to + `mime-encoding-name'. + + * mime-def.el: Function `mime/make-charset-default-encoding-alist' + was abolished. + + * mime-edit.el: Function `mime/encoding-name' was moved from + mime-def.el. + + * mime-def.el: Function `mime/encoding-name' was moved to + mime-edit.el. + +Tue Feb 25 06:15:53 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-edit.el: Variable `mime-charset-type-list' was moved from + mime-def.el. + + * mime-def.el: Variable `mime-charset-type-list' was moved to + mime-edit.el. + +Mon Feb 24 10:07:33 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * eword-encode.el (eword-encode-header): fixed typo. + +Mon Feb 24 10:04:23 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-edit.el (mime-edit-insert-message, mime-edit-insert-mail, + mime-editor::edit-again): Don't use `assoc-value'; Don't require + tl-list. + +Mon Feb 24 10:00:50 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-play.el: require tl-atype. + + * mime-view.el: Don't require tl-atype. + +Mon Feb 24 09:58:14 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-view.el: Don't require tl-misc. + +Mon Feb 24 09:57:03 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * eword-encode.el (eword-encode-header): Use function `assoc-if' + instead of `ASSOC'; require cl instead of tl-list. + + * mime-parse.el (define-structure): New macro; Don't require + tl-misc.el. + + * mime-view.el (mime-preview/insert-content-button): Don't use + function `assoc-value'. + + * mime-view.el: Require cl instead of tl-list. + + * mime-view.el: Don't require tl-str.el. + +Mon Feb 24 09:12:12 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-parse.el (define-structure): New macro; Don't require + tl-misc.el. + + * mime-view.el (mime-preview/insert-content-button): Don't use + function `assoc-value'. + + * mime-view.el: Require cl instead of tl-list. + + * mime-view.el: Don't require tl-str.el. + +Mon Feb 24 09:04:48 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * eword-decode.el: Constant + `eword-Q-encoding-and-encoded-text-regexp' was abolished. + + * eword-decode.el (quoted-printable-hex-chars, + quoted-printable-octet-regexp, eword-Q-encoded-text-regexp, + eword-Q-encoding-and-encoded-text-regexp): New constant; moved + from mime-def.el. + + * mime-def.el (quoted-printable-hex-chars, + quoted-printable-octet-regexp, eword-Q-encoded-text-regexp, + eword-Q-encoding-and-encoded-text-regexp): Moved to + eword-decode.el. + + * eword-decode.el (base64-token-regexp, + base64-token-padding-regexp, eword-B-encoded-text-regexp): New + constant; moved from mime-def.el. + + * mime-def.el: Constant `base64-token-regexp', + `base64-token-padding-regexp' and `eword-B-encoded-text-regexp' + were moved to eword-decode.el. + + * mime-def.el: Constant `eword-B-encoding-and-encoded-text-regexp' + was abolished. + +Mon Feb 24 08:52:01 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * eword-decode.el: Don't require emu. + + * eword-decode.el: Don't require tl-str.el. + + * mime-def.el (get-version-string): New inline-function; imported + from tl-str.el. + +Mon Feb 24 02:42:24 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-setup.el: Function `mime/encode-message-header' was renamed + to `eword-encode-header'. + + * mime-edit.el, eword-encode.el: Function + `eword-encode-message-header' was renamed to + `eword-encode-header'. + +Mon Feb 24 02:26:02 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * eword-decode.el (eword-decode-header): New optional argument + `SEPARATOR'; Use function `std11-narrow-to-header'. + + * mime-view.el, mime-setup.el, eword-decode.el: Function + `eword-decode-message-header' was renamed to + `eword-decode-header'. + +Mon Feb 24 02:17:11 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-edit.el: tm-ew-e.el was renamed to eword-encode.el; + Function `mime/encode-message-header' was renamed to + `eword-encode-message-header'. + +Mon Feb 24 01:59:28 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-view.el: Function `mime-eword/decode-string' was renamed to + `eword-decode-string'. + + * mime-def.el: `mime/Q-' -> `eword-Q-'. + + * mime-def.el: `mime/B-' -> `eword-B-'. + +Mon Feb 24 01:46:59 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * eword-decode.el: Constant `eword-charset-regexp' was renamed to + `mime-charset-regexp'. + + * mime-def.el: Constant `mime/charset-regexp' was renamed to + `mime-charset-regexp'. + +Mon Feb 24 01:38:18 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-view.el: Function `mime/decode-message-header' was renamed to + `eword-decode-message-header'. + + * mime-view.el: tm-ew-d.el was renamed to eword-decode.el. + +Mon Feb 24 01:32:33 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-setup.el: tm-ew-d.el was renamed to eword-decode.el; + Function `mime/decode-message-header' was renamed to + `eword-decode-message-header'. + +Sat Feb 22 17:30:15 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-CFG: Renamed from TM-CFG. + + * SEMI-ELS: Renamed from TM-ELS. + + * eword-encode.el: `eword-exist-encoded-word-in-subject' -> + `eword-in-subject-p'. + + * eword-encode.el: `mime/' -> `eword-'. + + * eword-encode.el (eword-generate-X-Nsubject): Don't refer + variable `mime/use-X-Nsubject'. + + * eword-encode.el (eword-generate-X-Nsubject): Renamed from + `mime/generate-X-Nsubject'. + + * eword-encode.el (eword-field-encoding-method-alist): Don't refer + variable `mime/no-encoding-header-fields'. + + * eword-encode.el (eword-field-encoding-method-alist): Renamed + from `mime/field-encoding-method-alist'. + + * eword-encode.el: Renamed from tm-ew-e.el. + + * eword-decode.el: Renamed from tm-ew-d.el. + + * mime-view.el: Don't require tm-def. + + * mime-parse.el: tm-def.el was renamed to mime-def.el. + + * mime-def.el: Renamed from tm-def.el. + +1997-02-22 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * SEMI-ELS: Renamed from TM-ELS. + +1997-02-22 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * eword-encode.el: `eword-exist-encoded-word-in-subject' -> + `eword-in-subject-p'. + + * eword-encode.el: `mime/' -> `eword-'. + + * eword-encode.el (eword-generate-X-Nsubject): Don't refer + variable `mime/use-X-Nsubject'. + + * eword-encode.el (eword-generate-X-Nsubject): Renamed from + `mime/generate-X-Nsubject'. + + * eword-encode.el (eword-field-encoding-method-alist): Don't refer + variable `mime/no-encoding-header-fields'. + + * eword-encode.el (eword-field-encoding-method-alist): Renamed + from `mime/field-encoding-method-alist'. + + * eword-encode.el: Renamed from tm-ew-e.el. + + * eword-decode.el: Renamed from tm-ew-d.el. + + * mime-view.el: Don't require tm-def. + + * mime-parse.el: tm-def.el was renamed to mime-def.el. + +1997-02-22 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-def.el: Renamed from tm-def.el. + +Fri Feb 21 08:04:42 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-view.el: Don't `suppress-keymap'. + +Fri Feb 21 07:42:32 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-view.el: tm-parse.el was renamed to mime-parse.el. + + * mime-parse.el: Renamed from tm-parse.el. + + * mime-view.el: Key-binding for function + `mime-view-display-x-face' was abolished. + +Fri Feb 21 07:04:51 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-setup.el: modified for mime-edit.el. + +Fri Feb 21 07:02:52 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-edit.el: `mime-editor/' -> `mime-edit-'. + +Fri Feb 21 06:57:11 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-edit.el: based on tm-edit 7.105. + + * semi-setup.el: tm-image.el was renamed to mime-image.el. + + * mime-image.el: Renamed from tm-image.el. + +Fri Feb 21 05:57:53 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * semi-setup.el: Renamed from tm-setup.el. + + * mime-setup.el: Setting for GNUS was abolished. + + * mime-setup.el: Variable `mime-setup-use-sc' was abolished. + + * mime-view.el: tm-play.el was renamed to mime-play.el. + + * mime-partial.el: Renamed from tm-partial.el. + + * mime-play.el: Renamed from tm-play.el. + + * mime-view.el: `tm-text' is renamed to `mime-text'. + + * mime-view.el (mime-view-mode): Optional argument `mother-keymap' + was renamed to `default-keymap-or-function'; optional argument + `default-function' was abolished. + + * mime-text.el: `mime-view-code-converter-alist' -> + `mime-text-decoder-alist'. + + * mime-text.el: Renamed from tm-text.el. + +Thu Feb 20 09:02:36 1997 Tomohiko Morioka <tmorioka@mule.etl.go.jp> + + * mime-view.el: `mime/viewer-mode' -> `mime-view-mode'. + + * mime-view.el: Renamed from tm-view.el. + +Thu Jul 11 14:57:42 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-file-types): add for patch. + + * mime-edit.el: rearrangement. + +Wed Jul 10 12:05:05 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-editor/normalize-body): Use function + `encode-mime-charset-region' instead of + `mime-charset-encode-region'. + +Wed Jul 10 11:51:13 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-editor/normalize-body): fixed. + + * mime-edit.el (mime-editor/define-charset): + Argument `charset' was changed to + symbol. + (mime-editor/choose-charset): Changed to return symbol. + (mime-editor/normalize-body): charset was changed to symbol. + +Wed Jul 10 11:22:55 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-editor/make-charset-default-encoding-alist): + New function. + (mime-editor/charset-default-encoding-alist): Use function + `mime-editor/make-charset-default-encoding-alist'. + (mime-editor/toggle-transfer-level): Use function + `mime-editor/make-charset-default-encoding-alist'. + + * mime-edit.el (mime-editor/choose-charset): Use function + `detect-mime-charset-region' instead of + `mime/find-charset-region'. + +Tue Jul 9 13:24:21 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime/editor-mode): Don't toggle. + + (mime-editor/toggle-mode): New function. + +Tue Jul 2 14:06:53 1996 Alastair Burt <burt@dfki.uni-kl.de> + + * mime-edit.el: I think the following is the best way to handle + tm-edit as a minor mode in XEmacs (at least in 19.14 -- I am not + sure if "add-minor-mode" works the same way in earlier versions). + By clicking on the mode line you can turn mime/editor-mode on or + off. + +Thu Jun 27 14:08:17 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-editor/encrypt-pgp-kazu): Use macro + `as-binary-process'. + + * mime-edit.el (mime-editor/sign-pgp-kazu): Use macro + `as-binary-process'. + +Wed Jun 12 05:58:23 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-editor/split-message-sender-alist): setting + for `mail-mode' was moved to tm-rmail.el. + +Sun Jun 9 06:44:19 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el: Variable + `mime-editor/message-default-sender-alist' was abolished. + +Sun Jun 9 06:40:26 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el: Variable `mime-editor/window-config-alist' was + abolished. + +Sun Jun 9 06:35:10 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-editor/split-and-send): New implementation. + +Mon Jun 3 17:39:10 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-editor::edit-again): fixed about multipart. + +Wed May 29 09:57:53 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-editor/define-charset, + mime-editor/set-parameter): Function `mime-set-parameter' was + renamed to `mime-editor/set-parameter'. + + * mime-edit.el (mime-set-parameter): New implementation + + (mime-editor/translate-single-part-tag): New function. + (mime-editor/translate-region): Use function + `mime-editor/translate-single-part-tag'. + +Tue May 28 15:15:33 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-editor::edit-again): fixed. + + * mime-edit.el (mime/edit-again): fixed. + + * mime-edit.el (mime-editor::edit-again): modified for new tag + rule. + + * mime-edit.el (mime-editor/insert-signature): Use variable + `signature-file-name' instead of `signature'. + + * mime-edit.el (mime-editor/multipart-beginning-regexp): Don't + require begging new-line. + + (defconst mime-editor/multipart-end-regexp): Don't require begging + new-line. + + (mime-editor/find-inmost): modified for new enclosure tag rule. + + (mime-editor/translate-region): modified for new enclosure tag rule. + + (mime-editor/enclose-region): modified for new enclosure tag rule. + +Sun May 26 05:04:20 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el: Add `(provide 'tm-edit)'. + + Do `(run-hooks 'tm-edit-load-hook)' if variable + `mime-edit-load-hook' is not bound. + +Sun May 26 02:10:08 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-editor/insert-binary-buffer): fixed. + (mime-editor/normalize-body): fixed. + +Sat May 25 20:47:32 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-editor/normalize-body): fixed. + + (mime-editor/content-end): Used function `invisible-p' and + `next-visible-point'. + +Sat May 25 20:05:20 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-editor/insert-binary-buffer): Use function + `invisible-region' instead of `mime-flag-region'. + (mime-editor/normalize-body): Use function `visible-region' + instead of `mime-flag-region'. + (mime-editor/content-end): New implementation. + +Sat May 25 16:04:28 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-editor/enquote-region): New command; bound to + `C-c C-x q'. + + (mime-editor/menu-list): New item for function + `mime-editor/enquote-region'. + +Sat May 25 15:52:44 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-editor/process-multipart-1): Use function + `string-equal' instead of `string='. + +Sat May 25 15:48:33 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-editor/process-multipart-1): fixed about + condition of next tag inserting. + +Sat May 25 15:36:58 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-editor/enclose-region): fixed for new format. + +Sat May 25 15:15:03 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-editor/insert-partial-header): Comment of + Mime-Version field was modified. + + * mime-edit.el (mime-editor/insert-tag): Don't insert unnecessary + line break. + + * mime-edit.el (mime-editor/version-name): New constant. + + (mime-editor/mime-version-value): Use constant + `mime-editor/version-name'. + + (mime-editor/insert-partial-header): Use constant + `mime-editor/version-name'. + +Fri May 24 15:16:37 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * mime-edit.el (mime-editor/goto-tag): fixed for a tag without + line break. + (mime-editor/normalize-body): fixed for a tag without line break. + + * mime-edit.el (mime-editor/translate-region): fixed for a part + starting without line break. + + * mime-edit.el (mime-editor/single-part-tag-regexp): It allows any + column. + (mime-editor/quoted-single-part-tag-regexp): New constant. + (mime-editor/enquote-region): New function. + (mime-editor/dequote-region): New function. + (mime-editor/process-multipart-1): Processing for ``quote'' + enclosure was added. + (mime-editor/translate-body): Use function + `mime-editor/dequote-region'. + + (mime-editor/mime-version-value): Comment was renamed. + + * mime-edit.el: Renamed from tm-edit.el diff --git a/semi-1.14.6/Makefile b/semi-1.14.6/Makefile new file mode 100644 index 0000000..ed31669 --- /dev/null +++ b/semi-1.14.6/Makefile @@ -0,0 +1,70 @@ +# +# Makefile for SEMI kernel. +# + +PACKAGE = semi +API = 1.14 +RELEASE = 6 + +FLIM_API= 1.14 + +TAR = tar +RM = /bin/rm -f +CP = /bin/cp -p + +EMACS = emacs +XEMACS = xemacs +FLAGS = -batch -q -no-site-file -l SEMI-MK + +PREFIX = NONE +LISPDIR = NONE +PACKAGEDIR = NONE +VERSION_SPECIFIC_LISPDIR = NONE + +GOMI = *.elc + +VERSION = $(API).$(RELEASE) +ARC_DIR_PREFIX = /home/kanji/tomo/public_html/comp/emacsen/lisp +ARC_DIR = $(ARC_DIR_PREFIX)/semi/semi-$(API)-for-flim-$(FLIM_API) + + +elc: + $(EMACS) $(FLAGS) -f compile-semi \ + $(PREFIX) $(LISPDIR) $(VERSION_SPECIFIC_LISPDIR) + +install-elc: elc + $(EMACS) $(FLAGS) -f install-semi \ + $(PREFIX) $(LISPDIR) $(VERSION_SPECIFIC_LISPDIR) + +install: install-elc + + +package: + $(XEMACS) $(FLAGS) -f compile-semi-package $(PACKAGEDIR) + +install-package: package + $(XEMACS) $(FLAGS) -f install-semi-package $(PACKAGEDIR) + + +clean: + -$(RM) $(GOMI) + + +tar: + cvs commit + sh -c 'cvs tag -R $(PACKAGE)-`echo $(VERSION) | tr . _`; \ + cd /tmp; \ + cvs -d :pserver:anonymous@cvs.m17n.org:/cvs/root \ + export -d $(PACKAGE)-$(VERSION) \ + -r $(PACKAGE)-`echo $(VERSION) | tr . _` \ + semi' + $(RM) /tmp/$(PACKAGE)-$(VERSION)/ftp.in + cd /tmp; $(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)/" \ + | sed "s/FLIM_API/$(FLIM_API)/" > ftp + +release: + -$(RM) $(ARC_DIR)/$(PACKAGE)-$(VERSION).tar.gz + mv /tmp/$(PACKAGE)-$(VERSION).tar.gz $(ARC_DIR) diff --git a/semi-1.14.6/NEWS b/semi-1.14.6/NEWS new file mode 100644 index 0000000..eaebaeb --- /dev/null +++ b/semi-1.14.6/NEWS @@ -0,0 +1,579 @@ +SEMI NEWS --- history of major-changes. +Copyright (C) 1998,1999 Free Software Foundation, Inc. + +* Changes in SEMI 1.13 + +** PGP 5.0i and GnuPG are now supported for PGP/MIME + + You can select the various PGP or GnuPG commands by the user option +`pgg-default-scheme' or `pgg-scheme'. The former is for encrypting and +signing, the latter could be bound for controlling which command is +used to process the incoming PGP armors. Note that Mailcrypt is not +needed anymore. A user interface for editing or viewing has never +changed. Note also that `pgp-function' and `pgp-functions-alist' are +abolished in this version. + + +** Requires FLIM 1.13 API + + +** Don't expect raw-buffer + +In FLIM 1.13 API, existence of a raw-buffer corresponding to each +entity is not guaranteed. + +*** Now acting-method must not expect to run in raw-buffer + +Function `mime-play-entity' was changed to permit to run in any buffer +(may be called in preview-buffer). So each acting-method is called in +any buffer. + +*** Don't refer variable `mime-raw-buffer' + +Preview-buffer's local variable `mime-raw-buffer' is deleted. So +don't refer it. + +*** Don't refer variable `mime-preview-buffer' + +There are no guarantee about existence of a raw-buffer corresponding +to each entity, so don't refer buffer local variables of the +raw-buffer, e.g. `mime-preview-buffer'. + + +** Function `mime-play-entity' + +Function `mime-play-entity' was renamed from `mime-raw-play-entity' +and changed interface. + +Current interface is: + + mime-play-entity (entity &optional situation ignored-method) + +Please use `situation' if you would like to specify `mode' and +`ignore-examples'. + + +** Text property `mime-view-entity-{header|body}' + +Now mime-view put text property `mime-view-entity-header' and +`mime-view-entity-body' in header and body of each entity. + + +** Behavior change about `mime-display-header-hook' + +Function `mime-display-entity' runs `mime-display-header-hook' before +it inserts "\n". + +In addition, now it is cleared that current point means beginning of +header when `mime-display-entity' runs `mime-display-header-hook'. +Therefore header-presentation-method must not change current point. + + +** New variable `mime-preview-move-scroll' + +This variables decides how to scroll in the MIME-View-mode +when mime-preview-move-upper, mime-preview-move-previous, +mime-preview-move-next is called. Those are bound to `u', `p', `n', +respectively. + + +* Changes in SEMI 1.12 + +There are no user-visible changes. + +** New function `eliminate-top-spaces' + +Now mime-edit has it. + + +* Changes in SEMI 1.11 + +** New function `mime-edit-decode-message-in-buffer' + +Add new function `mime-edit-decode-message-in-buffer'. Function +`mime-edit-decode-buffer' was abolished. + + +** Requires FLIM 1.12 API + + +* Changes in SEMI 1.10 + +** Abolish variable `mime-temp-directory' + + FLIM 1.11 and SEMI 1.10 use variable `temporary-file-directory' +instead of `mime-temp-directory'. So environment variable +"MIME_TMP_DIR" and "TM_TMP_DIR" are not effective to specify temporary +directory of FLIM and SEMI. + + +** Abolish function `mime-text-insert-decoded-body' + + SEMI 1.10 uses function `mime-insert-text-content' of FLIM 1.11 API +instead of `mime-text-insert-decoded-body'. + + Now `mime-view-caesar' does not run `mime-text-decode-hook'. + + +* Changes in SEMI 1.9 + +** User option `mime-encoding-list' + + SEMI 1.9 requires FLIM 1.10 API. In FLIM 1.10 API, variable +`mime-file-encoding-method-alist' was abolished. If you want to use +non-standard Content-Transfer-Encoding to insert a file into sending +message, please edit new user option `mime-encoding-list' instead of +`mime-file-encoding-method-alist'. + + +** Constant `mime-user-interface-product' + + Constant `mime-user-interface-version' was renamed to +`mime-user-interface-product'. Notice that data format is changed +too. + + FLIM 1.10 API provides following macros to access a slot of the new +data format: + + mime-product-name (product) + + mime-product-version (product) + + mime-product-code-name (product) + +Please use them to get elements of the constant +`mime-user-interface-product'. + + +* Changes in SEMI 1.8 + +** Don't use "file" command to detect content of entity + + Acting-method to detect content of entity was modified not to use +"file" command. + + Variable `mime-file-content-type-alist' was abolished. Instead of +it, new variable `mime-magic-type-alist' is available to customize. +It is an alist of regexp about magic-number vs. corresponding +media-types. Each element looks like (REGEXP TYPE SUBTYPE). REGEXP +is a regular expression to match against the beginning of the content +of entity. TYPE is symbol to indicate primary type of media-type. +SUBTYPE is symbol to indicate subtype of media-type. + + +** Abolish external X-Face viewer + + +** Abolish obsolete utility for *-field-list and *-field-regexp + + Abolish function `tm:set-fields', `tm:add-fields' and +`tm:delete-fields'. + + +** Change MUA interface of automatic message/partial combining + + Abolish variable `mime-view-partial-message-method-alist'. + + Instead of it, `request-partial-message-method' in acting-situation +is available to specify MUA depended implementation. + + Each element of `mime-view-partial-message-method-alist' were +required to display message at current summary line, and its return +value were ignored. On the other hand, +`request-partial-message-method' is required to return structure of +message at current summary line. Format of it is mime-entity. + + +** User-Agent field + + MIME-Edit inserts User-Agent field instaed of X-Emacs field if +`mime-edit-insert-user-agent-field' is not nil. Contents of +User-Agent is specified by mime-edit-user-agent-value'. + + X-Emacs field related features were abolished. + + +* Changes in SEMI 1.7 + +** Header-presentation-method + + Now MIME-View uses header-presentation-method instead of +header-filter. + + - abolish variable `mime-view-content-header-filter-alist' + + - abolish function `mime-view-cut-header' + + - Rename `mime-view-content-header-filter-hook' to + `mime-display-header-hook' + + +** Abolish `mime-view-ignored-field-regexp' + + Now mime-view uses `mime-view-ignored-field-list' directly in +default header-presentation-method. + + +** Abolish body filter support + + Please use body-presentation-method. + + +** Methods for MUAs + + - Rename `mime-view-following-method-alist' to + `mime-preview-following-method-alist' + + - Rename `mime-method-to-combine-message/partial-pieces' to + `mime-combine-message/partial-pieces-automatically' + + +* Changes in SEMI 1.6 + +** Abolish tm-compatible external method support + + Abolish tm-compatible external method support. Please use mailcap +method instead of it. + + +** Abolish `mime-edit-signing-type' and `mime-edit-encrypting-type' + + C-c C-m C-s encloses as "pgp-signed" which means PGP/MIME signature. + + C-c C-m C-e encloses as "pgp-encrypted" which means PGP/MIME +encryption. + + +** New method to detect content of entity + + Now MIME-View can detect content of entity for +application/octet-stream in default setting. + + It uses "file" command to detect. User can customize +`mime-file-content-type-alist' to specify media-type for output of +"file" command. It is an alist of "file" output patterns +vs. corresponding media-types. Each element looks like (REGEXP TYPE +SUBTYPE). REGEXP is pattern for "file" command output. TYPE is +symbol to indicate primary type of media-type. SUBTYPE is symbol to +indicate subtype of media-type. + + +** New interface to display message + +- Function `mime-view-buffer' +- Function `mime-view-display-message' + + +** Change interface of internal playback method + + Interface of internal playback method was changed to + + (entity situation) + +It is as same as interface of body-presentation-method. + + +** Change interface of `mime-view-entity-button-visible-p' + +** Change interface of `mime-view-insert-entity-button' + + +** `mime-preview-original-major-mode' + + Abolish variable `mime-preview-original-major-mode'. + + Please use function `mime-preview-original-major-mode' instead of +it. + + +** mime-preview-over-to-{previous|next}-method-alist + + `mime-preview-over-to-{previous|next}-method-alist' were renamed +from `mime-view-over-to-{previous|next}-method-alist'. + + +* Changes in SEMI 1.5 + +** mime-w3 + + Add inline text/html preview feature using w3. If +`mime-setup-enable-inline-html' is not nil, semi-setup.el sets up it. + + +** `pgp-elkins' -> `pgp-mime' + + Rename `pgp-elkins' -> `pgp-mime'. Variable +`mime-edit-signing-type' and `mime-edit-encrypting-type' does not +allow `pgp-elkins'. + + +** type-subtype-score + + Now MIME-View chooses one entity to display body in +multipart/alternative. In this mechanism, +`mime-view-type-subtype-score-alist' is used to specify priority of +each entity. + + Variable `mime-view-type-subtype-score-alist' is alist of +TYPE-SUBTYPE vs. SCORE. TYPE-SUBTYPE is cons pair (TYPE . SUBTYPE), +symbol TYPE or t. TYPE and SUBTYPE are symbol. `t' means default. +SCORE is integer. Larger number is larger priority. + + +** text presentation + + Change text presentation mechanism. In anything older than SEMI +1.4, text presentation mechanism is based on filter model. However it +has design problem about conversion between byte representation and +text presentation. So SEMI was changed to use +body-presentation-method to display text entity. In this purpose, old +text decoding features were abolished and introduces news features +(cf. next section). + + +** mime-raw-representation-type and mime-raw-representation-type-alist + + Abolish `mime-text-decoder' and `mime-text-decoder-alist' because of +text presentation mechanism change (cf. previous section). Instead of +it, SEMI introduces variable about representation-type of +mime-raw-buffer. If it is `binary', mime-raw-buffer is as same as +network representation. If it is `cooked', mime-raw-buffer is +code-converted. + + `mime-raw-representation-type-alist' is an alist of major-mode +vs. representation-type. Each element looks like + + (SYMBOL . REPRESENTATION-TYPE). + +SYMBOL is major-mode or t. t means default. + + `mime-raw-representation-type' is a buffer local variable of +mime-raw-buffer. If it is non-nil, it overrides +`mime-raw-representation-type-alist'. + + In addition, `mime-raw-buffer-coding-system-alist' was abolished. +Because representation-type has enough information. + + +* Changes in SEMI 1.4 + +** mailcap + + mailcap was supported to set up 'mime-acting-condition. + + tm-external-method scripts written by born shell were abolished. + + +** mime-add-condition + + New function to set up 'mime-preview-condition and/or +'mime-acting-condition. + + +** signature setting in semi-setup.el + + Abolish MUA depended signature setting. + + Setting for mail-mode were moved to mail-mime-setup.el. + + +* Changes in SEMI 1.3 + +** mime-acting-condition + + Format of variable 'mime-acting-condition was changed from `atype' +to `condition tree'. Its format is as same as +'mime-preview-condition. + + If there are two or more conditions are found when matching, menu +pops up to select method to run. Selected situation will be added to +example database. (cf. mime-acting-situation-examples-file) + +** New variables + +*** mime-view-find-every-acting-situation + + Find every available acting-situation if non-nil. + +*** mime-acting-situation-examples-file + + File name of example about acting-situation demonstrated by + user. + + +* Changes in SEMI 1.2 + +** User setting + +*** hooks + + 'mime-view-plain-text-preview-hook was renamed to +'mime-preview-text/plain-hook. + +*** Variable + + Variable 'mime-view-childrens-header-showing-Content-Type-list was +abolished. Please use 'mime-preview-condition instead. + +*** API about visible-predicates were abolished + + Following functions were abolished: + + mime-view-header-visible-p (entity message-info) + + mime-view-body-visible-p (entity message-info) + + mime-view-entity-separator-visible-p (entity message-info) + +Please use 'mime-preview-condition instead. + + Function 'mime-view-entity-button-visible-p is not abolished, but it +is obsoleted. + +*** mime-preview-condition + + Following are added as pre-defined keys: + + 'childrens-situation default preview-situation for children + 'message-button to specify to display message-button + nil: default (invisible) + 'visible: visible + 'invisible: invisible + 'entity-button to specify to display entity-button + nil: default (visible) + 'visible: visible + 'invisible: invisible + 'header to specify to display header + nil: default (invisible) + 'visible: visible + 'invisible: invisible + +** API + +*** Interface for body-filter + + 'mime-view-filter-for-* was renamed to 'mime-preview-filter-for-*. + + +*** mime-text-decode-body + + Function 'mime-decode-text-body was renamed to +'mime-text-decode-body and changed interface. New interface is +following: + + mime-text-decode-body (SITUATION) + +SITUATION is preview-situation. Content-Transfer-Encoding and +MIME-charset are specified in field of it. + + +* Changes in SEMI 1.1 + +** User setting + +*** Setting variable about visible body + + 'mime-view-visible-media-type-list and +'mime-view-content-filter-alist were abolished. Please use +'mime-preview-condition instead. + + Notice that 'mime-preview-condition is not list of +media-type/subtype string nor association-list. It uses new +data-structure `ctree' (condition-tree; it is introduced to replace +`atype'). Function 'ctree-set-calist-strictly and +'ctree-set-calist-with-default may be useful to modify it (`calist' +(condition-alist) is as same as `atype'). + + +*** API about visible-predicates + + Interface of visible-predicates for entity elements were changed. +New interfaces are following: + + mime-view-entity-button-visible-p (entity message-info) + + mime-view-header-visible-p (entity message-info) + + mime-view-body-visible-p (entity message-info) + + mime-view-entity-separator-visible-p (entity message-info) + + +** API + +*** entity representation + + Structure 'mime-entity-info was renamed to 'mime-entity. So various +functions were renamed too. + + +*** Interface for entity-button generators + + Interface of entity-button generators was changed. New interfaces +is following: + + mime-view-insert-entity-button (entity message-info subject) + + +*** mime-preview-condition and preview-situation + + Conditions about preview generation are unified to +'mime-preview-condition. Namely other variables, such as +'mime-view-visible-media-type-list, 'mime-view-content-filter-alist, +'mime-view-image-converter-alist were abolished. + + Preview-situation is generated from entity information, running +environment and 'mime-preview-condition. These elements are checked +to match with each other. (it is similar to acting-situation) + + Format of preview-situation is association-list. Following key is +pre-defined: + + 'type media-type + 'subtype media-subtype + 'encoding content-transfer-encoding + 'major-mode major-mode of MUA + <STRING> attribute of Content-Type field. + 'body-presentation-method body-presentation-method + +If 'body-presentation-method is 'with-filter, 'body-filter is used to +specify body-filter function. If 'body-presentation-method is +function, it is called to generate presentation of entity body. + +Body-filter function 'mime-view-filter-for-image refers 'image-format. + +Setting for message/partial button is specified by +'mime-preview-condition instead of hard-coding. + + +*** Interface for body-filter + + Interface of body-filter was changed. New interfaces is following: + + <body-filter> (situation) + +Current pre-defined filters are following: + + mime-view-filter-for-text/plain (situation) + mime-view-filter-for-text/richtext (situation) + mime-view-filter-for-text/enriched (situation) + mime-view-filter-for-image (situation) ; if available + +'mime-view-filter-for-application/postscript was abolished. + + +*** Format of mime-acting-condition (acting-situation) + + Format of `mime-acting-condition' were changed. `type' and +`subtype' are separated and changed to symbol. + + +*** Renaming + +- mime-view-buffer -> mime-preview-buffer + + +Local variables: +mode: outline +paragraph-separate: "[ ]*$" +end: diff --git a/semi-1.14.6/README.en b/semi-1.14.6/README.en new file mode 100644 index 0000000..7845674 --- /dev/null +++ b/semi-1.14.6/README.en @@ -0,0 +1,263 @@ +[README for SEMI kernel package (English Version)] + +What's SEMI? +============ + + SEMI is a library to provide MIME feature for GNU Emacs. MIME is a + proposed internet standard for including content and headers other + than (ASCII) plain text in messages. + + RFC 2045 : Internet Message Bodies + RFC 2046 : Media Types + RFC 2047 : Message Header Extensions + RFC 2048 : MIME Registration Procedures + RFC 2049 : MIME Conformance + + SEMI has the following features: + + - MIME message viewer (mime-view-mode) (RFC 2045 .. 2049) + - MIME message composer (mime-edit-mode) (RFC 2045 .. 2049) + + MIME message viewer and composer also support following features: + + - filename handling by Content-Disposition field (RFC 1806) + - PGP/MIME security Multiparts (RFC 2015) + - application/pgp (draft-kazu-pgp-mime-00.txt; obsolete) + - text/richtext (RFC 1521; obsolete; preview only) + - text/enriched (RFC 1896) + - External method configuration by mailcap (RFC 1524) + + Notice that this package does not contain MIME extender for any + MUAs. They are released as separated packages. + + +Required environment +==================== + + SEMI supports XEmacs 21.1 or later, and GNU Emacs 20.4 or later. + + SEMI does not support anything older than GNU Emacs 19.28 or XEmacs + 19.14. In addition, SEMI does not word with byte-indexing Mule + implementations, such as Mule 1, Mule 2 and GNU Emacs 20.1/20.2. + + SEMI also does not support Emacs 19.29 to 19.34, XEmacs 19.15 or + XEmacs 20.2, but SEMI may work with them. + + SEMI requires APEL (9.22 or later) and FLIM (1.14.2 or later) + package. Please install them before installing it. APEL package is + available at: + + ftp://ftp.m17n.org/pub/mule/apel/ + + and FLIM package is available at: + + http://www.kanji.zinbun.kyoto-u.ac.jp/~tomo/comp/emacsen/lisp/ + flim/flim-1.14/ + +Installation +============ + +(a) run in expanded place + + If you don't want to install other directories, please do only + following: + + % make + + You can specify the emacs command name, for example + + % make EMACS=xemacs + + If `EMACS=...' is omitted, EMACS=emacs is used. + +(b) make install + + If you want to install other directories, please do following: + + % make install + + You can specify the emacs command name, for example + + % make install EMACS=xemacs + + If `EMACS=...' is omitted, EMACS=emacs is used. + + You can specify the prefix of the directory tree for Emacs Lisp + programs and shell scripts, for example: + + % make install PREFIX=~/ + + If `PREFIX=...' is omitted, the prefix of the directory tree of the + specified emacs command is used (perhaps /usr/local). + + For example, if PREFIX=/usr/local and EMACS 19.34 is specified, it + will create the following directory tree: + + /usr/local/share/emacs/19.34/site-lisp/ --- emu + /usr/local/share/emacs/site-lisp/apel/ --- APEL + /usr/local/share/emacs/site-lisp/flim/ --- FLIM + /usr/local/share/emacs/site-lisp/semi/ --- SEMI + + You can specify site-lisp directory, for example + + % make install LISPDIR=~/share/emacs/lisp + + If `LISPDIR=...' is omitted, site-lisp directory of the specified + emacs command is used (perhaps /usr/local/share/emacs/site-lisp or + /usr/local/lib/xemacs/site-lisp). + + If the emu modules (included in APEL package) have been installed in + the non-standard directory, you should specify where they will be + found, for example: + + % make install VERSION_SPECIFIC_LISPDIR=~/elisp + +(c) install as a XEmacs package + + If you want to install to XEmacs package directory, please do + following: + + % make install-package + + You can specify the emacs command name, for example + + % make install-package XEMACS=xemacs-21 + + If `XEMACS=...' is omitted, XEMACS=xemacs is used. + + You can specify the package directory, for example: + + % make install PACKAGEDIR=~/.xemacs + + If `PACKAGEDIR=...' is omitted, the first existing package + directory is used. + + Notice that XEmacs package system requires XEmacs 21.0 or later. + +(a,b,c) + + You can specify other optional settings by editing the file + ${archive}/SEMI-CFG. Please read ${archive}/README.en and comments + in ${archive}/SEMI-CFG. + + +Initialization +============== + +(a) load-path + + If you are using Emacs or Mule, please add directory of emu, apel, + flim and semi to load-path. If you install by default setting, you + can write subdirs.el for example: + + -------------------------------------------------------------------- + (normal-top-level-add-to-load-path + '("apel" "flim" "semi")) + -------------------------------------------------------------------- + + If you are using XEmacs, there are no need of setting about + load-path. + +(b) mime-setup + + Please insert the following into your ~/.emacs: + + (load "mime-setup") + + +Documentation +============= + + To get started, please read ${archive}/README.en. + + RFC's 822, 1524, 1806, 1847, 1896, 2015, 2045, 2046, 2047, 2048 and + 2049 are available via anonymous ftp: + + ftp://ftp.merit.edu/internet/documents/rfc/ + + +Mailing lists +============= + + If you write bug-reports and/or suggestions for improvement, please + send them to the EMACS-MIME Mailing List: + + emacs-mime-en@m17n.org (English) + emacs-mime-ja@m17n.org (Japanese) + + Via the EMACS-MIME ML, you can report SEMI bugs, obtain the latest + release of SEMI, and discuss future enhancements to SEMI. To join + the EMACS-MIME ML, send an e-mail to + + emacs-mime-en-ctl@m17n.org (English) + emacs-mime-ja-ctl@m17n.org (Japanese) + + containing + + subscribe YOUR NAME + + in its contents. + + Notice that you should not send mail to author(s), such as + morioka@jaist.ac.jp, directly. Because your problem may occur in + other environments (if not, it might be your problem, not bug of + SEMI). We should discuss in the EMACS-MIME mailing lists. Anyway + direct-mail for authors might be ignored. Please send mail to the + EMACS-MIME mailing lists. + + +CVS based development +===================== + + If you would like to join CVS based development, please send mail to + + cvs@cvs.m17n.org + + with your account name and your public key for ssh. cvsroot is + :ext:cvs@cvs.m17n.org:/cvs/root. + + If you cannot use ssh, please send UNIX /etc/passwd style crypted + password. you can commit with the cvsroot + :pserver:<accountname>@cvs.m17n.org:/cvs/root. + + We hope you will join the open development. + + +Authors +======= + +Original authors + + MORIOKA Tomohiko <morioka@jaist.ac.jp> + (the author of mime-view and various parts of SEMI) + UMEDA Masanobu <umerin@mse.kyutech.ac.jp> + (the author of mime.el of emacs-mime-tools. mime.el is the + origin of mime-edit.el of SEMI) + +Other authors + + Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> + (a major author of signature.el and a lot of codes) + MASUTANI Yasuhiro <masutani@me.es.osaka-u.ac.jp> + (anonymous ftp codes of mime-play.el) + OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp> + (a major author of mime-partial.el and signature.el) + + Steinar Bang <sb@metis.no> + Steven L. Baur <steve@miranova.com> + Kevin Broadey <KevinB@bartley.demon.co.uk> + Alastair Burt <burt@dfki.uni-kl.de> + Eric Ding <ericding@San-Jose.ate.slb.com> + Thierry Emery <Thierry.Emery@aar.alcatel-alsthom.fr> + Simon Josefsson <jas@pdc.kth.se> + Jens Lautenbacher <jtl@tkm.physik.uni-karlsruhe.de> + Carsten Leonhardt <leo@arioch.tng.oche.de> + Pekka Marjola <marjola@bilbo.ntc.nokia.com> + Hisashi Miyashita <himi@bird.scphys.kyoto-u.ac.jp> + Kazuhiro Ohta <ohta@ele.cst.nihon-u.ac.jp> + Alexandre Oliva <oliva@dcc.unicamp.br> + Franois Pinard <pinard@iro.umontreal.ca> + Artur Pioro <artur@flugor.if.uj.edu.pl> + Dan Rich <drich@morpheus.corp.sgi.com> + (contribute to evolve mime-image.el with XEmacs) + Katsumi Yamaoka <yamaoka@jpl.org> diff --git a/semi-1.14.6/README.ja b/semi-1.14.6/README.ja new file mode 100644 index 0000000..47196b2 --- /dev/null +++ b/semi-1.14.6/README.ja @@ -0,0 +1,253 @@ +[README for SEMI kernel package ($BF|K\8lHG(B)] + +SEMI $B$H$O(B? +========= + + SEMI $B$O(B GNU Emacs $B$KBP$7$F(B MIME $B5!G=$rDs6!$9$k%i%$%V%i%j$G$9!#(BMIME $B$O!"(B + $B%a%C%;!<%8Fb$K%W%l!<%s%F%-%9%H(B (ASCII) $B0J30$NFbMF$d%X%C%@$r4^$`$b$N$K(B + $B4X$7$FDs0F$5$l$?%$%s%?!<%M%C%H5,3J$G$9!#(B + + RFC 2045 : Internet Message Bodies + RFC 2046 : Media Types + RFC 2047 : Message Header Extensions + RFC 2048 : MIME Registration Procedures + RFC 2049 : MIME Conformance + + SEMI $B$O!"0J2<$N5!G=$r;}$C$F$$$^$9(B: + + - MIME message viewer (mime-view-mode) (RFC 2045 .. 2049) + - MIME message composer (mime-edit-mode) (RFC 2045 .. 2049) + + MIME message viewer $B$H(B MIME message compiser $B$O$5$i$K<!$NFCD'$r;}$C$F(B + $B$$$^$9(B: + + - filename handling by Content-Disposition field (RFC 1806) + - PGP/MIME security Multiparts (RFC 2015) + - application/pgp (draft-kazu-pgp-mime-00.txt; obsolete) + - text/richtext (RFC 1521; obsolete; preview only) + - text/enriched (RFC 1896) + - External method configuration by mailcap (RFC 1524) + + $B$3$N%Q%C%1!<%8$K$O(B MUAs $B$K4X$9$k(B MIME $B3HD%$O4^$^$l$F$$$J$$$3$H$KCm0U(B + $B$7$F$/$@$5$$!#$3$l$i$O!"JL$N%Q%C%1!<%8$H$7$FG[I[$5$l$F$$$^$9!#(B + +$BI,MW$J4D6-(B +========== + + SEMI $B$O!"(BXEmacs 21.1 $B0J9_!"$*$h$S(B GNU Emacs 20.4 $B0J9_$KBP1~$7$F$$$^$9!#(B + + SEMI $B$O!"(BGNU Emacs 19.28 $B$^$?$O(B XEmacs 19.14 $B$h$j$b8E$$$b$N$K$D$$$F$O!"(B + $B0l@ZBP1~$7$F$$$^$;$s!#2C$($F!"(BSEMI $B$O(B Mule 1, Mule 2 $B$*$h$S(B GNU Emacs + 20.1/20.2 $B$J$I$G<BAu$5$l$F$$$k(B byte-indexing $B$G$OF0:n$7$^$;$s!#(B + + SEMI $B$O!"(BEmacs 19.29 $B$+$i(B 19.34, XEmacs 19.15 $B$^$?$O(B XEmacs 20.2 $B$K$D(B + $B$$$F$bBP1~$O$7$F$$$^$;$s$,!"F0$/$+$b$7$l$^$;$s!#(B + + SEMI $B$O!"(BAPEL (9.22 $B0J9_(B) $B$H(B FLIM (1.14.2 $B0J9_(B) $B$rI,MW$H$7$^$9!#(B SEMI + $B$r%$%s%9%H!<%k$9$kA0$K!"$3$l$i$r%$%s%9%H!<%k$7$F$/$@$5$$!#(BAPEL $B$O!"0J(B + $B2<$GF~<j2DG=$G$9!#(B: + + ftp://ftp.m17n.org/pub/mule/apel/ + + $B$=$7$F!"(BFLIM $B$O0J2<$GF~<j2DG=$G$9!#(B: + + http://www.kanji.zinbun.kyoto-u.ac.jp/~tomo/comp/emacsen/lisp/ + flim/flim-1.14/ + +$B%$%s%9%H!<%k(B +============ + +(a) $BE83+$7$?>l=j$G<B9T$9$k(B + + $B$b$7!"B>$N%G%#%l%/%H%j$K%$%s%9%H!<%k$9$k$3$H$rK>$^$J$$$J$i$P!"0J2<$N(B + $B$_$r<B9T$7$F$/$@$5$$!#(B: + + % make + + $B$"$J$?$O(B emacs $B%3%^%s%IL>$r;XDj$9$k$3$H$,2DG=$G$9!#Nc$($P!"(B + + % make EMACS=xemacs + + $B$b$7!"(B`EMACS=...' $B$,>JN,$5$l$k$H!"(BEMACS=emacs $B$,MQ$$$i$l$^$9!#(B + +(b) make install + + $B$b$7$"$J$?$,!"B>$N%G%#%l%/%H%j$K%$%s%9%H!<%k$9$k$3$H$rK>$`$J$i$P!"0J2<(B + $B$r<B9T$7$F$/$@$5$$!#(B: + + % make install + + $B$"$J$?$O(B emacs $B%3%^%s%IL>$r;XDj$9$k$3$H$,2DG=$G$9!#Nc$($P!"(B + + % make install EMACS=xemacs + + $B$b$7!"(B`EMACS=...' $B$,>JN,$5$l$k$H!"(BEMACS=emacs $B$,MQ$$$i$l$^$9!#(B + + $B$"$J$?$O!"(BEmacs Lisp $B%W%m%0%i%`$H%7%'%k%9%/%j%W%H$K4X$9$k%G%#%l%/%H%j3,(B + $BAX$N@\F,8l$r;XDj$9$k$3$H$,$G$-$^$9!#$?$H$($P!"(B: + + % make install PREFIX=~/ + + $B$b$7!"(B`PREFIX=...' $B$,>JN,$5$l$k$H!";XDj$7$?(B emacs $B%3%^%s%I$N%G%#%l%/(B + $B%H%j3,AX$N@\F,8l$,;HMQ$5$l$^$9!#(B($B$?$V$s!"(B/usr/local) + + $BNc$($P!"$b$7!"(BPREFIX=/usr/local $B$*$h$S!"(BEMACS 19.34 $B$,;XDj$5$l$k$H!"(B + $B0J2<$N$h$&$J%G%#%l%/%H%j3,AX$,:n@.$5$l$k$G$7$g$&!#(B: + + /usr/local/share/emacs/19.34/site-lisp/ --- emu + /usr/local/share/emacs/site-lisp/apel/ --- APEL + /usr/local/share/emacs/site-lisp/flim/ --- FLIM + /usr/local/share/emacs/site-lisp/semi/ --- SEMI + + $B$"$J$?$O!"(Bsite-lisp $B$N%G%#%l%/%H%j$r;XDj$9$k$3$H$,$G$-$^$9!#Nc$($P!"(B + + % make install LISPDIR=~/share/emacs/lisp + + $B$b$7!"(B`LISPDIR=...' $B$,>JN,$5$l$k$H!";XDj$7$?(B emacs $B%3%^%s%I$N(B + site-lisp $B%G%#%l%/%H%j$,;HMQ$5$l$^$9(B($B$?$V$s!"(B + /usr/local/share/emacs/site-lisp $B$^$?$O(B + /usr/local/lib/xemacs/site-lisp)$B!#(B + + $B$b$7!"(Bemu $B%b%8%e!<%k(B (APEL $B$K4^$^$l$F$$$k(B)$B$,0lHLE*$G$O$J$$%G%#%l%/%H(B + $B%j$K%$%s%9%H!<%k$5$l$F$$$k>l9g$K$O!"$"$J$?$O!"$3$l$i$,$I$3$G8+IU$1$i(B + $B$l$k$+;XDj$9$kI,MW$,$"$j$^$9!#(B: + + % make install VERSION_SPECIFIC_LISPDIR=~/elisp + +(c) XEmacs package $B$H$7$F$N%$%s%9%H!<%k(B + + $B$b$7$"$J$?$,!"(BXEmacs package $B$N%G%#%l%/%H%j$K%$%s%9%H!<%k$9$k$3$H$rK>(B + $B$`$J$i$P!"0J2<$r<B9T$7$F$/$@$5$$!#(B: + + % make install-package + + $B$"$J$?$O!"(Bemacs command $B$NL>A0$r;XDj$9$k$3$H$,$G$-$^$9!#$?$H$($P!"(B: + + % make install-package XEMACS=xemacs-21 + + $B$b$7!"(B`XEMACS=...' $B$,>JN,$5$l$k$H!"(BXEMACS=xemacs $B$,MQ$$$i$l$^$9!#(B + + $B$"$J$?$O!"(Bpackage $B$N%G%#%l%/%H%j$r;XDj$9$k$3$H$,$G$-$^$9!#$?$H$($P!"(B: + + % make install PACKAGEDIR=~/.xemacs + + $B$b$7!"(B`PACKAGEDIR=...' $B$,>JN,$5$l$k$H!":G=i$KB8:_$9$k(B package $B$N%G%#(B + $B%l%/%H%j$,;HMQ$5$l$^$9!#(B + + XEmacs package $B%7%9%F%`$O!"(BXEmacs 21.0 $B0J9_$rI,MW$H$9$k$3$H$KCm0U$7$F$/(B + $B$@$5$$!#(B + +(a,b,c) + + $B$"$J$?$O!"(B${archive}/SEMI-CFG $B$H$$$&%U%!%$%k$r=q$-49$($k$3$H$K$h$j!"(B + $BB>$N%*%W%7%g%s$N@_Dj$r;XDj$9$k$3$H$,$G$-$^$9!#(B${archive}/README.en $B$H(B + ${archive}/SEMI-CFG $B$N%3%a%s%H$rFI$s$G$/$@$5$$!#(B + +$B=i4|2=(B +====== + +(a) load-path + + $B$"$J$?$,(B XEmacs 21.1 $B0J9_$"$k$$$O(B GNU Emacs 20.4 $B0J9_$r;HMQ$7$F$$$k$J(B + $B$i!"(Bload-path $B$K4X$7$FI,MW$J@_Dj$O$"$j$^$;$s!#(B + +(b) mime-setup + + $B$"$J$?$N(B ~/.emacs $B$K0J2<$N5-=R$rDI2C$7$F$/$@$5$$!#(B: + + (load "mime-setup") + +$BIUB0;qNA(B +======== + + SEMI $B$r;H$$;O$a$k$?$a$K!"(B${archive}/README.en $B$rFI$s$G$/$@$5$$!#(B + + RFC 822, 1524, 1806, 1847, 1896, 2015, 2045, 2046, 2047, 2048 $B$*$h$S(B + 2049 $B$O(B anonymous ftp $B$r7PM3$7$FF~<j2DG=$G$9!#(B: + + ftp://ftp.merit.edu/internet/documents/rfc/ + +$B%a!<%j%s%0%j%9%H(B +================ + + $B$b$7!"$"$J$?$,!"%P%0%l%]!<%H$*$h$S(B/$B$^$?$O2~NI$N$?$a$NDs0F$r=q$/>l9g$K$O!"(B + $B$=$l$i$r(B EMACS-MIME $B%a!<%j%s%0%j%9%H$KAw$C$F$/$@$5$$!#(B + + emacs-mime-en@m17n.org ($B1Q8l(B) + emacs-mime-ja@m17n.org ($BF|K\8l(B) + + EMACS-MIME ML $B$r7PM3$7$F!"$"$J$?$O(B SEMI $B$N%P%0$rJs9p$9$k$3$H$d!"(BSEMI + $B$N:G?7HG$NF~<j!"(BSEMI $B$N>-Mh$N6/2=$K$D$$$F5DO@$9$k$3$H$J$I$,$G$-$^$9!#(B + EMACS-MIME ML $B$K2CF~$9$k$?$a$K$O!"K\J8$K(B + + subscribe $B$"$J$?$NL>A0(B + $BNc(B: subscribe MORIOKA Tomohiko + +$B$H=q$$$?%a!<%k$r<!$N%"%I%l%9$N$I$A$i$+$KAw?.$7$F$/$@$5$$!#(B + + emacs-mime-en-ctl@m17n.org ($B1Q8l(B) + emacs-mime-ja-ctl@m17n.org ($BF|K\8l(B) + + $B$3$3$G!"(Bmorioka@jaist.ac.jp $B$J$I$N:n<T(B($BC#(B)$B$KD>@\%a!<%k$rAw?.$7$F$O$J(B + $B$i$J$$$3$H$KCm0U$7$F$/$@$5$$!#$J$<$J$i!"$"$J$?$NLdBj$O!"B>$N4D6-$K@8(B + $B$8$k$+$b$7$l$J$$$+$i$G$9(B($B$=$&$G$J$1$l$P$=$l$O(BSEMI$B$N%P%/$G$OL5$/!"$"$J(B + $B$?$NLdBj$G$"$k$+$b$7$l$^$;$s(B)$B!#(B $B2f!9$O!"(BEMACS-MIME $B%a!<%j%s%0%j%9%HFb(B + $B$G5DO@$7$^$9!#$H$j$"$($:!":n<T$X$ND>@\$N%a!<%k$OL5;k$5$l$k$+$b$7$l$^(B + $B$;$s!#(BEMACS-MIME $B%a!<%j%s%0%j%9%H$K%a!<%k$rAw?.$7$F$/$@$5$$!#(B + +CVS $B$K4p$E$$$?3+H/(B +================== + + $B$b$7$"$J$?$,(B CVS $B$K4p$E$$$?3+H/$K;22C$7$?$$$H;W$&$J$i$P!"0J2<$N%"%I%l%9$K!"(B + $B$"$J$?$N%"%+%&%s%HL>$H(B ssh $B$N(B public key $B$rE:$($?%a!<%k$rAw?.$7$F$/$@$5$$!#(B + + cvs@cvs.m17n.org + + CVSROOT $B$O!"(B:ext:cvs@cvs.m17n.org:/cvs/root $B$G$9!#(B + + $B$b$7!"$"$J$?$,(B ssh $B$r;HMQ$G$-$J$$$N$G$"$l$P!"(BUNIX $B$N(B /etc/passwd $B7?$K0E9f(B + $B2=$5$l$?%Q%9%o!<%I$rAw?.$7$F$/$@$5$$!#$"$J$?$O(B CVSROOT $B$r(B + :pserver:<accountname>@cvs.m17n.org:/cvs/root + $B$H$7$F;22C$9$k$3$H$,$G$-$^$9!#(B + + $B2f!9$O!"$"$J$?$,3+$+$l$?3+H/$K;22C$7$F$/$@$5$k$3$H$r4|BT$7$F$$$^$9!#(B + +$B:n<T(B +==== + +$B85$N:n<T(B + + MORIOKA Tomohiko <morioka@jaist.ac.jp> + (SEMI $B$N$$$m$$$m$JItJ,$H(B mime-view $B$N:n<T(B) + UMEDA Masanobu <umerin@mse.kyutech.ac.jp> + (emacs-mime-tools $B$N(B mime.el $B$N:n<T!#(Bmime.el $B$O(B SEMI $B$N(B + meme-edit.el $B$N867?$G$9(B) + +$BB>$N:n<T(B + + Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> + ($B$?$/$5$s$N%3!<%I$H(B signature.el $B$N<gMW$J:n<T(B) + MASUTANI Yasuhiro <masutani@me.es.osaka-u.ac.jp> + (mime-play.el $B$N(B anonymous ftp $B%3!<%I(B) + OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp> + (mime-partial.el $B$H(B signature.el $B$N<gMW$J:n<T(B) + + Steinar Bang <sb@metis.no> + Steven L. Baur <steve@miranova.com> + Kevin Broadey <KevinB@bartley.demon.co.uk> + Alastair Burt <burt@dfki.uni-kl.de> + Eric Ding <ericding@San-Jose.ate.slb.com> + Thierry Emery <Thierry.Emery@aar.alcatel-alsthom.fr> + Simon Josefsson <jas@pdc.kth.se> + Jens Lautenbacher <jtl@tkm.physik.uni-karlsruhe.de> + Carsten Leonhardt <leo@arioch.tng.oche.de> + Pekka Marjola <marjola@bilbo.ntc.nokia.com> + Hisashi Miyashita <himi@bird.scphys.kyoto-u.ac.jp> + Kazuhiro Ohta <ohta@ele.cst.nihon-u.ac.jp> + Alexandre Oliva <oliva@dcc.unicamp.br> + Fran$Bgo(Bis Pinard <pinard@iro.umontreal.ca> + Artur Pioro <artur@flugor.if.uj.edu.pl> + Artur Pioro <artur@flugor.if.uj.edu.pl> + Dan Rich <drich@morpheus.corp.sgi.com> + (XEmacs $B$H6&$K(B mime-image.el $B$rH/E8$5$;$k$?$a$K4sM?(B) + Katsumi Yamaoka <yamaoka@jpl.org> diff --git a/semi-1.14.6/SEMI-CFG b/semi-1.14.6/SEMI-CFG new file mode 100644 index 0000000..a126788 --- /dev/null +++ b/semi-1.14.6/SEMI-CFG @@ -0,0 +1,159 @@ +;;; -*-Emacs-Lisp-*- + +;; SEMI-CFG: installation setting about SEMI. + +;;; Code: + +(defvar default-load-path load-path) + +(add-to-list 'load-path + (expand-file-name "lisp/apel" user-emacs-directory)) +(add-to-list 'load-path + (expand-file-name "lisp/emu" user-emacs-directory)) +(add-to-list 'load-path + (expand-file-name "lisp/flim" user-emacs-directory)) + + +(if (boundp 'LISPDIR) + (progn + (add-to-list 'default-load-path LISPDIR) + (add-to-list 'load-path LISPDIR) + (add-to-list 'load-path (expand-file-name "apel" LISPDIR)) + )) + +(defvar VERSION_SPECIFIC_LISPDIR nil) + +(if VERSION_SPECIFIC_LISPDIR + (add-to-list 'load-path VERSION_SPECIFIC_LISPDIR)) + +(condition-case nil + (require 'install) + (error (error "Please install APEL 8.7 or later."))) + +(add-path "bitmap-mule") +(add-path "flim") + +(add-to-list 'load-path (expand-file-name ".")) + +(or (module-installed-p 'calist) + (error "Please install APEL 8.7 or later.")) +(or (module-installed-p 'mime) + (error "Please install FLIM 1.6.0 or later.")) +(if (module-installed-p 'tm-view) + (message "Please remove tm from load-path.")) + + +;;; @ Please specify optional package directory if you use them. +;;; + +;; It is only necessary to use `add-path' if these packages are not +;; already on the standard load-path of Emacs. + +;; Function `get-latest-path' detect latest version of such package +;; under load-path directories. If you want to use a version of a +;; package instead of latest version, please specify by argument of +;; function `add-path'. + +;; Function `add-path' finds path under load-path directories. If a +;; package does not exist in load-path, please specify by absolutely +;; (`~/' is available), for example +;; (add-path "~/lib/elisp/bbdb") +;; or +;; (add-path "/opt/share/xmule/site-lisp/bbdb") + + +;;; @@ Please specify BBDB path. +;;; + +(let ((path (get-latest-path "bbdb" 'all-paths))) + (if path + (progn + (add-path path) + (add-path (expand-file-name "lisp" path)) ; run-in-place installation + ))) + +;; Or please specify path. +;; (add-path "bbdb-1.50" 'all-paths) + + +;;; +;;; @@ Please specify Emacs/W3 path. +;;; + +(let ((path (get-latest-path "w3" 'all-paths))) + (if path + (progn + (add-path path) + (add-path (expand-file-name "lisp" path)) ; run-in-place installation + ))) + +;; Or please specify path. +;; (add-path "w3-4.0pre.20" 'all-paths) + + +;;; +;;; @@ Please specify CUSTOM path. +;;; + +(add-latest-path "custom") + + +;;; @ Please specify prefix of install directory. +;;; + +;; Please specify install path prefix. +;; If it is omitted, shared directory (maybe /usr/local is used). +(defvar PREFIX install-prefix) +;;(setq PREFIX "~/") + +;; Please specify emu prefix [optional] +(setq EMU_PREFIX + (if (string-match "XEmacs" emacs-version) + "emu" + "")) + +;; Please specify SEMI prefix [optional] +(setq SEMI_PREFIX "semi") + + +;;; @ executables +;;; + +;; Please specify binary path. (for external method scripts) +(setq METHOD_DIR (expand-file-name "share/semi" PREFIX)) + + + + +;;; @ optional settings +;;; + +;; It is generated by automatically. Please set variable `PREFIX'. +;; If you don't like default directory tree, please set it. +(defvar LISPDIR (install-detect-elisp-directory PREFIX)) +;; (setq install-default-elisp-directory "~/lib/emacs/lisp") + +(setq SEMI_KERNEL_DIR (expand-file-name SEMI_PREFIX LISPDIR)) +(setq SETUP_FILE_DIR SEMI_KERNEL_DIR) + +(setq METHOD_SRC_DIR "methods") +(setq METHODS + '("tm-au" "tm-file" "tm-html" "tm-image" "tm-mpeg" + "tm-plain" "tm-ps" + "tmdecode")) + +(defvar PACKAGEDIR + (if (boundp 'early-packages) + (let ((dirs (append (if early-package-load-path + early-packages) + (if late-package-load-path + late-packages) + (if last-package-load-path + last-packages))) + dir) + (while (not (file-exists-p + (setq dir (car dirs)))) + (setq dirs (cdr dirs))) + dir))) + +;;; SEMI-CFG ends here diff --git a/semi-1.14.6/SEMI-ELS b/semi-1.14.6/SEMI-ELS new file mode 100644 index 0000000..448caf3 --- /dev/null +++ b/semi-1.14.6/SEMI-ELS @@ -0,0 +1,42 @@ +;;; -*-Emacs-Lisp-*- + +;; SEMI-ELS: list of SEMI modules to install + +;;; Code: + +(setq semi-modules-to-compile + '(signature + pgg-def pgg pgg-parse pgg-gpg pgg-pgp5 pgg-pgp mime-pgp + smime + semi-def mime-view mime-play mime-partial postpet + mime-edit + semi-setup mail-mime-setup)) + +(setq semi-modules-not-to-compile nil) + +(mapcar (function + (lambda (cell) + (let ((c-module (car cell)) + (i-modules (cdr cell)) + ) + (if (module-installed-p c-module) + (setq semi-modules-to-compile + (nconc semi-modules-to-compile i-modules)) + (setq semi-modules-not-to-compile + (nconc semi-modules-not-to-compile i-modules)) + ) + ))) + '((bbdb mime-bbdb) + (w3 mime-w3) + )) + +(if (or (string-match "XEmacs" emacs-version) + (featurep 'mule)) + (setq semi-modules-to-compile + (nconc semi-modules-to-compile '(mime-image))) + ) + +(setq semi-modules (append semi-modules-to-compile + semi-modules-not-to-compile)) + +;;; SEMI-ELS ends here diff --git a/semi-1.14.6/SEMI-MK b/semi-1.14.6/SEMI-MK new file mode 100644 index 0000000..2aed7f1 --- /dev/null +++ b/semi-1.14.6/SEMI-MK @@ -0,0 +1,97 @@ +;;; -*-Emacs-Lisp-*- + +;; SEMI-MK: installer for SEMI. + +;;; Code: + +(defun config-semi () + (let (prefix exec-prefix lisp-dir version-specific-lisp-dir) + (and (setq prefix (car command-line-args-left)) + (or (string-equal "NONE" prefix) + (defvar PREFIX prefix) + )) + (setq command-line-args-left (cdr command-line-args-left)) + (and (setq lisp-dir (car command-line-args-left)) + (or (string-equal "NONE" lisp-dir) + (defvar LISPDIR lisp-dir) + )) + (setq command-line-args-left (cdr command-line-args-left)) + (and (setq version-specific-lisp-dir (car command-line-args-left)) + (or (string-equal "NONE" version-specific-lisp-dir) + (progn + (defvar VERSION_SPECIFIC_LISPDIR version-specific-lisp-dir) + (princ (format "VERSION_SPECIFIC_LISPDIR=%s\n" + VERSION_SPECIFIC_LISPDIR))) + )) + (setq command-line-args-left (cdr command-line-args-left)) + ) + (load-file "SEMI-CFG") + (load-file "SEMI-ELS") + (princ (format "PREFIX=%s +LISPDIR=%s\n" PREFIX LISPDIR)) + ) + +(defun directory= (dir1 dir2) + (string= (file-name-as-directory dir1)(file-name-as-directory dir2)) + ) + +(defun compile-semi () + (config-semi) + (print load-path) + (compile-elisp-modules semi-modules-to-compile ".") + (compile-elisp-module 'mime-setup ".") + ) + +(defun install-semi () + (config-semi) + (princ (format "%s\n" emacs-version)) + (install-elisp-modules semi-modules "." SEMI_KERNEL_DIR) + (install-elisp-modules '(mime-setup) "." SETUP_FILE_DIR) + ) + +(defun install-execs () + (config-semi) + (install-files METHODS METHOD_SRC_DIR METHOD_DIR nil t) + ) + +(defun config-semi-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 "SEMI-CFG") + (load-file "SEMI-ELS") + + (princ (format "PACKAGEDIR=%s\n" PACKAGEDIR)) + )) + +(defun compile-semi-package () + (config-semi-package) + + (setq autoload-package-name "semi") + (add-to-list 'command-line-args-left ".") + (batch-update-directory) + + (add-to-list 'command-line-args-left ".") + (Custom-make-dependencies) + + (compile-elisp-modules (append semi-modules-to-compile + '(mime-setup auto-autoloads custom-load)) + ".") + ) + +(defun install-semi-package () + (config-semi-package) + (install-elisp-modules (append semi-modules + '(mime-setup auto-autoloads custom-load)) + "./" + (expand-file-name SEMI_PREFIX + (expand-file-name "lisp" + PACKAGEDIR))) + (delete-file "./auto-autoloads.el") + (delete-file "./custom-load.el") + ) + +;;; SEMI-MK ends here diff --git a/semi-1.14.6/SEMI-naming.ol b/semi-1.14.6/SEMI-naming.ol new file mode 100644 index 0000000..746e1f4 --- /dev/null +++ b/semi-1.14.6/SEMI-naming.ol @@ -0,0 +1,41 @@ +* MIME-View + +** mime-entity-* + + mime-entity related functions. + + +** mime-raw-* + + mime-raw-buffer related features. + + - buffer local variables in mime-raw-buffer + + - functions expected running in mime-raw-buffer + + +** mime-preview-* + + mime-preview-buffer related features. + + - buffer local variables in mime-preview-buffer + + - functions expected running in mime-preview-buffer + + +** mime-display-* + + - functions to make presentation in mime-preview-buffer from + element(s) of mime-raw-buffer + + +** mime-view-* + + MIME-View related general features. + + - variables or functions related with both mime-raw-buffer and + mime-preview-buffer + + - customizable variables + + - view something and enter another mode in another buffer diff --git a/semi-1.14.6/TODO b/semi-1.14.6/TODO new file mode 100644 index 0000000..4be8a0e --- /dev/null +++ b/semi-1.14.6/TODO @@ -0,0 +1,66 @@ +[TODO] +====== + +* MIME-View + +** dynamic configuration for 'mime-preview-condition + +** Don't expect raw-buffer + +** lazy generating of situations from mime-entity information + + +* MIME-Edit + +** WYSIWYG editing support + +** Use MIME-Preview like tag and display + +** Redesign to use two buffers for one message + + MIME-View is based on "Multiple Representation Space (layer) Model". +In this model, network representation and its presentation are +distinguished. Thus MIME-View uses two buffers for one message, +'mime-raw-buffer (for network representation) and +'mime-preview-buffer. MIME-View manages them based on information of +entities. According to experience of MIME-View, this model is good to +treat complex structured data, such as MIME. + + MIME-Edit was designed to use one buffer for one message. So it is +hard to edit like WYSIWYG style. Format of tag is limited by +translation. Content of forwarded message is unreadable. It is +better to introduce "Multiple Representation Space Model" to resolve +these problems. + +** Check available MIME-charset + + MIME-charset $B0J30$,@8@.$5$l$k>l9g$N=hM}$r;XDj$G$-$k$h$&$K$9$k!#(B + + For example: + + (a) translate problematic characters to similar representation + (b) display warning message + (e.g. "`x-ctext' is generated. Do you send it? (yes/no)") + (c) stop sending + +** Don't use buffer-local variables + + Don't use buffer-local variables to control behavior about +translating to network representation, such as 'mime-transfer-level, +'mime-transfer-level-string, +'mime-edit-charset-default-encoding-alist, 'mime-edit-pgp-processing. +Because they have problem with Semi-gnus. + + +* Etc. + +** Write manual + + + +[Known Bugs] +============ + +* MIME-Edit + +** Content-ID is mandatory for message/external-body diff --git a/semi-1.14.6/VERSION b/semi-1.14.6/VERSION new file mode 100644 index 0000000..abdf13a --- /dev/null +++ b/semi-1.14.6/VERSION @@ -0,0 +1,239 @@ +[SEMI Version names] + +0.72 -------- -------- +0.75 -------- -------- +0.83 -------- -------- +0.87 -------- -------- +0.88 -------- -------- +0.91 -------- -------- +0.92 -------- -------- + +;;------------------------------------------------------------------------- +;; Hokuriku Railway $(BKLN&E4F;(B +;; Ishikawa Line $(B@P@n@~(B +;;------------------------------------------------------------------------- +0.96 Kaga-Ichinomiya $(B2C2l0l$N5\(B ; $(B!JGr;3Hf$(D5/$(B?@<R!K(B +0.97 Naka-Tsurugi $(BCfDaMh(B +0.112 Tsurugi $(BDaMh(B ; <=> $(B$8$c$$%P%9(B +0.115 Hinomiko $(BF|8f;R(B +0.115.1 Oyanagi $(B>.Lx(B +0.115.2 Inokuchi $(B0f8}(B +0.116 D-Dhji-A $(BF;K!;{(B +0.118 Sodani $(BA>C+(B +0.118.1 Shijima $(B;M==K|(B +0.118.2 Otomaru $(B254](B +1.0.0 Nukaj-Dtaku-mae-A $(B3[=;BpA0(B +1.0.1 Magae $(BGOBX(B +1.0.2 Nonoichi-K-Ddaimae-A $(BLn!9;T9)BgA0(B +1.1.0 Nonoichi $(BLn!9;T(B +1.1.1 Oshino $(B2!Ln(B +1.1.2 Shin-Nishikanazawa $(B?7@>6bBt(B ; <=> JR $(B@>6bBt(B +1.2.0 Nishiizumi $(B@>@t(B +1.2.1 Nomachi $(BLnD.(B + +;;------------------------------------------------------------------------- +;; West Japan Railway $(B@>F|K\N95RE4F;(B http://www.westjr.co.jp/ +;; Hokuriku Line $(BKLN&K\@~(B +;;------------------------------------------------------------------------- +1.2.2 Naoetsu $(BD>9>DE(B ; = JR $(B?.1[K\@~(B +1.2.3 Tanihama $(BC+IM(B +1.2.4 Arimagawa $(BM-4V@n(B +1.3.0 Nadachi $(BL>N)(B +1.3.1 Tsutsuishi $(BE{@P(B +1.3.2 N-D-A $(BG=@8(B +1.3.3 Uramoto $(B1:K\(B +1.3.4 Kajiyashiki $(B3a20I_(B +1.4.0 Itoigawa $(B;e5{@n(B ; = JR $(BBg;e@~(B +1.4.1 -Dmi-A $(B@D3$(B +1.4.2 Oyashirazu $(B?FITCN(B +1.4.3 Ichiburi $(B;T?6(B +1.4.4 Ecch-D-Miyazaki-A $(B1[Cf5\:j(B +1.4.5 Tomari $(BGq(B +1.4.6 Ny-Dzen-A $(BF~A1(B +1.5.0 Nishi-Ny-Dzen-A $(B@>F~A1(B +1.5.1 Ikuji $(B@8CO(B +1.5.2 Kurobe $(B9uIt(B +1.5.3 Uozu $(B5{DE(B ; <=> $(BIY;3COJ}E4F;(B +1.5.4 Higashi-Namerikawa $(BEl3j@n(B +1.6.0 Namerikawa $(B3j@n(B ; <=> $(BIY;3COJ}E4F;(B +1.7.0 Mizuhashi $(B?e66(B +1.7.1 Higashi-Toyama $(BElIY;3(B +1.8.0 Toyama $(BIY;3(B ; = JR $(B9b;3K\@~!"IY;39A@~(B +1.8.1 Kureha $(B8b1)(B +1.8.2 Kosugi $(B>.?y(B +1.8.3 Ecch-D-Daimon-A $(B1[CfBgLg(B +1.8.4 Takaoka $(B9b2,(B ; = JR $(BI98+@~!">kC<@~(B +1.8.5 Nishi-Takaoka $(B@>9b2,(B +1.8.6 Fukuoka $(BJ!2,(B +1.9.0 Isurugi $(B@PF0(B +1.9.1 Kurikara $(B6fMx2@Me(B +1.10.0 Tsubata $(BDEH((B +1.10.1 Morimoto $(B?9K\(B +1.10.2 Higashi-Kanazawa $(BEl6bBt(B +1.11.0 Kanazawa $(B6bBt(B ; <=> $(BKLN&E4F;(B $(BKLE46bBt(B +1.12.0 Nishi-Kanazawa $(B@>6bBt(B ; <=> $(BKLN&E4F;(B $(B?7@>6bBt(B +1.12.1 [JR] Nonoichi [JR] $(BLn!9;T(B +1.13.0 Matt-D-A $(B>>G$(B +1.13.1 Kaga-Kasama $(B2C2l3^4V(B +1.13.2 Mikawa $(BH~@n(B +1.13.3 Komaiko $(B>.Iq;R(B +1.13.4 Terai $(B;{0f(B +1.13.5 Meih-D-A $(BL@Jv(B +1.13.6 Komatsu $(B>.>>(B +1.13.7 Awazu $(B0@DE(B +1.14.0 Iburihashi $(BF066(B +1.14.1 Kaga-Onsen $(B2C2l29@t(B +1.14.2 Daish-Dji-A $(BBg@;;{(B +1.14.3 Ushinoya $(B5m%NC+(B +1.14.4 Hosorogi $(B:YO$LZ(B +1.14.5 Awara-Onsen $(B028629@t(B +1.14.6 Maruoka $(B4]2,(B +: : : +------- Tsuruga $(BFX2l(B ; = JR $(B>.IM@~(B +------- Shin-Hikida $(B?7I%ED(B +------- -Dmi-Shiotsu-A $(B6a9>1vDE(B ; = JR $(B8P@>@~(B +------- Yogo $(BM>8b(B +------- Kinomoto $(BLZ%NK\(B +------- Takatsuki $(B9b7n(B +------- Kawake $(B2OLS(B +------- Torahime $(B8WI1(B +------- Nagahama $(BD9IM(B +------- Tamura $(BEDB<(B +------- Sakata $(B:dED(B + (Maibara) ($(BJF86(B) ; = JR $(BEl3$F;K\@~(B + + +[WEMI version names] + +;;------------------------------------------------------------------------- +;; East Japan Railway $(BElF|K\N95RE4F;(B http://www.jreast.co.jp/ +;; T-Dkaid-A Line $(BEl3$F;K\@~(B +;;------------------------------------------------------------------------- +1.2.0 T-Dky-A $(BEl5~(B +1.2.1 Shinbashi $(B?766(B ; = JR $(B;3<j@~!"2#?\2l@~(B +1.2.2 Shinagawa $(BIJ@n(B ; = JR $(B;3<j@~!"2#?\2l@~(B +1.2.3 Kawasaki $(B@n:j(B ; = JR $(BFnIp@~(B +1.2.4 Yokohama $(B2#IM(B ; = JR $(B5~IMElKL@~!&:,4_@~!"2#?\2l@~(B +1.3.0 Totsuka $(B8MDM(B ; = JR $(B2#?\2l@~(B +1.3.1 -Dfuna-A $(BBgA%(B ; = JR $(B:,4_@~!"2#?\2l@~(B +1.4.0 Fujisawa $(BF#Bt(B ; <=> $(B>.ED5^EEE4(B $(B9>%NEg@~!"9>%NEgEEE4(B +1.4.1 Tsujid-D-A $(@DTF2(B ; $(B!J!V$(@DT!W(B= J90@B-4454:128b$(B!K(B +1.4.2 Chigasaki $(B3}%v:j(B ; = JR $(BAjLO@~(B +1.4.3 Hiratsuka $(BJ?DM(B +1.4.4 -Diso-A $(BBg0k(B +1.4.5 Ninomiya $(BFs5\(B +1.4.6 K-Dzu-A $(B9qI\DE(B ; = JR $(B8fEB>l@~(B +1.5.0 Kamonomiya $(B3{5\(B +1.5.1 Odawara $(B>.ED86(B ; <=> $(B>.ED5^!"H":,EP;3E4F;!"(B + ; $(B0KF&H":,E4F;(B +1.5.2 Hayakawa $(BAa@n(B +1.5.3 Nebukawa $(B:,I\@n(B +1.5.4 Manazuru $(B??Da(B +1.6.0 Yugawara $(BEr2O86(B +1.7.0 Atami $(BG.3$(B ; = JR $(B0KEl@~(B +;;------------------------------------------------------------------------- +;; Central Japan Railway $(BEl3$N95RE4F;(B +;;------------------------------------------------------------------------- +1.7.1 Kan'nami $(BH!Fn(B +1.8.0 Mishima $(B;0Eg(B ; = $(B0KF&H":,E4F;(B +1.8.1 Numazu $(B>BDE(B ; = JR $(B8fEB>l@~(B +1.8.2 Katahama $(BJRIM(B +1.8.4 Hara $(B86(B +1.8.5 Higashi-Tagonoura $(BElED;R%N1:(B +1.8.6 Yoshiwara $(B5H86(B ; = $(B3YFnE4F;(B +1.9.0 Fuji $(BIY;N(B ; = JR $(B?H1d@~(B +1.9.1 Fujikawa $(BIY;N@n(B +1.10.0 Shin-Kambara $(B?73w86(B +1.10.1 Kambara $(B3w86(B +1.10.2 Yui $(BM3Hf(B +1.11.0 Okitsu $(B6=DE(B +1.12.0 Shimizu $(B@6?e(B +1.12.1 Kusanagi $(BApFe(B +1.13.0 Shizuoka $(B@E2,(B +1.13.1 Abekawa $(B0BG\@n(B +1.13.2 Mochimune $(BMQ=!(B +1.13.3 Yaizu $(B>FDE(B +1.13.4 Nishi-Yaizu $(B@>>FDE(B +1.13.5 Fijieda $(BF#;^(B +1.13.6 Rokug-D-A $(BO;9g(B +1.13.7 Shimada $(BEgED(B +1.14.0 Kanaya $(B6bC+(B ; = $(BBg0f@nE4F;(B +------ Kikugawa $(B5F@n(B +------ Kakegawa $(B3]@n(B ; = $(BE7N5IML>8PE4F;(B +------ Fukuroi $(BB^0f(B +------ Iwata $(BHXED(B +------ Toyodach-D-A $(BK-EDD.(B +------ Tenry-Dgawa-A $(BE7N5@n(B +------ Hamamatsu $(BIM>>(B ; = $(B1s=#E4F;(B +------ Takatsuka $(B9bDM(B +------ Maisaka $(BIq:e(B +------ Bentenjima $(BJ[E7Eg(B +------ Araimachi $(B?75oD.(B +------ Wasizu $(BOIDE(B +------ Shinjohara $(B?7=j86(B ; = $(BE7N5IML>8PE4F;(B +------ Futagawa $(BFs2O(B +------ Toyohashi $(BK-66(B ; = JR $(BHSED@~(B +: : : +------ Kanayama $(B6b;3(B ; =$(B!J(BJR $(BCf1{K\@~!K(B +------ Ot-Dbashi-A $(BHxF,66(B +------ Nagoya $(BL>8E20(B ; = JR $(B4X@>K\@~!J!&Cf1{K\@~!K(B +: : : +------ Gifu $(B4tIl(B ; = JR $(B9b;3K\@~(B +: : : +------ Samegai $(B@C%v0f(B +;;------------------------------------------------------------------------- +;; West Japan Railway $(B@>F|K\N95RE4F;(B http://www.westjr.co.jp/ +;;------------------------------------------------------------------------- +------ Maibara $(BJF86(B ; = JR $(BKLN&K\@~(B +: : : +------ Kusatsu $(BApDE(B ; = JR $(BApDE@~(B +: : : +------ Yamashina $(B;32J(B ; = JR $(B8P@>@~(B +------ Ky-Dto-A $(B5~ET(B ; = JR $(BF`NI@~!&;31"K\@~(B + ; <=> $(B6aE4(B $(B5~ET@~!"5~ET;T8rDL6I(B $(B1(4]@~(B +: : : +------ -Dsaka-A $(BBg:e(B ; = JR $(BBg:e4D>u@~(B <=> JR $(BEl@>@~(B $(BKL?7CO(B + ; <=> $(BBg:e;T8rDL6I!":e?@!":e5^(B $(BG_ED(B +: : : +------ K-Dbe-A $(B?@8M(B ; = JR $(B;3M[K\@~(B + + +[REMI version names] + +;;------------------------------------------------------------------------- +;; West Japan Railway $(B@>F|K\N95RE4F;(B http://www.westjr.co.jp/ +;; Himi Line $(BI98+@~(B +;;------------------------------------------------------------------------- +1.4.0 Himi $(BI98+(B +1.5.0 Shimao $(BEgHx(B +1.6.0 Amaharashi $(B1+@2(B +1.8.0 Ecch-D-Kokubu-A $(B1[Cf9qJ,(B +1.8.1 Fushiki $(BIzLZ(B ; <=> $(B%&%i%8%*%9%C%H%C%/9RO)(B +1.8.2 N-Dmachi-A $(BG=D.(B +1.8.3 Ecch-D-Nakagawa-A $(B1[CfCf@n(B +1.8.4 Takaoka $(B9b2,(B ; = JR $(BKLN&K\@~!">kC<@~(B + +;;------------------------------------------------------------------------- +;; Hokuetsu Express $(BKL1[5^9T(B +;; http://www.tiara.or.jp/~tokamaci/hokuhoku/hokuhoku.html +;; Hokuhoku Line $(B$[$/$[$/@~(B +;;------------------------------------------------------------------------- +1.13.0 Saigata $(B:T3c(B ; = JR $(B?.1[K\@~(B +1.13.1 Kubiki $(B$/$S$-(B +1.13.2 -Dike-Ikoinomori-A $(BBgCS$$$3$$$N?9(B +1.14.0 Uragawara $(B$&$i$,$o$i(B +1.14.1 Mushigawa-Dsugi-A $(BCn@nBg?y(B +1.14.2 Hokuhoku--Dshima-A $(B$[$/$[$/BgEg(B +1.14.3 Matsudai $(B$^$D$@$$(B + + +[etc.] + +;;------------------------------------------------------------------------- +;; West Japan Railway $(B@>F|K\N95RE4F;(B http://www.westjr.co.jp/ +;; Kosei Line $(B8P@>@~(B +;;------------------------------------------------------------------------- +------- (-Dmi-Shiotsu)-A ($(B6a9>1vDE(B) ; = JR $(BKLN&K\@~(B +: : : +------- Nishi--Dtsu-A $(B@>BgDE(B + (Yamashina) ($(B;32J(B) ; = JR $(BEl3$F;K\@~(B diff --git a/semi-1.14.6/mail-mime-setup.el b/semi-1.14.6/mail-mime-setup.el new file mode 100644 index 0000000..7b375b7 --- /dev/null +++ b/semi-1.14.6/mail-mime-setup.el @@ -0,0 +1,65 @@ +;;; mail-mime-setup.el --- setup file for mail-mode. + +;; Copyright (C) 1994,1995,1996,1997,1998,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> +;; Keywords: mail-mode, MIME, multimedia, multilingual, encoded-word + +;; This file is part of SEMI (Setting for Emacs MIME Interfaces). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Code: + +(require 'semi-setup) +(require 'alist) + + +(autoload 'turn-on-mime-edit "mime-edit" + "Unconditionally turn on MIME-Edit minor mode." t) + +;; (autoload 'eword-decode-header "eword-decode" +;; "Decode MIME encoded-words in header fields." t) + + +;;; @ for mail-mode, RMAIL and VM +;;; + +;; (add-hook 'mail-setup-hook 'eword-decode-header) +(add-hook 'mail-setup-hook 'turn-on-mime-edit 'append) +(add-hook 'mail-send-hook 'mime-edit-maybe-translate) +(set-alist 'mime-edit-split-message-sender-alist + 'mail-mode (function + (lambda () + (interactive) + (funcall send-mail-function) + ))) + + +;;; @ for signature +;;; + +(if mime-setup-use-signature + (setq mail-signature nil) + ) + + +;;; @ end +;;; + +(provide 'mail-mime-setup) + +;;; mail-mime-setup.el ends here diff --git a/semi-1.14.6/mime-bbdb.el b/semi-1.14.6/mime-bbdb.el new file mode 100644 index 0000000..cc6f7f2 --- /dev/null +++ b/semi-1.14.6/mime-bbdb.el @@ -0,0 +1,308 @@ +;;; mime-bbdb.el --- SEMI shared module for BBDB + +;; Copyright (C) 1995,1996,1997 Shuhei KOBAYASHI +;; Copyright (C) 1997,1998 MORIOKA Tomohiko + +;; Author: Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> +;; Maintainer: Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> +;; Keywords: BBDB, MIME, multimedia, multilingual, mail, news + +;; This file is part of SEMI (Suite of Emacs MIME Interfaces). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Code: + +(require 'path-util) +(require 'std11) +(require 'mime-view) + +(if (module-installed-p 'bbdb-com) + (require 'bbdb-com) + (eval-when-compile + ;; imported from bbdb-1.51 + (defmacro bbdb-pop-up-elided-display () + '(if (boundp 'bbdb-pop-up-elided-display) + bbdb-pop-up-elided-display + bbdb-elided-display)) + (defmacro bbdb-user-mail-names () + "Returns a regexp matching the address of the logged-in user" + '(or bbdb-user-mail-names + (setq bbdb-user-mail-names + (concat "\\b" (regexp-quote (user-login-name)) "\\b")))) + )) + + +;;; @ User Variables +;;; + +(defvar mime-bbdb/use-mail-extr t + "*If non-nil, `mail-extract-address-components' is used. +Otherwise `mime-bbdb/extract-address-components' overrides it.") + +(defvar mime-bbdb/auto-create-p nil + "*If t, create new BBDB records automatically. +If function, then it is called with no arguments to decide whether an +entry should be automatically creaded. + +mime-bbdb uses this variable instead of `bbdb/mail-auto-create-p' or +`bbdb/news-auto-create-p' unless other tm-MUA overrides it.") + +(defvar mime-bbdb/delete-empty-window nil + "*If non-nil, delete empty BBDB window. +All bbdb-MUAs but bbdb-gnus display BBDB window even if it is empty. +If you prefer behavior of bbdb-gnus, set this variable to t. + +For framepop users: If empty, `framepop-banish' is used instead.") + +;;; @ mail-extr +;;; + +(defun mime-bbdb/extract-address-components (str) + (let* ((ret (std11-extract-address-components str)) + (phrase (car ret)) + (address (car (cdr ret))) + (methods mime-bbdb/canonicalize-full-name-methods)) + (while (and phrase methods) + (setq phrase (funcall (car methods) phrase) + methods (cdr methods))) + (if (string= address "") (setq address nil)) + (if (string= phrase "") (setq phrase nil)) + (list phrase address) + )) + +(or mime-bbdb/use-mail-extr + (progn + (require 'mail-extr) ; for `what-domain' + (or (fboundp 'tm:mail-extract-address-components) + (fset 'tm:mail-extract-address-components + (symbol-function 'mail-extract-address-components))) + (fset 'mail-extract-address-components + (symbol-function 'mime-bbdb/extract-address-components)) + )) + + +;;; @ bbdb-extract-field-value +;;; + +(or (fboundp 'tm:bbdb-extract-field-value) + (progn + ;; (require 'bbdb-hooks) ; not provided. + ;; (or (fboundp 'bbdb-extract-field-value) ; defined as autoload + + ;; almost BBDB functions are autoloaded. + ;; (or (fboundp 'bbdb-header-start) + (or (and (fboundp 'bbdb-extract-field-value) + (not (eq 'autoload (car-safe (symbol-function + 'bbdb-extract-field-value))))) + (load "bbdb-hooks")) + (fset 'tm:bbdb-extract-field-value + (symbol-function 'bbdb-extract-field-value)) + (defun bbdb-extract-field-value (field) + (let ((value (tm:bbdb-extract-field-value field))) + (and value + (eword-decode-string value)))) + )) + + +;;; @ full-name canonicalization methods +;;; + +(defun mime-bbdb/canonicalize-spaces (str) + (let (dest) + (while (string-match "\\s +" str) + (setq dest (cons (substring str 0 (match-beginning 0)) dest)) + (setq str (substring str (match-end 0))) + ) + (or (string= str "") + (setq dest (cons str dest))) + (setq dest (nreverse dest)) + (mapconcat 'identity dest " ") + )) + +(defun mime-bbdb/canonicalize-dots (str) + (let (dest) + (while (string-match "\\." str) + (setq dest (cons (substring str 0 (match-end 0)) dest)) + (setq str (substring str (match-end 0))) + ) + (or (string= str "") + (setq dest (cons str dest))) + (setq dest (nreverse dest)) + (mapconcat 'identity dest " ") + )) + +(defvar mime-bbdb/canonicalize-full-name-methods + '(eword-decode-string + mime-bbdb/canonicalize-dots + mime-bbdb/canonicalize-spaces)) + + +;;; @ BBDB functions for mime-view-mode +;;; + +(defun mime-bbdb/update-record (&optional offer-to-create) + "Return the record corresponding to the current MIME previewing message. +Creating or modifying it as necessary. A record will be created if +mime-bbdb/auto-create-p is non-nil, or if OFFER-TO-CREATE is non-nil and +the user confirms the creation." + (save-excursion + (if (and mime-preview-buffer + (get-buffer mime-preview-buffer)) + (set-buffer mime-preview-buffer)) + (if bbdb-use-pop-up + (mime-bbdb/pop-up-bbdb-buffer offer-to-create) + (let* ((message (get-text-property (point-min) 'mime-view-entity)) + (from (mime-entity-fetch-field message 'From)) + addr) + (if (or (null from) + (null (setq addr (car (mime-entity-read-field message 'From)))) + (string-match (bbdb-user-mail-names) + (std11-address-string addr))) + (setq from (or (mime-entity-fetch-field message 'To) + from)) + ) + (if from + (bbdb-annotate-message-sender + (mime-decode-field-body from 'From) t + (or (bbdb-invoke-hook-for-value mime-bbdb/auto-create-p) + offer-to-create) + offer-to-create)) + )))) + +(defun mime-bbdb/annotate-sender (string) + "Add a line to the end of the Notes field of the BBDB record +corresponding to the sender of this message." + (interactive + (list (if bbdb-readonly-p + (error "The Insidious Big Brother Database is read-only.") + (read-string "Comments: ")))) + (bbdb-annotate-notes (mime-bbdb/update-record t) string)) + +(defun mime-bbdb/edit-notes (&optional arg) + "Edit the notes field or (with a prefix arg) a user-defined field +of the BBDB record corresponding to the sender of this message." + (interactive "P") + (let ((record (or (mime-bbdb/update-record t) + (error "")))) + (bbdb-display-records (list record)) + (if arg + (bbdb-record-edit-property record nil t) + (bbdb-record-edit-notes record t)))) + +(defun mime-bbdb/show-sender () + "Display the contents of the BBDB for the sender of this message. +This buffer will be in bbdb-mode, with associated keybindings." + (interactive) + (let ((record (mime-bbdb/update-record t))) + (if record + (bbdb-display-records (list record)) + (error "unperson")))) + +(defun mime-bbdb/pop-up-bbdb-buffer (&optional offer-to-create) + "Make the *BBDB* buffer be displayed along with the MIME preview window(s), +displaying the record corresponding to the sender of the current message." + (let ((framepop (eq temp-buffer-show-function 'framepop-display-buffer))) + (or framepop + (bbdb-pop-up-bbdb-buffer + (function + (lambda (w) + (let ((b (current-buffer))) + (set-buffer (window-buffer w)) + (prog1 (eq major-mode 'mime-view-mode) + (set-buffer b))))))) + (let ((bbdb-gag-messages t) + (bbdb-use-pop-up nil) + (bbdb-electric-p nil)) + (let ((record (mime-bbdb/update-record offer-to-create)) + (bbdb-elided-display (bbdb-pop-up-elided-display)) + (b (current-buffer))) + (if framepop + (if record + (bbdb-display-records (list record)) + (framepop-banish)) + (bbdb-display-records (if record (list record) nil)) + (if (and (null record) + mime-bbdb/delete-empty-window) + (delete-windows-on (get-buffer "*BBDB*")))) + (set-buffer b) + record)))) + +(defun mime-bbdb/define-keys () + (let ((mime-view-mode-map (current-local-map))) + (define-key mime-view-mode-map ";" 'mime-bbdb/edit-notes) + (define-key mime-view-mode-map ":" 'mime-bbdb/show-sender) + )) + +(add-hook 'mime-view-define-keymap-hook 'mime-bbdb/define-keys) + + +;;; @ for signature.el +;;; + +(defun signature/get-bbdb-sigtype (addr) + "Extract sigtype information from BBDB." + (let ((record (bbdb-search-simple nil addr))) + (and record + (bbdb-record-getprop record 'sigtype)) + )) + +(defun signature/set-bbdb-sigtype (sigtype addr) + "Add sigtype information to BBDB." + (let* ((bbdb-notice-hook nil) + (record (bbdb-annotate-message-sender + addr t + (bbdb-invoke-hook-for-value + bbdb/mail-auto-create-p) + t))) + (if record + (progn + (bbdb-record-putprop record 'sigtype sigtype) + (bbdb-change-record record nil)) + ))) + +(defun signature/get-sigtype-from-bbdb (&optional verbose) + (let* ((to (std11-field-body "To")) + (addr (and to + (car (cdr (mail-extract-address-components to))))) + (sigtype (signature/get-bbdb-sigtype addr)) + return + ) + (if addr + (if verbose + (progn + (setq return (signature/get-sigtype-interactively sigtype)) + (if (and (not (string-equal return sigtype)) + (y-or-n-p + (format "Register \"%s\" for <%s>? " return addr)) + ) + (signature/set-bbdb-sigtype return addr) + ) + return) + (or sigtype + (signature/get-signature-file-name)) + )) + )) + + +;;; @ end +;;; + +(provide 'mime-bbdb) + +(run-hooks 'mime-bbdb-load-hook) + +;;; end of mime-bbdb.el diff --git a/semi-1.14.6/mime-edit.el b/semi-1.14.6/mime-edit.el new file mode 100644 index 0000000..18263bf --- /dev/null +++ b/semi-1.14.6/mime-edit.el @@ -0,0 +1,3051 @@ +;;; mime-edit.el --- Simple MIME Composer for GNU Emacs + +;; Copyright (C) 1993,94,95,96,97,98,99,2000,01,02,03 +;; Free Software Foundation, Inc. + +;; Author: UMEDA Masanobu <umerin@mse.kyutech.ac.jp> +;; MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp> +;; Daiki Ueno <ueno@ueda.info.waseda.ac.jp> +;; Created: 1994/08/21 renamed from mime.el +;; Renamed: 1997/2/21 from tm-edit.el +;; Keywords: MIME, multimedia, multilingual, mail, news + +;; This file is part of SEMI (Sophisticated Emacs MIME Interfaces). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; This is an Emacs minor mode for editing Internet multimedia +;; messages formatted in MIME (RFC 2045, 2046, 2047, 2048 and 2049). +;; All messages in this mode are composed in the tagged MIME format, +;; that are described in the following examples. The messages +;; composed in the tagged MIME format are automatically translated +;; into a MIME compliant message when exiting the mode. + +;; Mule (multilingual feature of Emacs 20 and multilingual extension +;; for XEmacs 20) has a capability of handling multilingual text in +;; limited ISO-2022 manner that is based on early experiences in +;; Japanese Internet community and resulted in RFC 1468 (ISO-2022-JP +;; charset for MIME). In order to enable multilingual capability in +;; single text message in MIME, charset of multilingual text written +;; in Mule is declared as either `ISO-2022-JP-2' [RFC 1554]. Mule is +;; required for reading the such messages. + +;; This MIME composer can work with Mail mode, mh-e letter Mode, and +;; News mode. First of all, you need the following autoload +;; definition to load mime-edit-mode automatically: +;; +;; (autoload 'turn-on-mime-edit "mime-edit" +;; "Minor mode for editing MIME message." t) +;; +;; In case of Mail mode (includes VM mode), you need the following +;; hook definition: +;; +;; (add-hook 'mail-mode-hook 'turn-on-mime-edit) +;; (add-hook 'mail-send-hook 'mime-edit-maybe-translate) +;; +;; In case of MH-E, you need the following hook definition: +;; +;; (add-hook 'mh-letter-mode-hook +;; (function +;; (lambda () +;; (turn-on-mime-edit) +;; (make-local-variable 'mail-header-separator) +;; (setq mail-header-separator "--------") +;; )))) +;; (add-hook 'mh-before-send-letter-hook 'mime-edit-maybe-translate) +;; +;; In case of News mode, you need the following hook definition: +;; +;; (add-hook 'news-reply-mode-hook 'turn-on-mime-edit) +;; (add-hook 'news-inews-hook 'mime-edit-maybe-translate) +;; +;; In case of Emacs 19, it is possible to emphasize the message tags +;; using font-lock mode as follows: +;; +;; (add-hook 'mime-edit-mode-hook +;; (function +;; (lambda () +;; (font-lock-mode 1) +;; (setq font-lock-keywords (list mime-edit-tag-regexp)) +;; )))) + +;; The message tag looks like: +;; +;; --[[TYPE/SUBTYPE;PARAMETERS][ENCODING]] +;; +;; The tagged MIME message examples: +;; +;; This is a conventional plain text. It should be translated into +;; text/plain. +;; +;;--[[text/plain]] +;; This is also a plain text. But, it is explicitly specified as is. +;;--[[text/plain; charset=ISO-8859-1]] +;; This is also a plain text. But charset is specified as iso-8859-1. +;; +;; Hola! Buenos das. Cmo est usted? +;;--[[text/enriched]] +;; <center>This is a richtext.</center> +;; +;;--[[image/gif][base64]]^M...image encoded in base64 comes here... +;; +;;--[[audio/basic][base64]]^M...audio encoded in base64 comes here... + +;;; Code: + +(require 'sendmail) +(require 'mail-utils) +(require 'mel) +(require 'mime-view) +(require 'signature) +(require 'alist) +(require 'invisible) +(require 'pgg-def) +(require 'pgg-parse) + +(autoload 'pgg-encrypt-region "pgg" + "PGP encryption of current region." t) +(autoload 'pgg-sign-region "pgg" + "PGP signature of current region." t) +(autoload 'pgg-insert-key "pgg" + "Insert PGP public key at point." t) +(autoload 'smime-encrypt-region "smime" + "S/MIME encryption of current region.") +(autoload 'smime-sign-region "smime" + "S/MIME signature of current region.") +(defvar smime-output-buffer) +(defvar smime-errors-buffer) + + +;;; @ version +;;; + +(eval-and-compile + (defconst mime-edit-version + (concat + (mime-product-name mime-user-interface-product) " " + (mapconcat #'number-to-string + (mime-product-version mime-user-interface-product) ".") + " - \"" (mime-product-code-name mime-user-interface-product) "\""))) + + +;;; @ variables +;;; + +(defgroup mime-edit nil + "MIME edit mode" + :group 'mime) + +(defcustom mime-ignore-preceding-spaces nil + "*Ignore preceding white spaces if non-nil." + :group 'mime-edit + :type 'boolean) + +(defcustom mime-ignore-trailing-spaces nil + "*Ignore trailing white spaces if non-nil." + :group 'mime-edit + :type 'boolean) + +(defcustom mime-ignore-same-text-tag t + "*Ignore preceding text content-type tag that is same with new one. +If non-nil, the text tag is not inserted unless something different." + :group 'mime-edit + :type 'boolean) + +(defcustom mime-auto-hide-body t + "*Hide non-textual body encoded in base64 after insertion if non-nil." + :group 'mime-edit + :type 'boolean) + +(defcustom mime-edit-voice-recorder + (function mime-edit-voice-recorder-for-sun) + "*Function to record a voice message and encode it." + :group 'mime-edit + :type 'function) + +(defcustom mime-edit-mode-hook nil + "*Hook called when enter MIME mode." + :group 'mime-edit + :type 'hook) + +(defcustom mime-edit-translate-hook nil + "*Hook called before translating into a MIME compliant message. +To insert a signature file automatically, call the function +`mime-edit-insert-signature' from this hook." + :group 'mime-edit + :type 'hook) + +(defcustom mime-edit-exit-hook nil + "*Hook called when exit MIME mode." + :group 'mime-edit + :type 'hook) + +(defvar mime-content-types + '(("text" + ;; Charset parameter need not to be specified, since it is + ;; defined automatically while translation. + ("plain" + ;;("charset" "" "ISO-2022-JP" "US-ASCII" "ISO-8859-1" "ISO-8859-8") + ) + ("enriched") + ("html") + ("css") ; rfc2318 + ("xml") ; rfc2376 + ("x-latex") + ;; ("x-rot13-47-48") + ) + ("message" + ("external-body" + ("access-type" + ("anon-ftp" + ("site" "ftp.jaist.ac.jp" "wnoc-fuk.wide.ad.jp" "nic.karrn.ad.jp") + ("directory" "/pub/GNU/elisp/mime") + ("name") + ("mode" "image" "ascii" "local8")) + ("ftp" + ("site") + ("directory") + ("name") + ("mode" "image" "ascii" "local8")) + ("tftp" ("site") ("name")) + ("afs" ("site") ("name")) + ("local-file" ("site") ("name")) + ("mail-server" + ("server" "ftpmail@nic.karrn.ad.jp") + ("subject")) + ("url" ("url")) + )) + ("rfc822") + ("news") + ) + ("application" + ("octet-stream" ("type" "" "tar" "shar")) + ("postscript") + ("vnd.ms-powerpoint") + ("x-kiss" ("x-cnf"))) + ("image" + ("gif") + ("jpeg") + ("png") + ("tiff") + ("x-pic") + ("x-mag") + ("x-xwd") + ("x-xbm") + ) + ("audio" ("basic")) + ("video" ("mpeg")) + ) + "*Alist of content-type, subtype, parameters and its values.") + +(defcustom mime-file-types + '( + + ;; Programming languages + + ("\\.cc$" + "application" "octet-stream" (("type" . "C++")) + "7bit" + "attachment" (("filename" . file)) + ) + + ("\\.el$" + "application" "octet-stream" (("type" . "emacs-lisp")) + "7bit" + "attachment" (("filename" . file)) + ) + + ("\\.lsp$" + "application" "octet-stream" (("type" . "common-lisp")) + "7bit" + "attachment" (("filename" . file)) + ) + + ("\\.pl$" + "application" "octet-stream" (("type" . "perl")) + "7bit" + "attachment" (("filename" . file)) + ) + + ;; Text or translated text + + ("\\.txt$" + "text" "plain" nil + nil + "inline" (("filename" . file)) + ) + + ;; .rc : procmail modules pm-xxxx.rc + ;; *rc : other resource files + + ("\\.\\(rc\\|lst\\|log\\|sql\\|mak\\)$\\|\\..*rc$" + "text" "plain" nil + nil + "attachment" (("filename" . file)) + ) + + ("\\.html$" + "text" "html" nil + nil + nil nil) + + ("\\.diff$\\|\\.patch$" + "application" "octet-stream" (("type" . "patch")) + nil + "attachment" (("filename" . file)) + ) + + ("\\.signature" + "text" "plain" nil nil nil nil) + + + ;; Octect binary text + + ("\\.doc$" ;MS Word + "application" "msword" nil + "base64" + "attachment" (("filename" . file)) + ) + ("\\.ppt$" ; MS Power Point + "application" "vnd.ms-powerpoint" nil + "base64" + "attachment" (("filename" . file)) + ) + + ("\\.pln$" + "text" "plain" nil + nil + "inline" (("filename" . file)) + ) + ("\\.ps$" + "application" "postscript" nil + "quoted-printable" + "attachment" (("filename" . file)) + ) + + ;; Pure binary + + ("\\.jpg$\\|\\.jpeg$" + "image" "jpeg" nil + "base64" + "inline" (("filename" . file)) + ) + ("\\.gif$" + "image" "gif" nil + "base64" + "inline" (("filename" . file)) + ) + ("\\.png$" + "image" "png" nil + "base64" + "inline" (("filename" . file)) + ) + ("\\.tiff$" + "image" "tiff" nil + "base64" + "inline" (("filename" . file)) + ) + ("\\.pic$" + "image" "x-pic" nil + "base64" + "inline" (("filename" . file)) + ) + ("\\.mag$" + "image" "x-mag" nil + "base64" + "inline" (("filename" . file)) + ) + ("\\.xbm$" + "image" "x-xbm" nil + "base64" + "inline" (("filename" . file)) + ) + ("\\.xwd$" + "image" "x-xwd" nil + "base64" + "inline" (("filename" . file)) + ) + ("\\.au$" + "audio" "basic" nil + "base64" + "attachment" (("filename" . file)) + ) + ("\\.mpg$" + "video" "mpeg" nil + "base64" + "attachment" (("filename" . file)) + ) + ("\\.tar\\.gz$" + "application" "octet-stream" (("type" . "tar+gzip")) + "base64" + "attachment" (("filename" . file)) + ) + ("\\.tgz$" + "application" "octet-stream" (("type" . "tar+gzip")) + "base64" + "attachment" (("filename" . file)) + ) + ("\\.tar\\.Z$" + "application" "octet-stream" (("type" . "tar+compress")) + "base64" + "attachment" (("filename" . file)) + ) + ("\\.taz$" + "application" "octet-stream" (("type" . "tar+compress")) + "base64" + "attachment" (("filename" . file)) + ) + ("\\.gz$" + "application" "octet-stream" (("type" . "gzip")) + "base64" + "attachment" (("filename" . file)) + ) + ("\\.Z$" + "application" "octet-stream" (("type" . "compress")) + "base64" + "attachment" (("filename" . file)) + ) + ("\\.lzh$" + "application" "octet-stream" (("type" . "lha")) + "base64" + "attachment" (("filename" . file)) + ) + ("\\.zip$" + "application" "zip" nil + "base64" + "attachment" (("filename" . file)) + ) + + ;; Rest + + (".*" + "application" "octet-stream" nil + nil + "attachment" (("filename" . file))) + ) + "*Alist of file name, types, parameters, and default encoding. +If encoding is nil, it is determined from its contents." + :type `(repeat + (list regexp + ;; primary-type + (choice :tag "Primary-Type" + ,@(nconc (mapcar (lambda (cell) + (list 'item (car cell)) + ) + mime-content-types) + '(string))) + ;; subtype + (choice :tag "Sub-Type" + ,@(nconc + (apply #'nconc + (mapcar (lambda (cell) + (mapcar (lambda (cell) + (list 'item (car cell)) + ) + (cdr cell))) + mime-content-types)) + '(string))) + ;; parameters + (repeat :tag "Parameters of Content-Type field" + (cons string (choice string symbol))) + ;; content-transfer-encoding + (choice :tag "Encoding" + ,@(cons + '(const nil) + (mapcar (lambda (cell) + (list 'item cell) + ) + (mime-encoding-list)))) + ;; disposition-type + (choice :tag "Disposition-Type" + (item nil) + (item "inline") + (item "attachment") + string) + ;; parameters + (repeat :tag "Parameters of Content-Disposition field" + (cons string (choice string symbol))) + )) + :group 'mime-edit) + + +;;; @@ about charset, encoding and transfer-level +;;; + +(defvar mime-charset-type-list + '((us-ascii 7 nil) + (iso-8859-1 8 "quoted-printable") + (iso-8859-2 8 "quoted-printable") + (iso-8859-3 8 "quoted-printable") + (iso-8859-4 8 "quoted-printable") + (iso-8859-5 8 "quoted-printable") + (koi8-r 8 "quoted-printable") + (iso-8859-7 8 "quoted-printable") + (iso-8859-8 8 "quoted-printable") + (iso-8859-9 8 "quoted-printable") + (iso-8859-14 8 "quoted-printable") + (iso-8859-15 8 "quoted-printable") + (iso-2022-jp 7 "base64") + (iso-2022-jp-3 7 "base64") + (iso-2022-kr 7 "base64") + (euc-kr 8 "base64") + (cn-gb 8 "base64") + (gb2312 8 "base64") + (cn-big5 8 "base64") + (big5 8 "base64") + (shift_jis 8 "base64") + (tis-620 8 "base64") + (iso-2022-jp-2 7 "base64") + (iso-2022-int-1 7 "base64") + )) + +(defvar mime-transfer-level 7 + "*A number of network transfer level. It should be bigger than 7.") +(make-variable-buffer-local 'mime-transfer-level) + +(defsubst mime-encoding-name (transfer-level &optional not-omit) + (cond ((> transfer-level 8) "binary") + ((= transfer-level 8) "8bit") + (not-omit "7bit") + )) + +(defvar mime-transfer-level-string + (mime-encoding-name mime-transfer-level 'not-omit) + "A string formatted version of mime-transfer-level") +(make-variable-buffer-local 'mime-transfer-level-string) + +;;; @@ about content transfer encoding + +(defvar mime-content-transfer-encoding-priority-list + '(nil "8bit" "binary")) + +;;; @@ about message inserting +;;; + +(defvar mime-edit-yank-ignored-field-list + '("Received" "Approved" "Path" "Replied" "Status" + "Xref" "X-UIDL" "X-Filter" "X-Gnus-.*" "X-VM-.*") + "Delete these fields from original message when it is inserted +as message/rfc822 part. +Each elements are regexp of field-name.") + +(defvar mime-edit-yank-ignored-field-regexp + (concat "^" + (apply (function regexp-or) mime-edit-yank-ignored-field-list) + ":")) + +(defvar mime-edit-message-inserter-alist nil) +(defvar mime-edit-mail-inserter-alist nil) + + +;;; @@ about message splitting +;;; + +(defcustom mime-edit-split-message t + "*Split large message if it is non-nil." + :group 'mime-edit + :type 'boolean) + +(defcustom mime-edit-message-default-max-lines 1000 + "*Default maximum lines of a message." + :group 'mime-edit + :type 'integer) + +(defcustom mime-edit-message-max-lines-alist + '((news-reply-mode . 500)) + "Alist of major-mode vs maximum lines of a message. +If it is not specified for a major-mode, +`mime-edit-message-default-max-lines' is used." + :group 'mime-edit + :type 'list) + +(defconst mime-edit-split-ignored-field-regexp + "\\(^Content-\\|^Subject:\\|^Mime-Version:\\|^Message-Id:\\)") + +(defcustom mime-edit-split-blind-field-regexp + "\\(^[BDFbdf]cc:\\|^cc:[ \t]*$\\)" + "*Regular expression to match field-name to be ignored when split sending." + :group 'mime-edit + :type 'regexp) + +(defvar mime-edit-split-message-sender-alist nil) + +(defvar mime-edit-news-reply-mode-server-running nil) + + +;;; @@ about tag +;;; + +(defconst mime-edit-single-part-tag-regexp + "--[[][[]\\([^]]*\\)]\\([[]\\([^]]*\\)]\\|\\)]" + "*Regexp of MIME tag in the form of [[CONTENT-TYPE][ENCODING]].") + +(defconst mime-edit-quoted-single-part-tag-regexp + (concat "- " (substring mime-edit-single-part-tag-regexp 1))) + +(defconst mime-edit-multipart-beginning-regexp "--<<\\([^<>]+\\)>>-{\n") + +(defconst mime-edit-multipart-end-regexp "--}-<<\\([^<>]+\\)>>\n") + +(defconst mime-edit-beginning-tag-regexp + (regexp-or mime-edit-single-part-tag-regexp + mime-edit-multipart-beginning-regexp)) + +(defconst mime-edit-end-tag-regexp + (regexp-or mime-edit-single-part-tag-regexp + mime-edit-multipart-end-regexp)) + +(defconst mime-edit-tag-regexp + (regexp-or mime-edit-single-part-tag-regexp + mime-edit-multipart-beginning-regexp + mime-edit-multipart-end-regexp)) + +(defvar mime-tag-format "--[[%s]]" + "*Control-string making a MIME tag.") + +(defvar mime-tag-format-with-encoding "--[[%s][%s]]" + "*Control-string making a MIME tag with encoding.") + + +;;; @@ multipart boundary +;;; + +(defvar mime-multipart-boundary "Multipart" + "*Boundary of a multipart message.") + + +;;; @@ optional header fields +;;; + +(defvar mime-edit-insert-user-agent-field t + "*If non-nil, insert User-Agent header field.") + +(defvar mime-edit-user-agent-value + (concat (mime-product-name mime-user-interface-product) + "/" + (mapconcat #'number-to-string + (mime-product-version mime-user-interface-product) ".") + " (" + (mime-product-code-name mime-user-interface-product) + ") " + (mime-product-name mime-library-product) + "/" + (mapconcat #'number-to-string + (mime-product-version mime-library-product) ".") + " (" + (mime-product-code-name mime-library-product) + ") " + (if (fboundp 'apel-version) + (concat (apel-version) " ")) + (if (featurep 'xemacs) + (concat (cond ((and (featurep 'chise) + (boundp 'xemacs-chise-version)) + (concat "CHISE-MULE/" xemacs-chise-version)) + ((featurep 'utf-2000) + (concat "UTF-2000-MULE/" utf-2000-version)) + ((featurep 'mule) "MULE")) + " XEmacs" + (if (string-match "^[0-9]+\\(\\.[0-9]+\\)" emacs-version) + (concat + "/" + (substring emacs-version 0 (match-end 0)) + (cond ((and (boundp 'xemacs-betaname) + xemacs-betaname) + ;; It does not exist in XEmacs + ;; versions prior to 20.3. + (concat " " xemacs-betaname)) + ((and (boundp 'emacs-patch-level) + emacs-patch-level) + ;; It does not exist in FSF Emacs or in + ;; XEmacs versions earlier than 21.1.1. + (format " (patch %d)" emacs-patch-level)) + (t "")) + " (" xemacs-codename ")" + ;; `xemacs-extra-name' has appeared in the + ;; development version of XEmacs 21.5-b8. + (if (and (boundp 'xemacs-extra-name) + (symbol-value 'xemacs-extra-name)) + (concat " " (symbol-value 'xemacs-extra-name)) + "") + " (" + system-configuration ")") + " (" emacs-version ")")) + (let ((ver (if (string-match "\\.[0-9]+$" emacs-version) + (substring emacs-version 0 (match-beginning 0)) + emacs-version))) + (if (featurep 'mule) + (if (boundp 'enable-multibyte-characters) + (concat "Emacs/" ver + " (" system-configuration ")" + (if enable-multibyte-characters + (concat " MULE/" mule-version) + " (with unibyte mode)") + (if (featurep 'meadow) + (let ((mver (Meadow-version))) + (if (string-match "^Meadow-" mver) + (concat " Meadow/" + (substring mver + (match-end 0))) + )))) + (concat "MULE/" mule-version + " (based on Emacs " ver ")")) + (concat "Emacs/" ver " (" system-configuration ")"))))) + "Body of User-Agent field. +If variable `mime-edit-insert-user-agent-field' is not nil, it is +inserted into message header.") + + +;;; @ constants +;;; + +(defconst mime-tspecials-regexp "[][()<>@,;:\\\"/?.= \t]" + "*Specify MIME tspecials. +Tspecials means any character that matches with it in header must be quoted.") + +(defconst mime-edit-mime-version-value + (concat "1.0 (generated by " mime-edit-version ")") + "MIME version number.") + +(defconst mime-edit-mime-version-field-for-message/partial + (concat "MIME-Version:" + (mime-encode-field-body + (concat " 1.0 (split by " mime-edit-version ")\n") + "MIME-Version:")) + "MIME version field for message/partial.") + + +;;; @ keymap and menu +;;; + +(defvar mime-edit-mode-flag nil) +(make-variable-buffer-local 'mime-edit-mode-flag) + +(defvar mime-edit-mode-entity-prefix "\C-c\C-x" + "Keymap prefix for MIME-Edit mode commands to insert entity or set status.") +(defvar mime-edit-mode-entity-map (make-sparse-keymap) + "Keymap for MIME-Edit mode commands to insert entity or set status.") + +(define-key mime-edit-mode-entity-map "\C-t" 'mime-edit-insert-text) +(define-key mime-edit-mode-entity-map "\C-i" 'mime-edit-insert-file) +(define-key mime-edit-mode-entity-map "\C-e" 'mime-edit-insert-external) +(define-key mime-edit-mode-entity-map "\C-v" 'mime-edit-insert-voice) +(define-key mime-edit-mode-entity-map "\C-y" 'mime-edit-insert-message) +(define-key mime-edit-mode-entity-map "\C-m" 'mime-edit-insert-mail) +(define-key mime-edit-mode-entity-map "\C-w" 'mime-edit-insert-signature) +(define-key mime-edit-mode-entity-map "\C-s" 'mime-edit-insert-signature) +(define-key mime-edit-mode-entity-map "\C-k" 'mime-edit-insert-key) +(define-key mime-edit-mode-entity-map "t" 'mime-edit-insert-tag) + +(define-key mime-edit-mode-entity-map "7" 'mime-edit-set-transfer-level-7bit) +(define-key mime-edit-mode-entity-map "8" 'mime-edit-set-transfer-level-8bit) +(define-key mime-edit-mode-entity-map "/" 'mime-edit-set-split) +(define-key mime-edit-mode-entity-map "s" 'mime-edit-set-sign) +(define-key mime-edit-mode-entity-map "v" 'mime-edit-set-sign) +(define-key mime-edit-mode-entity-map "e" 'mime-edit-set-encrypt) +(define-key mime-edit-mode-entity-map "h" 'mime-edit-set-encrypt) +(define-key mime-edit-mode-entity-map "p" 'mime-edit-preview-message) +(define-key mime-edit-mode-entity-map "\C-z" 'mime-edit-exit) +(define-key mime-edit-mode-entity-map "?" 'mime-edit-help) + +(defvar mime-edit-mode-enclosure-prefix "\C-c\C-m" + "Keymap prefix for MIME-Edit mode commands about enclosure.") +(defvar mime-edit-mode-enclosure-map (make-sparse-keymap) + "Keymap for MIME-Edit mode commands about enclosure.") + +(define-key mime-edit-mode-enclosure-map + "\C-a" 'mime-edit-enclose-alternative-region) +(define-key mime-edit-mode-enclosure-map + "\C-p" 'mime-edit-enclose-parallel-region) +(define-key mime-edit-mode-enclosure-map + "\C-m" 'mime-edit-enclose-mixed-region) +(define-key mime-edit-mode-enclosure-map + "\C-d" 'mime-edit-enclose-digest-region) +(define-key mime-edit-mode-enclosure-map + "\C-s" 'mime-edit-enclose-pgp-signed-region) +(define-key mime-edit-mode-enclosure-map + "\C-e" 'mime-edit-enclose-pgp-encrypted-region) +(define-key mime-edit-mode-enclosure-map + "\C-q" 'mime-edit-enclose-quote-region) + +(defvar mime-edit-mode-map (make-sparse-keymap) + "Keymap for MIME-Edit mode commands.") +(define-key mime-edit-mode-map + mime-edit-mode-entity-prefix mime-edit-mode-entity-map) +(define-key mime-edit-mode-map + mime-edit-mode-enclosure-prefix mime-edit-mode-enclosure-map) + +(defconst mime-edit-menu-title "MIME-Edit") + +(defconst mime-edit-menu-list + '((mime-help "Describe MIME editor mode" mime-edit-help) + (file "Insert File" mime-edit-insert-file) + (external "Insert External" mime-edit-insert-external) + (voice "Insert Voice" mime-edit-insert-voice) + (message "Insert Message" mime-edit-insert-message) + (mail "Insert Mail" mime-edit-insert-mail) + (signature "Insert Signature" mime-edit-insert-signature) + (text "Insert Text" mime-edit-insert-text) + (tag "Insert Tag" mime-edit-insert-tag) + (alternative "Enclose as alternative" + mime-edit-enclose-alternative-region) + (parallel "Enclose as parallel" mime-edit-enclose-parallel-region) + (mixed "Enclose as serial" mime-edit-enclose-mixed-region) + (digest "Enclose as digest" mime-edit-enclose-digest-region) + (signed "Enclose as signed" mime-edit-enclose-pgp-signed-region) + (encrypted "Enclose as encrypted" mime-edit-enclose-pgp-encrypted-region) + (quote "Verbatim region" mime-edit-enclose-quote-region) + (key "Insert Public Key" mime-edit-insert-key) + (split "Set splitting" mime-edit-set-split) + (sign "PGP sign" mime-edit-set-sign) + (encrypt "PGP encrypt" mime-edit-set-encrypt) + (preview "Preview Message" mime-edit-preview-message) + (level "Toggle transfer-level" mime-edit-toggle-transfer-level) + ) + "MIME-edit menubar entry.") + +(cond ((featurep 'xemacs) + ;; modified by Pekka Marjola <pema@iki.fi> + ;; 1995/9/5 (c.f. [tm-en:69]) + (defun mime-edit-define-menu-for-xemacs () + "Define menu for XEmacs." + (cond ((featurep 'menubar) + (make-local-variable 'current-menubar) + (set-buffer-menubar current-menubar) + (add-submenu + nil + (cons mime-edit-menu-title + (mapcar (function + (lambda (item) + (vector (nth 1 item)(nth 2 item) + mime-edit-mode-flag) + )) + mime-edit-menu-list))) + ))) + + ;; modified by Steven L. Baur <steve@miranova.com> + ;; 1995/12/6 (c.f. [tm-en:209]) + (or (boundp 'mime-edit-popup-menu-for-xemacs) + (setq mime-edit-popup-menu-for-xemacs + (append '("MIME Commands" "---") + (mapcar (function (lambda (item) + (vector (nth 1 item) + (nth 2 item) + t))) + mime-edit-menu-list))) + ) + ) + ((>= emacs-major-version 19) + (define-key mime-edit-mode-map [menu-bar mime-edit] + (cons mime-edit-menu-title + (make-sparse-keymap mime-edit-menu-title))) + (mapcar (function + (lambda (item) + (define-key mime-edit-mode-map + (vector 'menu-bar 'mime-edit (car item)) + (cons (nth 1 item)(nth 2 item)) + ) + )) + (reverse mime-edit-menu-list) + ) + )) + + +;;; @ functions +;;; + +(defvar mime-edit-touched-flag nil) + +;;;###autoload +(defun mime-edit-mode () + "MIME minor mode for editing the tagged MIME message. + +In this mode, basically, the message is composed in the tagged MIME +format. The message tag looks like: + + --[[text/plain; charset=ISO-2022-JP][7bit]] + +The tag specifies the MIME content type, subtype, optional parameters +and transfer encoding of the message following the tag. Messages +without any tag are treated as `text/plain' by default. Charset and +transfer encoding are automatically defined unless explicitly +specified. Binary messages such as audio and image are usually +hidden. The messages in the tagged MIME format are automatically +translated into a MIME compliant message when exiting this mode. + +Available charsets depend on Emacs version being used. The following +lists the available charsets of each emacs. + +Without mule: US-ASCII and ISO-8859-1 (or other charset) are available. +With mule: US-ASCII, ISO-8859-* (except for ISO-8859-5), KOI8-R, + ISO-2022-JP, ISO-2022-JP-2, EUC-KR, CN-GB-2312, + CN-BIG5 and ISO-2022-INT-1 are available. + +ISO-2022-JP-2 and ISO-2022-INT-1 charsets used in mule is expected to +be used to represent multilingual text in intermixed manner. Any +languages that has no registered charset are represented as either +ISO-2022-JP-2 or ISO-2022-INT-1 in mule. + +If you want to use non-ISO-8859-1 charset in Emacs 19 or XEmacs +without mule, please set variable `default-mime-charset'. This +variable must be symbol of which name is a MIME charset. + +If you want to add more charsets in mule, please set variable +`charsets-mime-charset-alist'. This variable must be alist of which +key is list of charset and value is symbol of MIME charset. If name +of coding-system is different as MIME charset, please set variable +`mime-charset-coding-system-alist'. This variable must be alist of +which key is MIME charset and value is coding-system. + +Following commands are available in addition to major mode commands: + +\[make single part\] +\\[mime-edit-insert-text] insert a text message. +\\[mime-edit-insert-file] insert a (binary) file. +\\[mime-edit-insert-external] insert a reference to external body. +\\[mime-edit-insert-voice] insert a voice message. +\\[mime-edit-insert-message] insert a mail or news message. +\\[mime-edit-insert-mail] insert a mail message. +\\[mime-edit-insert-signature] insert a signature file at end. +\\[mime-edit-insert-key] insert PGP public key. +\\[mime-edit-insert-tag] insert a new MIME tag. + +\[make enclosure (maybe multipart)\] +\\[mime-edit-enclose-alternative-region] enclose as multipart/alternative. +\\[mime-edit-enclose-parallel-region] enclose as multipart/parallel. +\\[mime-edit-enclose-mixed-region] enclose as multipart/mixed. +\\[mime-edit-enclose-digest-region] enclose as multipart/digest. +\\[mime-edit-enclose-pgp-signed-region] enclose as PGP signed. +\\[mime-edit-enclose-pgp-encrypted-region] enclose as PGP encrypted. +\\[mime-edit-enclose-quote-region] enclose as verbose mode + (to avoid to expand tags) + +\[other commands\] +\\[mime-edit-set-transfer-level-7bit] set transfer-level as 7. +\\[mime-edit-set-transfer-level-8bit] set transfer-level as 8. +\\[mime-edit-set-split] set message splitting mode. +\\[mime-edit-set-sign] set PGP-sign mode. +\\[mime-edit-set-encrypt] set PGP-encryption mode. +\\[mime-edit-preview-message] preview editing MIME message. +\\[mime-edit-exit] exit and translate into a MIME + compliant message. +\\[mime-edit-help] show this help. +\\[mime-edit-maybe-translate] exit and translate if in MIME mode, + then split. + +Additional commands are available in some major modes: +C-c C-c exit, translate and run the original command. +C-c C-s exit, translate and run the original command. + +The following is a message example written in the tagged MIME format. +TABs at the beginning of the line are not a part of the message: + + This is a conventional plain text. It should be translated + into text/plain. + --[[text/plain]] + This is also a plain text. But, it is explicitly specified as + is. + --[[text/plain; charset=ISO-8859-1]] + This is also a plain text. But charset is specified as + iso-8859-1. + + Hola! Buenos das. Cmo est usted? + --[[text/enriched]] + This is a <bold>enriched text</bold>. + --[[image/gif][base64]]...image encoded in base64 here... + --[[audio/basic][base64]]...audio encoded in base64 here... + +User customizable variables (not documented all of them): + mime-edit-prefix + Specifies a key prefix for MIME minor mode commands. + + mime-ignore-preceding-spaces + Preceding white spaces in a message body are ignored if non-nil. + + mime-ignore-trailing-spaces + Trailing white spaces in a message body are ignored if non-nil. + + mime-auto-hide-body + Hide a non-textual body message encoded in base64 after insertion + if non-nil. + + mime-transfer-level + A number of network transfer level. It should be bigger than 7. + If you are in 8bit-through environment, please set 8. + + mime-edit-voice-recorder + Specifies a function to record a voice message and encode it. + The function `mime-edit-voice-recorder-for-sun' is for Sun + SparcStations. + + mime-edit-mode-hook + Turning on MIME mode calls the value of mime-edit-mode-hook, if + it is non-nil. + + mime-edit-translate-hook + The value of mime-edit-translate-hook is called just before translating + the tagged MIME format into a MIME compliant message if it is + non-nil. If the hook call the function mime-edit-insert-signature, + the signature file will be inserted automatically. + + mime-edit-exit-hook + Turning off MIME mode calls the value of mime-edit-exit-hook, if it is + non-nil." + (interactive) + (if mime-edit-mode-flag + (mime-edit-exit) + (if mime-edit-touched-flag + (mime-edit-again) + (make-local-variable 'mime-edit-touched-flag) + (setq mime-edit-touched-flag t) + (turn-on-mime-edit) + ))) + + +(cond ((featurep 'xemacs) + (add-minor-mode 'mime-edit-mode-flag + '((" MIME-Edit " mime-transfer-level-string)) + mime-edit-mode-map + nil + 'mime-edit-mode) + ) + (t + (set-alist 'minor-mode-alist + 'mime-edit-mode-flag + '((" MIME-Edit " mime-transfer-level-string))) + (set-alist 'minor-mode-map-alist + 'mime-edit-mode-flag + mime-edit-mode-map) + )) + + +;;;###autoload +(defun turn-on-mime-edit () + "Unconditionally turn on MIME-Edit mode." + (interactive) + (if mime-edit-mode-flag + (error "You are already editing a MIME message.") + (setq mime-edit-mode-flag t) + + ;; Set transfer level into mode line + ;; + (setq mime-transfer-level-string + (mime-encoding-name mime-transfer-level 'not-omit)) + (force-mode-line-update) + + ;; Define menu for XEmacs. + (if (featurep 'xemacs) + (mime-edit-define-menu-for-xemacs) + ) + + (enable-invisible) + + ;; I don't care about saving these. + (setq paragraph-start + (regexp-or mime-edit-single-part-tag-regexp + paragraph-start)) + (setq paragraph-separate + (regexp-or mime-edit-single-part-tag-regexp + paragraph-separate)) + (run-hooks 'mime-edit-mode-hook) + (message + "%s" + (substitute-command-keys + "Type \\[mime-edit-exit] to exit MIME mode, and type \\[mime-edit-help] to get help.")) + )) + +;;;###autoload +(defalias 'edit-mime 'turn-on-mime-edit) ; for convenience + + +(defun mime-edit-exit (&optional nomime no-error) + "Translate the tagged MIME message into a MIME compliant message. +With no argument encode a message in the buffer into MIME, otherwise +just return to previous mode." + (interactive "P") + (if (not mime-edit-mode-flag) + (if (null no-error) + (error "You aren't editing a MIME message.") + ) + (if (not nomime) + (progn + (run-hooks 'mime-edit-translate-hook) + (mime-edit-translate-buffer))) + ;; Restore previous state. + (setq mime-edit-mode-flag nil) + (if (and (featurep 'xemacs) + (featurep 'menubar)) + (delete-menu-item (list mime-edit-menu-title)) + ) + (end-of-invisible) + (set-buffer-modified-p (buffer-modified-p)) + (run-hooks 'mime-edit-exit-hook) + (message "Exit MIME editor mode.") + )) + +(defun mime-edit-maybe-translate () + (interactive) + (mime-edit-exit nil t) + (call-interactively 'mime-edit-maybe-split-and-send) + ) + +(defun mime-edit-help () + "Show help message about MIME mode." + (interactive) + (with-output-to-temp-buffer "*Help*" + (princ "MIME editor mode:\n") + (princ (documentation 'mime-edit-mode)) + (print-help-return-message))) + +(defun mime-edit-insert-text (&optional subtype) + "Insert a text message. +Charset is automatically obtained from the `charsets-mime-charset-alist'. +If optional argument SUBTYPE is not nil, text/SUBTYPE tag is inserted." + (interactive) + (let ((ret (mime-edit-insert-tag "text" subtype nil))) + (when ret + (if (looking-at mime-edit-single-part-tag-regexp) + (progn + ;; Make a space between the following message. + (insert "\n") + (forward-char -1) + )) + (if (and (member (cadr ret) '("enriched")) + (fboundp 'enriched-mode)) + (enriched-mode t) + (if (boundp 'enriched-mode) + (enriched-mode -1) + )) + ))) + +(defun mime-edit-insert-file (file &optional verbose) + "Insert a message from a file." + (interactive "fInsert file as MIME message: \nP") + (let* ((guess (mime-find-file-type file)) + (type (nth 0 guess)) + (subtype (nth 1 guess)) + (parameters (nth 2 guess)) + (encoding (nth 3 guess)) + (disposition-type (nth 4 guess)) + (disposition-params (nth 5 guess)) + ) + (if verbose + (setq type (mime-prompt-for-type type) + subtype (mime-prompt-for-subtype type subtype) + )) + (if (or (interactive-p) verbose) + (setq encoding (mime-prompt-for-encoding encoding)) + ) + (if (or (consp parameters) (stringp disposition-type)) + (let ((rest parameters) cell attribute value) + (setq parameters "") + (while rest + (setq cell (car rest)) + (setq attribute (car cell)) + (setq value (cdr cell)) + (if (eq value 'file) + (setq value (std11-wrap-as-quoted-string + (file-name-nondirectory file))) + ) + (setq parameters (concat parameters "; " attribute "=" value)) + (setq rest (cdr rest)) + ) + (if disposition-type + (progn + (setq parameters + (concat parameters "\n" + "Content-Disposition: " disposition-type)) + (setq rest disposition-params) + (while rest + (setq cell (car rest)) + (setq attribute (car cell)) + (setq value (cdr cell)) + (if (eq value 'file) + (setq value (std11-wrap-as-quoted-string + (file-name-nondirectory file))) + ) + (setq parameters + (concat parameters "; " attribute "=" value)) + (setq rest (cdr rest)) + ) + )) + )) + (mime-edit-insert-tag type subtype parameters) + (mime-edit-insert-binary-file file encoding) + )) + +(defun mime-edit-insert-external () + "Insert a reference to external body." + (interactive) + (mime-edit-insert-tag "message" "external-body" nil ";\n\t") + ;;(forward-char -1) + ;;(insert "Content-Description: " (read-string "Content-Description: ") "\n") + ;;(forward-line 1) + (let* ((pritype (mime-prompt-for-type)) + (subtype (mime-prompt-for-subtype pritype)) + (parameters (mime-prompt-for-parameters pritype subtype ";\n\t"))) + (and pritype + subtype + (insert "Content-Type: " + pritype "/" subtype (or parameters "") "\n"))) + (if (and (not (eobp)) + (not (looking-at mime-edit-single-part-tag-regexp))) + (insert (mime-make-text-tag) "\n"))) + +(defun mime-edit-insert-voice () + "Insert a voice message." + (interactive) + (let ((encoding + (completing-read + "What transfer encoding: " + (mime-encoding-alist) nil t nil))) + (mime-edit-insert-tag "audio" "basic" nil) + (mime-edit-define-encoding encoding) + (save-restriction + (narrow-to-region (1- (point))(point)) + (unwind-protect + (funcall mime-edit-voice-recorder encoding) + (progn + (insert "\n") + (invisible-region (point-min)(point-max)) + (goto-char (point-max)) + ))))) + +(defun mime-edit-insert-signature (&optional arg) + "Insert a signature file." + (interactive "P") + (let ((signature-insert-hook + (function + (lambda () + (let ((items (mime-find-file-type signature-file-name))) + (apply (function mime-edit-insert-tag) + (car items) (cadr items) (list (caddr items)))) + ))) + ) + (insert-signature arg) + )) + + +;; Insert a new tag around a point. + +(defun mime-edit-insert-tag (&optional pritype subtype parameters delimiter) + "Insert new MIME tag and return a list of PRITYPE, SUBTYPE, and PARAMETERS. +If nothing is inserted, return nil." + (interactive) + (let ((p (point))) + (mime-edit-goto-tag) + (if (and (re-search-forward mime-edit-tag-regexp nil t) + (< (match-beginning 0) p) + (< p (match-end 0)) + ) + (goto-char (match-beginning 0)) + (goto-char p) + )) + (let ((oldtag nil) + (newtag nil) + (current (point)) + ) + (setq pritype + (or pritype + (mime-prompt-for-type))) + (setq subtype + (or subtype + (mime-prompt-for-subtype pritype))) + (setq parameters + (or parameters + (mime-prompt-for-parameters pritype subtype delimiter))) + ;; Make a new MIME tag. + (setq newtag (mime-make-tag pritype subtype parameters)) + ;; Find an current MIME tag. + (setq oldtag + (save-excursion + (if (mime-edit-goto-tag) + (buffer-substring (match-beginning 0) (match-end 0)) + ;; Assume content type is 'text/plan'. + (mime-make-tag "text" "plain") + ))) + ;; We are only interested in TEXT. + (if (and oldtag + (not (mime-test-content-type + (mime-edit-get-contype oldtag) "text"))) + (setq oldtag nil)) + ;; Make a new tag. + (if (or (not oldtag) ;Not text + (or mime-ignore-same-text-tag + (not (string-equal oldtag newtag)))) + (progn + ;; Mark the beginning of the tag for convenience. + (push-mark (point) 'nomsg) + (insert newtag "\n") + (list pritype subtype parameters) ;New tag is created. + ) + ;; Restore previous point. + (goto-char current) + nil ;Nothing is created. + ) + )) + +(defun mime-edit-insert-binary-file (file &optional encoding) + "Insert binary FILE at point. +Optional argument ENCODING specifies an encoding method such as base64." + (let* ((tagend (1- (point))) ;End of the tag + (hide-p (and mime-auto-hide-body + (stringp encoding) + (not + (let ((en (downcase encoding))) + (or (string-equal en "7bit") + (string-equal en "8bit") + (string-equal en "binary") + ))))) + ) + (save-restriction + (narrow-to-region tagend (point)) + (mime-insert-encoded-file file encoding) + (if hide-p + (progn + (invisible-region (point-min) (point-max)) + (goto-char (point-max)) + ) + (goto-char (point-max)) + )) + (or hide-p + (looking-at mime-edit-tag-regexp) + (= (point)(point-max)) + (mime-edit-insert-tag "text" "plain") + ) + ;; Define encoding even if it is 7bit. + (if (stringp encoding) + (save-excursion + (goto-char tagend) ; Make sure which line the tag is on. + (mime-edit-define-encoding encoding) + )) + )) + + +;; Commands work on a current message flagment. + +(defun mime-edit-goto-tag () + "Search for the beginning of the tagged MIME message." + (let ((current (point))) + (if (looking-at mime-edit-tag-regexp) + t + ;; At first, go to the end. + (cond ((re-search-forward mime-edit-beginning-tag-regexp nil t) + (goto-char (1- (match-beginning 0))) ;For multiline tag + ) + (t + (goto-char (point-max)) + )) + ;; Then search for the beginning. + (re-search-backward mime-edit-end-tag-regexp nil t) + (or (looking-at mime-edit-beginning-tag-regexp) + ;; Restore previous point. + (progn + (goto-char current) + nil + )) + ))) + +(defun mime-edit-content-beginning () + "Return the point of the beginning of content." + (save-excursion + (let ((beg (save-excursion + (beginning-of-line) (point)))) + (if (mime-edit-goto-tag) + (let ((top (point))) + (goto-char (match-end 0)) + (if (and (= beg top) + (= (following-char) ?\^M)) + (point) + (forward-line 1) + (point))) + ;; Default text/plain tag. + (goto-char (point-min)) + (re-search-forward + (concat "\n" (regexp-quote mail-header-separator) + (if mime-ignore-preceding-spaces + "[ \t\n]*\n" "\n")) nil 'move) + (point)) + ))) + +(defun mime-edit-content-end () + "Return the point of the end of content." + (save-excursion + (if (mime-edit-goto-tag) + (progn + (goto-char (match-end 0)) + (if (invisible-p (point)) + (next-visible-point (point)) + ;; Move to the end of this text. + (if (re-search-forward mime-edit-tag-regexp nil 'move) + ;; Don't forget a multiline tag. + (goto-char (match-beginning 0)) + ) + (point) + )) + ;; Assume the message begins with text/plain. + (goto-char (mime-edit-content-beginning)) + (if (re-search-forward mime-edit-tag-regexp nil 'move) + ;; Don't forget a multiline tag. + (goto-char (match-beginning 0))) + (point)) + )) + +(defun mime-edit-define-charset (charset) + "Set charset of current tag to CHARSET." + (save-excursion + (if (mime-edit-goto-tag) + (let ((tag (buffer-substring (match-beginning 0) (match-end 0)))) + (delete-region (match-beginning 0) (match-end 0)) + (insert + (mime-create-tag + (mime-edit-set-parameter + (mime-edit-get-contype tag) + "charset" + (let ((comment (get charset 'mime-charset-comment))) + (if comment + (concat (upcase (symbol-name charset)) " (" comment ")") + (upcase (symbol-name charset))))) + (mime-edit-get-encoding tag))) + )))) + +(defun mime-edit-define-encoding (encoding) + "Set encoding of current tag to ENCODING." + (save-excursion + (if (mime-edit-goto-tag) + (let ((tag (buffer-substring (match-beginning 0) (match-end 0)))) + (delete-region (match-beginning 0) (match-end 0)) + (insert (mime-create-tag (mime-edit-get-contype tag) encoding))) + ))) + +(defun mime-edit-choose-charset () + "Choose charset of a text following current point." + (detect-mime-charset-region (point) (mime-edit-content-end)) + ) + +(defun mime-make-text-tag (&optional subtype) + "Make a tag for a text after current point. +Subtype of text type can be specified by an optional argument SUBTYPE. +Otherwise, it is obtained from mime-content-types." + (let* ((pritype "text") + (subtype (or subtype + (car (car (cdr (assoc pritype mime-content-types))))))) + ;; Charset should be defined later. + (mime-make-tag pritype subtype))) + + +;; Tag handling functions + +(defun mime-make-tag (pritype subtype &optional parameters encoding) + "Make a tag of MIME message of PRITYPE, SUBTYPE and optional PARAMETERS." + (mime-create-tag (concat (or pritype "") "/" (or subtype "") + (or parameters "")) + encoding)) + +(defun mime-create-tag (contype &optional encoding) + "Make a tag with CONTENT-TYPE and optional ENCODING." + (format (if encoding mime-tag-format-with-encoding mime-tag-format) + contype encoding)) + +(defun mime-edit-get-contype (tag) + "Return Content-Type (including parameters) of TAG." + (and (stringp tag) + (or (string-match mime-edit-single-part-tag-regexp tag) + (string-match mime-edit-multipart-beginning-regexp tag) + (string-match mime-edit-multipart-end-regexp tag) + ) + (substring tag (match-beginning 1) (match-end 1)) + )) + +(defun mime-edit-get-encoding (tag) + "Return encoding of TAG." + (and (stringp tag) + (string-match mime-edit-single-part-tag-regexp tag) + (match-beginning 3) + (not (= (match-beginning 3) (match-end 3))) + (substring tag (match-beginning 3) (match-end 3)))) + +(defun mime-get-parameter (contype parameter) + "For given CONTYPE return value for PARAMETER. +Nil if no such parameter." + (if (string-match + (concat + ";[ \t\n]*" + (regexp-quote parameter) + "[ \t\n]*=[ \t\n]*\\([^\" \t\n;]*\\|\"[^\"]*\"\\)\\([ \t\n]*;\\|$\\)") + contype) + (substring contype (match-beginning 1) (match-end 1)) + nil ;No such parameter + )) + +(defun mime-edit-set-parameter (contype parameter value) + "For given CONTYPE set PARAMETER to VALUE." + (let (ctype opt-fields) + (if (string-match "\n[^ \t\n\r]+:" contype) + (setq ctype (substring contype 0 (match-beginning 0)) + opt-fields (substring contype (match-beginning 0))) + (setq ctype contype) + ) + (if (string-match + (concat + ";[ \t\n]*\\(" + (regexp-quote parameter) + "[ \t\n]*=[ \t\n]*\\([^\" \t\n;]*\\|\"[^\"]*\"\\)\\)[ \t\n]*\\(;\\|$\\)") + ctype) + ;; Change value + (concat (substring ctype 0 (match-beginning 1)) + parameter "=" value + (substring ctype (match-end 1)) + opt-fields) + (concat ctype "; " parameter "=" value opt-fields) + ))) + +(defun mime-strip-parameters (contype) + "Return primary content-type and subtype without parameters for CONTYPE." + (if (string-match "^[ \t]*\\([^; \t\n]*\\)" contype) + (substring contype (match-beginning 1) (match-end 1)) nil)) + +(defun mime-test-content-type (contype type &optional subtype) + "Test if CONTYPE is a TYPE and an optional SUBTYPE." + (and (stringp contype) + (stringp type) + (string-match + (concat "^[ \t]*" (downcase type) "/" (downcase (or subtype ""))) + (downcase contype)))) + + +;; Basic functions + +(defun mime-find-file-type (file) + "Guess Content-Type, subtype, and parameters from FILE." + (let ((guess nil) + (guesses mime-file-types)) + (while (and (not guess) guesses) + (if (string-match (car (car guesses)) file) + (setq guess (cdr (car guesses)))) + (setq guesses (cdr guesses))) + guess + )) + +(defun mime-prompt-for-type (&optional default) + "Ask for Content-type." + (let ((type "")) + ;; Repeat until primary content type is specified. + (while (string-equal type "") + (setq type + (completing-read "What content type: " + mime-content-types + nil + 'require-match ;Type must be specified. + default + )) + (if (string-equal type "") + (progn + (message "Content type is required.") + (beep) + (sit-for 1) + )) + ) + type)) + +(defun mime-prompt-for-subtype (type &optional default) + "Ask for subtype of media-type TYPE." + (let ((subtypes (cdr (assoc type mime-content-types)))) + (or (and default + (assoc default subtypes)) + (setq default (car (car subtypes))) + )) + (let* ((answer + (completing-read + (if default + (concat + "What content subtype: (default " default ") ") + "What content subtype: ") + (cdr (assoc type mime-content-types)) + nil + 'require-match ;Subtype must be specified. + nil + ))) + (if (string-equal answer "") default answer))) + +(defun mime-prompt-for-parameters (pritype subtype &optional delimiter) + "Ask for Content-type parameters of Content-Type PRITYPE and SUBTYPE. +Optional DELIMITER specifies parameter delimiter (';' by default)." + (let* ((delimiter (or delimiter "; ")) + (parameters + (mapconcat + (function identity) + (delq nil + (mime-prompt-for-parameters-1 + (cdr (assoc subtype + (cdr (assoc pritype mime-content-types)))))) + delimiter + ))) + (if (and (stringp parameters) + (not (string-equal parameters ""))) + (concat delimiter parameters) + "" ;"" if no parameters + ))) + +(defun mime-prompt-for-parameters-1 (optlist) + (apply (function append) + (mapcar (function mime-prompt-for-parameter) optlist))) + +(defun mime-prompt-for-parameter (parameter) + "Ask for PARAMETER. +Parameter must be '(PROMPT CHOICE1 (CHOICE2...))." + (let* ((prompt (car parameter)) + (choices (mapcar (function + (lambda (e) + (if (consp e) e (list e)))) + (cdr parameter))) + (default (car (car choices))) + (answer nil)) + (if choices + (progn + (setq answer + (completing-read + (concat "What " prompt + ": (default " + (if (string-equal default "") "\"\"" default) + ") ") + choices nil nil "")) + ;; If nothing is selected, use default. + (if (string-equal answer "") + (setq answer default))) + (setq answer + (read-string (concat "What " prompt ": ")))) + (cons (if (and answer + (not (string-equal answer ""))) + (concat prompt "=" + ;; Note: control characters ignored! + (if (string-match mime-tspecials-regexp answer) + (concat "\"" answer "\"") answer))) + (mime-prompt-for-parameters-1 (cdr (assoc answer (cdr parameter))))) + )) + +(defun mime-prompt-for-encoding (default) + "Ask for Content-Transfer-Encoding." + (let (encoding) + (while (string= + (setq encoding + (completing-read + "What transfer encoding: " + (mime-encoding-alist) nil t default) + ) + "")) + encoding)) + + +;;; @ Translate the tagged MIME messages into a MIME compliant message. +;;; + +(defvar mime-edit-translate-buffer-hook + '(mime-edit-pgp-enclose-buffer + mime-edit-translate-body + mime-edit-translate-header)) + +(defun mime-edit-translate-header () + "Encode the message header into network representation." + (mime-encode-header-in-buffer 'code-conversion) + (run-hooks 'mime-edit-translate-header-hook)) + +(defun mime-edit-translate-buffer () + "Encode the tagged MIME message in current buffer in MIME compliant message." + (interactive) + (undo-boundary) + (if (catch 'mime-edit-error + (save-excursion + (run-hooks 'mime-edit-translate-buffer-hook) + )) + (progn + (undo) + (error "Translation error!") + ))) + +(defun mime-edit-find-inmost () + (goto-char (point-min)) + (if (re-search-forward mime-edit-multipart-beginning-regexp nil t) + (let ((bb (match-beginning 0)) + (be (match-end 0)) + (type (buffer-substring (match-beginning 1)(match-end 1))) + end-exp eb) + (setq end-exp (format "--}-<<%s>>\n" type)) + (widen) + (if (re-search-forward end-exp nil t) + (setq eb (match-beginning 0)) + (setq eb (point-max)) + ) + (narrow-to-region be eb) + (goto-char be) + (if (re-search-forward mime-edit-multipart-beginning-regexp nil t) + (progn + (narrow-to-region (match-beginning 0)(point-max)) + (mime-edit-find-inmost) + ) + (widen) + (list type bb be eb) + )))) + +(defun mime-edit-process-multipart-1 (boundary) + (let ((ret (mime-edit-find-inmost))) + (if ret + (let ((type (car ret)) + (bb (nth 1 ret))(be (nth 2 ret)) + (eb (nth 3 ret)) + ) + (narrow-to-region bb eb) + (delete-region bb be) + (setq bb (point-min)) + (setq eb (point-max)) + (widen) + (goto-char eb) + (if (looking-at mime-edit-multipart-end-regexp) + (let ((beg (match-beginning 0)) + (end (match-end 0)) + ) + (delete-region beg end) + (or (looking-at mime-edit-beginning-tag-regexp) + (eobp) + (insert (concat (mime-make-text-tag) "\n")) + ))) + (cond ((string-equal type "quote") + (mime-edit-enquote-region bb eb) + ) + ((string-equal type "pgp-signed") + (mime-edit-sign-pgp-mime bb eb boundary) + ) + ((string-equal type "pgp-encrypted") + (mime-edit-encrypt-pgp-mime bb eb boundary) + ) + ((string-equal type "kazu-signed") + (mime-edit-sign-pgp-kazu bb eb boundary) + ) + ((string-equal type "kazu-encrypted") + (mime-edit-encrypt-pgp-kazu bb eb boundary) + ) + ((string-equal type "smime-signed") + (mime-edit-sign-smime bb eb boundary) + ) + ((string-equal type "smime-encrypted") + (mime-edit-encrypt-smime bb eb boundary) + ) + (t + (setq boundary + (nth 2 (mime-edit-translate-region bb eb + boundary t))) + (goto-char bb) + (insert + (format "--[[multipart/%s; + boundary=\"%s\"][7bit]]\n" + type boundary)) + )) + boundary)))) + +(defun mime-edit-enquote-region (beg end) + (save-excursion + (save-restriction + (narrow-to-region beg end) + (goto-char beg) + (while (re-search-forward mime-edit-single-part-tag-regexp nil t) + (let ((tag (buffer-substring (match-beginning 0)(match-end 0)))) + (replace-match (concat "- " (substring tag 1))) + ))))) + +(defun mime-edit-dequote-region (beg end) + (save-excursion + (save-restriction + (narrow-to-region beg end) + (goto-char beg) + (while (re-search-forward + mime-edit-quoted-single-part-tag-regexp nil t) + (let ((tag (buffer-substring (match-beginning 0)(match-end 0)))) + (replace-match (concat "-" (substring tag 2))) + ))))) + +(defvar mime-edit-pgp-user-id nil) + +(defun mime-edit-sign-pgp-mime (beg end boundary) + (save-excursion + (save-restriction + (let* ((from (std11-field-body "From" mail-header-separator)) + (ret (progn + (narrow-to-region beg end) + (mime-edit-translate-region beg end boundary))) + (ctype (car ret)) + (encoding (nth 1 ret)) + (pgp-boundary (concat "pgp-sign-" boundary)) + micalg) + (goto-char beg) + (insert (format "Content-Type: %s\n" ctype)) + (if encoding + (insert (format "Content-Transfer-Encoding: %s\n" encoding)) + ) + (insert "\n") + (or (let ((pgg-default-user-id + (or mime-edit-pgp-user-id + (if from + (nth 1 (std11-extract-address-components from)) + pgg-default-user-id)))) + (pgg-sign-region (point-min)(point-max))) + (throw 'mime-edit-error 'pgp-error) + ) + (setq micalg + (cdr (assq 'hash-algorithm + (cdar (with-current-buffer pgg-output-buffer + (pgg-parse-armor-region + (point-min)(point-max)))))) + micalg + (if micalg + (concat "; micalg=pgp-" (downcase (symbol-name micalg))) + "")) + (goto-char beg) + (insert (format "--[[multipart/signed; + boundary=\"%s\"%s; + protocol=\"application/pgp-signature\"][7bit]] +--%s +" pgp-boundary micalg pgp-boundary)) + (goto-char (point-max)) + (insert (format "\n--%s +Content-Type: application/pgp-signature +Content-Transfer-Encoding: 7bit + +" pgp-boundary)) + (insert-buffer-substring pgg-output-buffer) + (goto-char (point-max)) + (insert (format "\n--%s--\n" pgp-boundary)) + )))) + +(defvar mime-edit-encrypt-recipient-fields-list '("To" "cc")) + +(defun mime-edit-make-encrypt-recipient-header () + (let* ((names mime-edit-encrypt-recipient-fields-list) + (values + (std11-field-bodies (cons "From" names) + nil mail-header-separator)) + (from (prog1 + (car values) + (setq values (cdr values)))) + (header (and (stringp from) + (if (string-equal from "") + "" + (format "From: %s\n" from) + ))) + recipients) + (while (and names values) + (let ((name (car names)) + (value (car values)) + ) + (and (stringp value) + (or (string-equal value "") + (progn + (setq header (concat header name ": " value "\n") + recipients (if recipients + (concat recipients " ," value) + value)) + )))) + (setq names (cdr names) + values (cdr values)) + ) + (vector from recipients header) + )) + +(defun mime-edit-encrypt-pgp-mime (beg end boundary) + (save-excursion + (save-restriction + (let (from recipients header) + (let ((ret (mime-edit-make-encrypt-recipient-header))) + (setq from (aref ret 0) + recipients (aref ret 1) + header (aref ret 2)) + ) + (narrow-to-region beg end) + (let* ((ret + (mime-edit-translate-region beg end boundary)) + (ctype (car ret)) + (encoding (nth 1 ret)) + (pgp-boundary (concat "pgp-" boundary))) + (goto-char beg) + (insert header) + (insert (format "Content-Type: %s\n" ctype)) + (if encoding + (insert (format "Content-Transfer-Encoding: %s\n" encoding)) + ) + (insert "\n") + (mime-encode-header-in-buffer) + (or (let ((pgg-default-user-id + (or mime-edit-pgp-user-id + (if from + (nth 1 (std11-extract-address-components from)) + pgg-default-user-id)))) + (pgg-encrypt-region + (point-min) (point-max) + (mapcar (lambda (recipient) + (nth 1 (std11-extract-address-components + recipient))) + (split-string recipients + "\\([ \t\n]*,[ \t\n]*\\)+"))) + ) + (throw 'mime-edit-error 'pgp-error) + ) + (delete-region (point-min)(point-max)) + (goto-char beg) + (insert (format "--[[multipart/encrypted; + boundary=\"%s\"; + protocol=\"application/pgp-encrypted\"][7bit]] +--%s +Content-Type: application/pgp-encrypted + +--%s +Content-Type: application/octet-stream +Content-Transfer-Encoding: 7bit + +" pgp-boundary pgp-boundary pgp-boundary)) + (insert-buffer-substring pgg-output-buffer) + (goto-char (point-max)) + (insert (format "\n--%s--\n" pgp-boundary)) + ))))) + +(defun mime-edit-sign-pgp-kazu (beg end boundary) + (save-excursion + (save-restriction + (narrow-to-region beg end) + (let* ((ret + (mime-edit-translate-region beg end boundary)) + (ctype (car ret)) + (encoding (nth 1 ret))) + (goto-char beg) + (insert (format "Content-Type: %s\n" ctype)) + (if encoding + (insert (format "Content-Transfer-Encoding: %s\n" encoding)) + ) + (insert "\n") + (or (pgg-sign-region beg (point-max) 'clearsign) + (throw 'mime-edit-error 'pgp-error) + ) + (goto-char beg) + (insert + "--[[application/pgp; format=mime][7bit]]\n") + )) + )) + +(defun mime-edit-encrypt-pgp-kazu (beg end boundary) + (save-excursion + (let (recipients header) + (let ((ret (mime-edit-make-encrypt-recipient-header))) + (setq recipients (aref ret 1) + header (aref ret 2)) + ) + (save-restriction + (narrow-to-region beg end) + (let* ((ret + (mime-edit-translate-region beg end boundary)) + (ctype (car ret)) + (encoding (nth 1 ret))) + (goto-char beg) + (insert header) + (insert (format "Content-Type: %s\n" ctype)) + (if encoding + (insert (format "Content-Transfer-Encoding: %s\n" encoding)) + ) + (insert "\n") + (or (pgg-encrypt-region beg (point-max) recipients) + (throw 'mime-edit-error 'pgp-error) + ) + (goto-char beg) + (insert + "--[[application/pgp; format=mime][7bit]]\n") + )) + ))) + +(defun mime-edit-sign-smime (beg end boundary) + (save-excursion + (save-restriction + (let* ((ret (progn + (narrow-to-region beg end) + (mime-edit-translate-region beg end boundary))) + (ctype (car ret)) + (encoding (nth 1 ret)) + (smime-boundary (concat "smime-sign-" boundary))) + (goto-char beg) + (insert (format "Content-Type: %s\n" ctype)) + (if encoding + (insert (format "Content-Transfer-Encoding: %s\n" encoding)) + ) + (insert "\n") + (let (buffer-undo-list) + (goto-char (point-min)) + (while (progn (end-of-line) (not (eobp))) + (insert "\r") + (forward-line 1)) + (or (prog1 (smime-sign-region (point-min)(point-max)) + (push nil buffer-undo-list) + (ignore-errors (undo))) + (throw 'mime-edit-error 'pgp-error) + )) + (goto-char beg) + (insert (format "--[[multipart/signed; + boundary=\"%s\"; micalg=sha1; + protocol=\"application/pkcs7-signature\"][7bit]] +--%s +" smime-boundary smime-boundary)) + (goto-char (point-max)) + (insert (format "\n--%s +Content-Type: application/pkcs7-signature; name=\"smime.p7s\" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename=\"smime.p7s\" +Content-Description: S/MIME Cryptographic Signature + +" smime-boundary)) + (insert-buffer-substring smime-output-buffer) + (goto-char (point-max)) + (insert (format "\n--%s--\n" smime-boundary)) + )))) + +(defun mime-edit-encrypt-smime (beg end boundary) + (save-excursion + (save-restriction + (let* ((ret (progn + (narrow-to-region beg end) + (mime-edit-translate-region beg end boundary))) + (ctype (car ret)) + (encoding (nth 1 ret))) + (goto-char beg) + (insert (format "Content-Type: %s\n" ctype)) + (if encoding + (insert (format "Content-Transfer-Encoding: %s\n" encoding)) + ) + (insert "\n") + (goto-char (point-min)) + (while (progn (end-of-line) (not (eobp))) + (insert "\r") + (forward-line 1)) + (or (smime-encrypt-region (point-min)(point-max)) + (throw 'mime-edit-error 'pgp-error) + ) + (delete-region (point-min)(point-max)) + (insert "--[[application/pkcs7-mime; name=\"smime.p7m\" +Content-Disposition: attachment; filename=\"smime.p7m\" +Content-Description: S/MIME Encrypted Message][base64]]\n") + (insert-buffer-substring smime-output-buffer) + )))) + +(defsubst replace-space-with-underline (str) + (mapconcat (function + (lambda (arg) + (char-to-string + (if (eq arg ?\ ) + ?_ + arg)))) str "") + ) + +(defun mime-edit-make-boundary () + (concat mime-multipart-boundary "_" + (replace-space-with-underline (current-time-string)) + )) + +(defun mime-edit-translate-body () + "Encode the tagged MIME body in current buffer in MIME compliant message." + (interactive) + (save-excursion + (let ((boundary (mime-edit-make-boundary)) + (i 1) + ret) + (while (mime-edit-process-multipart-1 + (format "%s-%d" boundary i)) + (setq i (1+ i)) + ) + (save-restriction + ;; We are interested in message body. + (let* ((beg + (progn + (goto-char (point-min)) + (re-search-forward + (concat "\n" (regexp-quote mail-header-separator) + (if mime-ignore-preceding-spaces + "[ \t\n]*\n" "\n")) nil 'move) + (point))) + (end + (progn + (goto-char (point-max)) + (and mime-ignore-trailing-spaces + (re-search-backward "[^ \t\n]\n" beg t) + (forward-char 1)) + (point)))) + (setq ret (mime-edit-translate-region + beg end + (format "%s-%d" boundary i))) + )) + (mime-edit-dequote-region (point-min)(point-max)) + (let ((contype (car ret)) ;Content-Type + (encoding (nth 1 ret)) ;Content-Transfer-Encoding + ) + ;; Insert User-Agent field + (and mime-edit-insert-user-agent-field + (or (mail-position-on-field "User-Agent") + (insert mime-edit-user-agent-value) + )) + ;; Make primary MIME headers. + (or (mail-position-on-field "MIME-Version") + (insert mime-edit-mime-version-value)) + ;; Remove old Content-Type and other fields. + (save-restriction + (goto-char (point-min)) + (search-forward (concat "\n" mail-header-separator "\n") nil t) + (narrow-to-region (point-min) (point)) + (goto-char (point-min)) + (mime-delete-field "Content-Type") + (mime-delete-field "Content-Transfer-Encoding")) + ;; Then, insert Content-Type and Content-Transfer-Encoding fields. + (mail-position-on-field "Content-Type") + (insert contype) + (if encoding + (progn + (mail-position-on-field "Content-Transfer-Encoding") + (insert encoding))) + )))) + +(defun mime-edit-translate-single-part-tag (boundary &optional prefix) + "Translate single-part-tag to MIME header." + (if (re-search-forward mime-edit-single-part-tag-regexp nil t) + (let* ((beg (match-beginning 0)) + (end (match-end 0)) + (tag (buffer-substring beg end))) + (delete-region beg end) + (let ((contype (mime-edit-get-contype tag)) + (encoding (mime-edit-get-encoding tag))) + (insert (concat prefix "--" boundary "\n")) + (save-restriction + (narrow-to-region (point)(point)) + (insert "Content-Type: " contype "\n") + (if encoding + (insert "Content-Transfer-Encoding: " encoding "\n")) + (mime-encode-header-in-buffer)) + (cons (and contype + (downcase contype)) + (and encoding + (downcase encoding)))) + ))) + +(defun mime-edit-translate-region (beg end &optional boundary multipart) + (or boundary + (setq boundary (mime-edit-make-boundary)) + ) + (save-excursion + (save-restriction + (narrow-to-region beg end) + (let ((tag nil) ;MIME tag + (contype nil) ;Content-Type + (encoding nil) ;Content-Transfer-Encoding + (nparts 0)) ;Number of body parts + ;; Normalize the body part by inserting appropriate message + ;; tags for every message contents. + (mime-edit-normalize-body) + ;; Counting the number of Content-Type. + (goto-char (point-min)) + (while (re-search-forward mime-edit-single-part-tag-regexp nil t) + (setq nparts (1+ nparts))) + ;; Begin translation. + (cond + ((and (<= nparts 1)(not multipart)) + ;; It's a singular message. + (goto-char (point-min)) + (while (re-search-forward + mime-edit-single-part-tag-regexp nil t) + (setq tag + (buffer-substring (match-beginning 0) (match-end 0))) + (delete-region (match-beginning 0) (1+ (match-end 0))) + (setq contype (mime-edit-get-contype tag)) + (setq encoding (mime-edit-get-encoding tag)) + )) + (t + ;; It's a multipart message. + (goto-char (point-min)) + (let ((prio mime-content-transfer-encoding-priority-list) + part-info nprio) + (when (setq part-info + (mime-edit-translate-single-part-tag boundary)) + (and (setq nprio (member (cdr part-info) prio)) + (setq prio nprio)) + (while (setq part-info + (mime-edit-translate-single-part-tag boundary "\n")) + (and (setq nprio (member (cdr part-info) prio)) + (setq prio nprio)))) + ;; Define Content-Type as "multipart/mixed". + (setq contype + (concat "multipart/mixed;\n boundary=\"" boundary "\"")) + (setq encoding (car prio)) + ;; Insert the trailer. + (goto-char (point-max)) + (insert "\n--" boundary "--\n") + ))) + (list contype encoding boundary nparts) + )))) + +(defun mime-edit-normalize-body () + "Normalize the body part by inserting appropriate message tags." + ;; Insert the first MIME tags if necessary. + (goto-char (point-min)) + (if (not (looking-at mime-edit-single-part-tag-regexp)) + (insert (mime-make-text-tag) "\n")) + ;; Check each tag, and add new tag or correct it if necessary. + (goto-char (point-min)) + (while (re-search-forward mime-edit-single-part-tag-regexp nil t) + (let* ((tag (buffer-substring (match-beginning 0) (match-end 0))) + (contype (mime-edit-get-contype tag)) + (charset (mime-get-parameter contype "charset")) + (encoding (mime-edit-get-encoding tag))) + ;; Remove extra whitespaces after the tag. + (if (looking-at "[ \t]+$") + (delete-region (match-beginning 0) (match-end 0))) + (let ((beg (point)) + (end (mime-edit-content-end)) + ) + (if (= end (point-max)) + nil + (goto-char end) + (or (looking-at mime-edit-beginning-tag-regexp) + (eobp) + (insert (mime-make-text-tag) "\n") + )) + (visible-region beg end) + (goto-char beg) + ) + (cond + ((mime-test-content-type contype "message") + ;; Content-type "message" should be sent as is. + (forward-line 1) + ) + ((mime-test-content-type contype "text") + ;; Define charset for text if necessary. + (setq charset (if charset + (intern (downcase charset)) + (mime-edit-choose-charset))) + (mime-edit-define-charset charset) + (cond ((string-equal contype "text/x-rot13-47-48") + (save-excursion + (forward-line) + (mule-caesar-region (point) (mime-edit-content-end)) + )) + ((string-equal contype "text/enriched") + (save-excursion + (let ((beg (progn + (forward-line) + (point))) + (end (mime-edit-content-end)) + ) + ;; Patch for hard newlines + ;; (save-excursion + ;; (goto-char beg) + ;; (while (search-forward "\n" end t) + ;; (put-text-property (match-beginning 0) + ;; (point) + ;; 'hard t))) + ;; End patch for hard newlines + (enriched-encode beg end nil) + (goto-char beg) + (if (search-forward "\n\n") + (delete-region beg (match-end 0)) + ) + )))) + ;; Point is now on current tag. + ;; Define encoding and encode text if necessary. + (or encoding ;Encoding is not specified. + (let* ((encoding + (let (bits conv) + (let ((ret (cdr (assq charset mime-charset-type-list)))) + (if ret + (setq bits (car ret) + conv (nth 1 ret)) + (setq bits 8 + conv "quoted-printable"))) + (if (<= bits mime-transfer-level) + (mime-encoding-name bits) + conv))) + (beg (mime-edit-content-beginning))) + (encode-mime-charset-region beg (mime-edit-content-end) + charset) + ;; Protect "From " in beginning of line + (save-restriction + (narrow-to-region beg (mime-edit-content-end)) + (goto-char beg) + (let (case-fold-search) + (if (re-search-forward "^From " nil t) + (unless encoding + (if (memq charset '(iso-2022-jp + iso-2022-jp-2 + iso-2022-int-1 + x-ctext)) + (while (progn + (replace-match "\e(BFrom ") + (re-search-forward "^From " nil t) + )) + (setq encoding "quoted-printable") + ))))) + ;; canonicalize line break code + (or (member encoding '(nil "7bit" "8bit" "quoted-printable")) + (save-restriction + (narrow-to-region beg (mime-edit-content-end)) + (goto-char beg) + (while (re-search-forward "\\(\\=\\|[^\r]\\)\n" nil t) + ;; Don't use this in the multibyte buffer since it may + ;; convert the unibyte string into multibyte. + ;;;;(replace-match "\\1\r\n")))) + (backward-char 1) + (insert "\r") + (forward-char 1)))) + (goto-char beg) + (mime-encode-region beg (mime-edit-content-end) + (or encoding "7bit")) + (mime-edit-define-encoding encoding) + )) + (goto-char (mime-edit-content-end)) + ) + ((null encoding) ;Encoding is not specified. + ;; Application, image, audio, video, and any other + ;; unknown content-type without encoding should be + ;; encoded. + (let* ((encoding "base64") ;Encode in BASE64 by default. + (beg (mime-edit-content-beginning)) + (end (mime-edit-content-end))) + (mime-encode-region beg end encoding) + (mime-edit-define-encoding encoding)) + (forward-line 1) + )) + ))) + +(defun mime-delete-field (field) + "Delete header FIELD." + (let ((regexp (format "^%s:[ \t]*" field))) + (goto-char (point-min)) + (while (re-search-forward regexp nil t) + (delete-region (match-beginning 0) + (1+ (std11-field-end)))))) + + +;;; +;;; Platform dependent functions +;;; + +;; Sun implementations + +(defun mime-edit-voice-recorder-for-sun (encoding) + "Record voice in a buffer using Sun audio device, +and insert data encoded as ENCODING." + (message "Start the recording on %s. Type C-g to finish the recording..." + (system-name)) + (mime-insert-encoded-file "/dev/audio" encoding) + ) + + +;;; @ Other useful commands. +;;; + +;; Message forwarding commands as content-type "message/rfc822". + +(defun mime-edit-insert-message (&optional message) + (interactive) + (let ((inserter (cdr (assq major-mode mime-edit-message-inserter-alist)))) + (if (and inserter (fboundp inserter)) + (progn + (mime-edit-insert-tag "message" "rfc822") + (funcall inserter message) + ) + (message "Sorry, I don't have message inserter for your MUA.") + ))) + +(defun mime-edit-insert-mail (&optional message) + (interactive) + (let ((inserter (cdr (assq major-mode mime-edit-mail-inserter-alist)))) + (if (and inserter (fboundp inserter)) + (progn + (mime-edit-insert-tag "message" "rfc822") + (funcall inserter message) + ) + (message "Sorry, I don't have mail inserter for your MUA.") + ))) + +(defun mime-edit-inserted-message-filter () + (save-excursion + (save-restriction + (let ((header-start (point)) + (case-fold-search t) + beg end) + ;; for Emacs 18 + ;; (if (re-search-forward "^$" (marker-position (mark-marker))) + (if (re-search-forward "^$" (mark t)) + (narrow-to-region header-start (match-beginning 0)) + ) + (goto-char header-start) + (while (and (re-search-forward + mime-edit-yank-ignored-field-regexp nil t) + (setq beg (match-beginning 0)) + (setq end (1+ (std11-field-end))) + ) + (delete-region beg end) + ) + )))) + + +;;; @ multipart enclosure +;;; + +(defun mime-edit-enclose-region-internal (type beg end) + (save-excursion + (goto-char beg) + (save-restriction + (narrow-to-region beg end) + (insert (format "--<<%s>>-{\n" type)) + (goto-char (point-max)) + (insert (format "--}-<<%s>>\n" type)) + (goto-char (point-max)) + ) + (or (looking-at mime-edit-beginning-tag-regexp) + (eobp) + (insert (mime-make-text-tag) "\n") + ) + )) + +(defun mime-edit-enclose-quote-region (beg end) + (interactive "*r") + (mime-edit-enclose-region-internal 'quote beg end) + ) + +(defun mime-edit-enclose-mixed-region (beg end) + (interactive "*r") + (mime-edit-enclose-region-internal 'mixed beg end) + ) + +(defun mime-edit-enclose-parallel-region (beg end) + (interactive "*r") + (mime-edit-enclose-region-internal 'parallel beg end) + ) + +(defun mime-edit-enclose-digest-region (beg end) + (interactive "*r") + (mime-edit-enclose-region-internal 'digest beg end) + ) + +(defun mime-edit-enclose-alternative-region (beg end) + (interactive "*r") + (mime-edit-enclose-region-internal 'alternative beg end) + ) + +(defun mime-edit-enclose-pgp-signed-region (beg end) + (interactive "*r") + (mime-edit-enclose-region-internal 'pgp-signed beg end) + ) + +(defun mime-edit-enclose-pgp-encrypted-region (beg end) + (interactive "*r") + (mime-edit-enclose-region-internal 'pgp-encrypted beg end) + ) + +(defun mime-edit-enclose-kazu-signed-region (beg end) + (interactive "*r") + (mime-edit-enclose-region-internal 'kazu-signed beg end) + ) + +(defun mime-edit-enclose-kazu-encrypted-region (beg end) + (interactive "*r") + (mime-edit-enclose-region-internal 'kazu-encrypted beg end) + ) + +(defun mime-edit-enclose-smime-signed-region (beg end) + (interactive "*r") + (mime-edit-enclose-region-internal 'smime-signed beg end) + ) + +(defun mime-edit-enclose-smime-encrypted-region (beg end) + (interactive "*r") + (mime-edit-enclose-region-internal 'smime-encrypted beg end) + ) + +(defun mime-edit-insert-key (&optional arg) + "Insert a pgp public key." + (interactive "P") + (mime-edit-insert-tag "application" "pgp-keys") + (mime-edit-define-encoding "7bit") + (pgg-insert-key) + (if (and (not (eobp)) + (not (looking-at mime-edit-single-part-tag-regexp))) + (insert (mime-make-text-tag) "\n"))) + + +;;; @ flag setting +;;; + +(defun mime-edit-set-split (arg) + (interactive + (list + (y-or-n-p "Do you want to enable split? ") + )) + (setq mime-edit-split-message arg) + (if arg + (message "This message is enabled to split.") + (message "This message is not enabled to split.") + )) + +(defun mime-edit-toggle-transfer-level (&optional transfer-level) + "Toggle transfer-level is 7bit or 8bit through. + +Optional TRANSFER-LEVEL is a number of transfer-level, 7 or 8." + (interactive) + (if (numberp transfer-level) + (setq mime-transfer-level transfer-level) + (if (< mime-transfer-level 8) + (setq mime-transfer-level 8) + (setq mime-transfer-level 7) + )) + (message (format "Current transfer-level is %d bit" + mime-transfer-level)) + (setq mime-transfer-level-string + (mime-encoding-name mime-transfer-level 'not-omit)) + (force-mode-line-update) + ) + +(defun mime-edit-set-transfer-level-7bit () + (interactive) + (mime-edit-toggle-transfer-level 7) + ) + +(defun mime-edit-set-transfer-level-8bit () + (interactive) + (mime-edit-toggle-transfer-level 8) + ) + + +;;; @ pgp +;;; + +(defvar mime-edit-pgp-processing nil) +(make-variable-buffer-local 'mime-edit-pgp-processing) + +(defun mime-edit-set-sign (arg) + (interactive + (list + (y-or-n-p "Do you want to sign? ") + )) + (if arg + (progn + (or (memq 'sign mime-edit-pgp-processing) + (setq mime-edit-pgp-processing + (nconc mime-edit-pgp-processing + (copy-sequence '(sign))))) + (message "This message will be signed.") + ) + (setq mime-edit-pgp-processing + (delq 'sign mime-edit-pgp-processing)) + (message "This message will not be signed.") + )) + +(defun mime-edit-set-encrypt (arg) + (interactive + (list + (y-or-n-p "Do you want to encrypt? ") + )) + (if arg + (progn + (or (memq 'encrypt mime-edit-pgp-processing) + (setq mime-edit-pgp-processing + (nconc mime-edit-pgp-processing + (copy-sequence '(encrypt))))) + (message "This message will be encrypt.") + ) + (setq mime-edit-pgp-processing + (delq 'encrypt mime-edit-pgp-processing)) + (message "This message will not be encrypt.") + )) + +(defun mime-edit-pgp-enclose-buffer () + (let ((beg (save-excursion + (goto-char (point-min)) + (if (search-forward (concat "\n" mail-header-separator "\n")) + (match-end 0) + ))) + ) + (if beg + (dolist (pgp-processing mime-edit-pgp-processing) + (case pgp-processing + (sign + (mime-edit-enclose-pgp-signed-region + beg (point-max)) + ) + (encrypt + (mime-edit-enclose-pgp-encrypted-region + beg (point-max)) + ))) + ))) + + +;;; @ split +;;; + +(defun mime-edit-insert-partial-header (fields subject + id number total separator) + (insert fields) + (insert (format "Subject: %s (%d/%d)\n" subject number total)) + (insert mime-edit-mime-version-field-for-message/partial) + (insert (format "\ +Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n" + id number total separator)) + ) + +(defun mime-edit-split-and-send + (&optional cmd lines mime-edit-message-max-length) + (interactive) + (or lines + (setq lines + (count-lines (point-min) (point-max))) + ) + (or mime-edit-message-max-length + (setq mime-edit-message-max-length + (or (cdr (assq major-mode mime-edit-message-max-lines-alist)) + mime-edit-message-default-max-lines)) + ) + (let* ((separator mail-header-separator) + (id (concat "\"" + (replace-space-with-underline (current-time-string)) + "@" (system-name) "\""))) + (run-hooks 'mime-edit-before-split-hook) + (let ((the-buf (current-buffer)) + (copy-buf (get-buffer-create " *Original Message*")) + (header (std11-header-string-except + mime-edit-split-ignored-field-regexp separator)) + (subject (mail-fetch-field "subject")) + (total (+ (/ lines mime-edit-message-max-length) + (if (> (mod lines mime-edit-message-max-length) 0) + 1))) + (command + (or cmd + (cdr + (assq major-mode + mime-edit-split-message-sender-alist)) + (function + (lambda () + (interactive) + (error "Split sender is not specified for `%s'." major-mode) + )) + )) + (mime-edit-partial-number 1) + data) + (save-excursion + (set-buffer copy-buf) + (erase-buffer) + (insert-buffer the-buf) + (save-restriction + (if (re-search-forward + (concat "^" (regexp-quote separator) "$") nil t) + (let ((he (match-beginning 0))) + (replace-match "") + (narrow-to-region (point-min) he) + )) + (goto-char (point-min)) + (while (re-search-forward mime-edit-split-blind-field-regexp nil t) + (delete-region (match-beginning 0) + (1+ (std11-field-end))) + ))) + (while (< mime-edit-partial-number total) + (erase-buffer) + (save-excursion + (set-buffer copy-buf) + (setq data (buffer-substring + (point-min) + (progn + (goto-line mime-edit-message-max-length) + (point)) + )) + (delete-region (point-min)(point)) + ) + (mime-edit-insert-partial-header + header subject id mime-edit-partial-number total separator) + (insert data) + (save-excursion + (message (format "Sending %d/%d..." + mime-edit-partial-number total)) + (call-interactively command) + (message (format "Sending %d/%d...done" + mime-edit-partial-number total)) + ) + (setq mime-edit-partial-number + (1+ mime-edit-partial-number)) + ) + (erase-buffer) + (save-excursion + (set-buffer copy-buf) + (setq data (buffer-string)) + (erase-buffer) + ) + (mime-edit-insert-partial-header + header subject id mime-edit-partial-number total separator) + (insert data) + (save-excursion + (message (format "Sending %d/%d..." + mime-edit-partial-number total)) + (message (format "Sending %d/%d...done" + mime-edit-partial-number total)) + ) + ))) + +(defun mime-edit-maybe-split-and-send (&optional cmd) + (interactive) + (run-hooks 'mime-edit-before-send-hook) + (let ((mime-edit-message-max-length + (or (cdr (assq major-mode mime-edit-message-max-lines-alist)) + mime-edit-message-default-max-lines)) + (lines (count-lines (point-min) (point-max))) + ) + (if (and (> lines mime-edit-message-max-length) + mime-edit-split-message) + (mime-edit-split-and-send cmd lines mime-edit-message-max-length) + ))) + + +;;; @ preview message +;;; + +(defvar mime-edit-buffer nil) ; buffer local variable + +(defun mime-edit-preview-message () + "preview editing MIME message." + (interactive) + (let* ((str (buffer-string)) + (separator mail-header-separator) + (the-buf (current-buffer)) + (buf-name (buffer-name)) + (temp-buf-name (concat "*temp-article:" buf-name "*")) + (buf (get-buffer temp-buf-name)) + (pgp-processing mime-edit-pgp-processing) + ) + (if buf + (progn + (switch-to-buffer buf) + (erase-buffer) + ) + (setq buf (get-buffer-create temp-buf-name)) + (switch-to-buffer buf) + ) + (insert str) + (setq major-mode 'mime-temp-message-mode) + (make-local-variable 'mail-header-separator) + (setq mail-header-separator separator) + (make-local-variable 'mime-edit-buffer) + (setq mime-edit-buffer the-buf) + (setq mime-edit-pgp-processing pgp-processing) + + (run-hooks 'mime-edit-translate-hook) + (mime-edit-translate-buffer) + (goto-char (point-min)) + (if (re-search-forward + (concat "^" (regexp-quote separator) "$")) + (replace-match "") + ) + (mime-view-buffer) + (make-local-variable 'mime-edit-temp-message-buffer) + (setq mime-edit-temp-message-buffer buf))) + +(defun mime-edit-quitting-method () + "Quitting method for mime-view." + (let* ((temp mime-edit-temp-message-buffer) + buf) + (mime-preview-kill-buffer) + (set-buffer temp) + (setq buf mime-edit-buffer) + (kill-buffer temp) + (switch-to-buffer buf))) + +(set-alist 'mime-preview-quitting-method-alist + 'mime-temp-message-mode + #'mime-edit-quitting-method) + + +;;; @ edit again +;;; + +(defvar mime-edit-again-ignored-field-regexp + (concat "^\\(" "Content-.*\\|Mime-Version" + (if mime-edit-insert-user-agent-field "\\|User-Agent") + "\\):") + "Regexp for deleted header fields when `mime-edit-again' is called.") + +(defsubst eliminate-top-spaces (string) + "Eliminate top sequence of space or tab in STRING." + (if (string-match "^[ \t]+" string) + (substring string (match-end 0)) + string)) + +(defun mime-edit-decode-multipart-in-buffer (content-type not-decode-text) + (let* ((subtype + (or + (cdr (assoc (mime-content-type-parameter content-type "protocol") + '(("application/pgp-encrypted" . pgp-encrypted) + ("application/pgp-signature" . pgp-signed)))) + (mime-content-type-subtype content-type))) + (boundary (mime-content-type-parameter content-type "boundary")) + (boundary-pat (concat "\n--" (regexp-quote boundary) "[ \t]*\n"))) + (re-search-forward boundary-pat nil t) + (let ((bb (match-beginning 0)) eb tag) + (setq tag (format "\n--<<%s>>-{\n" subtype)) + (goto-char bb) + (insert tag) + (setq bb (+ bb (length tag))) + (re-search-forward + (concat "\n--" (regexp-quote boundary) "--[ \t]*\n") + nil t) + (setq eb (match-beginning 0)) + (replace-match (format "--}-<<%s>>\n" subtype)) + (save-restriction + (narrow-to-region bb eb) + (goto-char (point-min)) + (while (re-search-forward boundary-pat nil t) + (let ((beg (match-beginning 0)) + end) + (delete-region beg (match-end 0)) + (save-excursion + (if (re-search-forward boundary-pat nil t) + (setq end (match-beginning 0)) + (setq end (point-max)) + ) + (save-restriction + (narrow-to-region beg end) + (cond + ((eq subtype 'pgp-encrypted) + (when (and + (progn + (goto-char (point-min)) + (re-search-forward "^-+BEGIN PGP MESSAGE-+$" + nil t)) + (prog1 + (save-window-excursion + (pgg-decrypt-region (match-beginning 0) + (point-max))) + (delete-region (point-min)(point-max)))) + (insert-buffer-substring pgg-output-buffer) + (mime-edit-decode-message-in-buffer + nil not-decode-text) + (delete-region (goto-char (point-min)) + (if (search-forward "\n\n" nil t) + (match-end 0) + (point-min))) + (goto-char (point-max)) + )) + (t + (mime-edit-decode-message-in-buffer + (if (eq subtype 'digest) + (eval-when-compile + (make-mime-content-type 'message 'rfc822)) + ) + not-decode-text) + (goto-char (point-max)) + )) + )))) + )) + (goto-char (point-min)) + (or (= (point-min) 1) + (delete-region (point-min) + (if (search-forward "\n\n" nil t) + (match-end 0) + (point-min) + ))) + )) + +(defun mime-edit-decode-single-part-in-buffer + (content-type not-decode-text &optional content-disposition) + (let* ((type (mime-content-type-primary-type content-type)) + (subtype (mime-content-type-subtype content-type)) + (ctype (format "%s/%s" type subtype)) + charset + (pstr (let ((bytes (+ 14 (length ctype)))) + (mapconcat (function + (lambda (attr) + (if (string= (car attr) "charset") + (progn + (setq charset (cdr attr)) + "") + (let* ((str (concat (car attr) + "=" (cdr attr))) + (bs (length str))) + (setq bytes (+ bytes bs 2)) + (if (< bytes 76) + (concat "; " str) + (setq bytes (+ bs 1)) + (concat ";\n " str) + ) + )))) + (mime-content-type-parameters content-type) ""))) + encoding + encoded + (limit (save-excursion + (if (search-forward "\n\n" nil t) + (1- (point))))) + (disposition-type + (mime-content-disposition-type content-disposition)) + (disposition-str + (if disposition-type + (let ((bytes (+ 21 (length (format "%s" disposition-type))))) + (mapconcat (function + (lambda (attr) + (let* ((str (concat + (car attr) + "=" + (if (string-equal "filename" + (car attr)) + (std11-wrap-as-quoted-string + (cdr attr)) + (cdr attr)))) + (bs (length str))) + (setq bytes (+ bytes bs 2)) + (if (< bytes 76) + (concat "; " str) + (setq bytes (+ bs 1)) + (concat ";\n " str) + ) + ))) + (mime-content-disposition-parameters + content-disposition) + "")))) + ) + (if disposition-type + (setq pstr (format "%s\nContent-Disposition: %s%s" + pstr disposition-type disposition-str)) + ) + (save-excursion + (if (re-search-forward + "^Content-Transfer-Encoding:" limit t) + (let ((beg (match-beginning 0)) + (hbeg (match-end 0)) + (end (std11-field-end limit))) + (setq encoding + (downcase + (eliminate-top-spaces + (std11-unfold-string + (buffer-substring hbeg end))))) + (if (or charset (eq type 'text)) + (progn + (delete-region beg (1+ end)) + (goto-char (point-min)) + (if (search-forward "\n\n" nil t) + (progn + (mime-decode-region + (match-end 0)(point-max) encoding) + (setq encoded t + encoding nil) + ))))))) + (if (and (eq type 'text) + (or encoded (not not-decode-text))) + (progn + (save-excursion + (goto-char (point-min)) + (while (re-search-forward "\r\n" nil t) + (replace-match "\n") + )) + (decode-mime-charset-region (point-min)(point-max) + (or charset default-mime-charset)) + )) + (let ((he (if (re-search-forward "^$" nil t) + (match-end 0) + (point-min) + ))) + (if (and (eq type 'text) + (eq subtype 'x-rot13-47-48)) + (mule-caesar-region he (point-max)) + ) + (if (= (point-min) 1) + (progn + (goto-char he) + (insert + (concat "\n" + (mime-create-tag + (format "%s/%s%s" type subtype pstr) + encoding))) + ) + (delete-region (point-min) he) + (insert + (mime-create-tag (format "%s/%s%s" type subtype pstr) + encoding)) + )) + )) + +;;;###autoload +(defun mime-edit-decode-message-in-buffer (&optional default-content-type + not-decode-text) + (save-excursion + (goto-char (point-min)) + (let ((ctl (or (mime-read-Content-Type) + default-content-type))) + (if ctl + (let ((type (mime-content-type-primary-type ctl))) + (cond + ((and (eq type 'application) + (eq (mime-content-type-subtype ctl) 'pgp-signature)) + (delete-region (point-min)(point-max)) + ) + ((eq type 'multipart) + (mime-edit-decode-multipart-in-buffer ctl not-decode-text) + ) + (t + (mime-edit-decode-single-part-in-buffer + ctl not-decode-text (mime-read-Content-Disposition)) + ))) + (or not-decode-text + (decode-mime-charset-region (point-min) (point-max) + default-mime-charset)) + ) + (if (= (point-min) 1) + (progn + (save-restriction + (std11-narrow-to-header) + (goto-char (point-min)) + (while (re-search-forward + mime-edit-again-ignored-field-regexp nil t) + (delete-region (match-beginning 0) (1+ (std11-field-end))) + )) + (mime-decode-header-in-buffer (not not-decode-text)) + )) + ))) + +;;;###autoload +(defun mime-edit-again (&optional not-decode-text no-separator not-turn-on) + "Convert current buffer to MIME-Edit buffer and turn on MIME-Edit mode. +Content-Type and Content-Transfer-Encoding header fields will be +converted to MIME-Edit tags." + (interactive) + (goto-char (point-min)) + (if (search-forward + (concat "\n" (regexp-quote mail-header-separator) "\n") + nil t) + (replace-match "\n\n") + ) + (mime-edit-decode-message-in-buffer nil not-decode-text) + (goto-char (point-min)) + (or no-separator + (and (re-search-forward "^$") + (replace-match mail-header-separator) + )) + (or not-turn-on + (turn-on-mime-edit) + )) + + +;;; @ end +;;; + +(provide 'mime-edit) + +(run-hooks 'mime-edit-load-hook) + +;;; mime-edit.el ends here diff --git a/semi-1.14.6/mime-image.el b/semi-1.14.6/mime-image.el new file mode 100644 index 0000000..70347b0 --- /dev/null +++ b/semi-1.14.6/mime-image.el @@ -0,0 +1,206 @@ +;;; mime-image.el --- mime-view filter to display images + +;; Copyright (C) 1995,1996,1997,1998 MORIOKA Tomohiko +;; Copyright (C) 1996 Dan Rich + +;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> +;; Dan Rich <drich@morpheus.corp.sgi.com> +;; Daiki Ueno <ueno@ueda.info.waseda.ac.jp> +;; Katsumi Yamaoka <yamaoka@jpl.org> +;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp> +;; Created: 1995/12/15 +;; Renamed: 1997/2/21 from tm-image.el + +;; Keywords: image, picture, X-Face, MIME, multimedia, mail, news + +;; This file is part of SEMI (Showy Emacs MIME Interfaces). + +;; 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 2, 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 GNU XEmacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: +;; If you use this program with MULE, please install +;; etl8x16-bitmap.bdf font included in tl package. + +;;; Code: + +(eval-when-compile (require 'cl)) + +(eval-when-compile (require 'static)) + +(require 'mime-view) +(require 'alist) +(require 'path-util) + +(defsubst mime-image-normalize-xbm-buffer (buffer) + (save-excursion + (set-buffer buffer) + (let ((case-fold-search t) width height xbytes right margin) + (goto-char (point-min)) + (or (re-search-forward "_width[\t ]+\\([0-9]+\\)" nil t) + (error "!! Illegal xbm file format" (current-buffer))) + (setq width (string-to-int (match-string 1)) + xbytes (/ (+ width 7) 8)) + (goto-char (point-min)) + (or (re-search-forward "_height[\t ]+\\([0-9]+\\)" nil t) + (error "!! Illegal xbm file format" (current-buffer))) + (setq height (string-to-int (match-string 1))) + (goto-char (point-min)) + (re-search-forward "0x[0-9a-f][0-9a-f],") + (delete-region (point-min) (match-beginning 0)) + (goto-char (point-min)) + (while (re-search-forward "[\n\r\t ,;}]" nil t) + (replace-match "")) + (goto-char (point-min)) + (while (re-search-forward "0x" nil t) + (replace-match "\\x" nil t)) + (goto-char (point-min)) + (insert "(" (number-to-string width) " " + (number-to-string height) " \"") + (goto-char (point-max)) + (insert "\")") + (goto-char (point-min)) + (read (current-buffer))))) + +(static-if (featurep 'xemacs) + (progn + (defun mime-image-type-available-p (type) + (memq type (image-instantiator-format-list))) + + (defun mime-image-create (file-or-data &optional type data-p &rest props) + (when (and data-p (eq type 'xbm)) + (with-temp-buffer + (insert file-or-data) + (setq file-or-data + (mime-image-normalize-xbm-buffer (current-buffer))))) + (let ((glyph + (make-glyph + (if (and type (mime-image-type-available-p type)) + (vconcat + (list type (if data-p :data :file) file-or-data) + props) + file-or-data)))) + (if (nothing-image-instance-p (glyph-image-instance glyph)) nil + glyph))) + + (defun mime-image-insert (image &optional string area) + (let ((extent (make-extent (point) + (progn (and string + (insert string)) + (point))))) + (set-extent-property extent 'invisible t) + (set-extent-end-glyph extent image)))) + (condition-case nil + (progn + (require 'image) + (defalias 'mime-image-type-available-p 'image-type-available-p) + (defun mime-image-create + (file-or-data &optional type data-p &rest props) + (if (and data-p (eq type 'xbm)) + (with-temp-buffer + (insert file-or-data) + (setq file-or-data + (mime-image-normalize-xbm-buffer (current-buffer))) + (apply #'create-image (nth 2 file-or-data) type data-p + (nconc + (list :width (car file-or-data) + :height (nth 1 file-or-data)) + props))) + (apply #'create-image file-or-data type data-p props))) + (defalias 'mime-image-insert 'insert-image)) + (error + (condition-case nil + (progn + (require (if (featurep 'mule) 'bitmap "")) + (defun mime-image-read-xbm-buffer (buffer) + (condition-case nil + (mapconcat #'bitmap-compose + (append (bitmap-decode-xbm + (bitmap-read-xbm-buffer + (current-buffer))) nil) "\n") + (error nil))) + (defun mime-image-insert (image &optional string area) + (insert image))) + (error + (defalias 'mime-image-read-xbm-buffer + 'mime-image-normalize-xbm-buffer) + (defun mime-image-insert (image &optional string area) + (save-restriction + (narrow-to-region (point)(point)) + (let ((face (gensym "mii"))) + (or (facep face) (make-face face)) + (set-face-stipple face image) + (let ((row (make-string (/ (car image) (frame-char-width)) ? )) + (height (/ (nth 1 image) (frame-char-height))) + (i 0)) + (while (< i height) + (set-text-properties (point) (progn (insert row)(point)) + (list 'face face)) + (insert "\n") + (setq i (1+ i))))))))) + + (defun mime-image-type-available-p (type) + (eq type 'xbm)) + + (defun mime-image-create (file-or-data &optional type data-p &rest props) + (when (or (null type) (eq type 'xbm)) + (with-temp-buffer + (if data-p + (insert file-or-data) + (insert-file-contents file-or-data)) + (mime-image-read-xbm-buffer (current-buffer)))))))) + +(defvar mime-image-format-alist + '((image jpeg jpeg) + (image gif gif) + (image tiff tiff) + (image x-tiff tiff) + (image xbm xbm) + (image x-xbm xbm) + (image x-xpixmap xpm) + (image png png))) + +(dolist (rule mime-image-format-alist) + (when (mime-image-type-available-p (nth 2 rule)) + (ctree-set-calist-strictly + 'mime-preview-condition + (list (cons 'type (car rule))(cons 'subtype (nth 1 rule)) + '(body . visible) + (cons 'body-presentation-method #'mime-display-image) + (cons 'image-format (nth 2 rule)))))) + + +;;; @ content filter for images +;;; +;; (for XEmacs 19.12 or later) + +(defun mime-display-image (entity situation) + (message "Decoding image...") + (let ((format (cdr (assq 'image-format situation))) + image) + (setq image (mime-image-create (mime-entity-content entity) format 'data)) + (if (null image) + (message "Invalid glyph!") + (save-excursion + (mime-image-insert image) + (insert "\n") + (message "Decoding image...done"))))) + +;;; @ end +;;; + +(provide 'mime-image) + +;;; mime-image.el ends here diff --git a/semi-1.14.6/mime-mc.el b/semi-1.14.6/mime-mc.el new file mode 100644 index 0000000..a9f1ebc --- /dev/null +++ b/semi-1.14.6/mime-mc.el @@ -0,0 +1,164 @@ +;;; mime-mc.el --- Mailcrypt interface for SEMI + +;; Copyright (C) 1996,1997,1998 MORIOKA Tomohiko + +;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> +;; Keywords: PGP, security, MIME, multimedia, mail, news + +;; This file is part of SEMI (Secure Emacs MIME Interface). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Code: + +(require 'mailcrypt) +(eval-and-compile (load "mc-pgp")) + +(defun mime-mc-pgp-generic-parser (result) + (let ((ret (mc-pgp-generic-parser result))) + (if (consp ret) + (vector (car ret)(cdr ret)) + ))) + +(defun mime-mc-process-region + (beg end passwd program args parser &optional buffer boundary) + (let ((obuf (current-buffer)) + (process-connection-type nil) + mybuf result rgn proc) + (unwind-protect + (progn + (setq mybuf (or buffer (generate-new-buffer " *mailcrypt temp"))) + (set-buffer mybuf) + (erase-buffer) + (set-buffer obuf) + (buffer-disable-undo mybuf) + (setq proc + (apply 'start-process "*PGP*" mybuf program args)) + (if passwd + (progn + (process-send-string proc (concat passwd "\n")) + (or mc-passwd-timeout (mc-deactivate-passwd t)))) + (process-send-region proc beg end) + (process-send-eof proc) + (while (eq 'run (process-status proc)) + (accept-process-output proc 5)) + (setq result (process-exit-status proc)) + ;; Hack to force a status_notify() in Emacs 19.29 + (delete-process proc) + (set-buffer mybuf) + (goto-char (point-max)) + (if (re-search-backward "\nProcess \\*PGP.*\n\\'" nil t) + (delete-region (match-beginning 0) (match-end 0))) + (goto-char (point-min)) + ;; CRNL -> NL + (while (search-forward "\r\n" nil t) + (replace-match "\n")) + ;; Hurm. FIXME; must get better result codes. + (if (stringp result) + (error "%s exited abnormally: '%s'" program result) + (setq rgn (funcall parser result)) + ;; If the parser found something, migrate it + (if (consp rgn) + (progn + (set-buffer obuf) + (if boundary + (save-restriction + (narrow-to-region beg end) + (goto-char beg) + (insert (format "--%s\n" boundary)) + (goto-char (point-max)) + (insert (format "\n--%s +Content-Type: application/pgp-signature +Content-Transfer-Encoding: 7bit + +" boundary)) + (insert-buffer-substring mybuf (car rgn) (cdr rgn)) + (goto-char (point-max)) + (insert (format "\n--%s--\n" boundary)) + ) + (delete-region beg end) + (goto-char beg) + (insert-buffer-substring mybuf (car rgn) (cdr rgn)) + ) + (set-buffer mybuf) + (delete-region (car rgn) (cdr rgn))))) + ;; Return nil on failure and exit code on success + (if rgn result)) + ;; Cleanup even on nonlocal exit + (if (and proc (eq 'run (process-status proc))) + (interrupt-process proc)) + (set-buffer obuf) + (or buffer (null mybuf) (kill-buffer mybuf))))) + +(defun mime-mc-pgp-sign-region (start end &optional id unclear boundary) + ;; (if (not (boundp 'mc-pgp-user-id)) + ;; (load "mc-pgp") + ;; ) + (let ((process-environment process-environment) + (buffer (get-buffer-create mc-buffer-name)) + passwd args key + (parser (function mc-pgp-generic-parser)) + (pgp-path mc-pgp-path) + ) + (setq key (mc-pgp-lookup-key (or id mc-pgp-user-id))) + (setq passwd + (mc-activate-passwd + (cdr key) + (format "PGP passphrase for %s (%s): " (car key) (cdr key)))) + (setenv "PGPPASSFD" "0") + (setq args + (cons + (if boundary + "-fbast" + "-fast") + (list "+verbose=1" "+language=en" + (format "+clearsig=%s" (if unclear "off" "on")) + "+batchmode" "-u" (cdr key)))) + (if mc-pgp-comment + (setq args (cons (format "+comment=%s" mc-pgp-comment) args)) + ) + (message "Signing as %s..." (car key)) + (if (mime-mc-process-region + start end passwd pgp-path args parser buffer boundary) + (progn + (if boundary + (progn + (goto-char (point-min)) + (insert + (format "\ +--[[multipart/signed; protocol=\"application/pgp-signature\"; + boundary=\"%s\"; micalg=pgp-md5][7bit]]\n" boundary)) + )) + (message "Signing as %s...done" (car key)) + t) + nil))) + +(defun mime-mc-pgp-encrypt-region (recipients start end &optional id sign) + (let ((mc-pgp-always-sign (if (eq sign 'maybe) + mc-pgp-always-sign + 'never))) + (mc-pgp-encrypt-region + (mc-split "\\([ \t\n]*,[ \t\n]*\\)+" recipients) + start end id nil) + )) + + +;;; @ end +;;; + +(provide 'mime-mc) + +;;; mime-mc.el ends here diff --git a/semi-1.14.6/mime-partial.el b/semi-1.14.6/mime-partial.el new file mode 100644 index 0000000..618c5a6 --- /dev/null +++ b/semi-1.14.6/mime-partial.el @@ -0,0 +1,98 @@ +;;; mime-partial.el --- Grabbing all MIME "message/partial"s. + +;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc. + +;; Author: OKABE Yasuo @ Kyoto University +;; MORIOKA Tomohiko <morioka@jaist.ac.jp> +;; Keywords: message/partial, MIME, multimedia, mail, news + +;; This file is part of SEMI (Suite of Emacs MIME Interfaces). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Code: + +(require 'mime-view) +(require 'mime-play) + +(defun mime-combine-message/partial-pieces-automatically (entity situation) + "Internal method for mime-view to combine message/partial messages +automatically." + (interactive) + (let* ((id (cdr (assoc "id" situation))) + (target (cdr (assq 'major-mode situation))) + (subject-buf (eval (cdr (assq 'summary-buffer-exp situation)))) + (mother (current-buffer)) + subject-id + (root-dir (expand-file-name + (concat "m-prts-" (user-login-name)) + temporary-file-directory)) + (request-partial-message-method + (cdr (assq 'request-partial-message-method situation))) + full-file) + (setq root-dir (concat root-dir "/" (replace-as-filename id))) + (setq full-file (concat root-dir "/FULL")) + + (if (null target) + (error "%s is not supported. Sorry." target) + ) + + ;; if you can't parse the subject line, try simple decoding method + (if (or (file-exists-p full-file) + (not (y-or-n-p "Merge partials?")) + ) + (mime-store-message/partial-piece entity situation) + (setq subject-id (mime-entity-read-field entity 'Subject)) + (if (string-match "[0-9\n]+" subject-id) + (setq subject-id (substring subject-id 0 (match-beginning 0))) + ) + (save-excursion + (set-buffer subject-buf) + (while (search-backward subject-id nil t)) + (catch 'tag + (while t + (let* ((message + ;; request message at the cursor in Subject buffer. + (save-window-excursion + (funcall request-partial-message-method) + )) + (situation (mime-entity-situation message)) + (the-id (cdr (assoc "id" situation)))) + (when (string= the-id id) + (with-current-buffer mother + (mime-store-message/partial-piece message situation) + ) + (if (file-exists-p full-file) + (throw 'tag nil) + )) + (if (not (progn + (end-of-line) + (search-forward subject-id nil t) + )) + (error "not found") + ) + )) + ))))) + + +;;; @ end +;;; + +(provide 'mime-partial) + +(run-hooks 'mime-partial-load-hook) + +;;; mime-partial.el ends here diff --git a/semi-1.14.6/mime-pgp.el b/semi-1.14.6/mime-pgp.el new file mode 100644 index 0000000..4de3f67 --- /dev/null +++ b/semi-1.14.6/mime-pgp.el @@ -0,0 +1,281 @@ +;;; mime-pgp.el --- mime-view internal methods for PGP. + +;; Copyright (C) 1995,1996,1997,1998,1999,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko <tomo@m17n.org> +;; Daiki Ueno <ueno@ueda.info.waseda.ac.jp> +;; Created: 1995/12/7 +;; Renamed: 1997/2/27 from tm-pgp.el +;; Keywords: PGP, security, MIME, multimedia, mail, news + +;; This file is part of SEMI (Secure Emacs MIME Interface). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; This module is based on + +;; [security-multipart] RFC 1847: "Security Multiparts for MIME: +;; Multipart/Signed and Multipart/Encrypted" by +;; Jim Galvin <galvin@tis.com>, Sandy Murphy <sandy@tis.com>, +;; Steve Crocker <crocker@cybercash.com> and +;; Ned Freed <ned@innosoft.com> (1995/10) + +;; [PGP/MIME] RFC 2015: "MIME Security with Pretty Good Privacy +;; (PGP)" by Michael Elkins <elkins@aero.org> (1996/6) + +;; [PGP-kazu] draft-kazu-pgp-mime-00.txt: "PGP MIME Integration" +;; by Kazuhiko Yamamoto <kazu@is.aist-nara.ac.jp> (1995/10; +;; expired) + +;; [OpenPGP/MIME] draft-yamamoto-openpgp-mime-00.txt: "MIME +;; Security with OpenPGP (OpenPGP/MIME)" by Kazuhiko YAMAMOTO +;; <kazu@iijlab.net> (1998/1) + +;;; Code: + +(require 'mime-play) +(require 'pgg-def) + +(autoload 'pgg-decrypt-region "pgg" + "PGP decryption of current region." t) +(autoload 'pgg-verify-region "pgg" + "PGP verification of current region." t) +(autoload 'pgg-snarf-keys-region "pgg" + "Snarf PGP public keys in current region." t) +(autoload 'smime-decrypt-region "smime" + "S/MIME decryption of current region.") +(autoload 'smime-verify-region "smime" + "S/MIME verification of current region.") +(defvar smime-output-buffer) +(defvar smime-errors-buffer) + + +;;; @ Internal method for multipart/signed +;;; +;;; It is based on RFC 1847 (security-multipart). + +(defun mime-verify-multipart/signed (entity situation) + "Internal method to verify multipart/signed." + (mime-play-entity + (nth 1 (mime-entity-children entity)) ; entity-info of signature + (list (assq 'mode situation)) ; play-mode + )) + + +;;; @ internal method for application/pgp +;;; +;;; It is based on draft-kazu-pgp-mime-00.txt (PGP-kazu). + +(defun mime-view-application/pgp (entity situation) + (let* ((p-win (or (get-buffer-window (current-buffer)) + (get-largest-window))) + (new-name + (format "%s-%s" (buffer-name) (mime-entity-number entity))) + (mother (current-buffer)) + (preview-buffer (concat "*Preview-" (buffer-name) "*")) + representation-type message-buf) + (set-buffer (setq message-buf (get-buffer-create new-name))) + (erase-buffer) + (mime-insert-entity entity) + (cond ((progn + (goto-char (point-min)) + (re-search-forward "^-+BEGIN PGP SIGNED MESSAGE-+$" nil t)) + (pgg-verify-region (match-beginning 0)(point-max) nil 'fetch) + (goto-char (point-min)) + (delete-region + (point-min) + (and + (re-search-forward "^-+BEGIN PGP SIGNED MESSAGE-+\n\n") + (match-end 0))) + (delete-region + (and (re-search-forward "^-+BEGIN PGP SIGNATURE-+") + (match-beginning 0)) + (point-max)) + (goto-char (point-min)) + (while (re-search-forward "^- -" nil t) + (replace-match "-")) + (setq representation-type (if (mime-entity-cooked-p entity) + 'cooked))) + ((progn + (goto-char (point-min)) + (re-search-forward "^-+BEGIN PGP MESSAGE-+$" nil t)) + (pgg-decrypt-region (point-min)(point-max)) + (delete-region (point-min)(point-max)) + (insert-buffer pgg-output-buffer) + (setq representation-type 'binary))) + (setq major-mode 'mime-show-message-mode) + (save-window-excursion + (mime-view-buffer nil preview-buffer mother + nil representation-type) + (make-local-variable 'mime-view-temp-message-buffer) + (setq mime-view-temp-message-buffer message-buf)) + (set-window-buffer p-win preview-buffer))) + + +;;; @ Internal method for application/pgp-signature +;;; +;;; It is based on RFC 2015 (PGP/MIME) and +;;; draft-yamamoto-openpgp-mime-00.txt (OpenPGP/MIME). + +(defun mime-verify-application/pgp-signature (entity situation) + "Internal method to check PGP/MIME signature." + (let* ((entity-node-id (mime-entity-node-id entity)) + (mother (mime-entity-parent entity)) + (knum (car entity-node-id)) + (onum (if (> knum 0) + (1- knum) + (1+ knum))) + (orig-entity (nth onum (mime-entity-children mother))) + (sig-file (make-temp-file "tm" nil ".asc"))) + (save-excursion + (mime-show-echo-buffer) + (set-buffer mime-echo-buffer-name) + (set-window-start + (get-buffer-window mime-echo-buffer-name) + (point-max))) + (mime-write-entity-content entity sig-file) + (unwind-protect + (with-temp-buffer + (mime-insert-entity orig-entity) + (goto-char (point-min)) + (while (progn (end-of-line) (not (eobp))) + (insert "\r") + (forward-line 1)) + (pgg-verify-region (point-min)(point-max) + sig-file 'fetch) + (save-excursion + (set-buffer mime-echo-buffer-name) + (insert-buffer-substring pgg-errors-buffer))) + (delete-file sig-file)))) + + +;;; @ Internal method for application/pgp-encrypted +;;; +;;; It is based on RFC 2015 (PGP/MIME) and +;;; draft-yamamoto-openpgp-mime-00.txt (OpenPGP/MIME). + +(defun mime-decrypt-application/pgp-encrypted (entity situation) + (let* ((entity-node-id (mime-entity-node-id entity)) + (mother (mime-entity-parent entity)) + (knum (car entity-node-id)) + (onum (if (> knum 0) + (1- knum) + (1+ knum))) + (orig-entity (nth onum (mime-entity-children mother)))) + (mime-view-application/pgp orig-entity situation))) + + +;;; @ Internal method for application/pgp-keys +;;; +;;; It is based on RFC 2015 (PGP/MIME) and +;;; draft-yamamoto-openpgp-mime-00.txt (OpenPGP/MIME). + +(defun mime-add-application/pgp-keys (entity situation) + (save-excursion + (mime-show-echo-buffer) + (set-buffer mime-echo-buffer-name) + (set-window-start + (get-buffer-window mime-echo-buffer-name) + (point-max))) + (with-temp-buffer + (mime-insert-entity-content entity) + (mime-decode-region (point-min) (point-max) + (cdr (assq 'encoding situation))) + (pgg-snarf-keys-region (point-min)(point-max)) + (save-excursion + (set-buffer mime-echo-buffer-name) + (insert-buffer-substring pgg-errors-buffer)))) + + +;;; @ Internal method for application/pkcs7-signature +;;; +;;; It is based on RFC 2633 (S/MIME version 3). + +(defun mime-verify-application/pkcs7-signature (entity situation) + "Internal method to check S/MIME signature." + (let* ((entity-node-id (mime-entity-node-id entity)) + (mother (mime-entity-parent entity)) + (knum (car entity-node-id)) + (onum (if (> knum 0) + (1- knum) + (1+ knum))) + (orig-entity (nth onum (mime-entity-children mother))) + (sig-file (make-temp-file "tm" nil ".asc")) + status) + (save-excursion + (mime-show-echo-buffer) + (set-buffer mime-echo-buffer-name) + (set-window-start + (get-buffer-window mime-echo-buffer-name) + (point-max))) + (mime-write-entity entity sig-file) + (unwind-protect + (with-temp-buffer + (mime-insert-entity orig-entity) + (goto-char (point-min)) + (while (progn (end-of-line) (not (eobp))) + (insert "\r") + (forward-line 1)) + (setq status (smime-verify-region (point-min)(point-max) + sig-file)) + (save-excursion + (set-buffer mime-echo-buffer-name) + (insert-buffer-substring (if status smime-output-buffer + smime-errors-buffer)))) + (delete-file sig-file)))) + + +;;; @ Internal method for application/pkcs7-mime +;;; +;;; It is based on RFC 2633 (S/MIME version 3). + +(defun mime-view-application/pkcs7-mime (entity situation) + (let* ((p-win (or (get-buffer-window (current-buffer)) + (get-largest-window))) + (new-name + (format "%s-%s" (buffer-name) (mime-entity-number entity))) + (mother (current-buffer)) + (preview-buffer (concat "*Preview-" (buffer-name) "*")) + message-buf) + (when (memq (or (cdr (assq 'smime-type situation)) 'enveloped-data) + '(enveloped-data signed-data)) + (set-buffer (setq message-buf (get-buffer-create new-name))) + (let ((inhibit-read-only t) + buffer-read-only) + (erase-buffer) + (mime-insert-entity entity) + (smime-decrypt-region (point-min)(point-max)) + (delete-region (point-min)(point-max)) + (insert-buffer smime-output-buffer)) + (setq major-mode 'mime-show-message-mode) + (save-window-excursion + (mime-view-buffer nil preview-buffer mother + nil 'binary) + (make-local-variable 'mime-view-temp-message-buffer) + (setq mime-view-temp-message-buffer message-buf)) + (set-window-buffer p-win preview-buffer)))) + + +;;; @ end +;;; + +(provide 'mime-pgp) + +(run-hooks 'mime-pgp-load-hook) + +;;; mime-pgp.el ends here diff --git a/semi-1.14.6/mime-play.el b/semi-1.14.6/mime-play.el new file mode 100644 index 0000000..59c8bb6 --- /dev/null +++ b/semi-1.14.6/mime-play.el @@ -0,0 +1,561 @@ +;;; mime-play.el --- Playback processing module for mime-view.el + +;; Copyright (C) 1994,95,96,97,98,99,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko <tomo@m17n.org> +;; Created: 1995/9/26 (separated from tm-view.el) +;; Renamed: 1997/2/21 from tm-play.el +;; Keywords: MIME, multimedia, mail, news + +;; This file is part of SEMI (Secretariat of Emacs MIME Interfaces). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Code: + +(require 'mime-view) +(require 'alist) +(require 'filename) + +(eval-when-compile + (condition-case nil + (require 'bbdb) + (error (defvar bbdb-buffer-name nil))) + ) + +(defcustom mime-save-directory "~/" + "*Name of the directory where MIME entity will be saved in. +If t, it means current directory." + :group 'mime-view + :type '(choice (const :tag "Current directory" t) + (directory))) + +(defcustom mime-play-delete-file-immediately t + "If non-nil, delete played file immediately." + :group 'mime-view + :type 'boolean) + +(defvar mime-play-find-every-situations t + "*Find every available situations if non-nil.") + +(defvar mime-play-messages-coding-system nil + "Coding system to be used for external MIME playback method.") + + +;;; @ content decoder +;;; + +;;;###autoload +(defun mime-preview-play-current-entity (&optional ignore-examples mode) + "Play current entity. +It decodes current entity to call internal or external method. The +method is selected from variable `mime-acting-condition'. +If IGNORE-EXAMPLES (C-u prefix) is specified, this function ignores +`mime-acting-situation-example-list'. +If MODE is specified, play as it. Default MODE is \"play\"." + (interactive "P") + (let ((entity (get-text-property (point) 'mime-view-entity))) + (if entity + (let ((situation + (get-text-property (point) 'mime-view-situation))) + (or mode + (setq mode "play")) + (setq situation + (if (assq 'mode situation) + (put-alist 'mode mode (copy-alist situation)) + (cons (cons 'mode mode) + situation))) + (if ignore-examples + (setq situation + (cons (cons 'ignore-examples ignore-examples) + situation))) + (mime-play-entity entity situation) + )))) + +;;;###autoload +(defun mime-play-entity (entity &optional situation ignored-method) + "Play entity specified by ENTITY. +It decodes the entity to call internal or external method. The method +is selected from variable `mime-acting-condition'. If MODE is +specified, play as it. Default MODE is \"play\"." + (let ((ret + (mime-unify-situations (mime-entity-situation entity situation) + mime-acting-condition + mime-acting-situation-example-list + 'method ignored-method + mime-play-find-every-situations)) + method) + (setq mime-acting-situation-example-list (cdr ret) + ret (car ret)) + (cond ((cdr ret) + (setq ret (mime-select-menu-alist + "Methods" + (mapcar (function + (lambda (situation) + (cons + (format "%s" + (cdr (assq 'method situation))) + situation))) + ret))) + (setq ret (mime-sort-situation ret)) + (add-to-list 'mime-acting-situation-example-list (cons ret 0)) + ) + (t + (setq ret (car ret)) + )) + (setq method (cdr (assq 'method ret))) + (cond ((and (symbolp method) + (fboundp method)) + (funcall method entity ret) + ) + ((stringp method) + (mime-activate-mailcap-method entity ret) + ) + ;; ((and (listp method)(stringp (car method))) + ;; (mime-activate-external-method entity ret) + ;; ) + (t + (mime-show-echo-buffer "No method are specified for %s\n" + (mime-type/subtype-string + (cdr (assq 'type situation)) + (cdr (assq 'subtype situation)))) + (if (y-or-n-p "Do you want to save current entity to disk?") + (mime-save-content entity situation)) + )) + )) + + +;;; @ external decoder +;;; + +(defvar mime-mailcap-method-filename-alist nil) + +(defun mime-activate-mailcap-method (entity situation) + (let ((method (cdr (assoc 'method situation))) + (name (mime-entity-safe-filename entity))) + (setq name (expand-file-name (if (and name (not (string= name ""))) + name + (make-temp-name "EMI")) + (make-temp-file "EMI" 'directory))) + (mime-write-entity-content entity name) + (message "External method is starting...") + (let ((process + (let ((command + (mime-format-mailcap-command + method + (cons (cons 'filename name) situation))) + (coding-system-for-read mime-play-messages-coding-system)) + (start-process command mime-echo-buffer-name + shell-file-name shell-command-switch command)))) + (set-alist 'mime-mailcap-method-filename-alist process name) + (set-process-sentinel process 'mime-mailcap-method-sentinel)))) + +(defun mime-mailcap-method-sentinel (process event) + (when mime-play-delete-file-immediately + (let ((file (cdr (assq process mime-mailcap-method-filename-alist)))) + (when (file-exists-p file) + (ignore-errors + (delete-file file) + (delete-directory (file-name-directory file))))) + (remove-alist 'mime-mailcap-method-filename-alist process)) + (message "%s %s" process event)) + +(defun mime-mailcap-delete-played-files () + (dolist (elem mime-mailcap-method-filename-alist) + (when (file-exists-p (cdr elem)) + (ignore-errors + (delete-file (cdr elem)) + (delete-directory (file-name-directory (cdr elem))))))) + +(add-hook 'kill-emacs-hook 'mime-mailcap-delete-played-files) + +(defvar mime-echo-window-is-shared-with-bbdb + (module-installed-p 'bbdb) + "*If non-nil, mime-echo window is shared with BBDB window.") + +(defvar mime-echo-window-height + (function + (lambda () + (/ (window-height) 5) + )) + "*Size of mime-echo window. +It allows function or integer. If it is function, +`mime-show-echo-buffer' calls it to get height of mime-echo window. +Otherwise `mime-show-echo-buffer' uses it as height of mime-echo +window.") + +(defun mime-show-echo-buffer (&rest forms) + "Show mime-echo buffer to display MIME-playing information." + (get-buffer-create mime-echo-buffer-name) + (let ((the-win (selected-window)) + (win (get-buffer-window mime-echo-buffer-name))) + (unless win + (unless (and mime-echo-window-is-shared-with-bbdb + (condition-case nil + (setq win (get-buffer-window bbdb-buffer-name)) + (error nil))) + (select-window (get-buffer-window (or mime-preview-buffer + (current-buffer)))) + (setq win (split-window-vertically + (- (window-height) + (if (functionp mime-echo-window-height) + (funcall mime-echo-window-height) + mime-echo-window-height) + ))) + ) + (set-window-buffer win mime-echo-buffer-name) + ) + (select-window win) + (goto-char (point-max)) + (if forms + (let ((buffer-read-only nil)) + (insert (apply (function format) forms)) + )) + (select-window the-win) + )) + + +;;; @ file name +;;; + +(defvar mime-view-file-name-char-regexp "[A-Za-z0-9+_-]") + +(defvar mime-view-file-name-regexp-1 + (concat mime-view-file-name-char-regexp "+\\." + mime-view-file-name-char-regexp "+")) + +(defvar mime-view-file-name-regexp-2 + (concat (regexp-* mime-view-file-name-char-regexp) + "\\(\\." mime-view-file-name-char-regexp "+\\)*")) + +(defun mime-entity-safe-filename (entity) + (let ((filename + (or (mime-entity-filename entity) + (let ((subj + (or (mime-entity-read-field entity 'Content-Description) + (mime-entity-read-field entity 'Subject)))) + (if (and subj + (or (string-match mime-view-file-name-regexp-1 subj) + (string-match mime-view-file-name-regexp-2 subj))) + (substring subj (match-beginning 0)(match-end 0)) + ))))) + (if filename + (replace-as-filename filename) + ))) + + +;;; @ file extraction +;;; + +(defun mime-save-content (entity situation) + (let ((name (or (mime-entity-safe-filename entity) + (format "%s" (mime-entity-media-type entity)))) + (dir (if (eq t mime-save-directory) + default-directory + mime-save-directory)) + filename) + (setq filename (read-file-name + (concat "File name: (default " + (file-name-nondirectory name) ") ") + dir + (concat (file-name-as-directory dir) + (file-name-nondirectory name)))) + (if (file-directory-p filename) + (setq filename (concat (file-name-as-directory filename) + (file-name-nondirectory name)))) + (if (file-exists-p filename) + (or (yes-or-no-p (format "File %s exists. Save anyway? " filename)) + (error ""))) + (mime-write-entity-content entity (expand-file-name filename)) + )) + + +;;; @ file detection +;;; + +(defvar mime-magic-type-alist + '(("^\377\330\377[\340\356]..JFIF" image jpeg) + ("^\211PNG" image png) + ("^GIF8[79]" image gif) + ("^II\\*\000" image tiff) + ("^MM\000\\*" image tiff) + ("^MThd" audio midi) + ("^\000\000\001\263" video mpeg) + ) + "*Alist of regexp about magic-number vs. corresponding media-types. +Each element looks like (REGEXP TYPE SUBTYPE). +REGEXP is a regular expression to match against the beginning of the +content of entity. +TYPE is symbol to indicate primary type of media-type. +SUBTYPE is symbol to indicate subtype of media-type.") + +(defun mime-detect-content (entity situation) + (let (type subtype) + (let ((mdata (mime-entity-content entity)) + (rest mime-magic-type-alist)) + (while (not (let ((cell (car rest))) + (if cell + (if (string-match (car cell) mdata) + (setq type (nth 1 cell) + subtype (nth 2 cell)) + ) + t))) + (setq rest (cdr rest)))) + (setq situation (del-alist 'method (copy-alist situation))) + (mime-play-entity entity + (if type + (put-alist 'type type + (put-alist 'subtype subtype + situation)) + situation) + 'mime-detect-content))) + + +;;; @ mail/news message +;;; + +(defun mime-preview-quitting-method-for-mime-show-message-mode () + "Quitting method for mime-view. +It is registered to variable `mime-preview-quitting-method-alist'." + (let ((mother mime-mother-buffer) + (win-conf mime-preview-original-window-configuration)) + (if (and (boundp 'mime-view-temp-message-buffer) + (buffer-live-p mime-view-temp-message-buffer)) + (kill-buffer mime-view-temp-message-buffer)) + (mime-preview-kill-buffer) + (set-window-configuration win-conf) + (pop-to-buffer mother))) + +(defun mime-view-message/rfc822 (entity situation) + (let* ((new-name + (format "%s-%s" (buffer-name) (mime-entity-number entity))) + (mother (current-buffer)) + (children (car (mime-entity-children entity))) + (preview-buffer + (mime-display-message + children new-name mother nil + (cdr (assq 'major-mode + (get-text-property (point) 'mime-view-situation)))))) + (or (get-buffer-window preview-buffer) + (let ((m-win (get-buffer-window mother))) + (if m-win + (set-window-buffer m-win preview-buffer) + (switch-to-buffer preview-buffer) + ))))) + + +;;; @ message/partial +;;; + +(defun mime-require-safe-directory (dir) + "Create a directory DIR safely. +The permission of the created directory becomes `700' (for the owner only). +If the directory already exists and is writable by other users, an error +occurs." + (let ((attr (file-attributes dir)) + (orig-modes (default-file-modes))) + (if (and attr (eq (car attr) t)) ; directory already exists. + (unless (or (memq system-type '(windows-nt ms-dos OS/2 emx)) + (and (eq (nth 2 attr) (user-real-uid)) + (eq (file-modes dir) 448))) + (error "Invalid owner or permission for %s" dir)) + (unwind-protect + (progn + (set-default-file-modes 448) + (make-directory dir)) + (set-default-file-modes orig-modes))))) + +(defun mime-store-message/partial-piece (entity cal) + (let* ((root-dir + (expand-file-name + (concat "m-prts-" (user-login-name)) temporary-file-directory)) + (id (cdr (assoc "id" cal))) + (number (cdr (assoc "number" cal))) + (total (cdr (assoc "total" cal))) + file + (mother (current-buffer)) + (orig-modes (default-file-modes))) + (mime-require-safe-directory root-dir) + (or (file-exists-p root-dir) + (unwind-protect + (progn + (set-default-file-modes 448) + (make-directory root-dir)) + (set-default-file-modes orig-modes))) + (setq id (replace-as-filename id)) + (setq root-dir (concat root-dir "/" id)) + + (or (file-exists-p root-dir) + (unwind-protect + (progn + (set-default-file-modes 448) + (make-directory root-dir)) + (set-default-file-modes orig-modes))) + + (setq file (concat root-dir "/FULL")) + (if (file-exists-p file) + (let ((full-buf (get-buffer-create "FULL")) + (pwin (or (get-buffer-window mother) + (get-largest-window))) + pbuf) + (save-window-excursion + (set-buffer full-buf) + (erase-buffer) + (binary-insert-encoded-file file) + (setq major-mode 'mime-show-message-mode) + (mime-view-buffer (current-buffer) nil mother) + (setq pbuf (current-buffer)) + (make-local-variable 'mime-view-temp-message-buffer) + (setq mime-view-temp-message-buffer full-buf)) + (set-window-buffer pwin pbuf) + (select-window pwin)) + (setq file (concat root-dir "/" number)) + (mime-write-entity-body entity file) + (let ((total-file (concat root-dir "/CT"))) + (setq total + (if total + (progn + (or (file-exists-p total-file) + (save-excursion + (set-buffer + (get-buffer-create mime-temp-buffer-name)) + (erase-buffer) + (insert total) + (write-region (point-min)(point-max) total-file) + (kill-buffer (current-buffer)) + )) + (string-to-number total) + ) + (and (file-exists-p total-file) + (save-excursion + (set-buffer (find-file-noselect total-file)) + (prog1 + (and (re-search-forward "[0-9]+" nil t) + (string-to-number + (buffer-substring (match-beginning 0) + (match-end 0))) + ) + (kill-buffer (current-buffer)) + ))) + ))) + (if (and total (> total 0) + (>= (length (directory-files root-dir nil "^[0-9]+$" t)) + total)) + (catch 'tag + (save-excursion + (set-buffer (get-buffer-create mime-temp-buffer-name)) + (let ((full-buf (current-buffer))) + (erase-buffer) + (let ((i 1)) + (while (<= i total) + (setq file (concat root-dir "/" (int-to-string i))) + (or (file-exists-p file) + (throw 'tag nil) + ) + (binary-insert-encoded-file file) + (goto-char (point-max)) + (setq i (1+ i)))) + (binary-write-decoded-region + (point-min)(point-max) + (expand-file-name "FULL" root-dir)) + (let ((i 1)) + (while (<= i total) + (let ((file (format "%s/%d" root-dir i))) + (and (file-exists-p file) + (delete-file file))) + (setq i (1+ i)))) + (let ((file (expand-file-name "CT" root-dir))) + (and (file-exists-p file) + (delete-file file))) + (let ((buf (current-buffer)) + (pwin (or (get-buffer-window mother) + (get-largest-window))) + (pbuf (mime-display-message + (mime-open-entity 'buffer (current-buffer)) + nil mother nil 'mime-show-message-mode))) + (with-current-buffer pbuf + (make-local-variable 'mime-view-temp-message-buffer) + (setq mime-view-temp-message-buffer buf)) + (set-window-buffer pwin pbuf) + (select-window pwin) + ))))) + ))) + + +;;; @ message/external-body +;;; + +(defvar mime-raw-dired-function + (if (and (>= emacs-major-version 19) window-system) + (function dired-other-frame) + (function mime-raw-dired-function-for-one-frame) + )) + +(defun mime-raw-dired-function-for-one-frame (dir) + (let ((win (or (get-buffer-window mime-preview-buffer) + (get-largest-window)))) + (select-window win) + (dired dir) + )) + +(defun mime-view-message/external-anon-ftp (entity cal) + (let* ((site (cdr (assoc "site" cal))) + (directory (cdr (assoc "directory" cal))) + (name (cdr (assoc "name" cal))) + (pathname (concat "/anonymous@" site ":" directory))) + (message "%s" (concat "Accessing " (expand-file-name name pathname) "...")) + (funcall mime-raw-dired-function pathname) + (goto-char (point-min)) + (search-forward name) + )) + +(defvar mime-raw-browse-url-function mime-browse-url-function) + +(defun mime-view-message/external-url (entity cal) + (let ((url (cdr (assoc "url" cal)))) + (message "%s" (concat "Accessing " url "...")) + (funcall mime-raw-browse-url-function url))) + + +;;; @ rot13-47 +;;; + +(defun mime-view-caesar (entity situation) + "Internal method for mime-view to display ROT13-47-48 message." + (let ((buf (get-buffer-create + (format "%s-%s" (buffer-name) (mime-entity-number entity))))) + (with-current-buffer buf + (setq buffer-read-only nil) + (erase-buffer) + (mime-insert-text-content entity) + (mule-caesar-region (point-min) (point-max)) + (set-buffer-modified-p nil) + ) + (let ((win (get-buffer-window (current-buffer)))) + (or (eq (selected-window) win) + (select-window (or win (get-largest-window))) + )) + (view-buffer buf) + (goto-char (point-min)) + )) + + +;;; @ end +;;; + +(provide 'mime-play) + +;;; mime-play.el ends here diff --git a/semi-1.14.6/mime-setup.el b/semi-1.14.6/mime-setup.el new file mode 100644 index 0000000..dae2871 --- /dev/null +++ b/semi-1.14.6/mime-setup.el @@ -0,0 +1,47 @@ +;;; mime-setup.el --- setup file for MIME viewer and composer. + +;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> +;; Keywords: MIME, multimedia, multilingual, mail, news + +;; This file is part of SEMI (Setting for Emacs MIME Interfaces). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Code: + +(load "mail-mime-setup") + +(condition-case nil + (load "gnus-mime-setup") + (error (message "gnus-mime-setup is not found.")) + ) + +(condition-case nil + (load "emh-setup") + (error (message "emh-setup is not found.")) + ) + + +;;; @ end +;;; + +(provide 'mime-setup) + +(run-hooks 'mime-setup-load-hook) + +;;; mime-setup.el ends here diff --git a/semi-1.14.6/mime-ui-en.sgml b/semi-1.14.6/mime-ui-en.sgml new file mode 100644 index 0000000..ba407c4 --- /dev/null +++ b/semi-1.14.6/mime-ui-en.sgml @@ -0,0 +1,707 @@ +<!doctype sinfo system> +<head> +<title>SEMI 1.14 Manual +<author>MORIOKA Tomohiko <mail>morioka@jaist.ac.jp</mail> +<date>1998/07/03 + +<toc> +</head> + +<body> + +<abstract> +<p> +This file documents SEMI, a MIME user interface for GNU Emacs. +</abstract> + + +<h1> What is SEMI? +<node> Introduction +<p> +SEMI is a package for GNU Emacs to provide features related with MIME +user interface. +<p> +SEMI provides two user interfaces: MIME-View and MIME-Edit. +<p> +MIME-View is a kernel of user interface to display or operate MIME +messages, STD 11 messages or ``localized RFC 822'' messages. +<p> +MIME-Edit is a user interface to compose MIME messages. +<p> +Each MUA can use powerful MIME features to combine these features. + + +<h1> MIME message viewing +<node> MIME-View +<p> +MIME-View is a MIME viewer for wide use that runs on GNU Emacs. +<p> +MIME-View is the kernel of the user interface for browsing MIME +messages. You can start some presentation-method which is a program for +creating some representation, or some acting-method which is a program +for processing the entity. Then you can deal with a variety of entities. + + +<h2> Basic design +<node> Overview of MIME-View +<p> +The representation form of the internet messages in electric letters +or in net news is based on STD 11. The STD 11 message body is a plain +text which consists of lines as its only structure, and the character +code is fixed as us-ascii. Actually, there are ``localized STD 11'' +messages that use some character code in their linguistic range +instead of using us-ascii. Even in that case, the character code in +the message is single. Therefore, Message User Agents have considered +(byte row) = (us-ascii string), or (byte row) = (string in the +character code in the linguistic range). +<p> +Although, the MIME message has the tree structure in entity unit. +And one message can contain multiple character codes. The content of +an entity can be not only a letter or an image that can be displayed +simply, but also can be a voice or an animation that are played for +some time interval, a data for some specific application, a source +code of some program, or an external reference that consists of +the usage of ftp or mail service, or some URL. Therefore the simple +extension of STD 11 user interface, which only consider displaying +the message, cannot treat all of the MIME functionalities. +Then it is not sufficient to decode message along its MIME type, but +it is also required to consider a playback processing through some +dialogue with the user. The format of MIME messages is designed +to easily be passed to automatic processing. But some contents in the +MIME message should not be passed to automatic processing for security +reasons. So it should be designed to ask user in such cases. +After all, in order to deal with MIME message, it is required to +distinguish the representation for information exchange which is +written in STD 11 or MIME construction, and its result +after some interpretation which is a display screen or a playback +process. It is also needed to converse with user for playback +processing. +<p> +Therefore, MIME-View uses two buffers for one document, one is the +mime-raw-buffer that stores the representation for information exchange, +and the other is the mime-preview-buffer that stores the representation +for displaying. +<p> +MIME-View provides a mode in the mime-preview-buffer for reading MIME +message, which is called as mime-view-mode. User can manipulate each +entity there. + + +<h2> Presentation of mime-preview-buffer +<node> MIME-Preview +<p> +mime-view-mode displays information about each entity as +<p> +<verb> + [entity-button] + (header) + + (body) + (separator) +</verb> +<p> +<noindent> +You can change their design or inhibit showing some of them, according +to some condition +<p> +See following example + + +<verb> +From: morioka@jaist.ac.jp (MORIOKA Tomohiko) +Subject: Re: question? +Newsgroups: zxr.message.mime +Date: 22 Oct 93 11:02:44 +Mime-Version: 1.0 +Organization: Japan Advanced Institute of Science and Technology, + Ishikawa, Japan + +[1 (text/plain)] + How to compose MIME message in MIME-Edit mode. + + C-c C-x ? shows its help. + +C-c C-x C-t insert a text message. +C-c C-x TAB insert a (binary) file. +C-c C-x C-e insert a reference to external body. +C-c C-x C-v insert a voice message. +C-c C-x C-y insert a mail or news message. +C-c C-x RET insert a mail message. +C-c C-x C-s insert a signature file at end. +C-c C-x t insert a new MIME tag. +C-c C-x a enclose as multipart/alternative. +C-c C-x p enclose as multipart/parallel. +C-c C-x m enclose as multipart/mixed. +C-c C-x d enclose as multipart/digest. +C-c C-x s enclose as PGP signed. +C-c C-x e enclose as PGP encrypted. +C-c C-x C-k insert PGP public key. +C-c C-x C-p preview editing MIME message. +... + +therefore, you should type C-c C-x C-i and specify the binary file +which you want to insert. + + You should select Base64 as MIME encoding for binary file. + +[2 (image/gif)] + +[3 (text/plain)] + + Like above, you can compose the message with image. + +==================== Take A Cup Of Russian Tea ====================== +========= ** Not With Jam Nor Marmalade But With Honey ** ========== +========= MORIOKA TOMOHIKO ========== +============== Internet E-mail: <morioka@@jaist.ac.jp> ============== +</verb> + + +<h3> entity-button +<node> entity-button +<p> +<concept>entity-button</concept> is a tag on the top of the entity +which shows brief information of the part. +<p> +Normally, it appears as + +<verb> + [1.3 test (text/plain)] +</verb> + +<p> +The number on the head describes the place of the entity in the +message (like the section number) and it is called as +<concept>entity-number</concept>. +<p> +The string in the next describes its title. This information is +taken from + +<ol> +<li>Title described in Content-Description field or Subject field +<li>File name specified by filename parameter in Content-Disposition field +<li>File name specified by name parameter in Content-Type field +<li>File name for uuencode'ing +</ol> + +<noindent> +If none of them are specified, displays a blank. +<p> +The 3rd item in the parenthesis describes media-type/subtype of +the entity. If it is is not MIME entity, it displays <code>nil</code>. +<p> +This entity-button plays a role like icon that symbolically +shows the content of the entity. For example, push <kbd>v</kbd> on + +<verb> + [2 (image/gif)] +</verb> + +<noindent> +shows up the image contained there. +<p> +If the mouse operation is possible, you can display the image +by pushing 2nd button (the middle button for 3 button mouse) too. + + +<h3> entity-header +<node> entity-header +<p> +<concept>entity-header</concept> is the header of the entity. +(Don't blame me as ``You say nothing more than as it is'', +It is no more than that.) + +<h3> entity-body +<node> entity-body +<p> +<concept>entity-body</concept> is the content of the part. +<p> +Sophistication does not seem enough here also, but it is really such +a thing. +<p> +Though, it actually be twisted a little. +<p> +The text entity is passed to code conversion according to its charset, +and the image entity should be converted on XEmacs. +<p> +Details will be described later. + + +<h2> Operation in mime-preview-buffer +<node> mime-view-mode +<p> +mime-preview-buffer posesses following functionalities. +<p> +<kl> +<kt>u +<kd> +go back to upper part (in the first part of the message, +go back to the Summary mode (*1)) +</kd> +<kt>p<kd>go to previous part +</kd> +<kt>M-TAB<kd>go to previous part +</kd> +<kt>n<kd>go to next part +</kd> +<kt>TAB<kd>go to next part +</kd> +<kt>SPC<kd>scroll up +</kd> +<kt>M-SPC<kd>scroll down +</kd> +<kt>DEL<kd>scroll down +</kd> +<kt>RET<kd>go to next line +</kd> +<kt>M-RET<kd>go to previous line +</kd> +<kt>v<kd>play current part (*2) +</kd> +<kt>e<kd>extract file from current part (*2) +</kd> +<kt>C-c C-p<kd>print current part (*2) +</kd> +<kt>mouse-button-2 +<kd> +start the mouse button in preview-buffer +<p> +on content-button, play current part (*2) +<p> +on URL-button, start WWW browser +</kd> +</kl> +<p> +<memo title="Notice"> +<p> +(*1) Do not go back to Summary mode unless appropriately +configured for mime-view in the MUA. +<p> +(*2) actual behavior depends on the associated method +</memo> + + +<h1> MIME message editing +<node> MIME-Edit +<p> +<concept>MIME-Edit</concept> is a general MIME composer for GNU Emacs. + + +<h2> Minor-mode to edit MIME message +<node> mime-edit-mode +<p> +<concept>mime-edit-mode</concept> is a minor mode to compose MIME +message. In this mode, <concept>tag</concept> represents various +kinds of data, so you can edit multi part message consists of various +kinds of data, such as text, image, audio, etc. +<p> +There are 2 kinds of tags: + +<ul> +<li> single-part tag +<li> multi-part tag +</ul> +<p> +single-part tag represents single part, this form is following: +<p> +<verb> + --[[TYPE/SUBTYPE;PARAMETERS][ENCODING] + OPTIONAL-FIELDS] +</verb> +<p> +TYPE/SUBTYPE and PARAMETERS indicates type/subtype and parameters of +<dref file="mime-en">Content-Type</dref> field. TYPE/SUBTYPE is +required, PARAMETERS is optional. +<p> +ENCODING indicates <dref +file="mime-ja">Content-Transfer-Encoding</dref> field. It is optional +too. +<p> +OPTIONAL-FIELDS is to represent another fields except Content-Type +field and Content-Transfer-Encoding field. +<p> +multi-part tags represent <a file="mime-en" node="multipart">multi +part</a>. They consist of a pair of <concept>multi-part beginning +tag</concept> and <concept>multi-part ending tag</concept>. +<p> +multi-part beginning tag's form is following: + +<verb> + --<<TYPE>>-{ +</verb> +<p> +multi-part ending tag's form is following: + +<verb> + --}-<<TYPE>> +</verb> +<p> +A region from multi-part beginning tag to multi-part ending tag is +called as <concept>enclosure</concept>. + + +<h2> Operations for single-part +<node> single-part tags +<p> +Operations to make single-part are following: + +<kl> +<kt>C-c C-x C-t +<kd> +Insert single-part tag indicates text part. +</kd> +<kt>C-c C-x C-i +<kd> +Insert file as a MIME attachment. If <kbd>C-u</kbd> is followed by +it, it asks media-type, subtype or encoding even if their default +values are specified. <cf node="tag specification for inserted file"> +</kd> +<kt>C-c C-x C-e +<kd> +Insert external part. +</kd> +<kt>C-c C-x C-v +<kd> +Record audio input until <kbd>C-g</kbd> is pressed, and insert as a +audio part. (It requires /dev/audio in default.) +</kd> +<kt>C-c C-x C-y +<kd> +Insert current (mail or news) message. (It is MUA depended.) +</kd> +<kt>C-c C-x C-m +<kd> +Insert mail message. (It is MUA depended.) +</kd> +<dt><key>C-c C-x C-w</key>, <key>C-c C-x C-s</key> +<dd> +Insert signature. +</dd> +<kt>C-c C-x C-k +<kd> +Insert <dref>PGP</dref> public key. +</kd> +<kt>C-c C-x t +<kd> +Insert any single-part tag. +</kl> + + +<h2> Operations for enclosure +<node> enclosure tags +<p> +Operations to make enclosure are following: + +<kl> +<kt>C-c C-m C-a +<kd> +Enclose specified region as multipart/alternative. +</kd> +<kt>C-c C-x C-p +<kd> +Enclose specified region as multipart/parallel. +</kd> +<kt>C-c C-x C-m +<kd> +Enclose specified region as multipart/mixed. +</kd> +<kt>C-c C-x C-d +<kd> +Enclose specified region as multipart/digest. +</kd> +<kt>C-c C-x C-s +<kd> +Digital-sign to specified region. <cf node="PGP"> +</kd> +<kt>C-c C-x C-e +<kd> +Encrypt to specified region. <cf node="PGP"> +</kd> +<kt>C-c C-x C-q +<kd> +avoid to encode tags in specified region. In other words, tags is +interpreted as such string. (In current version, it may be +incomplete. Maybe PGP-signature does not work for this enclosure.) +</kl> + + +<h2> Other operations +<node> other MIME-Edit operations +<p> +There are another operations in mime-edit-mode. + +<kl> +<kt>C-c C-c +<kd> +Send current editing message. +</kd> +<kt>C-c C-x p +<kd> +Preview current editing message. <cf node="MIME-View"> +</kd> +<kt>C-c C-x C-z +<kd> +Exit mime-edit-mode without sending. +</kd> +<kt>C-c C-x / +<kd> +Set current editing message to enable automatic splitting or not. +Form of automatic split messages is message/partial. +</kd> +<kt>C-c C-x 7 +<kd> +Set <dref file="mime-en">7bit</dref> to <dref>transfer level</dref>. +</kd> +<kt>C-c C-x 8 +<kd> +Set <dref file="mime-en">8bit</dref> to <dref>transfer level</dref>. +</kd> +<kt>C-c C-x v +<kd> +Set current editing message to digital-sign or not. <cf node="PGP"> +</kd> +<kt>C-c C-x h +<kd> +Set current editing message to encrypt or not. <cf node="PGP"> +<kt>C-c C-x ? +<kd> +Display help message. +</kl> + + +<h2> How to detect tag for inserted file +<node> file-type specification +<p> +When <kbd>C-c C-x C-i</kbd> (<code>mime-edit-insert-file</code>) is +pressed, tag parameters for inserted file, such as media-type or +encoding, are detected by variable <code>mime-file-types</code>. +<p> +When <kbd>C-u</kbd> is followed by it or parameter is not found from +the variable, it asks from user. (When <kbd>C-u</kbd> is followed by +it, detected value is used as default value) +<p> +If you want to change default value for file names, please change +variable <code>mime-file-types</code>. + +<defvar name="mime-file-types"> +<p> +Specification of default value of tag for file name of inserted file. +<p> +It is a list of following list: + +<lisp> + (FILE_PAT TYPE SUBTYPE PARAMS ENCODING + DISPOSITION_TYPE DISPOSITION_PARAMS) +</lisp> + +Each element of the list is following: + +<dl> +<dt>FILE_PAT +<dd>regular expression of file name +<dt>TYPE +<dd>primary-type of media-type +<dt>SUBTYPE +<dd>subtype of media-type +<dt>PARAMS +<dd>parameters of Content-Type field +<dt>ENCODING +<dd>Content-Transfer-Encoding +<dt>DISPOSITION_TYPE +<dd>disposition-type +<dt>DISPOSITION_PARAMS +<dd>parameters of Content-Disposition field +</dl> + +<noindent> +Example: Specify application/rtf as default media type for +<file>*.rtf</file> + +<lisp> +(eval-after-load + "mime-edit" + '(set-alist 'mime-file-types + "\\.rtf$" + '("application" "rtf" nil nil + "attachment" (("filename" . file))) + )) +</lisp> +</defvar> + + +<h2> transfer level +<node> transfer level +<p> +Each content inserted in a message is represented by <dref +file="mime-en">7bit</dref>, <dref file="mime-en">8bit</dref> or <dref +file="mime-en">binary</dref>. +<p> +If a message is translated by 7bit-through <dref +file="mime-en">MTA</dref>, there is no need to encode 7bit data, but +8bit and binary data must be encoded to 7bit data. +<p> +Similarly, if a message is translated by 8bit-through MTA, there is no +need to encode 7bit or 8bit data, but binary data must be encoded to +7bit or 8bit data. +<p> +<memo> +EBCDIC MTA breaks 7bit data, so in this case, 7bit data must be +encoded by base64. But I don't know EBCDIC. (^_^; +<p> +Similarly, I wish ASCII-printable only MTA and code-conversion MTA +disappeared. (^_^; +<p> +Maybe there are binary-through MTA, but I think it is not major. +</memo> +<p> +<concept>transfer level</concept> represents how range data are +available. mime-edit has a variable <code>mime-transfer-level</code> +to represent transfer level. + + +<defvar name="mime-transfer-level"> +<p> +transfer level. +<p> +If transfer level of a data is over it, a data is encoded to 7bit. +<p> +Currently, 7 or 8 is available. Default value is 7. +<p> +In extension plan, EBCDIC will be 5, ASCII printable only will be 6, +binary will be 9. But it will not be implemented. +</defvar> + + +<memo> +transfer level is only for body, not for <a node="header">message +header</a>. MIME extends <dref file="mime-en">RFC 822</dref> to use +8bit data in body, but it requires to use <dref +file="mime-en">us-ascii</dref> in header. +</memo> + + +<h2> Splitting +<node> message/partial sending +<p> +<defvar name="mime-edit-split-message"> +<p> +Split large message if it is non-nil. +</defvar> + +<defvar name="mime-edit-message-default-max-lines"> +<p> +Default maximum lines of a message. +</defvar> + +<defvar name="mime-edit-message-max-lines-alist"> +<p> +Alist of major-mode vs maximum lines of a message. +<p> +If it is not specified for a major-mode, +<code>mime-edit-message-default-max-lines</code> is used. +</defvar> + +<defvar name="mime-edit-split-blind-field-regexp"> +<p> +Regular expression to match field-name to be ignored when split +sending. +</defvar> + + +<h1> Miscellaneous +<node> Various + +<h2> PGP +<node> PGP +<p> +mime-edit provides PGP encryption, signature and inserting public-key +features based on <concept>PGP/MIME</concept> (RFC 2015) or +<concept>PGP-kazu</concept> (draft-kazu-pgp-mime-00.txt). +<p> +This feature requires your pgp command. + +<defvar name="pgg-default-scheme"> +<p> +Version of PGP or GnuPG command to be used for encryption or sign. +The value should be a symbol. Allowed versions are <code>gpg</code>, +<code>pgp</code> or <code>pgp5</code>. +</defvar> + +<defvar name="pgg-scheme"> +<p> +Version of PGP or GnuPG command to be used for decryption or verification. +The value should be a symbol. Allowed versions are <code>gpg</code>, +<code>pgp</code> or <code>pgp5</code>. +</defvar> + +<defvar name="pgg-insert-url-function"> +<p> +The function to fetch public key from the keyserver. +Use Emacs/W3 by the default setting. To use emacs-w3m +instead, set as follows: +<lisp> +(setq pgg-insert-url-function #'w3m-retrieve) +</lisp> +</defvar> + + +<h2> Mouse button +<node> Buttons +<p> +<defvar name="mime-button-face"> +<p> +Face used for content-button or URL-button of MIME-Preview buffer. +</defvar> + +<defvar name="mime-button-mouse-face"> +<p> +Face used for MIME-preview buffer mouse highlighting. +</defvar> + +<defvar name="mime-browse-url-function"> +<p> +Function to browse URL. +</defvar> + + +<h2> Utility for configuration +<node> Acting-condition configuration +<p> +<defun name="mime-add-condition"> + <args> target-type condition <opts> mode file +<p> +Add <var>condition</var> to database specified by +<var>target-type</var>. +<p> +<var>target-type</var> must be <code>preview</code> or +<code>action</code>. +<p> +If optional argument <var>mode</var> is <code>strict</code> or +<code>nil</code> (omitted), <var>condition</var> is added strictly. +<p> +If optional argument <var>mode</var> is <code>with-default</code>, +<var>condition</var> is added with default rule. +<p> +If optional argument <var>file</var> is specified, it is loaded when +<var>condition</var> is activate. +</defun> + + +<h1> Concept Index +<node> Concept Index + +<cindex> + + +<h1> Function Index +<node> Function Index + +<findex> + + +<h1> Variable Index +<node> Variable Index + +<vindex> + +</body> diff --git a/semi-1.14.6/mime-ui-en.texi b/semi-1.14.6/mime-ui-en.texi new file mode 100644 index 0000000..e8e4fd0 --- /dev/null +++ b/semi-1.14.6/mime-ui-en.texi @@ -0,0 +1,783 @@ +\input texinfo.tex +@setfilename mime-ui-en.info +@settitle{SEMI 1.14 Manual} +@titlepage +@title SEMI 1.14 Manual +@author MORIOKA Tomohiko <morioka@@jaist.ac.jp> +@subtitle 1998/07/03 +@end titlepage +@node Top, Introduction, (dir), (dir) +@top SEMI 1.14 Manual + +@ifinfo + +This file documents SEMI, a MIME user interface for GNU Emacs. +@end ifinfo + +@menu +* Introduction:: What is SEMI? +* MIME-View:: MIME message viewing +* MIME-Edit:: MIME message editing +* Various:: Miscellaneous +* Concept Index:: +* Function Index:: +* Variable Index:: +@end menu + +@node Introduction, MIME-View, Top, Top +@chapter What is SEMI? + +SEMI is a package for GNU Emacs to provide features related with MIME +user interface.@refill + +SEMI provides two user interfaces: MIME-View and MIME-Edit.@refill + + +MIME-View is a kernel of user interface to display or operate MIME +messages, STD 11 messages or ``localized RFC 822'' messages.@refill + +MIME-Edit is a user interface to compose MIME messages.@refill + +Each MUA can use powerful MIME features to combine these features. + + +@node MIME-View, MIME-Edit, Introduction, Top +@chapter MIME message viewing + +MIME-View is a MIME viewer for wide use that runs on GNU Emacs.@refill + +MIME-View is the kernel of the user interface for browsing MIME +messages. You can start some presentation-method which is a program for +creating some representation, or some acting-method which is a program +for processing the entity. Then you can deal with a variety of entities. + + +@menu +* Overview of MIME-View:: Basic design +* MIME-Preview:: Presentation of mime-preview-buffer +* mime-view-mode:: Operation in mime-preview-buffer +@end menu + +@node Overview of MIME-View, MIME-Preview, MIME-View, MIME-View +@section Basic design + +The representation form of the internet messages in electric letters +or in net news is based on STD 11. The STD 11 message body is a plain +text which consists of lines as its only structure, and the character +code is fixed as us-ascii. Actually, there are ``localized STD 11'' +messages that use some character code in their linguistic range +instead of using us-ascii. Even in that case, the character code in +the message is single. Therefore, Message User Agents have considered +(byte row) = (us-ascii string), or (byte row) = (string in the +character code in the linguistic range).@refill + +Although, the MIME message has the tree structure in entity unit. +And one message can contain multiple character codes. The content of +an entity can be not only a letter or an image that can be displayed +simply, but also can be a voice or an animation that are played for +some time interval, a data for some specific application, a source +code of some program, or an external reference that consists of +the usage of ftp or mail service, or some URL. Therefore the simple +extension of STD 11 user interface, which only consider displaying +the message, cannot treat all of the MIME functionalities. +Then it is not sufficient to decode message along its MIME type, but +it is also required to consider a playback processing through some +dialogue with the user. The format of MIME messages is designed +to easily be passed to automatic processing. But some contents in the +MIME message should not be passed to automatic processing for security +reasons. So it should be designed to ask user in such cases. +After all, in order to deal with MIME message, it is required to +distinguish the representation for information exchange which is +written in STD 11 or MIME construction, and its result +after some interpretation which is a display screen or a playback +process. It is also needed to converse with user for playback +processing.@refill + +Therefore, MIME-View uses two buffers for one document, one is the +mime-raw-buffer that stores the representation for information exchange, +and the other is the mime-preview-buffer that stores the representation +for displaying.@refill + +MIME-View provides a mode in the mime-preview-buffer for reading MIME +message, which is called as mime-view-mode. User can manipulate each +entity there. + + +@node MIME-Preview, mime-view-mode, Overview of MIME-View, MIME-View +@section Presentation of mime-preview-buffer + +mime-view-mode displays information about each entity as@refill + +@example + [entity-button] + (header) + + (body) + (separator) +@end example + +@noindent +You can change their design or inhibit showing some of them, according +to some condition. + +See following example + + +@example +From: morioka@@jaist.ac.jp (MORIOKA Tomohiko) +Subject: Re: question? +Newsgroups: zxr.message.mime +Date: 22 Oct 93 11:02:44 +Mime-Version: 1.0 +Organization: Japan Advanced Institute of Science and Technology, + Ishikawa, Japan + +[1 (text/plain)] + How to compose MIME message in MIME-Edit mode. + + C-c C-x ? shows its help. + +C-c C-x C-t insert a text message. +C-c C-x TAB insert a (binary) file. +C-c C-x C-e insert a reference to external body. +C-c C-x C-v insert a voice message. +C-c C-x C-y insert a mail or news message. +C-c C-x RET insert a mail message. +C-c C-x C-s insert a signature file at end. +C-c C-x t insert a new MIME tag. +C-c C-x a enclose as multipart/alternative. +C-c C-x p enclose as multipart/parallel. +C-c C-x m enclose as multipart/mixed. +C-c C-x d enclose as multipart/digest. +C-c C-x s enclose as PGP signed. +C-c C-x e enclose as PGP encrypted. +C-c C-x C-k insert PGP public key. +C-c C-x C-p preview editing MIME message. +... + +therefore, you should type C-c C-x C-i and specify the binary file +which you want to insert. + + You should select Base64 as MIME encoding for binary file. + +[2 (image/gif)] + +[3 (text/plain)] + + Like above, you can compose the message with image. + +==================== Take A Cup Of Russian Tea ====================== +========= ** Not With Jam Nor Marmalade But With Honey ** ========== +========= MORIOKA TOMOHIKO ========== +============== Internet E-mail: <morioka@@jaist.ac.jp> ============== +@end example + + + +@menu +* entity-button:: +* entity-header:: +* entity-body:: +@end menu + +@node entity-button, entity-header, MIME-Preview, MIME-Preview +@subsection entity-button +@cindex entity-number +@cindex entity-button + +@strong{entity-button} is a tag on the top of the entity +which shows brief information of the part.@refill + +Normally, it appears as + +@example + [1.3 test (text/plain)] +@end example + +@noindent + +The number on the head describes the place of the entity in the +message (like the section number) and it is called as +@strong{entity-number}.@refill + +The string in the next describes its title. This information is +taken from + +@enumerate +@item +Title described in Content-Description field or Subject field +@item +File name specified by filename parameter in Content-Disposition field +@item +File name specified by name parameter in Content-Type field +@item +File name for uuencode'ing +@end enumerate + +@noindent +If none of them are specified, displays a blank. + +The 3rd item in the parenthesis describes media-type/subtype of +the entity. If it is is not MIME entity, it displays @code{nil}. +@refill + +This entity-button plays a role like icon that symbolically +shows the content of the entity. For example, push @kbd{v} on + +@example + [2 (image/gif)] +@end example + +@noindent +shows up the image contained there. + +If the mouse operation is possible, you can display the image +by pushing 2nd button (the middle button for 3 button mouse) too. + + +@node entity-header, entity-body, entity-button, MIME-Preview +@subsection entity-header +@cindex entity-header + +@strong{entity-header} is the header of the entity. +(Don't blame me as ``You say nothing more than as it is'', +It is no more than that.) + +@node entity-body, , entity-header, MIME-Preview +@subsection entity-body +@cindex entity-body + +@strong{entity-body} is the content of the part.@refill + +Sophistication does not seem enough here also, but it is really such +a thing.@refill + +Though, it actually be twisted a little.@refill + +The text entity is passed to code conversion according to its charset, +and the image entity should be converted on XEmacs.@refill + +Details will be described later. + + +@node mime-view-mode, , MIME-Preview, MIME-View +@section Operation in mime-preview-buffer + +mime-preview-buffer posesses following functionalities.@refill + +@table @kbd +@item @key{u} +go back to upper part (in the first part of the message, +go back to the Summary mode (*1)) + +@item @key{p} +go to previous part + +@item @key{M-TAB} +go to previous part + +@item @key{n} +go to next part + +@item @key{TAB} +go to next part + +@item @key{SPC} +scroll up + +@item @key{M-SPC} +scroll down + +@item @key{DEL} +scroll down + +@item @key{RET} +go to next line + +@item @key{M-RET} +go to previous line + +@item @key{v} +play current part (*2) + +@item @key{e} +extract file from current part (*2) + +@item @key{C-c C-p} +print current part (*2) + +@item @key{mouse-button-2} +start the mouse button in preview-buffer + +on content-button, play current part (*2)@refill + +on URL-button, start WWW browser@refill + +@end table + +@noindent +@strong{[Notice]} +@quotation + +(*1) Do not go back to Summary mode unless appropriately +configured for mime-view in the MUA.@refill + +(*2) actual behavior depends on the associated method +@end quotation + + + +@node MIME-Edit, Various, MIME-View, Top +@chapter MIME message editing +@cindex MIME-Edit + +@strong{MIME-Edit} is a general MIME composer for GNU Emacs. + + +@menu +* mime-edit-mode:: Minor-mode to edit MIME message +* single-part tags:: Operations for single-part +* enclosure tags:: Operations for enclosure +* other MIME-Edit operations:: Other operations +* file-type specification:: How to detect tag for inserted file +* transfer level:: +* message/partial sending:: Splitting +@end menu + +@node mime-edit-mode, single-part tags, MIME-Edit, MIME-Edit +@section Minor-mode to edit MIME message +@cindex enclosure +@cindex multi-part ending tag +@cindex multi-part beginning tag +@cindex tag +@cindex mime-edit-mode + +@strong{mime-edit-mode} is a minor mode to compose MIME message. In +this mode, @strong{tag} represents various kinds of data, so you can +edit multi part message consists of various kinds of data, such as text, +image, audio, etc.@refill + +There are 2 kinds of tags: + +@itemize @bullet +@item + single-part tag +@item + multi-part tag +@end itemize + +single-part tag represents single part, this form is following:@refill + +@example + --[[TYPE/SUBTYPE;PARAMETERS][ENCODING] + OPTIONAL-FIELDS] +@end example + +TYPE/SUBTYPE and PARAMETERS indicates type/subtype and parameters of +Content-Type (@ref{(mime-en)Content-Type}) field. TYPE/SUBTYPE is +required, PARAMETERS is optional.@refill + +ENCODING indicates Content-Transfer-Encoding +(@ref{(mime-ja)Content-Transfer-Encoding}) field. It is optional +too.@refill + +OPTIONAL-FIELDS is to represent another fields except Content-Type field +and Content-Transfer-Encoding field.@refill + +multi-part tags represent multi part (@ref{(mime-en)multipart}). They +consist of a pair of @strong{multi-part beginning tag} and +@strong{multi-part ending tag}.@refill + +multi-part beginning tag's form is following: + +@example + --<<TYPE>>-@{ +@end example + +multi-part ending tag's form is following: + +@example + --@}-<<TYPE>> +@end example + +A region from multi-part beginning tag to multi-part ending tag is +called as @strong{enclosure}. + + +@node single-part tags, enclosure tags, mime-edit-mode, MIME-Edit +@section Operations for single-part + +Operations to make single-part are following: + +@table @kbd +@item @key{C-c C-x C-t} +Insert single-part tag indicates text part. + +@item @key{C-c C-x C-i} +Insert file as a MIME attachment. If @kbd{C-u} is followed by it, it +asks media-type, subtype or encoding even if their default values are +specified. (cf. @ref{tag specification for inserted file}) + +@item @key{C-c C-x C-e} +Insert external part. + +@item @key{C-c C-x C-v} +Record audio input until @kbd{C-g} is pressed, and insert as a +audio part. (It requires /dev/audio in default.) + +@item @key{C-c C-x C-y} +Insert current (mail or news) message. (It is MUA depended.) + +@item @key{C-c C-x C-m} +Insert mail message. (It is MUA depended.) + +@item @key{C-c C-x C-w}, @key{C-c C-x C-s} +Insert signature. + +@item @key{C-c C-x C-k} +Insert PGP (@ref{PGP}) public key. (It requires Mailcrypt package.) + +@item @key{C-c C-x t} +Insert any single-part tag. + +@end table + + + +@node enclosure tags, other MIME-Edit operations, single-part tags, MIME-Edit +@section Operations for enclosure + +Operations to make enclosure are following: + +@table @kbd +@item @key{C-c C-m C-a} +Enclose specified region as multipart/alternative. + +@item @key{C-c C-x C-p} +Enclose specified region as multipart/parallel. + +@item @key{C-c C-x C-m} +Enclose specified region as multipart/mixed. + +@item @key{C-c C-x C-d} +Enclose specified region as multipart/digest. + +@item @key{C-c C-x C-s} +Digital-sign to specified region. (cf. @ref{PGP}) + +@item @key{C-c C-x C-e} +Encrypt to specified region. (cf. @ref{PGP}) + +@item @key{C-c C-x C-q} +avoid to encode tags in specified region. In other words, tags is +interpreted as such string. (In current version, it may be +incomplete. Maybe PGP-signature does not work for this enclosure.) + +@end table + + + +@node other MIME-Edit operations, file-type specification, enclosure tags, MIME-Edit +@section Other operations + +There are another operations in mime-edit-mode. + +@table @kbd +@item @key{C-c C-c} +Send current editing message. + +@item @key{C-c C-x p} +Preview current editing message. (cf. @ref{MIME-View}) + +@item @key{C-c C-x C-z} +Exit mime-edit-mode without sending. + +@item @key{C-c C-x /} +Set current editing message to enable automatic splitting or not. +Form of automatic split messages is message/partial. + +@item @key{C-c C-x 7} +Set 7bit (@ref{(mime-en)7bit}) to transfer level (@ref{transfer level}). + +@item @key{C-c C-x 8} +Set 8bit (@ref{(mime-en)8bit}) to transfer level (@ref{transfer level}). + +@item @key{C-c C-x v} +Set current editing message to digital-sign or not. (cf. @ref{PGP}) + +@item @key{C-c C-x h} +Set current editing message to encrypt or not. (cf. @ref{PGP}) + +@item @key{C-c C-x ?} +Display help message. + +@end table + + + +@node file-type specification, transfer level, other MIME-Edit operations, MIME-Edit +@section How to detect tag for inserted file + +When @kbd{C-c C-x C-i} (@code{mime-edit-insert-file}) is pressed, tag +parameters for inserted file, such as media-type or encoding, are +detected by variable @code{mime-file-types}.@refill + +When @kbd{C-u} is followed by it or parameter is not found from the +variable, it asks from user. (When @kbd{C-u} is followed by it, +detected value is used as default value)@refill + +If you want to change default value for file names, please change +variable @code{mime-file-types}. + +@defvar mime-file-types + +Specification of default value of tag for file name of inserted +file.@refill + +It is a list of following list: + +@lisp + (FILE_PAT TYPE SUBTYPE PARAMS ENCODING + DISPOSITION_TYPE DISPOSITION_PARAMS) +@end lisp + + +Each element of the list is following: + +@table @samp +@item FILE_PAT +regular expression of file name + +@item TYPE +primary-type of media-type + +@item SUBTYPE +subtype of media-type + +@item PARAMS +parameters of Content-Type field + +@item ENCODING +Content-Transfer-Encoding + +@item DISPOSITION_TYPE +disposition-type + +@item DISPOSITION_PARAMS +parameters of Content-Disposition field + +@end table + +@noindent +Example: Specify application/rtf as default media type for +@file{*.rtf} + +@lisp +(eval-after-load + "mime-edit" + '(set-alist 'mime-file-types + "\\.rtf$" + '("application" "rtf" nil nil + "attachment" (("filename" . file))) + )) +@end lisp +@end defvar + + + +@node transfer level, message/partial sending, file-type specification, MIME-Edit +@section transfer level +@cindex transfer level + +Each content inserted in a message is represented by 7bit +(@ref{(mime-en)7bit}), 8bit (@ref{(mime-en)8bit}) or binary +(@ref{(mime-en)binary}).@refill + +If a message is translated by 7bit-through MTA (@ref{(mime-en)MTA}), +there is no need to encode 7bit data, but 8bit and binary data must be +encoded to 7bit data.@refill + +Similarly, if a message is translated by 8bit-through MTA, there is no +need to encode 7bit or 8bit data, but binary data must be encoded to +7bit or 8bit data.@refill + +@noindent +@strong{[Memo]} +@quotation +EBCDIC MTA breaks 7bit data, so in this case, 7bit data must be +encoded by base64. But I don't know EBCDIC. (^_^; + +Similarly, I wish ASCII-printable only MTA and code-conversion MTA +disappeared. (^_^;@refill + +Maybe there are binary-through MTA, but I think it is not major. +@end quotation + +@strong{transfer level} represents how range data are +available. mime-edit has a variable @code{mime-transfer-level} +to represent transfer level. + + +@defvar mime-transfer-level + +transfer level.@refill + +If transfer level of a data is over it, a data is encoded to +7bit.@refill + +Currently, 7 or 8 is available. Default value is 7.@refill + +In extension plan, EBCDIC will be 5, ASCII printable only will be 6, +binary will be 9. But it will not be implemented. +@end defvar + + + +@noindent +@strong{[Memo]} +@quotation +transfer level is only for body, not for message header (@ref{header}). +MIME extends RFC 822 (@ref{(mime-en)RFC 822}) to use 8bit data in body, +but it requires to use us-ascii (@ref{(mime-en)us-ascii}) in header. +@end quotation + + + +@node message/partial sending, , transfer level, MIME-Edit +@section Splitting + +@defvar mime-edit-split-message + +Split large message if it is non-nil. +@end defvar + + +@defvar mime-edit-message-default-max-lines + +Default maximum lines of a message. +@end defvar + + +@defvar mime-edit-message-max-lines-alist + +Alist of major-mode vs maximum lines of a message.@refill + +If it is not specified for a major-mode, +@code{mime-edit-message-default-max-lines} is used. +@end defvar + + +@defvar mime-edit-split-blind-field-regexp + +Regular expression to match field-name to be ignored when split sending. +@end defvar + + + +@node Various, Concept Index, MIME-Edit, Top +@chapter Miscellaneous + + +@menu +* PGP:: Encryption, Sign +* Buttons:: Mouse button +* Acting-condition configuration:: Utility for configuration +@end menu + +@node PGP, Buttons, Various, Various +@section PGP +@cindex PGP-kazu +@cindex PGP/MIME + +mime-edit provides PGP encryption, signature and inserting public-key +features based on @strong{PGP/MIME} (RFC 2015) or @strong{PGP-kazu} +(draft-kazu-pgp-mime-00.txt).@refill + +This feature requires your pgp command. + +@defvar pgg-default-scheme + +Version of PGP or GnuPG command to be used for encryption or sign. +The value should be a symbol. Allowed versions are @code{gpg}, +@code{pgp} or @code{pgp5}.@refill +@end defvar + + +@defvar pgg-scheme + +Version of PGP or GnuPG command to be used for decryption or verification. +The value should be a symbol. Allowed versions are @code{gpg}, +@code{pgp} or @code{pgp5}.@refill +@end defvar + + +@defvar pgg-insert-url-function + +The function to fetch public key from the keyserver. +Use Emacs/W3 by the default setting. To use emacs-w3m +instead, set as follows: +@lisp +(setq pgg-insert-url-function #'w3m-retrieve) +@end lisp +@end defvar + + + +@node Buttons, Acting-condition configuration, PGP, Various +@section Mouse button + +@defvar mime-button-face + +Face used for content-button or URL-button of MIME-Preview buffer. +@end defvar + + +@defvar mime-button-mouse-face + +Face used for MIME-preview buffer mouse highlighting. +@end defvar + + +@defvar mime-browse-url-function + +Function to browse URL. +@end defvar + + + +@node Acting-condition configuration, , Buttons, Various +@section Utility for configuration + +@defun mime-add-condition target-type condition &optional mode file + +Add @var{condition} to database specified by @var{target-type}.@refill + +@var{target-type} must be @code{preview} or @code{action}.@refill + +If optional argument @var{mode} is @code{strict} or @code{nil} +(omitted), @var{condition} is added strictly.@refill + +If optional argument @var{mode} is @code{with-default}, @var{condition} +is added with default rule.@refill + +If optional argument @var{file} is specified, it is loaded when +@var{condition} is activate. +@end defun + + + +@node Concept Index, Function Index, Various, Top +@chapter Concept Index + +@printindex cp + +@node Function Index, Variable Index, Concept Index, Top +@chapter Function Index + +@printindex fn + +@node Variable Index, , Function Index, Top +@chapter Variable Index + +@printindex vr +@bye diff --git a/semi-1.14.6/mime-ui-ja.sgml b/semi-1.14.6/mime-ui-ja.sgml new file mode 100644 index 0000000..8e0db7d --- /dev/null +++ b/semi-1.14.6/mime-ui-ja.sgml @@ -0,0 +1,713 @@ +<!doctype sinfo system> +<head> +<title>SEMI 1.14 $B@bL@=q(B +<author>$B<i2,(B $BCNI'(B <mail>morioka@jaist.ac.jp</mail> +<date>1998/07/03 + +<toc> +</head> + +<body> + +<abstract> +<p> +This file documents SEMI, a MIME user interface for GNU Emacs. +<p> +GNU Emacs $BMQ$N(B MIME user interface $B$G$"$k(B SEMI $B$K$D$$$F@bL@$7$^$9!#(B +</abstract> + + +<h1> SEMI $B$C$F2?!)(B +<node> Introduction +<p> +SEMI $B$O(B GNU Emacs $BMQ$N(B MIME user interface $B$rDs6!$9$k(B package $B$G$9!#(B +<p> +SEMI $B$,Ds6!$9$k(B MIME user interface $B$O(B MIME-View $B$H(B MIME-Edit $B$+$i$J$j$^(B +$B$9!#(B +<p> +MIME-View $B$O(B MIME $B$d(B STD 11 $B$*$h$S!XCO0h2=$5$l$?(B RFC 822$B!Y(Bmessage $B$rI=<((B +$B$7$?$j!"A`:n$7$?$j$9$k$?$a$N(B user interface $B$NCf3K$G$9!#(B +<p> +MIME-Edit $B$O(B MIME message $B$r@8@.$9$k$?$a$N(B user interface $B$G$9!#(B +<p> +$B3F(B MUA $B$G$3$l$i$N5!G=$rMxMQ$9$k$3$H$K$h$j!"9bEY$J(B MIME $B5!G=$rMxMQ$9$k$3(B +$B$H$,$G$-$^$9!#(B + + +<h1> MIME message $B$N1\Mw(B +<node> MIME-View +<p> +MIME-View $B$O(B GNU Emacs $B$GF0:n$9$kHFMQE*$J(B MIME viewer $B$G$9!#(B +<p> +MIME-View $B$O(B MIME message $B$r1\Mw$9$k$?$a$NMxMQ<T3&LL(B (user interface) +$B$N3K$G$"$j!"$3$N>e$G(B presentation-method $B$H8F$P$l$kI=<($r:n$k%W%m%0%i%`(B +$B$rF0$+$7$?$j!"(Bacting-method $B$H8F$P$l$k(B entity $B$N=hM}%W%m%0%i%`$rF0$+$9(B +$B$3$H$,2DG=$G!"$5$^$6$^$J<oN`$N(B entity $B$r07$&;v$,$G$-$k$h$&$K$J$C$F$$$^$9!#(B + + +<h2> MIME-View $B35@b(B +<node> Overview of MIME-View +<p> +Internet $B$NEE;R=q4J!&%M%C%H%K%e!<%9$J$I$N=qLL(B (message) $B$NI=8=7A<0$O(B +STD 11 $B$K4p$E$$$F$$$^$9!#(BSTD 11 $B$N=qLLK\BN(B (message body) $B$O9T$rM#0l$N(B +$B9=B$$H$9$k4J0WJ8LL(B (plain text) $B$G$"$j!"J8;zId9f$b(B us-ascii $B$HDj$a$i$l(B +$B$F$$$^$9!#<B:]$K$O!"J8;zId9f$r(B us-ascii $B$NBe$o$j$K$=$N8@8l7w$GMQ$$$i$l(B +$B$kJ8;zId9f$H$7$?!XCO0h2=$5$l$?(B STD 11$B!Y=qLL$bMQ$$$i$l$F$-$^$7$?$,!"$3(B +$B$N>l9g$b=qLL$NJ8;zId9f$O#1$D$G$9!#$3$N$?$a!"MxMQ<T3&LL(B (Message User +Agent) $B$O!"$7$P$7$P!"(Bbyte $BNs(B = us-ascii $BJ8;zNs!"$J$$$7$O!"(Bbyte $BNs(B = $B$=(B +$B$N8@8l7w$GMQ$$$kJ8;zId9f$NJ8;zNs$N$h$&$K8+Jo$7$F$-$^$7$?!#(B +<p> +$B$7$+$7$J$,$i!"(BMIME $B$G$O=qLL$O(B entity $B$rC10L$H$9$kLZ9=B$$K$J$j!"$^$?!"(B +$B#1$D$N=qLL$GJ#?t$NJ8;zId9f$rMQ$$$k$3$H$,$G$-$^$9!#$^$?!"(Bentity $B$NFbMF(B +$B$OJ8LL$d3($N$h$&$JC1=c$KI=<(2DG=$J$b$N$@$1$G$J$/!"2;@<$dF02h$J$I$N0lDj(B +$B;~4V:F@8$5$l$k$h$&$J$b$N$dFCDj$N%"%W%j%1!<%7%g%s$N%G!<%?$d%W%m%0%i%`$N(B +$B%=!<%9!"$"$k$$$O!"(Bftp $B$d(B mail service $B$NMxMQK!$d(B URL $B$H$$$C$?7A$GI=$5(B +$B$l$?30It;2>H$J$I$N$5$^$6$^$J$b$N$,9M$($i$^$9!#$3$N$?$a!"I=<($@$1$r9M$((B +$B$F$$$?(B STD 11 $B$K$*$1$kMxMQ<T3&LL$NC1=c$J1dD9$G$O(B MIME $B$NA4$F$N5!G=$r07(B +$B$&$3$H$O$G$-$^$;$s!#$D$^$j!"(BMIME $B$N7A<0$K9g$o$;$FI|9f$9$k$@$1$G$OIT==(B +$BJ,$G$"$j!"MxMQ<T$H$NBPOCE*$J:F@8=hM}$r9MN8$9$kI,MW$,$"$j$^$9!#(BMIME $B=q(B +$BLL$N7A<0$O<+F0=hM}$,$7$d$9$/@_7W$5$l$F$$$^$9$,!"(BMIME $B=qLL$K4^$^$l$kFb(B +$BMF$NCf$K$O%;%-%e%j%F%#!<>e$NLdBj$+$i<+F0=hM}$r$9$k$Y$-$G$J$$$b$N$,$"$j!"(B +$B$3$&$$$C$?$b$N$N:F@8$K4X$7$F$OMxMQ<T$NH=CG$r6D$0$h$&$K@_7W$5$l$k$Y$-$G(B +$B$7$g$&!#7k6I!"(BMIME $B=qLL$r07$&$?$a$K$O(B STD 11 $B$*$h$S(B MIME $B$N9=J8$G5-=R(B +$B$5$l$?%a%C%;!<%8$N>pJs8r49MQI=8=$H$=$N2r<a7k2L$G$"$kI=<(2hLL$d:F@8Ey$N(B +$B=hM}$r6hJL$7$F9M$($kI,MW$,$"$j$^$9!#$^$?!"MxMQ<T$H$NBPOCE*$J:F@8=hM}$,(B +$BI,MW$G$9!#(B +<p> +$B$3$N$?$a!"(BMIME-View $B$O#1$D$N=qLL$KBP$7$F!">pJs8r49MQI=8=$r3JG<$9$k(B +mime-raw-buffer $B$HI=<(MQI=8=$r3JG<$9$k(B mime-preview-buffer $B$N#2$D$N(B +buffer $B$rMQ$$$^$9!#(B +<p> +MIME-View $B$O(B mime-preview-buffer $B$KBP$7$F(B mime-view-mode $B$H$$$&(B MIME +message $B$r1\Mw$9$k$?$a$N(B mode $B$rDs6!$7$^$9!#MxMQ<T$O$3$3$G3F(B entity $B$K(B +$BBP$7$FA`:n$r9T$&$3$H$,$G$-$^$9!#(B + + +<h2> mime-preview-buffer $B$N2hLL9=@.(B +<node> MIME-Preview +<p> +mime-view-mode $B$G$O3F(B entity $B$KBP$7$F(B +<p> +<verb> + [entity-button] + (header) + + (body) + (separator) +</verb> +<p> +<noindent> +$B$H$$$&>pJs$rI=<($7$^$9!#$3$l$i$O>r7o$K=>$C$F(B design $B$rJQ99$7$?$j!"I=<((B +$B$rM^@)$9$k$3$H$b$G$-$^$9!#(B +<p> +$B0J2<$K!"I=<(Nc$r<($7$^$9!#(B + + +<verb> +From: morioka@jaist.ac.jp ($B<i2,(B $BCNI'(B / MORIOKA Tomohiko) +Subject: Re: $B<ALd!)(B +Newsgroups: zxr.message.mime +Date: 22 Oct 93 11:02:44 +Mime-Version: 1.0 +Organization: Japan Advanced Institute of Science and Technology, + Ishikawa, Japan + +[1 (text/plain)] + MIME-Edit mode $B$K$*$1$k!"(BMIME message $B$N:n$jJ}!#(B + + C-c C-x ? $B$r2!$9$H(B help $B$,=P$F$/$k!#(B + +C-c C-x C-t insert a text message. +C-c C-x TAB insert a (binary) file. +C-c C-x C-e insert a reference to external body. +C-c C-x C-v insert a voice message. +C-c C-x C-y insert a mail or news message. +C-c C-x RET insert a mail message. +C-c C-x C-s insert a signature file at end. +C-c C-x t insert a new MIME tag. +C-c C-x a enclose as multipart/alternative. +C-c C-x p enclose as multipart/parallel. +C-c C-x m enclose as multipart/mixed. +C-c C-x d enclose as multipart/digest. +C-c C-x s enclose as PGP signed. +C-c C-x e enclose as PGP encrypted. +C-c C-x C-k insert PGP public key. +C-c C-x C-p preview editing MIME message. +... + +$B$C$FLu$G!"(BC-c C-x C-i $B$r2!$7$F!"A^F~$7$?$$(B binary file $B$r;XDj$7$^$9!#(B + + binary file $B$N(B MIME encoding $B$K$O!"IaDL!"(BBase64 $B$r;XDj$7$^$9!#(B + +[2 (image/gif)] + +[3 (text/plain)] + + $B$3$s$JIw$K!"3(F~$j(B message $B$N$G$->e$,$j!#(B + +$B".".".".".".".".".".".(B $B%m%7%"%s!&%F%#!<$r0lGU!#(B $B".".".".".".".".".".".(B +$B".".".".".(B $B!y(B $B%8%c%`$G$O$J$/%^!<%^%l!<%I$G$b$J$/K*L*$G(B $B!y(B $B".".".".".(B +$B".".".".".(B $B'.'0'2$$'0','!(B $B'4'0'.'0'7'*','0(B $B".".".".".(B +$B".".".".".".".(B Internet E-mail: <morioka@jaist.ac.jp> $B".".".".".".".(B +</verb> + + +<h3> entity-button +<node> entity-button +<p> +<concept>entity-button</concept> $B$O(B entity $B$N@hF,$K$"$C$F!"$=$N(B entity +$B$K4X$9$kBg$^$+$J>pJs$rI=<($9$kItJ,$G$9!#(B +<p> +$BI8=`$G$O(B + +<verb> + [1.3 test (text/plain)] +</verb> + +<noindent> +$B$N$h$&$J46$8$KI=<($5$l$^$9!#(B +<p> +$B:G=i$N?t;z$O(B message $BCf$N$3$N(B entity $B$N0LCV$r@aHV9f$N$h$&$KI=$7$?$b$N(B +$B$G!"(B<concept>entity-number</concept> $B$H8F$S$^$9!#(B +<p> +$B#2HVL\$NJ8;zNs$OI=Bj$rI=$7$^$9!#$3$N>pJs$O!"(B + +<ol> +<li>Content-Description field $B$b$7$/$O(B Subject field $B$K=q$+$l$?I=Bj(B +<li>Content-Disposition field $B$N(B filename parameter $B$K=q$+$l$?(B file $BL>(B +<li>Content-Type field $B$N(B name parameter $B$K=q$+$l$?(B file $BL>(B +<li> uuencode $B$N>l9g$N(B file $BL>(B +</ol> + +<noindent> +$B$+$i:n$j$^$9!#$I$l$bB8:_$7$J$$>l9g$O6uGr$,I=<($5$l$^$9!#(B +<p> +$B#3HVL\$N3g8L$NCf$N>pJs$O$=$N(B entity $B$N(B media-type/subtype $B$rI=$7$^$9!#(B +$BHs(B MIME entity $B$N>l9g!"(B<code>nil</code> $B$,I=<($5$l$^$9!#(B +<p> +$B$3$N(B entity-button $B$O(B entity $B$NFbMF$r>]D'$9$k(B icon $B$N$h$&$JLr3d$r2L$?(B +$B$7$^$9!#Nc$($P!"(B + +<verb> + [2 (image/gif)] +</verb> + +<noindent> +$B$N>e$G(B <kbd>v</kbd> $B$r2!$;$P$3$3$KF~$C$F$$$k3($,I=<($5$l$^$9!#(B +<p> +$B$^$?!"(Bmouse $BA`:n$,2DG=$J>l9g!"(Bentity-button $B$rBh#2%\%?%s!J(B3 button +mouse $B$N>l9g!"Cf1{$N%\%?%s!K$G2!$;$P!"F1MM$K$=$N3($,I=<($5$l$^$9!#(B + + +<h3> entity-header +<node> entity-header +<p> +<concept>entity-header</concept> $B$O$"$k(B entity $B$N(B header $B$rI=<($9$kIt(B +$BJ,$G$9!J!V$=$N$^$^$d$s$1!W$C$FE\$i$J$$$G!#$=$&$$$&$b$s$J$s$G$9!K!#(B + + +<h3> entity-body +<node> entity-body +<p> +<concept>entity-body</concept> $B$O(B part $B$NFbMF$rI=<($9$kItJ,$G$9!#(B +<p> +$B$3$l$b$R$M$j$,B-$j$J$$$G$9$,!"$^$"!"$=$&$$$&$b$s$G$9!#(B +<p> +$B$H$O$$$(!"<B:]$K$O>/$7$R$M$C$F$^$9!#(B +<p> +text entity $B$N>l9g$O(B charset $B$K1~$8$F(B code $BJQ49$7$?$j$7$^$9$7!"(BXEmacs +$B$G$O(B image entity $B$rJQ49$7$J$$$H$$$1$J$$$7!#(B +<p> +$B>\$7$/$O$^$?8e$G!#(B + + +<h2> mime-preview-buffer $B$G$NA`:n(B +<node> mime-view-mode +<p> +mime-preview-buffer $B$K$O0J2<$N5!G=$,$"$j$^$9!#(B +<p> +<kl> +<kt>u +<kd> +$B>e$N(B part $B$KLa$k!J(Bmessage $B$N0lHV>e$N(B part $B$G$3$l$r9T$J$&$H(B Summary +mode $B$KLa$k(B (*1)$B!K(B +</kd> +<kt>p<kd>$BA0$N(B part $B$K0\F0$9$k(B +</kd> +<kt>M-TAB<kd>$BA0$N(B part $B$K0\F0$9$k(B +</kd> +<kt>n<kd>$B<!$N(B part $B$K0\F0$9$k(B +</kd> +<kt>TAB<kd>$B<!$N(B part $B$K0\F0$9$k(B +</kd> +<kt>SPC<kd>scroll up $B$9$k(B +</kd> +<kt>M-SPC<kd>scroll down $B$9$k(B +</kd> +<kt>DEL<kd>scroll down $B$9$k(B +</kd> +<kt>RET<kd>$B<!$N9T$K0\F0$9$k(B +</kd> +<kt>M-RET<kd>$BA0$N9T$K0\F0$9$k(B +</kd> +<kt>v<kd>part $B$r:F@8$9$k(B (*2) +</kd> +<kt>e<kd>part $B$+$i(B file $B$r<h$j=P$9(B (*2) +</kd> +<kt>C-c C-p<kd>part $B$r0u:~$9$k(B (*2) +</kd> +<kt>mouse-button-2 +<kd> +preview-buffer $BCf$N(B mouse button $B$r5/F0$9$k(B +<p> +content-button $B$r2!$;$P!"$=$N(B part $B$,:F@8$5$l$k(B(*2) +<p> +URL-button $B$r2!$;$P!"$=$N(B WWW browser $B$,5/F0$5$l$k(B +</kd> +</kl> +<p> +<memo title="$BCm0U(B"> +<p> +(*1) MUA $B$G(B mime-view $B$N@_Dj$r$7$F$$$J$$>l9g!"(BSummary mode $B$K$OLa$j$^(B +$B$;$s!#(B +<p> +(*2) $B<B:]$NF0:n$OBP1~$9$k(B method $B$K0M$j$^$9!#(B +</memo> + + +<h1> MIME message $B$NJT=8(B +<node> MIME-Edit +<p> +<concept>MIME-Edit</concept> $B$O(B GNU Emacs $B$GF0:n$9$kHFMQE*$J(B MIME +composer $B$G$9!#(B + + +<h2> MIME message $B$rJT=8$9$k$?$a$N(B minor-mode +<node> mime-edit-mode +<p> +<concept>mime-edit-mode</concept> $B$O(B MIME message $B$r:n@.$9$k$?$a$N(B +minor-mode $B$G$9!#$3$N(B mode $B$G$O(B <concept>tag</concept> $B$r;H$C$F$5$^$6$^(B +$B$J<oN`$N(B data $B$rI=8=$7!"$5$^$6$^$J<oN`$N(B data $B$+$i$J$kJ#?t$NItJ,$+$i$J$k(B +message $B$rJT=8$9$k$3$H$r2DG=$K$7$F$$$^$9!#(B +<p> +tag $B$K$O(B + +<ul> +<li> single-part tag +<li> multi-part tag +</ul> + +<noindent> +$B$N#2$D$,$"$j$^$9!#(B +<p> +single-part tag $B$O(B single part $B$rI=8=$9$k$?$a$N(B tag $B$G!"(B +<p> +<verb> + --[[TYPE/SUBTYPE;PARAMETERS][ENCODING] + OPTIONAL-FIELDS] +</verb> +<p> +<noindent> +$B$H$$$&$h$&$J7A$r$7$F$$$^$9!#(B +<p> +TYPE/SUBTYPE $B$*$h$S(B PARAMETERS $B$O(B <dref file="mime-ja">Content-Type +</dref> $BMs$N(B type/subtype $B$*$h$S(B parameters $B$rI=$7$^$9!#(BTYPE/SUBTYPE $B$O(B +$BI,?\$G$"$j!"(BPARAMETERS $B$O>JN,2D$G$9!#(B +<p> +ENCODING $B$O(B <dref file="mime-ja">Content-Transfer-Encoding</dref> $BMs$rI=(B +$B$7$^$9!#$3$l$b>JN,2D$G$9!#(B +<p> +OPTIONAL-FIELDS $B$O(B Content-Type, Content-Transfer-Encoding $B0J30$N(B +field $B$r=q$/$?$a$NItJ,$G!">JN,2D$G$9!#(B +<p> +multi-part tag $B$O(B <a file="mime-ja" node="multipart">multi part</a> $B$rI=(B +$B8=$9$k$?$a$N(B tag $B$G!"(B +<p> +<verb> + --<<TYPE>>-@{ +</verb> +<p> +<noindent> +$B$H$$$&7A$N(B <concept>multi-part $B3+;O(B tag</concept> $B$H8F$P$l$k(B multi +part $B$N3+;O$r<($9(B tag $B$H(B +<p> +<verb> + --@}-<<TYPE>> +</verb> +<p> +<noindent> +$B$H$$$&7A$N(B <concept>multi-part $B=*N;(B tag</concept> $B$H8F$P$l$k(B multi +part $B$N=*N;$r<($9(B tag $B$,$"$j$^$9!#(B +<p> +$B$^$?!"(Bmulti-part $B3+;O(B tag $B$H(B multi-part $B=*N;(B tag $B$G0O$^$l$?ItJ,$r(B +<concept>enclosure</concept> $B$H8F$S$^$9!#(B + + +<h2> single-part $B$KBP$9$kA`:n(B +<node> single-part tags +<p> +single-part $B$r:n$k$?$a$NA`:n$K$O0J2<$N$h$&$J$b$N$,$"$j$^$9!#(B + +<kl> +<kt>C-c C-x C-t +<kd> +text part $B$rI=$9(B single-part tag $B$rA^F~$7$^$9!#(B +</kd> +<kt>C-c C-x C-i +<kd> +file $B$r(B MIME part $B$H$7$FE:IU$7$^$9!#A0$K(B <kbd>C-u</kbd> $B$rIU$1$?>l9g!"(B +$B>o$K(B media-type, subtype $BEy$rJ9$$$FMh$^$9!#(B<cf node="tag specification +for inserted file"> +</kd> +<kt>C-c C-x C-e +<kd> +external part $B$rA^F~$7$^$9!#(B +</kd> +<kt>C-c C-x C-v +<kd> +<kbd>C-g</kbd> $B$,2!$5$l$k$^$GO?2;$r9T$$!"2;@<(B part $B$rA^F~$7$^$9!#!J;H(B +$BMQ$G$-$J$$>l9g$,$"$j$^$9!K(B +</kd> +<kt>C-c C-x C-y +<kd> +$B8=:_I=<(Cf$N(B (mail or news) message $B$rA^F~$7$^$9!#!J<B:]$NF0:n$O;HMQ$7(B +$B$F$$$k(B MUA $B$K0MB8$7$^$9!K(B +</kd> +<kt>C-c C-x C-m +<kd> +mail message $B$rA^F~$7$^$9!#(B +</kd> +<dt><key>C-c C-x C-w</key>, <key>C-c C-x C-s</key> +<dd> +signature $B$rA^F~$7$^$9!#(B +</dd> +<kt>C-c C-x C-k +<kd> +<dref>PGP</dref> $B$N8x3+80$rA^F~$7$^$9!#(B +</kd> +<kt>C-c C-x t +<kd> +$BG$0U$N(B single-part tag $B$rA^F~$7$^$9!#(B +</kl> + + +<h2> enclosure $B$KBP$9$kA`:n(B +<node> enclosure tags +<p> +enclosure $B$r:n$k$?$a$NA`:n$H$7$F$O0J2<$N$h$&$J$b$N$,$"$j$^$9!#(B + +<kl> +<kt>C-c C-m C-a +<kd> +$B;XDj$7$?(B region $B$r(B multipart/alternative $B$H$7$F0O$_$^$9!#(B +</kd> +<kt>C-c C-x C-p +<kd> +$B;XDj$7$?(B region $B$r(B multipart/parallel $B$H$7$F0O$_$^$9!#(B +</kd> +<kt>C-c C-x C-m +<kd> +$B;XDj$7$?(B region $B$r(B multipart/mixed $B$H$7$F0O$_$^$9!#(B +</kd> +<kt>C-c C-x C-d +<kd> +$B;XDj$7$?(B region $B$r(B multipart/digest $B$H$7$F0O$_$^$9!#(B +</kd> +<kt>C-c C-x C-s +<kd> +$B;XDj$7$?(B region $B$KEE;R=pL>$r9T$$$^$9!#(B<cf node="PGP"> +</kd> +<kt>C-c C-x C-e +<kd> +$B;XDj$7$?(B region $B$r0E9f2=$7$^$9!#(B<cf node="PGP"> +<kt>C-c C-x C-q +<kd> +$B;XDj$7$?(B region $BFb$N(B tag $B$rL58z$K$7!"$=$N(B tag $B$rJ8;zNs$H$7$FMxMQ$G$-$k(B +$B$h$&$K$7$^$9!#!J8=:_$NHG$G$O$&$^$/F/$+$J$$$3$H$,$"$j$^$9!#$^$?!"EE;R=p(B +$BL>$H$NJ;MQ$K4X$7$F$bIT40A4$G$9!K(B +</kl> + + +<h2> mime-edit-mode $B$K$*$1$k$=$NB>$NA`:n(B +<node> other MIME-Edit operations +<p> +mime-edit-mode $B$K$*$1$k$=$NB>$NA`:n$r@bL@$7$^$9!#(B + +<kl> +<kt>C-c C-c +<kd> +$BJT=8Cf$N(B message $B$rAw?.$7$^$9!#(B +</kd> +<kt>C-c C-x p +<kd> +$BJT=8Cf$N(B message $B$r(B preview $B$7$^$9!#(B<cf node="MIME-View"> +</kd> +<kt>C-c C-x C-z +<kd> +$BJT=8Cf$N(B message $B$rAw?.$9$k$3$H$J$/!"(Bmime-edit-mode $B$r=*N;$7$^$9!#(B +</kd> +<kt>C-c C-x / +<kd> +$BBg$-$J(B message $B$rAw?.$9$k>l9g$K(B message/partial $B7A<0$K<+F0J,3d2DG=$H$9(B +$B$k$+$I$&$+$r7h$a$^$9!#(B +</kd> +<kt>C-c C-x 7 +<kd> +<dref>transfer level</dref> $B$r(B <dref file="mime-ja">7bit</dref> $B$K$7$^$9!#(B +</kd> +<kt>C-c C-x 8 +<kd> +<dref>transfer level</dref> $B$r(B <dref file="mime-ja">8bit</dref> $B$K$7$^$9!#(B +</kd> +<kt>C-c C-x v +<kd> +message $BA4BN$rEE;R=pL>$9$k$+$I$&$+$r7h$a$^$9!#(B<cf node="PGP"> +</kd> +<kt>C-c C-x h +<kd> +message $BA4BN$r0E9f2=$9$k$+$I$&$+$r7h$a$^$9!#(B<cf node="PGP"> +<kt>C-c C-x ? +<kd> +help message $B$rI=<($7$^$9!#(B +</kl> + + +<h2> $BA^F~$5$l$k(B file $B$KBP$9$k(B tag $B$N7hDj(B +<node> file-type specification +<p> +<kbd>C-c C-x C-i</kbd> (<code>mime-edit-insert-file</code>) $B$r<B9T$7$?;~!"(B +$BA^F~$5$l$k(B file $B$KBP$9$k(B media-type $B$d(B encoding $B$J$I$N(B tag $B$N>pJs$OJQ?t(B +<code>mime-file-types</code> $B$K$h$C$F(B file $BL>$+$i?dB,$5$l$^$9!#(B +<p> +$BA0$K(B <kbd>C-u</kbd> $B$rIU$1$?;~!"$*$h$S!"E,Ev$JCM$,8+IU$+$i$J$+$C$?>l9g!"(B +user $B$KBP$7$FCM$NF~NO$rB%$7$^$9!#!JA0$K(B <kbd>C-u</kbd> $B$rIU$1$?;~!"?d(B +$BB,$5$l$?CM$,4{DjCM$H$7$FMQ$$$i$l$^$9!K(B +<p> +file $BL>$KBP$9$k4{DjCM$rJQ$($?$$>l9g$OJQ?t(B <code>mime-file-types</code> +$B$r@_Dj$7$F2<$5$$!#(B + +<defvar name="mime-file-types"> +<p> +$BA^F~$5$l$k(B file $B$N(B file $BL>$KBP$9$k(B tag $B$N4{DjCM$rM?$($k!#(B +<p> +$B$3$NJQ?t$O(B + +<lisp> + (FILE_PAT TYPE SUBTYPE PARAMS ENCODING + DISPOSITION_TYPE DISPOSITION_PARAMS) +</lisp> + +$B$H$$$&(B list $B$N(B list $B$G!"3FMWAG$O0J2<$NDL$j$G$"$k!'(B + +<dl> +<dt>FILE_PAT +<dd>file $BL>$rI=$9@55,I=8=(B +<dt>TYPE +<dd>media type +<dt>SUBTYPE +<dd>media subtype +<dt>PARAMS +<dd>Content-Type field $B$N(B parameter +<dt>ENCODING +<dd>Content-Transfer-Encoding +<dt>DISPOSITION_TYPE +<dd>disposition-type +<dt>DISPOSITION_PARAMS +<dd>Content-Disposition field $B$N(B parameter +</dl> + +<noindent> +$B@_DjNc!'(B <file>*.rtf</file> $B$KBP$9$k(B media type $B$r(B application/rtf $B$K(B +$B$9$k>l9g(B + +<lisp> +(eval-after-load + "mime-edit" + '(set-alist 'mime-file-types + "\\.rtf$" + '("application" "rtf" nil nil + "attachment" (("filename" . file))) + )) +</lisp> +</defvar> + + +<h2> transfer level +<node> transfer level +<p> +message $B$KA^F~$9$k(B data $B$O(B <dref file="mime-ja">7bit</dref> $B$J$$$7(B +<dref file="mime-ja">8bit</dref> $B$b$7$/$O(B <dref +file="mime-ja">binary</dref> $B$GI=8=$9$k$3$H$,$G$-$^$9!#(B +<p> +$B$h$C$F!"(B7bit $B$7$+DL$5$J$$(B <dref file="mime-ja">MTA</dref> $B$r7PM3$9$k>l9g!"(B +7bit $B$N(B data $B$O$=$N$^$^$GAw$l$^$9$,!"(B8bit $B$d(B binary $B$N(B data $B$O(B 7bit $B$KJQ(B +$B49$7$J$1$l$P$J$j$^$;$s!#(B +<p> +$BF1MM$K!"(B8bit $B$7$+DL$5$J$$(B MTA $B$r7PM3$9$k>l9g!"(B7bit $B$d(B 8bit $B$N(B data $B$O(B +$B$=$N$^$^$GAw$l$^$9$,!"(Bbinary $B$N(B data $B$O(B 7bit $B$+(B 8bit $B$KJQ49$7$J$1$l$P(B +$B$J$j$^$;$s!#(B +<p> +<memo> +EBCDIC $B$7$+DL$5$J$$(B MTA $B$r7PM3$9$k>l9g!"(B7bit $B$N(B data $B$b(B base64 $BEy$GJQ(B +$B49$7$J$$$HAw$l$^$;$s$,!";d$O(B EBCDIC $B$N$3$H$^$G$OCN$j$^$;$s!#(B(^_^; +<p> +$BF1MM$K!"@)8fJ8;z$rDL$5$J$$(B MTA $B$N$3$H$d(B code $BJQ49$r9T$J$&(B MTA $B$b>C$($F(B +$B$J$/$J$C$FM_$7$$$G$9!#(B(^_^; +<p> +binary $B$bDL$9(B MTA $B$bB8:_$9$k$s$G$7$g$&$,!":#$N$H$3$m$"$^$j0lHLE*$H$O$$(B +$B$($J$$$G$7$g$&!#(B +</memo> +<p> +<concept>transfer level</concept> $B$H$$$&$N$O$I$NHO0O$N(B data $B$^$GAw$l$k$+(B +$B$H$$$&$3$H$rI=$9$b$N$G$9!#(Bmime-edit $B$O(B +<code>mime-transfer-level</code> $B$H$$$&JQ?t$r;}$C$F$*$j!"$3$l$G(B +transfer level $B$rI=8=$7$^$9!#(B + + +<defvar name="mime-transfer-level"> +<p> +transfer level $B$rI=$9!#(B +<p> +$B$"$k(B data $B$N(B transfer level $B$,$3$NCM$r1[$($k>l9g!"(B7bit data $B$X$NJQ49$,(B +$B9T$o$l$k!#(B +<p> +$B8=:_$N$H$3$m!"(B7 $B$+(B 8 $B$,M-8z$G$"$k!#4{DjCM$O(B 7 $B$G$"$k!#(B +<p> +EBCDIC $B$r(B 5, ASCII printable $B$N$_$r(B 6, binary $B$r(B 9 $B$H$9$k$3$H$r7W2h$7(B +$B$F$$$k$,!"<BAu$NM=Dj$O$J$$!#(B +</defvar> + + +<memo> +transfer level $B$O(B <a node="header">message header</a> $B$K$O4X78$7$J$$!#(B +MIME $B$O(B body $B$K$*$$$F!"(B8bit $B$N(B data $B$r;H$($k$h$&$K(B <dref +file="mime-ja">STD 11</dref> $B$r3HD%$7$F$$$k$,!"(Bmessage header $B$G$O(B +<dref file="mime-ja">us-ascii</dref> $B$N$_$rMQ$$$k$3$H$r5a$a$F$$$k!#(B +</memo> + + +<h2> Splitting +<node> message/partial sending +<p> +<defvar name="mime-edit-split-message"> +<p> +Non-nil $B$J$i$PBg$-$J%a%C%;!<%8$rJ,3d$7$FAw?.$7$^$9!#(B +</defvar> + +<defvar name="mime-edit-message-default-max-lines"> +<p> +$B%a%C%;!<%8$N:GBg9T?t$N%G%U%)%k%HCM$G$9!#(B +</defvar> + +<defvar name="mime-edit-message-max-lines-alist"> +<p> +$B%a%8%c!<%b!<%IBP%a%C%;!<%8$N:GBg9T?t$+$i@.$kO"A[%j%9%H$G$9!#(B +<p> +$B%a%8%c!<%b!<%I$,$3$3$G;XDj$5$l$F$J$$>l9g$K$O(B +<code>mime-edit-message-default-max-lines</code> $B$rMQ$$$^$9!#(B +</defvar> + +<defvar name="mime-edit-split-blind-field-regexp"> +<p> +$BJ,3dAw?.$N:]$KL5;k$5$l$k%U%#!<%k%IL>$K%^%C%A$9$k@55,I=8=$G$9!#(B +</defvar> + + +<h1> $B$=$NB>(B +<node> Various +<p> +<h2> $B0E9f2=!"=pL>(B +<node> PGP +<p> +mime-edit $B$G$O(B <concept>PGP/MIME</concept> (RFC 2015) $B$*$h$S(B +<concept>PGP-kazu</concept> (draft-kazu-pgp-mime-00.txt) $B$K$h$k0E9f2=!&(B +$BEE;R=pL>!&8x3+80$NA^F~5!G=$rMxMQ$9$k$3$H$,$G$-$^$9!#(B +<p> +$BC"$7!"$3$N5!G=$rMxMQ$9$k$K$O3F<o(B pgp command $B$,I,MW$G$9!#(B + +<defvar name="pgg-default-scheme"> +<p> +$B0E9f2=$b$7$/$O=pL>$KMQ$$$k(B PGP $B$b$7$/$O(B GnuPG $B%3%^%s%I$N%P!<%8%g%s$G$9!#(B +$BCM$O(B symbol $B$r;XDj$7$^$9!#;H$($k%P!<%8%g%s$O(B <code>gpg</code>$B!"(B +<code>pgp</code> $B$b$7$/$O(B <code>pgp5</code> $B$G$9!#(B +</defvar> + +<defvar name="pgg-scheme"> +<p> +$BI|9f$b$7$/$O8!>Z$KMQ$$$k(B PGP $B$b$7$/$O(B GnuPG $B%3%^%s%I$N%P!<%8%g%s$G$9!#(B +$BCM$O(B symbol $B$r;XDj$7$^$9!#;H$($k%P!<%8%g%s$O(B <code>gpg</code>$B!"(B +<code>pgp</code> $B$b$7$/$O(B <code>pgp5</code> $B$G$9!#(B +</defvar> + +<defvar name="pgg-insert-url-function"> +<p> +$B80%5!<%P$+$i8x3+80$r<h$j4s$;$k:]$K;H$&4X?t$G$9!#%G%U%)%k%H$G$O(B +Emacs/W3 $B$r;H$&@_Dj$K$J$C$F$$$^$9!#(Bemacs-w3m $B$r;H$&>l9g$K$O(B +$B<!$N$h$&$K@_Dj$7$^$9!#(B +<lisp> +(setq pgg-insert-url-function #'w3m-retrieve) +</lisp> +</defvar> + + +<h2> $B2!KU(B +<node> Buttons +<p> +<defvar name="mime-button-face"> +<p> +MIME-Preview $B%P%C%U%!$G(B content-button $B$b$7$/$O(B URL-button $B$KMQ$$$k(B +face $B$G$9!#(B +</defvar> + +<defvar name="mime-button-mouse-face"> +<p> +MIME-preview $B%P%C%U%!$G%^%&%9$r%O%$%i%$%H$9$k:]$KMQ$$$k(B face $B$G$9!#(B +</defvar> + +<defvar name="mime-browse-url-function"> +<p> +URL $B$r%V%i%&%:$9$k4X?t$G$9!#(B +</defvar> + + +<h2> $B<B9T>r7o$N@_Dj(B +<node> Acting-condition configuration +<p> +<defun name="mime-add-condition"> + <args> target-type condition <opts> mode file +<p> +Add <var>condition</var> to database specified by +<var>target-type</var>. +<p> +<var>target-type</var> must be <code>preview</code> or +<code>action</code>. +<p> +If optional argument <var>mode</var> is <code>strict</code> or +<code>nil</code> (omitted), <var>condition</var> is added strictly. +<p> +If optional argument <var>mode</var> is <code>with-default</code>, +<var>condition</var> is added with default rule. +<p> +If optional argument <var>file</var> is specified, it is loaded when +<var>condition</var> is activate. +</defun> + + +<h1> $B35G0:w0z(B +<node> Concept Index + +<cindex> + + +<h1> $B4X?t:w0z(B +<node> Function Index + +<findex> + + +<h1> $BJQ?t:w0z(B +<node> Variable Index + +<vindex> + +</body> diff --git a/semi-1.14.6/mime-ui-ja.texi b/semi-1.14.6/mime-ui-ja.texi new file mode 100644 index 0000000..79523f0 --- /dev/null +++ b/semi-1.14.6/mime-ui-ja.texi @@ -0,0 +1,789 @@ +\input texinfo.tex +@setfilename mime-ui-ja.info +@settitle{SEMI 1.14 $B@bL@=q(B} +@titlepage +@title SEMI 1.14 $B@bL@=q(B +@author $B<i2,(B $BCNI'(B <morioka@@jaist.ac.jp> +@subtitle 1998/07/03 +@end titlepage +@node Top, Introduction, (dir), (dir) +@top SEMI 1.14 $B@bL@=q(B + +@ifinfo + +This file documents SEMI, a MIME user interface for GNU Emacs.@refill + +GNU Emacs $BMQ$N(B MIME user interface $B$G$"$k(B SEMI $B$K$D$$$F@bL@$7$^$9!#(B +@end ifinfo + +@menu +* Introduction:: SEMI $B$C$F2?!)(B +* MIME-View:: MIME message $B$N1\Mw(B +* MIME-Edit:: MIME message $B$NJT=8(B +* Various:: $B$=$NB>(B +* Concept Index:: $B35G0:w0z(B +* Function Index:: $B4X?t:w0z(B +* Variable Index:: $BJQ?t:w0z(B +@end menu + +@node Introduction, MIME-View, Top, Top +@chapter SEMI $B$C$F2?!)(B + +SEMI $B$O(B GNU Emacs $BMQ$N(B MIME user interface $B$rDs6!$9$k(B package $B$G$9!#(B +@refill + +SEMI $B$,Ds6!$9$k(B MIME user interface $B$O(B MIME-View $B$H(B MIME-Edit $B$+$i$J$j$^(B +$B$9!#(B@refill + + +MIME-View $B$O(B MIME $B$d(B STD 11 $B$*$h$S!XCO0h2=$5$l$?(B RFC 822$B!Y(Bmessage $B$rI=<((B +$B$7$?$j!"A`:n$7$?$j$9$k$?$a$N(B user interface $B$NCf3K$G$9!#(B@refill + +MIME-Edit $B$O(B MIME message $B$r@8@.$9$k$?$a$N(B user interface $B$G$9!#(B@refill + +$B3F(B MUA $B$G$3$l$i$N5!G=$rMxMQ$9$k$3$H$K$h$j!"9bEY$J(B MIME $B5!G=$rMxMQ$9$k$3(B +$B$H$,$G$-$^$9!#(B + + +@node MIME-View, MIME-Edit, Introduction, Top +@chapter MIME message $B$N1\Mw(B + +MIME-View $B$O(B GNU Emacs $B$GF0:n$9$kHFMQE*$J(B MIME viewer $B$G$9!#(B@refill + +MIME-View $B$O(B MIME message $B$r1\Mw$9$k$?$a$NMxMQ<T3&LL(B (user interface) +$B$N3K$G$"$j!"$3$N>e$G(B presentation-method $B$H8F$P$l$kI=<($r:n$k%W%m%0%i%`(B +$B$rF0$+$7$?$j!"(Bacting-method $B$H8F$P$l$k(B entity $B$N=hM}%W%m%0%i%`$rF0$+$9(B +$B$3$H$,2DG=$G!"$5$^$6$^$J<oN`$N(B entity $B$r07$&;v$,$G$-$k$h$&$K$J$C$F$$$^$9!#(B + + +@menu +* Overview of MIME-View:: MIME-View $B35@b(B +* MIME-Preview:: mime-preview-buffer $B$N2hLL9=@.(B +* mime-view-mode:: mime-preview-buffer $B$G$NA`:n(B +@end menu + +@node Overview of MIME-View, MIME-Preview, MIME-View, MIME-View +@section MIME-View $B35@b(B + +Internet $B$NEE;R=q4J!&%M%C%H%K%e!<%9$J$I$N=qLL(B (message) $B$NI=8=7A<0$O(B STD +11 $B$K4p$E$$$F$$$^$9!#(BSTD 11 $B$N=qLLK\BN(B (message body) $B$O9T$rM#0l$N9=B$$H(B +$B$9$k4J0WJ8LL(B (plain text) $B$G$"$j!"J8;zId9f$b(B us-ascii $B$HDj$a$i$l$F$$$^$9!#(B +$B<B:]$K$O!"J8;zId9f$r(B us-ascii $B$NBe$o$j$K$=$N8@8l7w$GMQ$$$i$l$kJ8;zId9f$H(B +$B$7$?!XCO0h2=$5$l$?(B STD 11$B!Y=qLL$bMQ$$$i$l$F$-$^$7$?$,!"$3$N>l9g$b=qLL$N(B +$BJ8;zId9f$O#1$D$G$9!#$3$N$?$a!"MxMQ<T3&LL(B (Message User Agent) $B$O!"$7$P$7(B +$B$P!"(Bbyte $BNs(B = us-ascii $BJ8;zNs!"$J$$$7$O!"(Bbyte $BNs(B = $B$=$N8@8l7w$GMQ$$$kJ8(B +$B;zId9f$NJ8;zNs$N$h$&$K8+Jo$7$F$-$^$7$?!#(B@refill + +$B$7$+$7$J$,$i!"(BMIME $B$G$O=qLL$O(B entity $B$rC10L$H$9$kLZ9=B$$K$J$j!"$^$?!"#1(B +$B$D$N=qLL$GJ#?t$NJ8;zId9f$rMQ$$$k$3$H$,$G$-$^$9!#$^$?!"(Bentity $B$NFbMF$OJ8(B +$BLL$d3($N$h$&$JC1=c$KI=<(2DG=$J$b$N$@$1$G$J$/!"2;@<$dF02h$J$I$N0lDj;~4V:F(B +$B@8$5$l$k$h$&$J$b$N$dFCDj$N%"%W%j%1!<%7%g%s$N%G!<%?$d%W%m%0%i%`$N%=!<%9!"(B +$B$"$k$$$O!"(Bftp $B$d(B mail service $B$NMxMQK!$d(B URL $B$H$$$C$?7A$GI=$5$l$?30It;2(B +$B>H$J$I$N$5$^$6$^$J$b$N$,9M$($i$^$9!#$3$N$?$a!"I=<($@$1$r9M$($F$$$?(B STD +11 $B$K$*$1$kMxMQ<T3&LL$NC1=c$J1dD9$G$O(B MIME $B$NA4$F$N5!G=$r07$&$3$H$O$G$-(B +$B$^$;$s!#$D$^$j!"(BMIME $B$N7A<0$K9g$o$;$FI|9f$9$k$@$1$G$OIT==J,$G$"$j!"MxMQ(B +$B<T$H$NBPOCE*$J:F@8=hM}$r9MN8$9$kI,MW$,$"$j$^$9!#(BMIME $B=qLL$N7A<0$O<+F0=h(B +$BM}$,$7$d$9$/@_7W$5$l$F$$$^$9$,!"(BMIME $B=qLL$K4^$^$l$kFbMF$NCf$K$O%;%-%e%j(B +$B%F%#!<>e$NLdBj$+$i<+F0=hM}$r$9$k$Y$-$G$J$$$b$N$,$"$j!"$3$&$$$C$?$b$N$N:F(B +$B@8$K4X$7$F$OMxMQ<T$NH=CG$r6D$0$h$&$K@_7W$5$l$k$Y$-$G$7$g$&!#7k6I!"(BMIME +$B=qLL$r07$&$?$a$K$O(B STD 11 $B$*$h$S(B MIME $B$N9=J8$G5-=R$5$l$?%a%C%;!<%8$N>pJs(B +$B8r49MQI=8=$H$=$N2r<a7k2L$G$"$kI=<(2hLL$d:F@8Ey$N=hM}$r6hJL$7$F9M$($kI,MW(B +$B$,$"$j$^$9!#$^$?!"MxMQ<T$H$NBPOCE*$J:F@8=hM}$,I,MW$G$9!#(B@refill + +$B$3$N$?$a!"(BMIME-View $B$O#1$D$N=qLL$KBP$7$F!">pJs8r49MQI=8=$r3JG<$9$k(B +mime-raw-buffer $B$HI=<(MQI=8=$r3JG<$9$k(B mime-preview-buffer $B$N#2$D$N(B +buffer $B$rMQ$$$^$9!#(B@refill + +MIME-View $B$O(B mime-preview-buffer $B$KBP$7$F(B mime-view-mode $B$H$$$&(B MIME +message $B$r1\Mw$9$k$?$a$N(B mode $B$rDs6!$7$^$9!#MxMQ<T$O$3$3$G3F(B entity $B$K(B +$BBP$7$FA`:n$r9T$&$3$H$,$G$-$^$9!#(B + + +@node MIME-Preview, mime-view-mode, Overview of MIME-View, MIME-View +@section mime-preview-buffer $B$N2hLL9=@.(B + +mime-view-mode $B$G$O3F(B entity $B$KBP$7$F(B@refill + +@example + [entity-button] + (header) + + (body) + (separator) +@end example + +@noindent +$B$H$$$&>pJs$rI=<($7$^$9!#$3$l$i$O>r7o$K=>$C$F(B design $B$rJQ99$7$?$j!"I=<((B +$B$rM^@)$9$k$3$H$b$G$-$^$9!#(B + +$B0J2<$K!"I=<(Nc$r<($7$^$9!#(B + + +@example +From: morioka@@jaist.ac.jp ($B<i2,(B $BCNI'(B / MORIOKA Tomohiko) +Subject: Re: $B<ALd!)(B +Newsgroups: zxr.message.mime +Date: 22 Oct 93 11:02:44 +Mime-Version: 1.0 +Organization: Japan Advanced Institute of Science and Technology, + Ishikawa, Japan + +[1 (text/plain)] + MIME-Edit mode $B$K$*$1$k!"(BMIME message $B$N:n$jJ}!#(B + + C-c C-x ? $B$r2!$9$H(B help $B$,=P$F$/$k!#(B + +C-c C-x C-t insert a text message. +C-c C-x TAB insert a (binary) file. +C-c C-x C-e insert a reference to external body. +C-c C-x C-v insert a voice message. +C-c C-x C-y insert a mail or news message. +C-c C-x RET insert a mail message. +C-c C-x C-s insert a signature file at end. +C-c C-x t insert a new MIME tag. +C-c C-x a enclose as multipart/alternative. +C-c C-x p enclose as multipart/parallel. +C-c C-x m enclose as multipart/mixed. +C-c C-x d enclose as multipart/digest. +C-c C-x s enclose as PGP signed. +C-c C-x e enclose as PGP encrypted. +C-c C-x C-k insert PGP public key. +C-c C-x C-p preview editing MIME message. +... + +$B$C$FLu$G!"(BC-c C-x C-i $B$r2!$7$F!"A^F~$7$?$$(B binary file $B$r;XDj$7$^$9!#(B + + binary file $B$N(B MIME encoding $B$K$O!"IaDL!"(BBase64 $B$r;XDj$7$^$9!#(B + +[2 (image/gif)] + +[3 (text/plain)] + + $B$3$s$JIw$K!"3(F~$j(B message $B$N$G$->e$,$j!#(B + +$B".".".".".".".".".".".(B $B%m%7%"%s!&%F%#!<$r0lGU!#(B $B".".".".".".".".".".".(B +$B".".".".".(B $B!y(B $B%8%c%`$G$O$J$/%^!<%^%l!<%I$G$b$J$/K*L*$G(B $B!y(B $B".".".".".(B +$B".".".".".(B $B'.'0'2$$'0','!(B $B'4'0'.'0'7'*','0(B $B".".".".".(B +$B".".".".".".".(B Internet E-mail: <morioka@@jaist.ac.jp> $B".".".".".".".(B +@end example + + + +@menu +* entity-button:: +* entity-header:: +* entity-body:: +@end menu + +@node entity-button, entity-header, MIME-Preview, MIME-Preview +@subsection entity-button +@cindex entity-number +@cindex entity-button + +@strong{entity-button} $B$O(B entity $B$N@hF,$K$"$C$F!"$=$N(B entity $B$K4X$9$kBg(B +$B$^$+$J>pJs$rI=<($9$kItJ,$G$9!#(B@refill + +$BI8=`$G$O(B + +@example + [1.3 test (text/plain)] +@end example + +@noindent +$B$N$h$&$J46$8$KI=<($5$l$^$9!#(B + +$B:G=i$N?t;z$O(B message $BCf$N$3$N(B entity $B$N0LCV$r@aHV9f$N$h$&$KI=$7$?$b$N$G!"(B +@strong{entity-number} $B$H8F$S$^$9!#(B@refill + +$B#2HVL\$NJ8;zNs$OI=Bj$rI=$7$^$9!#$3$N>pJs$O!"(B + +@enumerate +@item +Content-Description field $B$b$7$/$O(B Subject field $B$K=q$+$l$?I=Bj(B +@item +Content-Disposition field $B$N(B filename parameter $B$K=q$+$l$?(B file $BL>(B +@item +Content-Type field $B$N(B name parameter $B$K=q$+$l$?(B file $BL>(B +@item + uuencode $B$N>l9g$N(B file $BL>(B +@end enumerate + +@noindent +$B$+$i:n$j$^$9!#$I$l$bB8:_$7$J$$>l9g$O6uGr$,I=<($5$l$^$9!#(B + +$B#3HVL\$N3g8L$NCf$N>pJs$O$=$N(B entity $B$N(B media-type/subtype $B$rI=$7$^$9!#Hs(B +MIME entity $B$N>l9g!"(B@code{nil} $B$,I=<($5$l$^$9!#(B@refill + +$B$3$N(B entity-button $B$O(B entity $B$NFbMF$r>]D'$9$k(B icon $B$N$h$&$JLr3d$r2L$?(B +$B$7$^$9!#Nc$($P!"(B + +@example + [2 (image/gif)] +@end example + +@noindent +$B$N>e$G(B @kbd{v} $B$r2!$;$P$3$3$KF~$C$F$$$k3($,I=<($5$l$^$9!#(B + +$B$^$?!"(Bmouse $BA`:n$,2DG=$J>l9g!"(Bentity-button $B$rBh#2%\%?%s!J(B3 button +mouse $B$N>l9g!"Cf1{$N%\%?%s!K$G2!$;$P!"F1MM$K$=$N3($,I=<($5$l$^$9!#(B + + +@node entity-header, entity-body, entity-button, MIME-Preview +@subsection entity-header +@cindex entity-header + +@strong{entity-header} $B$O$"$k(B entity $B$N(B header $B$rI=<($9$kIt(B +$BJ,$G$9!J!V$=$N$^$^$d$s$1!W$C$FE\$i$J$$$G!#$=$&$$$&$b$s$J$s$G$9!K!#(B + + +@node entity-body, , entity-header, MIME-Preview +@subsection entity-body +@cindex entity-body + +@strong{entity-body} $B$O(B part $B$NFbMF$rI=<($9$kItJ,$G$9!#(B@refill + +$B$3$l$b$R$M$j$,B-$j$J$$$G$9$,!"$^$"!"$=$&$$$&$b$s$G$9!#(B@refill + +$B$H$O$$$(!"<B:]$K$O>/$7$R$M$C$F$^$9!#(B@refill + +text entity $B$N>l9g$O(B charset $B$K1~$8$F(B code $BJQ49$7$?$j$7$^$9$7!"(BXEmacs $B$G(B +$B$O(B image entity $B$rJQ49$7$J$$$H$$$1$J$$$7!#(B@refill + +$B>\$7$/$O$^$?8e$G!#(B + + +@node mime-view-mode, , MIME-Preview, MIME-View +@section mime-preview-buffer $B$G$NA`:n(B + +mime-preview-buffer $B$K$O0J2<$N5!G=$,$"$j$^$9!#(B@refill + +@table @kbd +@item @key{u} +$B>e$N(B part $B$KLa$k!J(Bmessage $B$N0lHV>e$N(B part $B$G$3$l$r9T$J$&$H(B Summary +mode $B$KLa$k(B (*1)$B!K(B + +@item @key{p} +$BA0$N(B part $B$K0\F0$9$k(B + +@item @key{M-TAB} +$BA0$N(B part $B$K0\F0$9$k(B + +@item @key{n} +$B<!$N(B part $B$K0\F0$9$k(B + +@item @key{TAB} +$B<!$N(B part $B$K0\F0$9$k(B + +@item @key{SPC} +scroll up $B$9$k(B + +@item @key{M-SPC} +scroll down $B$9$k(B + +@item @key{DEL} +scroll down $B$9$k(B + +@item @key{RET} +$B<!$N9T$K0\F0$9$k(B + +@item @key{M-RET} +$BA0$N9T$K0\F0$9$k(B + +@item @key{v} +part $B$r:F@8$9$k(B (*2) + +@item @key{e} +part $B$+$i(B file $B$r<h$j=P$9(B (*2) + +@item @key{C-c C-p} +part $B$r0u:~$9$k(B (*2) + +@item @key{mouse-button-2} +preview-buffer $BCf$N(B mouse button $B$r5/F0$9$k(B + +content-button $B$r2!$;$P!"$=$N(B part $B$,:F@8$5$l$k(B(*2)@refill + +URL-button $B$r2!$;$P!"$=$N(B WWW browser $B$,5/F0$5$l$k(B@refill + +@end table + +@noindent +@strong{[$BCm0U(B]} +@quotation + +(*1) MUA $B$G(B mime-view $B$N@_Dj$r$7$F$$$J$$>l9g!"(BSummary mode $B$K$OLa$j$^$;(B +$B$s!#(B@refill + +(*2) $B<B:]$NF0:n$OBP1~$9$k(B method $B$K0M$j$^$9!#(B +@end quotation + + + +@node MIME-Edit, Various, MIME-View, Top +@chapter MIME message $B$NJT=8(B +@cindex MIME-Edit + +@strong{MIME-Edit} $B$O(B GNU Emacs $B$GF0:n$9$kHFMQE*$J(B MIME +composer $B$G$9!#(B + + +@menu +* mime-edit-mode:: MIME message $B$rJT=8$9$k$?$a$N(B minor-mode +* single-part tags:: single-part $B$KBP$9$kA`:n(B +* enclosure tags:: enclosure $B$KBP$9$kA`:n(B +* other MIME-Edit operations:: mime-edit-mode $B$K$*$1$k$=$NB>$NA`:n(B +* file-type specification:: $BA^F~$5$l$k(B file $B$KBP$9$k(B tag $B$N7hDj(B +* transfer level:: +* message/partial sending:: Splitting +@end menu + +@node mime-edit-mode, single-part tags, MIME-Edit, MIME-Edit +@section MIME message $B$rJT=8$9$k$?$a$N(B minor-mode +@cindex enclosure +@cindex multi-part $B=*N;(B tag +@cindex multi-part $B3+;O(B tag +@cindex tag +@cindex mime-edit-mode + +@strong{mime-edit-mode} $B$O(B MIME message $B$r:n@.$9$k$?$a$N(B minor-mode $B$G$9!#(B +$B$3$N(B mode $B$G$O(B @strong{tag} $B$r;H$C$F$5$^$6$^$J<oN`$N(B data $B$rI=8=$7!"$5$^(B +$B$6$^$J<oN`$N(B data $B$+$i$J$kJ#?t$NItJ,$+$i$J$k(B message $B$rJT=8$9$k$3$H$r2D(B +$BG=$K$7$F$$$^$9!#(B@refill + +tag $B$K$O(B + +@itemize @bullet +@item + single-part tag +@item + multi-part tag +@end itemize + +@noindent +$B$N#2$D$,$"$j$^$9!#(B + +single-part tag $B$O(B single part $B$rI=8=$9$k$?$a$N(B tag $B$G!"(B@refill + +@example + --[[TYPE/SUBTYPE;PARAMETERS][ENCODING] + OPTIONAL-FIELDS] +@end example + +@noindent +$B$H$$$&$h$&$J7A$r$7$F$$$^$9!#(B + +TYPE/SUBTYPE $B$*$h$S(B PARAMETERS $B$O(B Content-Type +(@ref{(mime-ja)Content-Type}) $BMs$N(B type/subtype $B$*$h$S(B parameters $B$rI=$7(B +$B$^$9!#(BTYPE/SUBTYPE $B$OI,?\$G$"$j!"(BPARAMETERS $B$O>JN,2D$G$9!#(B@refill + +ENCODING $B$O(B Content-Transfer-Encoding +(@ref{(mime-ja)Content-Transfer-Encoding}) $BMs$rI=$7$^$9!#$3$l$b>JN,2D$G(B +$B$9!#(B@refill + +OPTIONAL-FIELDS $B$O(B Content-Type, Content-Transfer-Encoding $B0J30$N(B field +$B$r=q$/$?$a$NItJ,$G!">JN,2D$G$9!#(B@refill + +multi-part tag $B$O(B multi part (@ref{(mime-ja)multipart}) $B$rI=8=$9$k$?$a$N(B +tag $B$G!"(B@refill + +@example + --<<TYPE>>-@@@{ +@end example + +@noindent +$B$H$$$&7A$N(B @strong{multi-part $B3+;O(B tag} $B$H8F$P$l$k(B multi +part $B$N3+;O$r<($9(B tag $B$H(B + +@example + --@@@}-<<TYPE>> +@end example + +@noindent +$B$H$$$&7A$N(B @strong{multi-part $B=*N;(B tag} $B$H8F$P$l$k(B multi +part $B$N=*N;$r<($9(B tag $B$,$"$j$^$9!#(B + +$B$^$?!"(Bmulti-part $B3+;O(B tag $B$H(B multi-part $B=*N;(B tag $B$G0O$^$l$?ItJ,$r(B +@strong{enclosure} $B$H8F$S$^$9!#(B + + +@node single-part tags, enclosure tags, mime-edit-mode, MIME-Edit +@section single-part $B$KBP$9$kA`:n(B + +single-part $B$r:n$k$?$a$NA`:n$K$O0J2<$N$h$&$J$b$N$,$"$j$^$9!#(B + +@table @kbd +@item @key{C-c C-x C-t} +text part $B$rI=$9(B single-part tag $B$rA^F~$7$^$9!#(B + +@item @key{C-c C-x C-i} +file $B$r(B MIME part $B$H$7$FE:IU$7$^$9!#A0$K(B @kbd{C-u} $B$rIU$1$?>l9g!">o$K(B +media-type, subtype $BEy$rJ9$$$FMh$^$9!#(B(cf. @ref{tag specification for inserted file}) + +@item @key{C-c C-x C-e} +external part $B$rA^F~$7$^$9!#(B + +@item @key{C-c C-x C-v} +@kbd{C-g} $B$,2!$5$l$k$^$GO?2;$r9T$$!"2;@<(B part $B$rA^F~$7$^$9!#!J;H(B +$BMQ$G$-$J$$>l9g$,$"$j$^$9!K(B + +@item @key{C-c C-x C-y} +$B8=:_I=<(Cf$N(B (mail or news) message $B$rA^F~$7$^$9!#!J<B:]$NF0:n$O;HMQ$7(B +$B$F$$$k(B MUA $B$K0MB8$7$^$9!K(B + +@item @key{C-c C-x C-m} +mail message $B$rA^F~$7$^$9!#(B + +@item @key{C-c C-x C-w}, @key{C-c C-x C-s} +signature $B$rA^F~$7$^$9!#(B + +@item @key{C-c C-x C-k} +PGP (@ref{PGP}) $B$N8x3+80$rA^F~$7$^$9!#(B + +@item @key{C-c C-x t} +$BG$0U$N(B single-part tag $B$rA^F~$7$^$9!#(B + +@end table + + + +@node enclosure tags, other MIME-Edit operations, single-part tags, MIME-Edit +@section enclosure $B$KBP$9$kA`:n(B + +enclosure $B$r:n$k$?$a$NA`:n$H$7$F$O0J2<$N$h$&$J$b$N$,$"$j$^$9!#(B + +@table @kbd +@item @key{C-c C-m C-a} +$B;XDj$7$?(B region $B$r(B multipart/alternative $B$H$7$F0O$_$^$9!#(B + +@item @key{C-c C-x C-p} +$B;XDj$7$?(B region $B$r(B multipart/parallel $B$H$7$F0O$_$^$9!#(B + +@item @key{C-c C-x C-m} +$B;XDj$7$?(B region $B$r(B multipart/mixed $B$H$7$F0O$_$^$9!#(B + +@item @key{C-c C-x C-d} +$B;XDj$7$?(B region $B$r(B multipart/digest $B$H$7$F0O$_$^$9!#(B + +@item @key{C-c C-x C-s} +$B;XDj$7$?(B region $B$KEE;R=pL>$r9T$$$^$9!#(B(cf. @ref{PGP}) + +@item @key{C-c C-x C-e} +$B;XDj$7$?(B region $B$r0E9f2=$7$^$9!#(B(cf. @ref{PGP}) + +@item @key{C-c C-x C-q} +$B;XDj$7$?(B region $BFb$N(B tag $B$rL58z$K$7!"$=$N(B tag $B$rJ8;zNs$H$7$FMxMQ$G$-$k(B +$B$h$&$K$7$^$9!#!J8=:_$NHG$G$O$&$^$/F/$+$J$$$3$H$,$"$j$^$9!#$^$?!"EE;R=p(B +$BL>$H$NJ;MQ$K4X$7$F$bIT40A4$G$9!K(B + +@end table + + + +@node other MIME-Edit operations, file-type specification, enclosure tags, MIME-Edit +@section mime-edit-mode $B$K$*$1$k$=$NB>$NA`:n(B + +mime-edit-mode $B$K$*$1$k$=$NB>$NA`:n$r@bL@$7$^$9!#(B + +@table @kbd +@item @key{C-c C-c} +$BJT=8Cf$N(B message $B$rAw?.$7$^$9!#(B + +@item @key{C-c C-x p} +$BJT=8Cf$N(B message $B$r(B preview $B$7$^$9!#(B(cf. @ref{MIME-View}) + +@item @key{C-c C-x C-z} +$BJT=8Cf$N(B message $B$rAw?.$9$k$3$H$J$/!"(Bmime-edit-mode $B$r=*N;$7$^$9!#(B + +@item @key{C-c C-x /} +$BBg$-$J(B message $B$rAw?.$9$k>l9g$K(B message/partial $B7A<0$K<+F0J,3d2DG=$H$9(B +$B$k$+$I$&$+$r7h$a$^$9!#(B + +@item @key{C-c C-x 7} +transfer level (@ref{transfer level}) $B$r(B 7bit (@ref{(mime-ja)7bit}) $B$K$7(B +$B$^$9!#(B + +@item @key{C-c C-x 8} +transfer level (@ref{transfer level}) $B$r(B 8bit (@ref{(mime-ja)8bit}) $B$K$7(B +$B$^$9!#(B + +@item @key{C-c C-x v} +message $BA4BN$rEE;R=pL>$9$k$+$I$&$+$r7h$a$^$9!#(B(cf. @ref{PGP}) + +@item @key{C-c C-x h} +message $BA4BN$r0E9f2=$9$k$+$I$&$+$r7h$a$^$9!#(B(cf. @ref{PGP}) + +@item @key{C-c C-x ?} +help message $B$rI=<($7$^$9!#(B + +@end table + + + +@node file-type specification, transfer level, other MIME-Edit operations, MIME-Edit +@section $BA^F~$5$l$k(B file $B$KBP$9$k(B tag $B$N7hDj(B + +@kbd{C-c C-x C-i} (@code{mime-edit-insert-file}) $B$r<B9T$7$?;~!"A^F~$5$l(B +$B$k(B file $B$KBP$9$k(B media-type $B$d(B encoding $B$J$I$N(B tag $B$N>pJs$OJQ?t(B +@code{mime-file-types} $B$K$h$C$F(B file $BL>$+$i?dB,$5$l$^$9!#(B@refill + +$BA0$K(B @kbd{C-u} $B$rIU$1$?;~!"$*$h$S!"E,Ev$JCM$,8+IU$+$i$J$+$C$?>l9g!"(Buser +$B$KBP$7$FCM$NF~NO$rB%$7$^$9!#!JA0$K(B @kbd{C-u} $B$rIU$1$?;~!"?dB,$5$l$?CM$,(B +$B4{DjCM$H$7$FMQ$$$i$l$^$9!K(B@refill + +file $BL>$KBP$9$k4{DjCM$rJQ$($?$$>l9g$OJQ?t(B @code{mime-file-types} +$B$r@_Dj$7$F2<$5$$!#(B + +@defvar mime-file-types + +$BA^F~$5$l$k(B file $B$N(B file $BL>$KBP$9$k(B tag $B$N4{DjCM$rM?$($k!#(B@refill + +$B$3$NJQ?t$O(B + +@lisp + (FILE_PAT TYPE SUBTYPE PARAMS ENCODING + DISPOSITION_TYPE DISPOSITION_PARAMS) +@end lisp + + +$B$H$$$&(B list $B$N(B list $B$G!"3FMWAG$O0J2<$NDL$j$G$"$k!'(B + +@table @samp +@item FILE_PAT +file $BL>$rI=$9@55,I=8=(B + +@item TYPE +media type + +@item SUBTYPE +media subtype + +@item PARAMS +Content-Type field $B$N(B parameter + +@item ENCODING +Content-Transfer-Encoding + +@item DISPOSITION_TYPE +disposition-type + +@item DISPOSITION_PARAMS +Content-Disposition field $B$N(B parameter + +@end table + +@noindent +$B@_DjNc!'(B @file{*.rtf} $B$KBP$9$k(B media type $B$r(B application/rtf $B$K(B +$B$9$k>l9g(B + +@lisp +(eval-after-load + "mime-edit" + '(set-alist 'mime-file-types + "\\.rtf$" + '("application" "rtf" nil nil + "attachment" (("filename" . file))) + )) +@end lisp +@end defvar + + + +@node transfer level, message/partial sending, file-type specification, MIME-Edit +@section transfer level +@cindex transfer level + +message $B$KA^F~$9$k(B data $B$O(B 7bit (@ref{(mime-ja)7bit}) $B$J$$$7(B 8bit +(@ref{(mime-ja)8bit}) $B$b$7$/$O(B binary (@ref{(mime-ja)binary}) $B$GI=8=$9$k(B +$B$3$H$,$G$-$^$9!#(B@refill + +$B$h$C$F!"(B7bit $B$7$+DL$5$J$$(B MTA (@ref{(mime-ja)MTA}) $B$r7PM3$9$k>l9g!"(B7bit +$B$N(B data $B$O$=$N$^$^$GAw$l$^$9$,!"(B8bit $B$d(B binary $B$N(B data $B$O(B 7bit $B$KJQ49$7(B +$B$J$1$l$P$J$j$^$;$s!#(B@refill + +$BF1MM$K!"(B8bit $B$7$+DL$5$J$$(B MTA $B$r7PM3$9$k>l9g!"(B7bit $B$d(B 8bit $B$N(B data $B$O$=(B +$B$N$^$^$GAw$l$^$9$,!"(Bbinary $B$N(B data $B$O(B 7bit $B$+(B 8bit $B$KJQ49$7$J$1$l$P$J$j(B +$B$^$;$s!#(B@refill + +@noindent +@strong{[Memo]} +@quotation +EBCDIC $B$7$+DL$5$J$$(B MTA $B$r7PM3$9$k>l9g!"(B7bit $B$N(B data $B$b(B base64 $BEy$GJQ(B +$B49$7$J$$$HAw$l$^$;$s$,!";d$O(B EBCDIC $B$N$3$H$^$G$OCN$j$^$;$s!#(B(^_^; + +$BF1MM$K!"@)8fJ8;z$rDL$5$J$$(B MTA $B$N$3$H$d(B code $BJQ49$r9T$J$&(B MTA $B$b>C$($F$J(B +$B$/$J$C$FM_$7$$$G$9!#(B(^_^;@refill + +binary $B$bDL$9(B MTA $B$bB8:_$9$k$s$G$7$g$&$,!":#$N$H$3$m$"$^$j0lHLE*$H$O$$$((B +$B$J$$$G$7$g$&!#(B +@end quotation + +@strong{transfer level} $B$H$$$&$N$O$I$NHO0O$N(B data $B$^$GAw$l$k$+(B +$B$H$$$&$3$H$rI=$9$b$N$G$9!#(Bmime-edit $B$O(B +@code{mime-transfer-level} $B$H$$$&JQ?t$r;}$C$F$*$j!"$3$l$G(B +transfer level $B$rI=8=$7$^$9!#(B + + +@defvar mime-transfer-level + +transfer level $B$rI=$9!#(B@refill + +$B$"$k(B data $B$N(B transfer level $B$,$3$NCM$r1[$($k>l9g!"(B7bit data $B$X$NJQ49$,9T(B +$B$o$l$k!#(B@refill + +$B8=:_$N$H$3$m!"(B7 $B$+(B 8 $B$,M-8z$G$"$k!#4{DjCM$O(B 7 $B$G$"$k!#(B@refill + +EBCDIC $B$r(B 5, ASCII printable $B$N$_$r(B 6, binary $B$r(B 9 $B$H$9$k$3$H$r7W2h$7$F(B +$B$$$k$,!"<BAu$NM=Dj$O$J$$!#(B +@end defvar + + + +@noindent +@strong{[Memo]} +@quotation +transfer level $B$O(B message header (@ref{header}) $B$K$O4X78$7$J$$!#(BMIME $B$O(B +body $B$K$*$$$F!"(B8bit $B$N(B data $B$r;H$($k$h$&$K(B STD 11 (@ref{(mime-ja)STD 11}) $B$r3HD%$7$F$$$k$,!"(Bmessage header $B$G$O(B us-ascii +(@ref{(mime-ja)us-ascii}) $B$N$_$rMQ$$$k$3$H$r5a$a$F$$$k!#(B +@end quotation + + + +@node message/partial sending, , transfer level, MIME-Edit +@section Splitting + +@defvar mime-edit-split-message + +Non-nil $B$J$i$PBg$-$J%a%C%;!<%8$rJ,3d$7$FAw?.$7$^$9!#(B +@end defvar + + +@defvar mime-edit-message-default-max-lines + +$B%a%C%;!<%8$N:GBg9T?t$N%G%U%)%k%HCM$G$9!#(B +@end defvar + + +@defvar mime-edit-message-max-lines-alist + +$B%a%8%c!<%b!<%IBP%a%C%;!<%8$N:GBg9T?t$+$i@.$kO"A[%j%9%H$G$9!#(B@refill + +$B%a%8%c!<%b!<%I$,$3$3$G;XDj$5$l$F$J$$>l9g$K$O(B +@code{mime-edit-message-default-max-lines} $B$rMQ$$$^$9!#(B +@end defvar + + +@defvar mime-edit-split-blind-field-regexp + +$BJ,3dAw?.$N:]$KL5;k$5$l$k%U%#!<%k%IL>$K%^%C%A$9$k@55,I=8=$G$9!#(B +@end defvar + + + +@node Various, Concept Index, MIME-Edit, Top +@chapter $B$=$NB>(B + + +@menu +* PGP:: $B0E9f2=!"=pL>(B +* Buttons:: $B2!KU(B +* Acting-condition configuration:: $B<B9T>r7o$N@_Dj(B +@end menu + +@node PGP, Buttons, Various, Various +@section PGP +@cindex PGP-kazu +@cindex PGP/MIME + +mime-edit $B$G$O(B @strong{PGP/MIME} (RFC 2015) $B$*$h$S(B@strong{PGP-kazu} +(draft-kazu-pgp-mime-00.txt) $B$K$h$k0E9f2=!&EE;R=pL>!&8x3+80$NA^F~5!G=$r(B +$BMxMQ$9$k$3$H$,$G$-$^$9!#(B@refill + +$BC"$7!"$3$N5!G=$rMxMQ$9$k$K$O3F<o(B pgp command $B$,I,MW$G$9!#(B + +@defvar pgg-default-scheme + +$B0E9f2=$b$7$/$O=pL>$KMQ$$$k(B PGP $B$b$7$/$O(B GnuPG $B%3%^%s%I$N%P!<%8%g%s$G$9!#(B +$BCM$O(B symbol $B$r;XDj$7$^$9!#;H$($k%P!<%8%g%s$O(B @code{gpg}$B!"(B +@code{pgp} $B$b$7$/$O(B @code{pgp5} $B$G$9!#(B@refill +@end defvar + + +@defvar pgg-scheme + +$BI|9f$b$7$/$O8!>Z$KMQ$$$k(B PGP $B$b$7$/$O(B GnuPG $B%3%^%s%I$N%P!<%8%g%s$G$9!#(B +$BCM$O(B symbol $B$r;XDj$7$^$9!#;H$($k%P!<%8%g%s$O(B @code{gpg}$B!"(B +@code{pgp} $B$b$7$/$O(B @code{pgp5} $B$G$9!#(B@refill +@end defvar + + +@defvar pgg-insert-url-function + +$B80%5!<%P$+$i8x3+80$r<h$j4s$;$k:]$K;H$&4X?t$G$9!#%G%U%)%k%H$G$O(B +Emacs/W3 $B$r;H$&@_Dj$K$J$C$F$$$^$9!#(Bemacs-w3m $B$r;H$&>l9g$K$O(B +$B<!$N$h$&$K@_Dj$7$^$9!#(B +@lisp +(setq pgg-insert-url-function #'w3m-retrieve) +@end lisp +@end defvar + + + +@node Buttons, Acting-condition configuration, PGP, Various +@section $B2!KU(B + +@defvar mime-button-face + +MIME-Preview $B%P%C%U%!$G(B content-button $B$b$7$/$O(B URL-button $B$KMQ$$$k(B +face $B$G$9!#(B +@end defvar + + +@defvar mime-button-mouse-face + +MIME-preview $B%P%C%U%!$G%^%&%9$r%O%$%i%$%H$9$k:]$KMQ$$$k(B face $B$G$9!#(B +@end defvar + + +@defvar mime-browse-url-function + +URL $B$r%V%i%&%:$9$k4X?t$G$9!#(B +@end defvar + + + +@node Acting-condition configuration, , Buttons, Various +@section $B<B9T>r7o$N@_Dj(B + +@defun mime-add-condition target-type condition &optional mode file + +Add @var{condition} to database specified by @var{target-type}.@refill + +@var{target-type} must be @code{preview} or @code{action}.@refill + +If optional argument @var{mode} is @code{strict} or @code{nil} +(omitted), @var{condition} is added strictly.@refill + +If optional argument @var{mode} is @code{with-default}, @var{condition} +is added with default rule.@refill + +If optional argument @var{file} is specified, it is loaded when +@var{condition} is activate. +@end defun + + + +@node Concept Index, Function Index, Various, Top +@chapter $B35G0:w0z(B + +@printindex cp + +@node Function Index, Variable Index, Concept Index, Top +@chapter $B4X?t:w0z(B + +@printindex fn + +@node Variable Index, , Function Index, Top +@chapter $BJQ?t:w0z(B + +@printindex vr +@bye diff --git a/semi-1.14.6/mime-view.el b/semi-1.14.6/mime-view.el new file mode 100644 index 0000000..81386cb --- /dev/null +++ b/semi-1.14.6/mime-view.el @@ -0,0 +1,1894 @@ +;;; mime-view.el --- interactive MIME viewer for GNU Emacs + +;; Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko <tomo@m17n.org> +;; Created: 1994/07/13 +;; Renamed: 1994/08/31 from tm-body.el +;; Renamed: 1997/02/19 from tm-view.el +;; Keywords: MIME, multimedia, mail, news + +;; This file is part of SEMI (Sample of Elastic MIME Interfaces). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Code: + +(require 'mime) +(require 'semi-def) +(require 'calist) +(require 'alist) +(require 'mime-conf) + +(eval-when-compile (require 'static)) + + +;;; @ version +;;; + +(defconst mime-view-version + (concat (mime-product-name mime-user-interface-product) " MIME-View " + (mapconcat #'number-to-string + (mime-product-version mime-user-interface-product) ".") + " (" (mime-product-code-name mime-user-interface-product) ")")) + + +;;; @ variables +;;; + +(defgroup mime-view nil + "MIME view mode" + :group 'mime) + +(defcustom mime-situation-examples-file "~/.mime-example" + "*File name of situation-examples demonstrated by user." + :group 'mime-view + :type 'file) + +(defcustom mime-preview-move-scroll nil + "*Decides whether to scroll when moving to next entity. +When t, scroll the buffer. Non-nil but not t means scroll when +the next entity is within next-screen-context-lines from top or +buttom. Nil means don't scroll at all." + :group 'mime-view + :type '(choice (const :tag "Off" nil) + (const :tag "On" t) + (sexp :tag "Situation" 1))) + +(defcustom mime-view-mailcap-files + (let ((files '("/etc/mailcap" "/usr/etc/mailcap" "~/.mailcap"))) + (or (member mime-mailcap-file files) + (setq files (cons mime-mailcap-file files))) + files) + "List of mailcap files." + :group 'mime-view + :type '(repeat file)) + + +;;; @ in raw-buffer (representation space) +;;; + +(defvar mime-preview-buffer nil + "MIME-preview buffer corresponding with the (raw) buffer.") +(make-variable-buffer-local 'mime-preview-buffer) + + +(defvar mime-raw-representation-type-alist + '((mime-show-message-mode . binary) + (mime-temp-message-mode . binary) + (t . cooked) + ) + "Alist of major-mode vs. representation-type of mime-raw-buffer. +Each element looks like (SYMBOL . REPRESENTATION-TYPE). SYMBOL is +major-mode or t. t means default. REPRESENTATION-TYPE must be +`binary' or `cooked'.") + + +;;; @ in preview-buffer (presentation space) +;;; + +(defvar mime-mother-buffer nil + "Mother buffer corresponding with the (MIME-preview) buffer. +If current MIME-preview buffer is generated by other buffer, such as +message/partial, it is called `mother-buffer'.") +(make-variable-buffer-local 'mime-mother-buffer) + +;; (defvar mime-raw-buffer nil +;; "Raw buffer corresponding with the (MIME-preview) buffer.") +;; (make-variable-buffer-local 'mime-raw-buffer) + +(defvar mime-preview-original-window-configuration nil + "Window-configuration before mime-view-mode is called.") +(make-variable-buffer-local 'mime-preview-original-window-configuration) + +(defun mime-preview-original-major-mode (&optional recursive point) + "Return major-mode of original buffer. +If optional argument RECURSIVE is non-nil and current buffer has +mime-mother-buffer, it returns original major-mode of the +mother-buffer." + (if (and recursive mime-mother-buffer) + (save-excursion + (set-buffer mime-mother-buffer) + (mime-preview-original-major-mode recursive) + ) + (cdr (assq 'major-mode + (get-text-property (or point + (if (> (point) (buffer-size)) + (max (1- (point-max)) (point-min)) + (point))) + 'mime-view-situation))))) + + +;;; @ entity information +;;; + +(defun mime-entity-situation (entity &optional situation) + "Return situation of ENTITY." + (let (rest param name) + ;; Content-Type + (unless (assq 'type situation) + (setq rest (or (mime-entity-content-type entity) + (make-mime-content-type 'text 'plain)) + situation (cons (car rest) situation) + rest (cdr rest)) + ) + (unless (assq 'subtype situation) + (or rest + (setq rest (or (cdr (mime-entity-content-type entity)) + '((subtype . plain))))) + (setq situation (cons (car rest) situation) + rest (cdr rest)) + ) + (while rest + (setq param (car rest)) + (or (assoc (car param) situation) + (setq situation (cons param situation))) + (setq rest (cdr rest))) + + ;; Content-Disposition + (setq rest nil) + (unless (assq 'disposition-type situation) + (setq rest (mime-entity-content-disposition entity)) + (if rest + (setq situation (cons (cons 'disposition-type + (mime-content-disposition-type rest)) + situation) + rest (mime-content-disposition-parameters rest)) + )) + (while rest + (setq param (car rest) + name (car param)) + (if (cond ((string= name "filename") + (if (assq 'filename situation) + nil + (setq name 'filename))) + ((string= name "creation-date") + (if (assq 'creation-date situation) + nil + (setq name 'creation-date))) + ((string= name "modification-date") + (if (assq 'modification-date situation) + nil + (setq name 'modification-date))) + ((string= name "read-date") + (if (assq 'read-date situation) + nil + (setq name 'read-date))) + ((string= name "size") + (if (assq 'size situation) + nil + (setq name 'size))) + (t (setq name (cons 'disposition name)) + (if (assoc name situation) + nil + name))) + (setq situation + (cons (cons name (cdr param)) + situation))) + (setq rest (cdr rest))) + + ;; Content-Transfer-Encoding + (or (assq 'encoding situation) + (setq situation + (cons (cons 'encoding (or (mime-entity-encoding entity) + "7bit")) + situation))) + + situation)) + +(defsubst mime-delq-null-situation (situations field + &rest ignored-values) + (let (dest) + (while situations + (let* ((situation (car situations)) + (cell (assq field situation))) + (if cell + (or (memq (cdr cell) ignored-values) + (setq dest (cons situation dest)) + ))) + (setq situations (cdr situations))) + dest)) + +(defun mime-compare-situation-with-example (situation example) + (let ((example (copy-alist example)) + (match 0)) + (while situation + (let* ((cell (car situation)) + (key (car cell)) + (ecell (assoc key example))) + (when ecell + (if (equal cell ecell) + (setq match (1+ match)) + (setq example (delq ecell example)) + )) + ) + (setq situation (cdr situation)) + ) + (cons match example) + )) + +(defun mime-sort-situation (situation) + (sort situation + #'(lambda (a b) + (let ((a-t (car a)) + (b-t (car b)) + (order '((type . 1) + (subtype . 2) + (mode . 3) + (method . 4) + (major-mode . 5) + (disposition-type . 6) + )) + a-order b-order) + (if (symbolp a-t) + (let ((ret (assq a-t order))) + (if ret + (setq a-order (cdr ret)) + (setq a-order 7) + )) + (setq a-order 8) + ) + (if (symbolp b-t) + (let ((ret (assq b-t order))) + (if ret + (setq b-order (cdr ret)) + (setq b-order 7) + )) + (setq b-order 8) + ) + (if (= a-order b-order) + (string< (format "%s" a-t)(format "%s" b-t)) + (< a-order b-order)) + ))) + ) + +(defun mime-unify-situations (entity-situation + condition situation-examples + &optional required-name ignored-value + every-situations) + (let (ret) + (in-calist-package 'mime-view) + (setq ret + (ctree-find-calist condition entity-situation + every-situations)) + (if required-name + (setq ret (mime-delq-null-situation ret required-name + ignored-value t))) + (or (assq 'ignore-examples entity-situation) + (if (cdr ret) + (let ((rest ret) + (max-score 0) + (max-escore 0) + max-examples + max-situations) + (while rest + (let ((situation (car rest)) + (examples situation-examples)) + (while examples + (let* ((ret + (mime-compare-situation-with-example + situation (caar examples))) + (ret-score (car ret))) + (cond ((> ret-score max-score) + (setq max-score ret-score + max-escore (cdar examples) + max-examples (list (cdr ret)) + max-situations (list situation)) + ) + ((= ret-score max-score) + (cond ((> (cdar examples) max-escore) + (setq max-escore (cdar examples) + max-examples (list (cdr ret)) + max-situations (list situation)) + ) + ((= (cdar examples) max-escore) + (setq max-examples + (cons (cdr ret) max-examples)) + (or (member situation max-situations) + (setq max-situations + (cons situation max-situations))) + ))))) + (setq examples (cdr examples)))) + (setq rest (cdr rest))) + (when max-situations + (setq ret max-situations) + (while max-examples + (let* ((example (car max-examples)) + (cell + (assoc example situation-examples))) + (if cell + (setcdr cell (1+ (cdr cell))) + (setq situation-examples + (cons (cons example 0) + situation-examples)) + )) + (setq max-examples (cdr max-examples)) + ))))) + (cons ret situation-examples) + ;; ret: list of situations + ;; situation-examples: new examples (notoce that contents of + ;; argument `situation-examples' has bees modified) + )) + +(defun mime-view-entity-title (entity) + (or (mime-entity-read-field entity 'Content-Description) + (mime-entity-read-field entity 'Subject) + (mime-entity-filename entity) + "")) + +(defvar mime-preview-situation-example-list nil) +(defvar mime-preview-situation-example-list-max-size 16) +;; (defvar mime-preview-situation-example-condition nil) + +(defun mime-find-entity-preview-situation (entity + &optional default-situation) + (or (let ((ret + (mime-unify-situations + (append (mime-entity-situation entity) + default-situation) + mime-preview-condition + mime-preview-situation-example-list))) + (setq mime-preview-situation-example-list + (cdr ret)) + (caar ret)) + default-situation)) + + +(defvar mime-acting-situation-example-list nil) +(defvar mime-acting-situation-example-list-max-size 16) +(defvar mime-situation-examples-file-coding-system nil) + +(defun mime-view-read-situation-examples-file (&optional file) + (or file + (setq file mime-situation-examples-file)) + (if (and file + (file-readable-p file)) + (with-temp-buffer + (insert-file-contents file) + (setq mime-situation-examples-file-coding-system + (static-cond + ((boundp 'buffer-file-coding-system) + (symbol-value 'buffer-file-coding-system)) + ((boundp 'file-coding-system) + (symbol-value 'file-coding-system)) + (t nil)) + ;; (and (boundp 'buffer-file-coding-system) + ;; buffer-file-coding-system) + ) + (condition-case error + (eval-buffer) + (error (message "%s is broken: %s" file (cdr error)))) + ;; format check + (condition-case nil + (let ((i 0)) + (while (and (> (length mime-preview-situation-example-list) + mime-preview-situation-example-list-max-size) + (< i 16)) + (setq mime-preview-situation-example-list + (mime-reduce-situation-examples + mime-preview-situation-example-list)) + (setq i (1+ i)))) + (error (setq mime-preview-situation-example-list nil))) + ;; (let ((rest mime-preview-situation-example-list)) + ;; (while rest + ;; (ctree-set-calist-strictly 'mime-preview-condition + ;; (caar rest)) + ;; (setq rest (cdr rest)))) + (condition-case nil + (let ((i 0)) + (while (and (> (length mime-acting-situation-example-list) + mime-acting-situation-example-list-max-size) + (< i 16)) + (setq mime-acting-situation-example-list + (mime-reduce-situation-examples + mime-acting-situation-example-list)) + (setq i (1+ i)))) + (error (setq mime-acting-situation-example-list nil)))))) + +(defun mime-save-situation-examples () + (if (or mime-preview-situation-example-list + mime-acting-situation-example-list) + (let ((file mime-situation-examples-file) + print-length print-level) + (with-temp-buffer + (insert ";;; " (file-name-nondirectory file) "\n") + (insert "\n;; This file is generated automatically by " + mime-view-version "\n\n") + (insert ";;; Code:\n\n") + (if mime-preview-situation-example-list + (pp `(setq mime-preview-situation-example-list + ',mime-preview-situation-example-list) + (current-buffer))) + (if mime-acting-situation-example-list + (pp `(setq mime-acting-situation-example-list + ',mime-acting-situation-example-list) + (current-buffer))) + (insert "\n;;; " + (file-name-nondirectory file) + " ends here.\n") + (static-cond + ((boundp 'buffer-file-coding-system) + (setq buffer-file-coding-system + mime-situation-examples-file-coding-system)) + ((boundp 'file-coding-system) + (setq file-coding-system + mime-situation-examples-file-coding-system))) + ;; (setq buffer-file-coding-system + ;; mime-situation-examples-file-coding-system) + (setq buffer-file-name file) + (save-buffer))))) + +(add-hook 'kill-emacs-hook 'mime-save-situation-examples) + +(defun mime-reduce-situation-examples (situation-examples) + (let ((len (length situation-examples)) + i ir ic j jr jc ret + dest d-i d-j + (max-sim 0) sim + min-det-ret det-ret + min-det-org det-org + min-freq freq) + (setq i 0 + ir situation-examples) + (while (< i len) + (setq ic (car ir) + j 0 + jr situation-examples) + (while (< j len) + (unless (= i j) + (setq jc (car jr)) + (setq ret (mime-compare-situation-with-example (car ic)(car jc)) + sim (car ret) + det-ret (+ (length (car ic))(length (car jc))) + det-org (length (cdr ret)) + freq (+ (cdr ic)(cdr jc))) + (cond ((< max-sim sim) + (setq max-sim sim + min-det-ret det-ret + min-det-org det-org + min-freq freq + d-i i + d-j j + dest (cons (cdr ret) freq)) + ) + ((= max-sim sim) + (cond ((> min-det-ret det-ret) + (setq min-det-ret det-ret + min-det-org det-org + min-freq freq + d-i i + d-j j + dest (cons (cdr ret) freq)) + ) + ((= min-det-ret det-ret) + (cond ((> min-det-org det-org) + (setq min-det-org det-org + min-freq freq + d-i i + d-j j + dest (cons (cdr ret) freq)) + ) + ((= min-det-org det-org) + (cond ((> min-freq freq) + (setq min-freq freq + d-i i + d-j j + dest (cons (cdr ret) freq)) + )) + )) + )) + )) + ) + (setq jr (cdr jr) + j (1+ j))) + (setq ir (cdr ir) + i (1+ i))) + (if (> d-i d-j) + (setq i d-i + d-i d-j + d-j i)) + (setq jr (nthcdr (1- d-j) situation-examples)) + (setcdr jr (cddr jr)) + (if (= d-i 0) + (setq situation-examples + (cdr situation-examples)) + (setq ir (nthcdr (1- d-i) situation-examples)) + (setcdr ir (cddr ir)) + ) + (if (setq ir (assoc (car dest) situation-examples)) + (progn + (setcdr ir (+ (cdr ir)(cdr dest))) + situation-examples) + (cons dest situation-examples) + ;; situation-examples may be modified. + ))) + + +;;; @ presentation of preview +;;; + +;;; @@ entity-button +;;; + +;;; @@@ predicate function +;;; + +;; (defun mime-view-entity-button-visible-p (entity) +;; "Return non-nil if header of ENTITY is visible. +;; Please redefine this function if you want to change default setting." +;; (let ((media-type (mime-entity-media-type entity)) +;; (media-subtype (mime-entity-media-subtype entity))) +;; (or (not (eq media-type 'application)) +;; (and (not (eq media-subtype 'x-selection)) +;; (or (not (eq media-subtype 'octet-stream)) +;; (let ((mother-entity (mime-entity-parent entity))) +;; (or (not (eq (mime-entity-media-type mother-entity) +;; 'multipart)) +;; (not (eq (mime-entity-media-subtype mother-entity) +;; 'encrypted))) +;; ) +;; ))))) + +;;; @@@ entity button generator +;;; + +(defun mime-view-insert-entity-button (entity) + "Insert entity-button of ENTITY." + (let ((entity-node-id (mime-entity-node-id entity)) + (params (mime-entity-parameters entity)) + (subject (mime-view-entity-title entity))) + (mime-insert-button + (let ((access-type (assoc "access-type" params)) + (num (or (cdr (assoc "x-part-number" params)) + (if (consp entity-node-id) + (mapconcat (function + (lambda (num) + (format "%s" (1+ num)) + )) + (reverse entity-node-id) ".") + "0")) + )) + (cond (access-type + (let ((server (assoc "server" params))) + (setq access-type (cdr access-type)) + (if server + (format "%s %s ([%s] %s)" + num subject access-type (cdr server)) + (let ((site (cdr (assoc "site" params))) + (dir (cdr (assoc "directory" params))) + (url (cdr (assoc "url" params))) + ) + (if url + (format "%s %s ([%s] %s)" + num subject access-type url) + (format "%s %s ([%s] %s:%s)" + num subject access-type site dir)) + ))) + ) + (t + (let ((media-type (mime-entity-media-type entity)) + (media-subtype (mime-entity-media-subtype entity)) + (charset (cdr (assoc "charset" params))) + (encoding (mime-entity-encoding entity))) + (concat + num " " subject + (let ((rest + (format " <%s/%s%s%s>" + media-type media-subtype + (if charset + (concat "; " charset) + "") + (if encoding + (concat " (" encoding ")") + "")))) + (if (>= (+ (current-column)(length rest))(window-width)) + "\n\t") + rest))) + ))) + (function mime-preview-play-current-entity)) + )) + + +;;; @@ entity-header +;;; + +(defvar mime-header-presentation-method-alist nil + "Alist of major mode vs. corresponding header-presentation-method functions. +Each element looks like (SYMBOL . FUNCTION). +SYMBOL must be major mode in raw-buffer or t. t means default. +Interface of FUNCTION must be (ENTITY SITUATION).") + +(defvar mime-view-ignored-field-list + '(".*Received:" ".*Path:" ".*Id:" "^References:" + "^Replied:" "^Errors-To:" + "^Lines:" "^Sender:" ".*Host:" "^Xref:" + "^Content-Type:" "^Precedence:" + "^Status:" "^X-VM-.*:") + "All fields that match this list will be hidden in MIME preview buffer. +Each elements are regexp of field-name.") + +(defvar mime-view-visible-field-list '("^Dnas.*:" "^Message-Id:") + "All fields that match this list will be displayed in MIME preview buffer. +Each elements are regexp of field-name.") + + +;;; @@ entity-body +;;; + +;;; @@@ predicate function +;;; + +(in-calist-package 'mime-view) + +(defun mime-calist::field-match-method-as-default-rule (calist + field-type field-value) + (let ((s-field (assq field-type calist))) + (cond ((null s-field) + (cons (cons field-type field-value) calist) + ) + (t calist)))) + +(define-calist-field-match-method + 'header #'mime-calist::field-match-method-as-default-rule) + +(define-calist-field-match-method + 'body #'mime-calist::field-match-method-as-default-rule) + + +(defvar mime-preview-condition nil + "Condition-tree about how to display entity.") + +(ctree-set-calist-strictly + 'mime-preview-condition '((type . application)(subtype . octet-stream) + (encoding . nil) + (body . visible))) +(ctree-set-calist-strictly + 'mime-preview-condition '((type . application)(subtype . octet-stream) + (encoding . "7bit") + (body . visible))) +(ctree-set-calist-strictly + 'mime-preview-condition '((type . application)(subtype . octet-stream) + (encoding . "8bit") + (body . visible))) + +(ctree-set-calist-strictly + 'mime-preview-condition '((type . application)(subtype . pgp) + (body . visible))) + +(ctree-set-calist-strictly + 'mime-preview-condition '((type . application)(subtype . x-latex) + (body . visible))) + +(ctree-set-calist-strictly + 'mime-preview-condition '((type . application)(subtype . x-selection) + (body . visible))) + +(ctree-set-calist-strictly + 'mime-preview-condition '((type . application)(subtype . x-comment) + (body . visible))) + +(ctree-set-calist-strictly + 'mime-preview-condition '((type . message)(subtype . delivery-status) + (body . visible))) + +(ctree-set-calist-strictly + 'mime-preview-condition + '((body . visible) + (body-presentation-method . mime-display-text/plain))) + +(ctree-set-calist-strictly + 'mime-preview-condition + '((type . nil) + (body . visible) + (body-presentation-method . mime-display-text/plain))) + +(ctree-set-calist-strictly + 'mime-preview-condition + '((type . text)(subtype . enriched) + (body . visible) + (body-presentation-method . mime-display-text/enriched))) + +(ctree-set-calist-strictly + 'mime-preview-condition + '((type . text)(subtype . richtext) + (body . visible) + (body-presentation-method . mime-display-text/richtext))) + +(autoload 'mime-display-application/x-postpet "postpet") + +(ctree-set-calist-strictly + 'mime-preview-condition + '((type . application)(subtype . x-postpet) + (body . visible) + (body-presentation-method . mime-display-application/x-postpet))) + +(ctree-set-calist-strictly + 'mime-preview-condition + '((type . text)(subtype . t) + (body . visible) + (body-presentation-method . mime-display-text/plain))) + +(ctree-set-calist-strictly + 'mime-preview-condition + '((type . multipart)(subtype . alternative) + (body . visible) + (body-presentation-method . mime-display-multipart/alternative))) + +(ctree-set-calist-strictly + 'mime-preview-condition + '((type . multipart)(subtype . related) + (body . visible) + (body-presentation-method . mime-display-multipart/related))) + +(ctree-set-calist-strictly + 'mime-preview-condition + '((type . multipart)(subtype . t) + (body . visible) + (body-presentation-method . mime-display-multipart/mixed))) + +(ctree-set-calist-strictly + 'mime-preview-condition + '((type . message)(subtype . partial) + (body . visible) + (body-presentation-method . mime-display-message/partial-button))) + +(ctree-set-calist-strictly + 'mime-preview-condition + '((type . message)(subtype . rfc822) + (body . visible) + (body-presentation-method . mime-display-multipart/mixed) + (childrens-situation (header . visible) + (entity-button . invisible)))) + +(ctree-set-calist-strictly + 'mime-preview-condition + '((type . message)(subtype . news) + (body . visible) + (body-presentation-method . mime-display-multipart/mixed) + (childrens-situation (header . visible) + (entity-button . invisible)))) + + +;;; @@@ entity presentation +;;; + +(defun mime-display-text/plain (entity situation) + (save-restriction + (narrow-to-region (point-max)(point-max)) + (condition-case nil + (mime-insert-text-content entity) + (error (progn + (message "Can't decode current entity.") + (sit-for 1)))) + (run-hooks 'mime-text-decode-hook) + (goto-char (point-max)) + (if (not (eq (char-after (1- (point))) ?\n)) + (insert "\n") + ) + (mime-add-url-buttons) + (run-hooks 'mime-display-text/plain-hook) + )) + +(defun mime-display-text/richtext (entity situation) + (save-restriction + (narrow-to-region (point-max)(point-max)) + (mime-insert-text-content entity) + (run-hooks 'mime-text-decode-hook) + (let ((beg (point-min))) + (remove-text-properties beg (point-max) '(face nil)) + (richtext-decode beg (point-max)) + ))) + +(defun mime-display-text/enriched (entity situation) + (save-restriction + (narrow-to-region (point-max)(point-max)) + (mime-insert-text-content entity) + (run-hooks 'mime-text-decode-hook) + (let ((beg (point-min))) + (remove-text-properties beg (point-max) '(face nil)) + (enriched-decode beg (point-max)) + ))) + + +(defvar mime-view-announcement-for-message/partial + (if (and (>= emacs-major-version 19) window-system) + "\ +\[[ This is message/partial style split message. ]] +\[[ Please press `v' key in this buffer ]] +\[[ or click here by mouse button-2. ]]" + "\ +\[[ This is message/partial style split message. ]] +\[[ Please press `v' key in this buffer. ]]" + )) + +(defun mime-display-message/partial-button (&optional entity situation) + (save-restriction + (goto-char (point-max)) + (if (not (search-backward "\n\n" nil t)) + (insert "\n") + ) + (goto-char (point-max)) + (narrow-to-region (point-max)(point-max)) + (insert mime-view-announcement-for-message/partial) + (mime-add-button (point-min)(point-max) + #'mime-preview-play-current-entity) + )) + +(defun mime-display-multipart/mixed (entity situation) + (let ((children (mime-entity-children entity)) + (original-major-mode-cell (assq 'major-mode situation)) + (default-situation + (cdr (assq 'childrens-situation situation)))) + (if original-major-mode-cell + (setq default-situation + (cons original-major-mode-cell default-situation))) + (while children + (mime-display-entity (car children) nil default-situation) + (setq children (cdr children)) + ))) + +(defcustom mime-view-type-subtype-score-alist + '(((text . enriched) . 3) + ((text . richtext) . 2) + ((text . plain) . 1) + (t . 0)) + "Alist MEDIA-TYPE vs corresponding score. +MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t. t means default." + :group 'mime-view + :type '(repeat (cons (choice :tag "Media-Type" + (cons :tag "Type/Subtype" + (symbol :tag "Primary-type") + (symbol :tag "Subtype")) + (symbol :tag "Type") + (const :tag "Default" t)) + integer))) + +(defun mime-display-multipart/alternative (entity situation) + (let* ((children (mime-entity-children entity)) + (original-major-mode-cell (assq 'major-mode situation)) + (default-situation + (cdr (assq 'childrens-situation situation))) + (i 0) + (p 0) + (max-score 0) + situations) + (if original-major-mode-cell + (setq default-situation + (cons original-major-mode-cell default-situation))) + (setq situations + (mapcar (function + (lambda (child) + (let ((situation + (mime-find-entity-preview-situation + child default-situation))) + (if (cdr (assq 'body-presentation-method situation)) + (let ((score + (cdr + (or (assoc + (cons + (cdr (assq 'type situation)) + (cdr (assq 'subtype situation))) + mime-view-type-subtype-score-alist) + (assq + (cdr (assq 'type situation)) + mime-view-type-subtype-score-alist) + (assq + t + mime-view-type-subtype-score-alist) + )))) + (if (> score max-score) + (setq p i + max-score score) + ))) + (setq i (1+ i)) + situation) + )) + children)) + (setq i 0) + (while children + (let ((child (car children)) + (situation (car situations))) + (mime-display-entity child (if (= i p) + situation + (put-alist 'body 'invisible + (copy-alist situation))))) + (setq children (cdr children) + situations (cdr situations) + i (1+ i))))) + +(defun mime-display-multipart/related (entity situation) + (let* ((param-start (mime-parse-msg-id + (std11-lexical-analyze + (cdr (assoc "start" + (mime-content-type-parameters + (mime-entity-content-type entity))))))) + (start (or (and param-start (mime-find-entity-from-content-id + param-start + entity)) + (car (mime-entity-children entity)))) + (original-major-mode-cell (assq 'major-mode situation)) + (default-situation (cdr (assq 'childrens-situation situation)))) + (if original-major-mode-cell + (setq default-situation + (cons original-major-mode-cell default-situation))) + (mime-display-entity start nil default-situation))) + +;;; @ acting-condition +;;; + +(defvar mime-acting-condition nil + "Condition-tree about how to process entity.") + +(defun mime-view-read-mailcap-files (&optional files) + (or files + (setq files mime-view-mailcap-files)) + (let (entries file) + (while files + (setq file (car files)) + (if (file-readable-p file) + (setq entries (append entries (mime-parse-mailcap-file file)))) + (setq files (cdr files))) + (while entries + (let ((entry (car entries)) + view print shared) + (while entry + (let* ((field (car entry)) + (field-type (car field))) + (cond ((eq field-type 'view) (setq view field)) + ((eq field-type 'print) (setq print field)) + ((memq field-type '(compose composetyped edit))) + (t (setq shared (cons field shared)))) + ) + (setq entry (cdr entry))) + (setq shared (nreverse shared)) + (ctree-set-calist-with-default + 'mime-acting-condition + (append shared (list '(mode . "play")(cons 'method (cdr view))))) + (if print + (ctree-set-calist-with-default + 'mime-acting-condition + (append shared + (list '(mode . "print")(cons 'method (cdr view))))))) + (setq entries (cdr entries))))) + +(mime-view-read-mailcap-files) + +(ctree-set-calist-strictly + 'mime-acting-condition + '((type . application)(subtype . octet-stream) + (mode . "play") + (method . mime-detect-content) + )) + +(ctree-set-calist-with-default + 'mime-acting-condition + '((mode . "extract") + (method . mime-save-content))) + +(ctree-set-calist-strictly + 'mime-acting-condition + '((type . text)(subtype . x-rot13-47)(mode . "play") + (method . mime-view-caesar) + )) +(ctree-set-calist-strictly + 'mime-acting-condition + '((type . text)(subtype . x-rot13-47-48)(mode . "play") + (method . mime-view-caesar) + )) + +(ctree-set-calist-strictly + 'mime-acting-condition + '((type . message)(subtype . rfc822)(mode . "play") + (method . mime-view-message/rfc822) + )) +(ctree-set-calist-strictly + 'mime-acting-condition + '((type . message)(subtype . partial)(mode . "play") + (method . mime-store-message/partial-piece) + )) + +(ctree-set-calist-strictly + 'mime-acting-condition + '((type . message)(subtype . external-body) + ("access-type" . "anon-ftp") + (method . mime-view-message/external-anon-ftp) + )) + +(ctree-set-calist-strictly + 'mime-acting-condition + '((type . message)(subtype . external-body) + ("access-type" . "url") + (method . mime-view-message/external-url) + )) + +(ctree-set-calist-strictly + 'mime-acting-condition + '((type . application)(subtype . octet-stream) + (method . mime-save-content) + )) + + +;;; @ quitting method +;;; + +(defvar mime-preview-quitting-method-alist + '((mime-show-message-mode + . mime-preview-quitting-method-for-mime-show-message-mode)) + "Alist of major-mode vs. quitting-method of mime-view.") + +(defvar mime-preview-over-to-previous-method-alist nil + "Alist of major-mode vs. over-to-previous-method of mime-view.") + +(defvar mime-preview-over-to-next-method-alist nil + "Alist of major-mode vs. over-to-next-method of mime-view.") + + +;;; @ following method +;;; + +(defvar mime-preview-following-method-alist nil + "Alist of major-mode vs. following-method of mime-view.") + +(defvar mime-view-following-required-fields-list + '("From")) + + +;;; @ buffer setup +;;; + +(defun mime-display-entity (entity &optional situation + default-situation preview-buffer) + (or preview-buffer + (setq preview-buffer (current-buffer))) + (let* (e nb ne nhb nbb) + (in-calist-package 'mime-view) + (or situation + (setq situation + (mime-find-entity-preview-situation entity default-situation))) + (let ((button-is-invisible + (eq (cdr (or (assq '*entity-button situation) + (assq 'entity-button situation))) + 'invisible)) + (header-is-visible + (eq (cdr (or (assq '*header situation) + (assq 'header situation))) + 'visible)) + (body-is-visible + (eq (cdr (or (assq '*body situation) + (assq 'body situation))) + 'visible)) + (children (mime-entity-children entity))) + (set-buffer preview-buffer) + (setq nb (point)) + (narrow-to-region nb nb) + (or button-is-invisible + ;; (if (mime-view-entity-button-visible-p entity) + (mime-view-insert-entity-button entity) + ;; ) + ) + (if header-is-visible + (let ((header-presentation-method + (or (cdr (assq 'header-presentation-method situation)) + (cdr (assq (cdr (assq 'major-mode situation)) + mime-header-presentation-method-alist))))) + (setq nhb (point)) + (if header-presentation-method + (funcall header-presentation-method entity situation) + (mime-insert-header entity + mime-view-ignored-field-list + mime-view-visible-field-list)) + (run-hooks 'mime-display-header-hook) + (put-text-property nhb (point-max) 'mime-view-entity-header entity) + (goto-char (point-max)) + (insert "\n"))) + (setq nbb (point)) + (unless children + (if body-is-visible + (let ((body-presentation-method + (cdr (assq 'body-presentation-method situation)))) + (if (functionp body-presentation-method) + (funcall body-presentation-method entity situation) + (mime-display-text/plain entity situation))) + (when button-is-invisible + (goto-char (point-max)) + (mime-view-insert-entity-button entity) + ) + (unless header-is-visible + (goto-char (point-max)) + (insert "\n")) + )) + (setq ne (point-max)) + (widen) + (put-text-property nb ne 'mime-view-entity entity) + (put-text-property nb ne 'mime-view-situation situation) + (put-text-property nbb ne 'mime-view-entity-body entity) + (goto-char ne) + (if (and children body-is-visible) + (let ((body-presentation-method + (cdr (assq 'body-presentation-method situation)))) + (if (functionp body-presentation-method) + (funcall body-presentation-method entity situation) + (mime-display-multipart/mixed entity situation)))) + ))) + + +;;; @ MIME viewer mode +;;; + +(defconst mime-view-menu-title "MIME-View") +(defconst mime-view-menu-list + '((up "Move to upper entity" mime-preview-move-to-upper) + (previous "Move to previous entity" mime-preview-move-to-previous) + (next "Move to next entity" mime-preview-move-to-next) + (scroll-down "Scroll-down" mime-preview-scroll-down-entity) + (scroll-up "Scroll-up" mime-preview-scroll-up-entity) + (play "Play current entity" mime-preview-play-current-entity) + (extract "Extract current entity" mime-preview-extract-current-entity) + (print "Print current entity" mime-preview-print-current-entity) + ) + "Menu for MIME Viewer") + +(cond ((featurep 'xemacs) + (defvar mime-view-xemacs-popup-menu + (cons mime-view-menu-title + (mapcar (function + (lambda (item) + (vector (nth 1 item)(nth 2 item) t) + )) + mime-view-menu-list))) + (defun mime-view-xemacs-popup-menu (event) + "Popup the menu in the MIME Viewer buffer" + (interactive "e") + (select-window (event-window event)) + (set-buffer (event-buffer event)) + (popup-menu 'mime-view-xemacs-popup-menu)) + (defvar mouse-button-2 'button2) + (defvar mouse-button-3 'button3) + ) + (t + (defvar mime-view-popup-menu + (let ((menu (make-sparse-keymap mime-view-menu-title))) + (nconc menu + (mapcar (function + (lambda (item) + (list (intern (nth 1 item)) 'menu-item + (nth 1 item)(nth 2 item)) + )) + mime-view-menu-list)))) + (defun mime-view-popup-menu (event) + "Popup the menu in the MIME Viewer buffer" + (interactive "@e") + (let ((menu mime-view-popup-menu) events func) + (setq events (x-popup-menu t menu)) + (and events + (setq func (lookup-key menu (apply #'vector events))) + (commandp func) + (funcall func)))) + (defvar mouse-button-2 [mouse-2]) + (defvar mouse-button-3 [mouse-3]) + )) + +(defun mime-view-define-keymap (&optional default) + (let ((mime-view-mode-map (if (keymapp default) + (copy-keymap default) + (make-sparse-keymap)))) + (define-key mime-view-mode-map + "u" (function mime-preview-move-to-upper)) + (define-key mime-view-mode-map + "p" (function mime-preview-move-to-previous)) + (define-key mime-view-mode-map + "n" (function mime-preview-move-to-next)) + (define-key mime-view-mode-map + "\e\t" (function mime-preview-move-to-previous)) + (define-key mime-view-mode-map + "\t" (function mime-preview-move-to-next)) + (define-key mime-view-mode-map + " " (function mime-preview-scroll-up-entity)) + (define-key mime-view-mode-map + "\M- " (function mime-preview-scroll-down-entity)) + (define-key mime-view-mode-map + "\177" (function mime-preview-scroll-down-entity)) + (define-key mime-view-mode-map + "\C-m" (function mime-preview-next-line-entity)) + (define-key mime-view-mode-map + "\C-\M-m" (function mime-preview-previous-line-entity)) + (define-key mime-view-mode-map + "v" (function mime-preview-play-current-entity)) + (define-key mime-view-mode-map + "e" (function mime-preview-extract-current-entity)) + (define-key mime-view-mode-map + "\C-c\C-p" (function mime-preview-print-current-entity)) + + (define-key mime-view-mode-map + "\C-c\C-t\C-f" (function mime-preview-toggle-header)) + (define-key mime-view-mode-map + "\C-c\C-th" (function mime-preview-toggle-header)) + (define-key mime-view-mode-map + "\C-c\C-t\C-c" (function mime-preview-toggle-content)) + + (define-key mime-view-mode-map + "\C-c\C-v\C-f" (function mime-preview-show-header)) + (define-key mime-view-mode-map + "\C-c\C-vh" (function mime-preview-show-header)) + (define-key mime-view-mode-map + "\C-c\C-v\C-c" (function mime-preview-show-content)) + + (define-key mime-view-mode-map + "\C-c\C-d\C-f" (function mime-preview-hide-header)) + (define-key mime-view-mode-map + "\C-c\C-dh" (function mime-preview-hide-header)) + (define-key mime-view-mode-map + "\C-c\C-d\C-c" (function mime-preview-hide-content)) + + (define-key mime-view-mode-map + "a" (function mime-preview-follow-current-entity)) + (define-key mime-view-mode-map + "q" (function mime-preview-quit)) + (define-key mime-view-mode-map + "\C-c\C-x" (function mime-preview-kill-buffer)) + ;; (define-key mime-view-mode-map + ;; "<" (function beginning-of-buffer)) + ;; (define-key mime-view-mode-map + ;; ">" (function end-of-buffer)) + (define-key mime-view-mode-map + "?" (function describe-mode)) + (define-key mime-view-mode-map + [tab] (function mime-preview-move-to-next)) + (define-key mime-view-mode-map + [delete] (function mime-preview-scroll-down-entity)) + (define-key mime-view-mode-map + [backspace] (function mime-preview-scroll-down-entity)) + (if (functionp default) + (cond ((featurep 'xemacs) + (set-keymap-default-binding mime-view-mode-map default) + ) + (t + (setq mime-view-mode-map + (append mime-view-mode-map (list (cons t default)))) + ))) + (if mouse-button-2 + (define-key mime-view-mode-map + mouse-button-2 (function mime-button-dispatcher)) + ) + (cond ((featurep 'xemacs) + (define-key mime-view-mode-map + mouse-button-3 (function mime-view-xemacs-popup-menu)) + ) + ((>= emacs-major-version 19) + (define-key mime-view-mode-map + mouse-button-3 (function mime-view-popup-menu)) + (define-key mime-view-mode-map [menu-bar mime-view] + (cons mime-view-menu-title + (make-sparse-keymap mime-view-menu-title))) + (mapcar (function + (lambda (item) + (define-key mime-view-mode-map + (vector 'menu-bar 'mime-view (car item)) + (cons (nth 1 item)(nth 2 item))) + )) + (reverse mime-view-menu-list)) + )) + ;; (run-hooks 'mime-view-define-keymap-hook) + mime-view-mode-map)) + +(defvar mime-view-mode-default-map (mime-view-define-keymap)) + + +(defsubst mime-maybe-hide-echo-buffer () + "Clear mime-echo buffer and delete window for it." + (let ((buf (get-buffer mime-echo-buffer-name))) + (if buf + (save-excursion + (set-buffer buf) + (erase-buffer) + (let ((win (get-buffer-window buf))) + (if win + (delete-window win) + )) + (bury-buffer buf) + )))) + +(defvar mime-view-redisplay nil) + +;;;###autoload +(defun mime-display-message (message &optional preview-buffer + mother default-keymap-or-function + original-major-mode keymap) + "View MESSAGE in MIME-View mode. + +Optional argument PREVIEW-BUFFER specifies the buffer of the +presentation. It must be either nil or a name of preview buffer. + +Optional argument MOTHER specifies mother-buffer of the preview-buffer. + +Optional argument DEFAULT-KEYMAP-OR-FUNCTION is nil, keymap or +function. If it is a keymap, keymap of MIME-View mode will be added +to it. If it is a function, it will be bound as default binding of +keymap of MIME-View mode. + +Optional argument ORIGINAL-MAJOR-MODE is major-mode of representation +buffer of MESSAGE. If it is nil, current `major-mode' is used. + +Optional argument KEYMAP is keymap of MIME-View mode. If it is +non-nil, DEFAULT-KEYMAP-OR-FUNCTION is ignored. If it is nil, +`mime-view-mode-default-map' is used." + (mime-maybe-hide-echo-buffer) + (let ((win-conf (current-window-configuration))) + (or preview-buffer + (setq preview-buffer + (concat "*Preview-" (mime-entity-name message) "*"))) + (or original-major-mode + (setq original-major-mode major-mode)) + (let ((inhibit-read-only t)) + (set-buffer (get-buffer-create preview-buffer)) + (widen) + (erase-buffer) + (if mother + (setq mime-mother-buffer mother)) + (setq mime-preview-original-window-configuration win-conf) + (setq major-mode 'mime-view-mode) + (setq mode-name "MIME-View") + (mime-display-entity message nil + `((entity-button . invisible) + (header . visible) + (major-mode . ,original-major-mode)) + preview-buffer) + (use-local-map + (or keymap + (if default-keymap-or-function + (mime-view-define-keymap default-keymap-or-function) + mime-view-mode-default-map))) + (let ((point + (next-single-property-change (point-min) 'mime-view-entity))) + (if point + (goto-char point) + (goto-char (point-min)) + (search-forward "\n\n" nil t))) + (run-hooks 'mime-view-mode-hook) + (set-buffer-modified-p nil) + (setq buffer-read-only t) + preview-buffer))) + +;;;###autoload +(defun mime-view-buffer (&optional raw-buffer preview-buffer mother + default-keymap-or-function + representation-type) + "View RAW-BUFFER in MIME-View mode. +Optional argument PREVIEW-BUFFER is either nil or a name of preview +buffer. +Optional argument DEFAULT-KEYMAP-OR-FUNCTION is nil, keymap or +function. If it is a keymap, keymap of MIME-View mode will be added +to it. If it is a function, it will be bound as default binding of +keymap of MIME-View mode. +Optional argument REPRESENTATION-TYPE is representation-type of +message. It must be nil, `binary' or `cooked'. If it is nil, +`cooked' is used as default." + (interactive) + (or raw-buffer + (setq raw-buffer (current-buffer))) + (or representation-type + (setq representation-type + (save-excursion + (set-buffer raw-buffer) + (cdr (or (assq major-mode mime-raw-representation-type-alist) + (assq t mime-raw-representation-type-alist))) + ))) + (if (eq representation-type 'binary) + (setq representation-type 'buffer) + ) + (setq preview-buffer (mime-display-message + (mime-open-entity representation-type raw-buffer) + preview-buffer mother default-keymap-or-function)) + (or (get-buffer-window preview-buffer) + (let ((r-win (get-buffer-window raw-buffer))) + (if r-win + (set-window-buffer r-win preview-buffer) + (let ((m-win (and mother (get-buffer-window mother)))) + (if m-win + (set-window-buffer m-win preview-buffer) + (switch-to-buffer preview-buffer) + )))))) + +(defun mime-view-mode (&optional mother ctl encoding + raw-buffer preview-buffer + default-keymap-or-function) + "Major mode for viewing MIME message. + +Here is a list of the standard keys for mime-view-mode. + +key feature +--- ------- + +u Move to upper content +p or M-TAB Move to previous content +n or TAB Move to next content +SPC Scroll up or move to next content +M-SPC or DEL Scroll down or move to previous content +RET Move to next line +M-RET Move to previous line +v Decode current content as `play mode' +e Decode current content as `extract mode' +C-c C-p Decode current content as `print mode' +a Followup to current content. +q Quit +button-2 Move to point under the mouse cursor + and decode current content as `play mode' +" + (interactive) + (unless mime-view-redisplay + (save-excursion + (if raw-buffer (set-buffer raw-buffer)) + (let ((type + (cdr + (or (assq major-mode mime-raw-representation-type-alist) + (assq t mime-raw-representation-type-alist))))) + (if (eq type 'binary) + (setq type 'buffer) + ) + (setq mime-message-structure (mime-open-entity type raw-buffer)) + (or (mime-entity-content-type mime-message-structure) + (mime-entity-set-content-type mime-message-structure ctl)) + ) + (or (mime-entity-encoding mime-message-structure) + (mime-entity-set-encoding mime-message-structure encoding)) + )) + (mime-display-message mime-message-structure preview-buffer + mother default-keymap-or-function) + ) + + +;;; @@ utility +;;; + +(defun mime-preview-find-boundary-info (&optional with-children) + "Return boundary information of current part. +If WITH-CHILDREN, refer boundary surrounding current part and its branches." + (let (entity + p-beg p-end + entity-node-id len) + (while (null (setq entity + (get-text-property (point) 'mime-view-entity))) + (backward-char)) + (setq p-beg (previous-single-property-change (point) 'mime-view-entity)) + (setq entity-node-id (mime-entity-node-id entity)) + (setq len (length entity-node-id)) + (cond ((null p-beg) + (setq p-beg + (if (eq (next-single-property-change (point-min) + 'mime-view-entity) + (point)) + (point) + (point-min))) + ) + ((eq (next-single-property-change p-beg 'mime-view-entity) + (point)) + (setq p-beg (point)) + )) + (setq p-end (next-single-property-change p-beg 'mime-view-entity)) + (cond ((null p-end) + (setq p-end (point-max)) + ) + ((null entity-node-id) + (setq p-end (point-max)) + ) + (with-children + (save-excursion + (catch 'tag + (let (e i) + (while (setq e + (next-single-property-change + (point) 'mime-view-entity)) + (goto-char e) + (let ((rc (mime-entity-node-id + (get-text-property (point) + 'mime-view-entity)))) + (or (and (>= (setq i (- (length rc) len)) 0) + (equal entity-node-id (nthcdr i rc))) + (throw 'tag nil))) + (setq p-end (or (next-single-property-change + (point) 'mime-view-entity) + (point-max))))) + (setq p-end (point-max)))) + )) + (vector p-beg p-end entity))) + + +;;; @@ playing +;;; + +(autoload 'mime-preview-play-current-entity "mime-play" + "Play current entity." t) + +(defun mime-preview-extract-current-entity (&optional ignore-examples) + "Extract current entity into file (maybe). +It decodes current entity to call internal or external method as +\"extract\" mode. The method is selected from variable +`mime-acting-condition'." + (interactive "P") + (mime-preview-play-current-entity ignore-examples "extract") + ) + +(defun mime-preview-print-current-entity (&optional ignore-examples) + "Print current entity (maybe). +It decodes current entity to call internal or external method as +\"print\" mode. The method is selected from variable +`mime-acting-condition'." + (interactive "P") + (mime-preview-play-current-entity ignore-examples "print") + ) + + +;;; @@ following +;;; + +(defun mime-preview-follow-current-entity () + "Write follow message to current entity. +It calls following-method selected from variable +`mime-preview-following-method-alist'." + (interactive) + (let ((entity (mime-preview-find-boundary-info t)) + p-beg p-end + pb-beg) + (setq p-beg (aref entity 0) + p-end (aref entity 1) + entity (aref entity 2)) + (if (get-text-property p-beg 'mime-view-entity-body) + (setq pb-beg p-beg) + (setq pb-beg + (next-single-property-change + p-beg 'mime-view-entity-body nil + (or (next-single-property-change p-beg 'mime-view-entity) + p-end)))) + (let* ((mode (mime-preview-original-major-mode 'recursive)) + (entity-node-id (mime-entity-node-id entity)) + (new-name + (format "%s-%s" (buffer-name) (reverse entity-node-id))) + new-buf + (the-buf (current-buffer)) + fields) + (save-excursion + (set-buffer (setq new-buf (get-buffer-create new-name))) + (erase-buffer) + (insert ?\n) + (insert-buffer-substring the-buf pb-beg p-end) + (goto-char (point-min)) + (let ((current-entity + (if (and (eq (mime-entity-media-type entity) 'message) + (eq (mime-entity-media-subtype entity) 'rfc822)) + (car (mime-entity-children entity)) + entity))) + (while (and current-entity + (if (and (eq (mime-entity-media-type + current-entity) 'message) + (eq (mime-entity-media-subtype + current-entity) 'rfc822)) + nil + (mime-insert-header current-entity fields) + t)) + (setq fields (std11-collect-field-names) + current-entity (mime-entity-parent current-entity)) + )) + (let ((rest mime-view-following-required-fields-list) + field-name ret) + (while rest + (setq field-name (car rest)) + (or (std11-field-body field-name) + (progn + (save-excursion + (set-buffer the-buf) + (let ((entity (when mime-mother-buffer + (set-buffer mime-mother-buffer) + (get-text-property (point) + 'mime-view-entity)))) + (while (and entity + (null (setq ret (mime-entity-fetch-field + entity field-name)))) + (setq entity (mime-entity-parent entity))))) + (if ret + (insert (concat field-name ": " ret "\n")) + ))) + (setq rest (cdr rest)) + )) + ) + (let ((f (cdr (assq mode mime-preview-following-method-alist)))) + (if (functionp f) + (funcall f new-buf) + (message + "Sorry, following method for %s is not implemented yet." + mode) + )) + ))) + + +;;; @@ moving +;;; + +(defun mime-preview-move-to-upper () + "Move to upper entity. +If there is no upper entity, call function `mime-preview-quit'." + (interactive) + (let (cinfo) + (while (null (setq cinfo + (get-text-property (point) 'mime-view-entity))) + (backward-char) + ) + (let ((r (mime-entity-parent cinfo)) + point) + (catch 'tag + (while (setq point (previous-single-property-change + (point) 'mime-view-entity)) + (goto-char point) + (when (eq r (get-text-property (point) 'mime-view-entity)) + (if (or (eq mime-preview-move-scroll t) + (and mime-preview-move-scroll + (>= point + (save-excursion + (move-to-window-line -1) + (forward-line (* -1 next-screen-context-lines)) + (beginning-of-line) + (point))))) + (recenter next-screen-context-lines)) + (throw 'tag t) + ) + ) + (mime-preview-quit) + )))) + +(defun mime-preview-move-to-previous () + "Move to previous entity. +If there is no previous entity, it calls function registered in +variable `mime-preview-over-to-previous-method-alist'." + (interactive) + (while (and (not (bobp)) + (null (get-text-property (point) 'mime-view-entity))) + (backward-char) + ) + (let ((point (previous-single-property-change (point) 'mime-view-entity))) + (if (and point + (>= point (point-min))) + (if (get-text-property (1- point) 'mime-view-entity) + (progn (goto-char point) + (if + (or (eq mime-preview-move-scroll t) + (and mime-preview-move-scroll + (<= point + (save-excursion + (move-to-window-line 0) + (forward-line next-screen-context-lines) + (end-of-line) + (point))))) + (recenter (* -1 next-screen-context-lines)))) + (goto-char (1- point)) + (mime-preview-move-to-previous) + ) + (let ((f (assq (mime-preview-original-major-mode) + mime-preview-over-to-previous-method-alist))) + (if f + (funcall (cdr f)) + )) + ))) + +(defun mime-preview-move-to-next () + "Move to next entity. +If there is no previous entity, it calls function registered in +variable `mime-preview-over-to-next-method-alist'." + (interactive) + (while (and (not (eobp)) + (null (get-text-property (point) 'mime-view-entity))) + (forward-char) + ) + (let ((point (next-single-property-change (point) 'mime-view-entity))) + (if (and point + (<= point (point-max))) + (progn + (goto-char point) + (if (null (get-text-property point 'mime-view-entity)) + (mime-preview-move-to-next) + (and + (or (eq mime-preview-move-scroll t) + (and mime-preview-move-scroll + (>= point + (save-excursion + (move-to-window-line -1) + (forward-line + (* -1 next-screen-context-lines)) + (beginning-of-line) + (point))))) + (recenter next-screen-context-lines)) + )) + (let ((f (assq (mime-preview-original-major-mode) + mime-preview-over-to-next-method-alist))) + (if f + (funcall (cdr f)) + )) + ))) + +(defun mime-preview-scroll-up-entity (&optional h) + "Scroll up current entity. +If reached to (point-max), it calls function registered in variable +`mime-preview-over-to-next-method-alist'." + (interactive) + (if (eobp) + (let ((f (assq (mime-preview-original-major-mode) + mime-preview-over-to-next-method-alist))) + (if f + (funcall (cdr f)) + )) + (let ((point + (or (next-single-property-change (point) 'mime-view-entity) + (point-max))) + (bottom (window-end (selected-window)))) + (if (and (not h) + (> bottom point)) + (progn (goto-char point) + (recenter next-screen-context-lines)) + (condition-case nil + (scroll-up h) + (end-of-buffer + (goto-char (point-max))))) + ))) + +(defun mime-preview-scroll-down-entity (&optional h) + "Scroll down current entity. +If reached to (point-min), it calls function registered in variable +`mime-preview-over-to-previous-method-alist'." + (interactive) + (if (bobp) + (let ((f (assq (mime-preview-original-major-mode) + mime-preview-over-to-previous-method-alist))) + (if f + (funcall (cdr f)) + )) + (let ((point + (or (previous-single-property-change (point) 'mime-view-entity) + (point-min))) + (top (window-start (selected-window)))) + (if (and (not h) + (< top point)) + (progn (goto-char point) + (recenter (* -1 next-screen-context-lines))) + (condition-case nil + (scroll-down h) + (beginning-of-buffer + (goto-char (point-min))))) + ))) + +(defun mime-preview-next-line-entity (&optional lines) + "Scroll up one line (or prefix LINES lines). +If LINES is negative, scroll down LINES lines." + (interactive "p") + (mime-preview-scroll-up-entity (or lines 1)) + ) + +(defun mime-preview-previous-line-entity (&optional lines) + "Scrroll down one line (or prefix LINES lines). +If LINES is negative, scroll up LINES lines." + (interactive "p") + (mime-preview-scroll-down-entity (or lines 1)) + ) + + +;;; @@ display +;;; + +(defun mime-preview-toggle-display (type &optional display) + (let ((situation (mime-preview-find-boundary-info t)) + (sym (intern (concat "*" (symbol-name type)))) + entity p-beg p-end) + (setq p-beg (aref situation 0) + p-end (aref situation 1) + entity (aref situation 2) + situation (get-text-property p-beg 'mime-view-situation)) + (cond ((eq display 'invisible) + (setq display nil)) + (display) + (t + (setq display + (eq (cdr (or (assq sym situation) + (assq type situation))) + 'invisible)))) + (setq situation (put-alist sym (if display + 'visible + 'invisible) + situation)) + (save-excursion + (let ((inhibit-read-only t)) + (delete-region p-beg p-end) + (mime-display-entity entity situation))) + (let ((ret (assoc situation mime-preview-situation-example-list))) + (if ret + (setcdr ret (1+ (cdr ret))) + (add-to-list 'mime-preview-situation-example-list + (cons situation 0)))))) + +(defun mime-preview-toggle-header (&optional force-visible) + (interactive "P") + (mime-preview-toggle-display 'header force-visible)) + +(defun mime-preview-toggle-content (&optional force-visible) + (interactive "P") + (mime-preview-toggle-display 'body force-visible)) + +(defun mime-preview-show-header () + (interactive) + (mime-preview-toggle-display 'header 'visible)) + +(defun mime-preview-show-content () + (interactive) + (mime-preview-toggle-display 'body 'visible)) + +(defun mime-preview-hide-header () + (interactive) + (mime-preview-toggle-display 'header 'invisible)) + +(defun mime-preview-hide-content () + (interactive) + (mime-preview-toggle-display 'body 'invisible)) + + +;;; @@ quitting +;;; + +(defun mime-preview-quit () + "Quit from MIME-preview buffer. +It calls function registered in variable +`mime-preview-quitting-method-alist'." + (interactive) + (let ((r (assq (mime-preview-original-major-mode) + mime-preview-quitting-method-alist))) + (if r + (funcall (cdr r)) + ))) + +(defun mime-preview-kill-buffer () + (interactive) + (kill-buffer (current-buffer)) + ) + + +;;; @ end +;;; + +(provide 'mime-view) + +(eval-when-compile + (setq mime-situation-examples-file nil) + ;; to avoid to read situation-examples-file at compile time. + ) + +(mime-view-read-situation-examples-file) + +;;; mime-view.el ends here diff --git a/semi-1.14.6/mime-w3.el b/semi-1.14.6/mime-w3.el new file mode 100644 index 0000000..32558c0 --- /dev/null +++ b/semi-1.14.6/mime-w3.el @@ -0,0 +1,93 @@ +;;; mime-w3.el --- mime-view content filter for text + +;; Copyright (C) 1994,95,96,97,98,99,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko <tomo@m17n.org> +;; Keywords: HTML, MIME, multimedia, mail, news + +;; This file is part of SEMI (Suite of Emacs MIME Interfaces). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Code: + +(condition-case nil + (require 'w3) + (error nil)) +(require 'mime) + +(defmacro mime-put-keymap-region (start end keymap) + `(put-text-property ,start ,end + ',(if (featurep 'xemacs) + 'keymap + 'local-map) + ,keymap)) + +(defmacro mime-save-background-color (&rest body) + (if (featurep 'xemacs) + `(let ((color (color-name (face-background 'default)))) + (prog1 + (progn ,@body) + (font-set-face-background 'default color (current-buffer)) + )) + (cons 'progn body))) + +(defvar mime-w3-message-structure nil) + +(defun mime-preview-text/html (entity situation) + (setq mime-w3-message-structure (mime-find-root-entity entity)) + (goto-char (point-max)) + (let ((p (point))) + (insert "\n") + (goto-char p) + (mime-save-background-color + (save-restriction + (narrow-to-region p p) + (mime-insert-text-content entity) + (run-hooks 'mime-text-decode-hook) + (condition-case err + (w3-region p (point-max)) + (error (message "%s" err))) + (mime-put-keymap-region p (point-max) w3-mode-map) + )))) + +(defun url-cid (url &optional proxy-info) + (let ((entity + (mime-find-entity-from-content-id (mime-uri-parse-cid url) + mime-w3-message-structure)) + buffer) + (when entity + (setq buffer (generate-new-buffer (format " *cid %s" url))) + (save-excursion + (set-buffer buffer) + (mime-insert-entity-content entity) + (if (boundp 'url-current-mime-type) + (setq url-current-mime-type (mime-entity-type/subtype entity))))) + buffer)) + +(if (fboundp 'url-register-protocol) + (url-register-protocol "cid" + 'url-cid + 'url-identity-expander) + (provide 'url-cid)) + + +;;; @ end +;;; + +(provide 'mime-w3) + +;;; mime-w3.el ends here diff --git a/semi-1.14.6/pgg-def.el b/semi-1.14.6/pgg-def.el new file mode 100644 index 0000000..a32dd24 --- /dev/null +++ b/semi-1.14.6/pgg-def.el @@ -0,0 +1,81 @@ +;;; pgg-def.el --- functions/macros for defining PGG functions + +;; Copyright (C) 1999 Free Software Foundation, Inc. + +;; Author: Daiki Ueno <ueno@unixuser.org> +;; Created: 1999/11/02 +;; Keywords: PGP, OpenPGP, GnuPG + +;; This file is part of SEMI (Secure Emacs MIME Interface). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Code: + +(require 'custom) + +(defgroup pgg () + "Glue for the various PGP implementations." + :group 'mime) + +(defcustom pgg-default-scheme 'gpg + "Default PGP scheme." + :group 'pgg + :type '(choice (const :tag "GnuPG" gpg) + (const :tag "PGP 5" pgp5) + (const :tag "PGP" pgp))) + +(defcustom pgg-default-user-id (user-login-name) + "User ID of your default identity." + :group 'pgg + :type 'string) + +(defcustom pgg-default-keyserver-address "wwwkeys.pgp.net" + "Host name of keyserver." + :group 'pgg + :type 'string) + +(defcustom pgg-encrypt-for-me nil + "If t, encrypt all outgoing messages with user's public key." + :group 'pgg + :type 'boolean) + +(defcustom pgg-cache-passphrase t + "If t, cache passphrase." + :group 'pgg + :type 'boolean) + +(defvar pgg-messages-coding-system nil + "Coding system used when reading from a PGP external process.") + +(defvar pgg-messages-locale nil + "Locale set before running a PGP external process.") + +(defvar pgg-status-buffer " *PGG status*") +(defvar pgg-errors-buffer " *PGG errors*") +(defvar pgg-output-buffer " *PGG output*") + +(defvar pgg-echo-buffer "*PGG-echo*") + +(defvar pgg-scheme nil + "Current scheme of PGP implementation.") + +(defmacro pgg-truncate-key-identifier (key) + `(if (> (length ,key) 8) (substring ,key 8) ,key)) + +(provide 'pgg-def) + +;;; pgg-def.el ends here diff --git a/semi-1.14.6/pgg-gpg.el b/semi-1.14.6/pgg-gpg.el new file mode 100644 index 0000000..886a6dc --- /dev/null +++ b/semi-1.14.6/pgg-gpg.el @@ -0,0 +1,256 @@ +;;; pgg-gpg.el --- GnuPG support for PGG. + +;; Copyright (C) 1999,2000 Free Software Foundation, Inc. + +;; Author: Daiki Ueno <ueno@unixuser.org> +;; Created: 1999/10/28 +;; Keywords: PGP, OpenPGP, GnuPG + +;; This file is part of SEMI (Secure Emacs MIME Interface). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Code: + +(require 'mel) ; binary-to-text-funcall +(eval-when-compile (require 'pgg)) + +(defgroup pgg-gpg () + "GnuPG interface" + :group 'pgg) + +(defcustom pgg-gpg-program "gpg" + "The GnuPG executable." + :group 'pgg-gpg + :type 'string) + +(defcustom pgg-gpg-extra-args nil + "Extra arguments for every GnuPG invocation." + :group 'pgg-gpg + :type 'string) + +(eval-and-compile + (luna-define-class pgg-scheme-gpg (pgg-scheme))) + +(defvar pgg-gpg-user-id nil + "GnuPG ID of your default identity.") + +(defvar pgg-gpg-messages-coding-system pgg-messages-coding-system + "Coding system used when reading from a GnuPG external process.") + +(defvar pgg-gpg-messages-locale pgg-messages-locale + "Locale set before running a GnuPG external process.") + +(defvar pgg-scheme-gpg-instance nil) + +;;;###autoload +(defun pgg-make-scheme-gpg () + (or pgg-scheme-gpg-instance + (setq pgg-scheme-gpg-instance + (luna-make-entity 'pgg-scheme-gpg)))) + +(defun pgg-gpg-process-region (start end passphrase program args) + (let* ((output-file-name (make-temp-file + (expand-file-name "pgg-output" + temporary-file-directory))) + (args + `("--status-fd" "2" + ,@(if passphrase '("--passphrase-fd" "0")) + "--yes" ; overwrite + "--output" ,output-file-name + ,@pgg-gpg-extra-args ,@args)) + (output-buffer pgg-output-buffer) + (errors-buffer pgg-errors-buffer) + (process-connection-type nil) + (process-environment process-environment) + process status exit-status) + (when pgg-gpg-messages-locale + (setq process-environment (copy-sequence process-environment)) + (setenv "LC_ALL" pgg-gpg-messages-locale) + (setenv "LANGUAGE" pgg-gpg-messages-locale)) + (with-current-buffer (get-buffer-create errors-buffer) + (buffer-disable-undo) + (erase-buffer)) + (unwind-protect + (progn + (setq process + (apply #'binary-to-text-funcall + pgg-gpg-messages-coding-system + #'start-process "*GnuPG*" errors-buffer + program args)) + (set-process-sentinel process #'ignore) + (when passphrase + (process-send-string process (concat passphrase "\n"))) + (process-send-region process start end) + (process-send-eof process) + (while (eq 'run (process-status process)) + (accept-process-output process 5)) + (setq status (process-status process) + exit-status (process-exit-status process)) + (delete-process process) + (with-current-buffer (get-buffer-create output-buffer) + (buffer-disable-undo) + (erase-buffer) + (if (file-exists-p output-file-name) + (let ((coding-system-for-read 'raw-text-dos)) + (insert-file-contents output-file-name))) + (set-buffer errors-buffer) + (if (memq status '(stop signal)) + (error "%s exited abnormally: '%s'" program exit-status)) + (if (= 127 exit-status) + (error "%s could not be found" program)))) + (if (and process (eq 'run (process-status process))) + (interrupt-process process)) + (if (file-exists-p output-file-name) + (delete-file output-file-name))))) + +(defun pgg-gpg-possibly-cache-passphrase (passphrase) + (if (and pgg-cache-passphrase + (progn + (goto-char (point-min)) + (re-search-forward "^\\[GNUPG:] GOOD_PASSPHRASE\\>" nil t))) + (pgg-add-passphrase-cache + (progn + (goto-char (point-min)) + (if (re-search-forward + "^\\[GNUPG:] NEED_PASSPHRASE \\w+ ?\\w*" nil t) + (substring (match-string 0) -8))) + passphrase))) + +(luna-define-method pgg-scheme-lookup-key ((scheme pgg-scheme-gpg) + string &optional type) + (let ((args (list "--with-colons" "--no-greeting" "--batch" + (if type "--list-secret-keys" "--list-keys") + string))) + (with-temp-buffer + (apply #'call-process pgg-gpg-program nil t nil args) + (goto-char (point-min)) + (if (re-search-forward "^\\(sec\\|pub\\):" nil t) + (substring + (nth 3 (split-string + (buffer-substring (match-end 0) + (progn (end-of-line)(point))) + ":")) 8))))) + +(luna-define-method pgg-scheme-encrypt-region ((scheme pgg-scheme-gpg) + start end recipients) + (let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id)) + (args + `("--batch" "--armor" "--always-trust" "--encrypt" + ,@(if recipients + (apply #'nconc + (mapcar (lambda (rcpt) + (list "--remote-user" rcpt)) + (append recipients + (if pgg-encrypt-for-me + (list pgg-gpg-user-id))))))))) + (pgg-as-lbt start end 'CRLF + (pgg-gpg-process-region start end nil pgg-gpg-program args)) + (pgg-process-when-success))) + +(luna-define-method pgg-scheme-decrypt-region ((scheme pgg-scheme-gpg) + start end) + (let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id)) + (passphrase + (pgg-read-passphrase + (format "GnuPG passphrase for %s: " pgg-gpg-user-id) + (pgg-scheme-lookup-key scheme pgg-gpg-user-id 'encrypt))) + (args '("--batch" "--decrypt"))) + (pgg-gpg-process-region start end passphrase pgg-gpg-program args) + (with-current-buffer pgg-errors-buffer + (pgg-gpg-possibly-cache-passphrase passphrase) + (goto-char (point-min)) + (re-search-forward "^\\[GNUPG:] DECRYPTION_OKAY\\>" nil t)))) + +(luna-define-method pgg-scheme-sign-region ((scheme pgg-scheme-gpg) + start end &optional cleartext) + (let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id)) + (passphrase + (pgg-read-passphrase + (format "GnuPG passphrase for %s: " pgg-gpg-user-id) + (pgg-scheme-lookup-key scheme pgg-gpg-user-id 'sign))) + (args + (list (if cleartext "--clearsign" "--detach-sign") + "--armor" "--batch" "--verbose" + "--local-user" pgg-gpg-user-id)) + (inhibit-read-only t) + buffer-read-only) + (pgg-as-lbt start end 'CRLF + (pgg-gpg-process-region start end passphrase pgg-gpg-program args)) + (with-current-buffer pgg-errors-buffer + (pgg-gpg-possibly-cache-passphrase passphrase)) + (pgg-process-when-success))) + +(luna-define-method pgg-scheme-verify-region ((scheme pgg-scheme-gpg) + start end &optional signature) + (let ((args '("--batch" "--verify"))) + (when (stringp signature) + (setq args (append args (list signature)))) + (setq args (append args '("-"))) + (pgg-gpg-process-region start end nil pgg-gpg-program args) + (with-current-buffer pgg-errors-buffer + (goto-char (point-min)) + (while (re-search-forward "^gpg: " nil t) + (replace-match "")) + (goto-char (point-min)) + (prog1 (re-search-forward "^\\[GNUPG:] GOODSIG\\>" nil t) + (goto-char (point-min)) + (delete-matching-lines "^\\[GNUPG:] ") + ;; XXX: copy contents of pgg-errors-buffer into + ;; pgg-output-buffer for backward compatibility. + (with-current-buffer pgg-output-buffer + (set-buffer-multibyte t) + (insert-buffer-substring pgg-errors-buffer)))))) + +(luna-define-method pgg-scheme-insert-key ((scheme pgg-scheme-gpg)) + (let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id)) + (args (list "--batch" "--export" "--armor" + pgg-gpg-user-id))) + (pgg-gpg-process-region (point)(point) nil pgg-gpg-program args) + (insert-buffer-substring pgg-output-buffer))) + +(luna-define-method pgg-scheme-snarf-keys-region ((scheme pgg-scheme-gpg) + start end) + (let ((args '("--import" "--batch" "-")) status) + (pgg-gpg-process-region start end nil pgg-gpg-program args) + (set-buffer pgg-errors-buffer) + (goto-char (point-min)) + (when (re-search-forward "^\\[GNUPG:] IMPORT_RES\\>" nil t) + (setq status (buffer-substring (match-end 0) + (progn (end-of-line)(point))) + status (vconcat (mapcar #'string-to-int (split-string status)))) + (erase-buffer) + (insert (format "Imported %d key(s). +\tArmor contains %d key(s) [%d bad, %d old].\n" + (+ (aref status 2) + (aref status 10)) + (aref status 0) + (aref status 1) + (+ (aref status 4) + (aref status 11))) + (if (zerop (aref status 9)) + "" + "\tSecret keys are imported.\n")) + ;; XXX: copy contents of pgg-errors-buffer into + ;; pgg-output-buffer for backward compatibility. + (with-current-buffer pgg-output-buffer + (set-buffer-multibyte t) + (insert-buffer-substring pgg-errors-buffer)) + t))) + +(provide 'pgg-gpg) + +;;; pgg-gpg.el ends here diff --git a/semi-1.14.6/pgg-parse.el b/semi-1.14.6/pgg-parse.el new file mode 100644 index 0000000..f3aec73 --- /dev/null +++ b/semi-1.14.6/pgg-parse.el @@ -0,0 +1,500 @@ +;;; pgg-parse.el --- OpenPGP packet parsing + +;; Copyright (C) 1999 Daiki Ueno + +;; Author: Daiki Ueno <ueno@ueda.info.waseda.ac.jp> +;; Created: 1999/10/28 +;; Keywords: PGP, OpenPGP, GnuPG + +;; This file is part of SEMI (Secure Emacs MIME Interface). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; This module is based on + +;; [OpenPGP] RFC 2440: "OpenPGP Message Format" +;; by John W. Noerenberg, II <jwn2@qualcomm.com>, +;; Jon Callas <jon@pgp.com>, Lutz Donnerhacke <lutz@iks-jena.de>, +;; Hal Finney <hal@pgp.com> and Rodney Thayer <rodney@unitran.com> +;; (1998/11) + +;;; Code: + +(eval-when-compile (require 'cl)) + +(eval-when-compile (require 'static)) + +(require 'pccl) +(require 'custom) +(require 'mel) + +(defgroup pgg-parse () + "OpenPGP packet parsing" + :group 'pgg) + +(defcustom pgg-parse-public-key-algorithm-alist + '((1 . RSA) (2 . RSA-E) (3 . RSA-S) (16 . ELG-E) (17 . DSA) (20 . ELG)) + "Alist of the assigned number to the public key algorithm." + :group 'pgg-parse + :type 'alist) + +(defcustom pgg-parse-symmetric-key-algorithm-alist + '((1 . IDEA) (2 . 3DES) (4 . CAST5) (5 . SAFER-SK128)) + "Alist of the assigned number to the simmetric key algorithm." + :group 'pgg-parse + :type 'alist) + +(defcustom pgg-parse-hash-algorithm-alist + '((1 . MD5) (2 . SHA1) (3 . RIPEMD160) (5 . MD2)) + "Alist of the assigned number to the cryptographic hash algorithm." + :group 'pgg-parse + :type 'alist) + +(defcustom pgg-parse-compression-algorithm-alist + '((0 . nil); Uncompressed + (1 . ZIP) + (2 . ZLIB)) + "Alist of the assigned number to the compression algorithm." + :group 'pgg-parse + :type 'alist) + +(defcustom pgg-parse-signature-type-alist + '((0 . "Signature of a binary document") + (1 . "Signature of a canonical text document") + (2 . "Standalone signature") + (16 . "Generic certification of a User ID and Public Key packet") + (17 . "Persona certification of a User ID and Public Key packet") + (18 . "Casual certification of a User ID and Public Key packet") + (19 . "Positive certification of a User ID and Public Key packet") + (24 . "Subkey Binding Signature") + (31 . "Signature directly on a key") + (32 . "Key revocation signature") + (40 . "Subkey revocation signature") + (48 . "Certification revocation signature") + (64 . "Timestamp signature.")) + "Alist of the assigned number to the signature type." + :group 'pgg-parse + :type 'alist) + +(defcustom pgg-ignore-packet-checksum t; XXX + "If non-nil checksum of each ascii armored packet will be ignored." + :group 'pgg-parse + :type 'boolean) + +(defvar pgg-armor-header-lines + '("^-----BEGIN PGP MESSAGE\\(, PART [0-9]+\\(/[0-9]+\\)?\\)?-----\r?$" + "^-----BEGIN PGP PUBLIC KEY BLOCK-----\r?$" + "^-----BEGIN PGP PRIVATE KEY BLOCK-----\r?$" + "^-----BEGIN PGP SIGNATURE-----\r?$") + "Armor headers.") + +(defmacro pgg-format-key-identifier (string) + `(mapconcat (lambda (c) (format "%02X" (char-int c))) + ,string "") + ;; `(upcase (apply #'format "%02x%02x%02x%02x%02x%02x%02x%02x" + ;; (string-to-int-list ,string))) + ) + +(defmacro pgg-parse-time-field (bytes) + `(list (logior (lsh (car ,bytes) 8) + (nth 1 ,bytes)) + (logior (lsh (nth 2 ,bytes) 8) + (nth 3 ,bytes)) + 0)) + +(defmacro pgg-byte-after (&optional pos) + `(char-int (char-after ,(or pos `(point))))) + +(defmacro pgg-read-byte () + `(char-int (char-after (prog1 (point) (forward-char))))) + +(defmacro pgg-read-bytes-string (nbytes) + `(buffer-substring + (point) (prog1 (+ ,nbytes (point)) + (forward-char ,nbytes)))) + +(defmacro pgg-read-bytes (nbytes) + `(mapcar #'char-int (pgg-read-bytes-string ,nbytes)) + ;; `(string-to-int-list (pgg-read-bytes-string ,nbytes)) + ) + +(defmacro pgg-read-body-string (ptag) + `(if (nth 1 ,ptag) + (pgg-read-bytes-string (nth 1 ,ptag)) + (pgg-read-bytes-string (- (point-max) (point))))) + +(defmacro pgg-read-body (ptag) + `(mapcar #'char-int (pgg-read-body-string ,ptag)) + ;; `(string-to-int-list (pgg-read-body-string ,ptag)) + ) + +(defalias 'pgg-skip-bytes 'forward-char) + +(defmacro pgg-skip-header (ptag) + `(pgg-skip-bytes (nth 2 ,ptag))) + +(defmacro pgg-skip-body (ptag) + `(pgg-skip-bytes (nth 1 ,ptag))) + +(defmacro pgg-set-alist (alist key value) + `(setq ,alist (nconc ,alist (list (cons ,key ,value))))) + +(unless-broken ccl-usable + (define-ccl-program pgg-parse-crc24 + '(1 + ((loop + (read r0) (r1 ^= r0) (r2 ^= 0) + (r5 = 0) + (loop + (r1 <<= 1) + (r1 += ((r2 >> 15) & 1)) + (r2 <<= 1) + (if (r1 & 256) + ((r1 ^= 390) (r2 ^= 19707))) + (if (r5 < 7) + ((r5 += 1) + (repeat)))) + (repeat))))) + + (defun pgg-parse-crc24-string (string) + (let ((h (vector nil 183 1230 nil nil nil nil nil nil))) + (ccl-execute-on-string pgg-parse-crc24 h string) + (format "%c%c%c" + (logand (aref h 1) 255) + (logand (lsh (aref h 2) -8) 255) + (logand (aref h 2) 255))))) + +(defmacro pgg-parse-length-type (c) + `(cond + ((< ,c 192) (cons ,c 1)) + ((< ,c 224) + (cons (+ (lsh (- ,c 192) 8) + (pgg-byte-after (+ 2 (point))) + 192) + 2)) + ((= ,c 255) + (cons (cons (logior (lsh (pgg-byte-after (+ 2 (point))) 8) + (pgg-byte-after (+ 3 (point)))) + (logior (lsh (pgg-byte-after (+ 4 (point))) 8) + (pgg-byte-after (+ 5 (point))))) + 5)) + (t;partial body length + '(0 . 0)))) + +(defun pgg-parse-packet-header () + (let ((ptag (pgg-byte-after)) + length-type content-tag packet-bytes header-bytes) + (if (zerop (logand 64 ptag));Old format + (progn + (setq length-type (logand ptag 3) + length-type (if (= 3 length-type) 0 (lsh 1 length-type)) + content-tag (logand 15 (lsh ptag -2)) + packet-bytes 0 + header-bytes (1+ length-type)) + (dotimes (i length-type) + (setq packet-bytes + (logior (lsh packet-bytes 8) + (pgg-byte-after (+ 1 i (point))))))) + (setq content-tag (logand 63 ptag) + length-type (pgg-parse-length-type + (pgg-byte-after (1+ (point)))) + packet-bytes (car length-type) + header-bytes (1+ (cdr length-type)))) + (list content-tag packet-bytes header-bytes))) + +(defun pgg-parse-packet (ptag) + (case (car ptag) + (1 ;Public-Key Encrypted Session Key Packet + (pgg-parse-public-key-encrypted-session-key-packet ptag)) + (2 ;Signature Packet + (pgg-parse-signature-packet ptag)) + (3 ;Symmetric-Key Encrypted Session Key Packet + (pgg-parse-symmetric-key-encrypted-session-key-packet ptag)) + ;; 4 -- One-Pass Signature Packet + ;; 5 -- Secret Key Packet + (6 ;Public Key Packet + (pgg-parse-public-key-packet ptag)) + ;; 7 -- Secret Subkey Packet + ;; 8 -- Compressed Data Packet + (9 ;Symmetrically Encrypted Data Packet + (pgg-read-body-string ptag)) + (10 ;Marker Packet + (pgg-read-body-string ptag)) + (11 ;Literal Data Packet + (pgg-read-body-string ptag)) + ;; 12 -- Trust Packet + (13 ;User ID Packet + (pgg-read-body-string ptag)) + ;; 14 -- Public Subkey Packet + ;; 60 .. 63 -- Private or Experimental Values + )) + +(defun pgg-parse-packets (&optional header-parser body-parser) + (let ((header-parser + (or header-parser + (function pgg-parse-packet-header))) + (body-parser + (or body-parser + (function pgg-parse-packet))) + result ptag) + (while (> (point-max) (1+ (point))) + (setq ptag (funcall header-parser)) + (pgg-skip-header ptag) + (push (cons (car ptag) + (save-excursion + (funcall body-parser ptag))) + result) + (if (zerop (nth 1 ptag)) + (goto-char (point-max)) + (forward-char (nth 1 ptag)))) + result)) + +(defun pgg-parse-signature-subpacket-header () + (let ((length-type (pgg-parse-length-type (pgg-byte-after)))) + (list (pgg-byte-after (+ (cdr length-type) (point))) + (1- (car length-type)) + (1+ (cdr length-type))))) + +(defun pgg-parse-signature-subpacket (ptag) + (case (car ptag) + (2 ;signature creation time + (cons 'creation-time + (let ((bytes (pgg-read-bytes 4))) + (pgg-parse-time-field bytes)))) + (3 ;signature expiration time + (cons 'signature-expiry + (let ((bytes (pgg-read-bytes 4))) + (pgg-parse-time-field bytes)))) + (4 ;exportable certification + (cons 'exportability (pgg-read-byte))) + (5 ;trust signature + (cons 'trust-level (pgg-read-byte))) + (6 ;regular expression + (cons 'regular-expression + (pgg-read-body-string ptag))) + (7 ;revocable + (cons 'revocability (pgg-read-byte))) + (9 ;key expiration time + (cons 'key-expiry + (let ((bytes (pgg-read-bytes 4))) + (pgg-parse-time-field bytes)))) + ;; 10 = placeholder for backward compatibility + (11 ;preferred symmetric algorithms + (cons 'preferred-symmetric-key-algorithm + (cdr (assq (pgg-read-byte) + pgg-parse-symmetric-key-algorithm-alist)))) + (12 ;revocation key + ) + (16 ;issuer key ID + (cons 'key-identifier + (pgg-format-key-identifier (pgg-read-body-string ptag)))) + (20 ;notation data + (pgg-skip-bytes 4) + (cons 'notation + (let ((name-bytes (pgg-read-bytes 2)) + (value-bytes (pgg-read-bytes 2))) + (cons (pgg-read-bytes-string + (logior (lsh (car name-bytes) 8) + (nth 1 name-bytes))) + (pgg-read-bytes-string + (logior (lsh (car value-bytes) 8) + (nth 1 value-bytes))))))) + (21 ;preferred hash algorithms + (cons 'preferred-hash-algorithm + (cdr (assq (pgg-read-byte) + pgg-parse-hash-algorithm-alist)))) + (22 ;preferred compression algorithms + (cons 'preferred-compression-algorithm + (cdr (assq (pgg-read-byte) + pgg-parse-compression-algorithm-alist)))) + (23 ;key server preferences + (cons 'key-server-preferences + (pgg-read-body ptag))) + (24 ;preferred key server + (cons 'preferred-key-server + (pgg-read-body-string ptag))) + ;; 25 = primary user id + (26 ;policy URL + (cons 'policy-url (pgg-read-body-string ptag))) + ;; 27 = key flags + ;; 28 = signer's user id + ;; 29 = reason for revocation + ;; 100 to 110 = internal or user-defined + )) + +(defun pgg-parse-signature-packet (ptag) + (let* ((signature-version (pgg-byte-after)) + (result (list (cons 'version signature-version))) + hashed-material field n) + (cond + ((= signature-version 3) + (pgg-skip-bytes 2) + (setq hashed-material (pgg-read-bytes 5)) + (pgg-set-alist result + 'signature-type + (cdr (assq (pop hashed-material) + pgg-parse-signature-type-alist))) + (pgg-set-alist result + 'creation-time + (pgg-parse-time-field hashed-material)) + (pgg-set-alist result + 'key-identifier + (pgg-format-key-identifier + (pgg-read-bytes-string 8))) + (pgg-set-alist result + 'public-key-algorithm (pgg-read-byte)) + (pgg-set-alist result + 'hash-algorithm (pgg-read-byte))) + ((= signature-version 4) + (pgg-skip-bytes 1) + (pgg-set-alist result + 'signature-type + (cdr (assq (pgg-read-byte) + pgg-parse-signature-type-alist))) + (pgg-set-alist result + 'public-key-algorithm + (pgg-read-byte)) + (pgg-set-alist result + 'hash-algorithm (pgg-read-byte)) + (when (>= 10000 (setq n (pgg-read-bytes 2) + n (logior (lsh (car n) 8) + (nth 1 n)))) + (save-restriction + (narrow-to-region (point)(+ n (point))) + (nconc result + (mapcar (function cdr) ;remove packet types + (pgg-parse-packets + #'pgg-parse-signature-subpacket-header + #'pgg-parse-signature-subpacket))) + (goto-char (point-max)))) + (when (>= 10000 (setq n (pgg-read-bytes 2) + n (logior (lsh (car n) 8) + (nth 1 n)))) + (save-restriction + (narrow-to-region (point)(+ n (point))) + (nconc result + (mapcar (function cdr) ;remove packet types + (pgg-parse-packets + #'pgg-parse-signature-subpacket-header + #'pgg-parse-signature-subpacket))))))) + + (setcdr (setq field (assq 'public-key-algorithm + result)) + (cdr (assq (cdr field) + pgg-parse-public-key-algorithm-alist))) + (setcdr (setq field (assq 'hash-algorithm + result)) + (cdr (assq (cdr field) + pgg-parse-hash-algorithm-alist))) + result)) + +(defun pgg-parse-public-key-encrypted-session-key-packet (ptag) + (let (result) + (pgg-set-alist result + 'version (pgg-read-byte)) + (pgg-set-alist result + 'key-identifier + (pgg-format-key-identifier + (pgg-read-bytes-string 8))) + (pgg-set-alist result + 'public-key-algorithm + (cdr (assq (pgg-read-byte) + pgg-parse-public-key-algorithm-alist))) + result)) + +(defun pgg-parse-symmetric-key-encrypted-session-key-packet (ptag) + (let (result) + (pgg-set-alist result + 'version + (pgg-read-byte)) + (pgg-set-alist result + 'symmetric-key-algorithm + (cdr (assq (pgg-read-byte) + pgg-parse-symmetric-key-algorithm-alist))) + result)) + +(defun pgg-parse-public-key-packet (ptag) + (let* ((key-version (pgg-read-byte)) + (result (list (cons 'version key-version))) + field) + (cond + ((= 3 key-version) + (pgg-set-alist result + 'creation-time + (let ((bytes (pgg-read-bytes 4))) + (pgg-parse-time-field bytes))) + (pgg-set-alist result + 'key-expiry (pgg-read-bytes 2)) + (pgg-set-alist result + 'public-key-algorithm (pgg-read-byte))) + ((= 4 key-version) + (pgg-set-alist result + 'creation-time + (let ((bytes (pgg-read-bytes 4))) + (pgg-parse-time-field bytes))) + (pgg-set-alist result + 'public-key-algorithm (pgg-read-byte)))) + + (setcdr (setq field (assq 'public-key-algorithm + result)) + (cdr (assq (cdr field) + pgg-parse-public-key-algorithm-alist))) + result)) + +(defun pgg-decode-packets () + (let* ((marker + (set-marker (make-marker) + (and (re-search-forward "^=") + (match-beginning 0)))) + (checksum (buffer-substring (point) (+ 4 (point))))) + (delete-region marker (point-max)) + (mime-decode-region (point-min) marker "base64") + (static-when (fboundp 'pgg-parse-crc24-string ) + (or pgg-ignore-packet-checksum + (string-equal + (funcall (mel-find-function 'mime-encode-string "base64") + (pgg-parse-crc24-string + (buffer-substring (point-min)(point-max)))) + checksum) + (error "PGP packet checksum does not match"))))) + +(defun pgg-decode-armor-region (start end) + (save-restriction + (narrow-to-region start end) + (goto-char (point-min)) + (re-search-forward "^-+BEGIN PGP" nil t) + (delete-region (point-min) + (and (search-forward "\n\n") + (match-end 0))) + (pgg-decode-packets) + (goto-char (point-min)) + (pgg-parse-packets))) + +(defun pgg-parse-armor (string) + (with-temp-buffer + (buffer-disable-undo) + (set-buffer-multibyte nil) + (insert string) + (pgg-decode-armor-region (point-min)(point)))) + +(defun pgg-parse-armor-region (start end) + (pgg-parse-armor (string-as-unibyte (buffer-substring start end)))) + +(provide 'pgg-parse) + +;;; pgg-parse.el ends here diff --git a/semi-1.14.6/pgg-pgp.el b/semi-1.14.6/pgg-pgp.el new file mode 100644 index 0000000..d34445b --- /dev/null +++ b/semi-1.14.6/pgg-pgp.el @@ -0,0 +1,242 @@ +;;; pgg-pgp.el --- PGP 2.* and 6.* support for PGG. + +;; Copyright (C) 1999,2000 Daiki Ueno + +;; Author: Daiki Ueno <ueno@ueda.info.waseda.ac.jp> +;; Created: 1999/11/02 +;; Keywords: PGP, OpenPGP + +;; This file is part of SEMI (Secure Emacs MIME Interface). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Code: + +(require 'mel) ; binary-to-text-funcall, binary-write-decoded-region +(eval-when-compile (require 'pgg)) + +(defgroup pgg-pgp () + "PGP 2.* and 6.* interface" + :group 'pgg) + +(defcustom pgg-pgp-program "pgp" + "PGP 2.* and 6.* executable." + :group 'pgg-pgp + :type 'string) + +(defcustom pgg-pgp-shell-file-name "/bin/sh" + "File name to load inferior shells from. +Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"." + :group 'pgg-pgp + :type 'string) + +(defcustom pgg-pgp-shell-command-switch "-c" + "Switch used to have the shell execute its command line argument." + :group 'pgg-pgp + :type 'string) + +(defcustom pgg-pgp-extra-args nil + "Extra arguments for every PGP invocation." + :group 'pgg-pgp + :type 'string) + +(eval-and-compile + (luna-define-class pgg-scheme-pgp (pgg-scheme))) + +(defvar pgg-pgp-user-id nil + "PGP ID of your default identity.") + +(defvar pgg-scheme-pgp-instance nil) + +;;;###autoload +(defun pgg-make-scheme-pgp () + (or pgg-scheme-pgp-instance + (setq pgg-scheme-pgp-instance + (luna-make-entity 'pgg-scheme-pgp)))) + +(defun pgg-pgp-process-region (start end passphrase program args) + (let* ((errors-file-name (make-temp-file "pgg-errors")) + (args + (append args + pgg-pgp-extra-args + (list (concat "2>" errors-file-name)))) + (shell-file-name pgg-pgp-shell-file-name) + (shell-command-switch pgg-pgp-shell-command-switch) + (process-environment process-environment) + (output-buffer pgg-output-buffer) + (errors-buffer pgg-errors-buffer) + (process-connection-type nil) + process status exit-status) + (with-current-buffer (get-buffer-create output-buffer) + (buffer-disable-undo) + (erase-buffer)) + (when passphrase + (setenv "PGPPASSFD" "0")) + (unwind-protect + (progn + (setq process + (apply #'binary-funcall + #'start-process-shell-command "*PGP*" output-buffer + program args)) + (set-process-sentinel process #'ignore) + (when passphrase + (process-send-string process (concat passphrase "\n"))) + (process-send-region process start end) + (process-send-eof process) + (while (eq 'run (process-status process)) + (accept-process-output process 5)) + (setq status (process-status process) + exit-status (process-exit-status process)) + (delete-process process) + (with-current-buffer output-buffer + (pgg-convert-lbt-region (point-min)(point-max) 'LF) + + (if (memq status '(stop signal)) + (error "%s exited abnormally: '%s'" program exit-status)) + (if (= 127 exit-status) + (error "%s could not be found" program)) + + (set-buffer (get-buffer-create errors-buffer)) + (buffer-disable-undo) + (erase-buffer) + (insert-file-contents errors-file-name))) + (if (and process (eq 'run (process-status process))) + (interrupt-process process)) + (condition-case nil + (delete-file errors-file-name) + (file-error nil))))) + +(luna-define-method pgg-scheme-lookup-key ((scheme pgg-scheme-pgp) + string &optional type) + (let ((args (list "+batchmode" "+language=en" "-kv" string))) + (with-current-buffer (get-buffer-create pgg-output-buffer) + (buffer-disable-undo) + (erase-buffer) + (apply #'call-process pgg-pgp-program nil t nil args) + (goto-char (point-min)) + (cond + ((re-search-forward "^pub\\s +[0-9]+/" nil t);PGP 2.* + (buffer-substring (point)(+ 8 (point)))) + ((re-search-forward "^Type" nil t);PGP 6.* + (beginning-of-line 2) + (substring + (nth 2 (split-string + (buffer-substring (point)(progn (end-of-line) (point))))) + 2)))))) + +(luna-define-method pgg-scheme-encrypt-region ((scheme pgg-scheme-pgp) + start end recipients) + (let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id)) + (args + `("+encrypttoself=off +verbose=1" "+batchmode" + "+language=us" "-fate" + ,@(if recipients + (mapcar (lambda (rcpt) (concat "\"" rcpt "\"")) + (append recipients + (if pgg-encrypt-for-me + (list pgg-pgp-user-id)))))))) + (pgg-pgp-process-region start end nil pgg-pgp-program args) + (pgg-process-when-success nil))) + +(luna-define-method pgg-scheme-decrypt-region ((scheme pgg-scheme-pgp) + start end) + (let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id)) + (passphrase + (pgg-read-passphrase + (format "PGP passphrase for %s: " pgg-pgp-user-id) + (pgg-scheme-lookup-key scheme pgg-pgp-user-id 'encrypt))) + (args + '("+verbose=1" "+batchmode" "+language=us" "-f"))) + (pgg-pgp-process-region start end passphrase pgg-pgp-program args) + (pgg-process-when-success nil))) + +(luna-define-method pgg-scheme-sign-region ((scheme pgg-scheme-pgp) + start end &optional clearsign) + (let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id)) + (passphrase + (pgg-read-passphrase + (format "PGP passphrase for %s: " pgg-pgp-user-id) + (pgg-scheme-lookup-key scheme pgg-pgp-user-id 'sign))) + (args + (list (if clearsign "-fast" "-fbast") + "+verbose=1" "+language=us" "+batchmode" + "-u" pgg-pgp-user-id))) + (pgg-pgp-process-region start end passphrase pgg-pgp-program args) + (pgg-process-when-success + (goto-char (point-min)) + (when (re-search-forward "^-+BEGIN PGP" nil t);XXX + (let ((packet + (cdr (assq 2 (pgg-parse-armor-region + (progn (beginning-of-line 2) + (point)) + (point-max)))))) + (if pgg-cache-passphrase + (pgg-add-passphrase-cache + (cdr (assq 'key-identifier packet)) + passphrase))))))) + +(luna-define-method pgg-scheme-verify-region ((scheme pgg-scheme-pgp) + start end &optional signature) + (let* ((orig-file (make-temp-file "pgg")) + (args '("+verbose=1" "+batchmode" "+language=us")) + (orig-mode (default-file-modes))) + (unwind-protect + (progn + (set-default-file-modes 448) + (binary-write-decoded-region start end orig-file)) + (set-default-file-modes orig-mode)) + (when (stringp signature) + (copy-file signature (setq signature (concat orig-file ".asc"))) + (setq args (append args (list signature orig-file)))) + (pgg-pgp-process-region (point)(point) nil pgg-pgp-program args) + (delete-file orig-file) + (if signature (delete-file signature)) + (pgg-process-when-success + (goto-char (point-min)) + (let ((case-fold-search t)) + (while (re-search-forward "^warning: " nil t) + (delete-region (match-beginning 0) + (progn (beginning-of-line 2) (point))))) + (goto-char (point-min)) + (when (re-search-forward "^\\.$" nil t) + (delete-region (point-min) + (progn (beginning-of-line 2) + (point))))))) + +(luna-define-method pgg-scheme-insert-key ((scheme pgg-scheme-pgp)) + (let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id)) + (args + (list "+verbose=1" "+batchmode" "+language=us" "-kxaf" + (concat "\"" pgg-pgp-user-id "\"")))) + (pgg-pgp-process-region (point)(point) nil pgg-pgp-program args) + (insert-buffer-substring pgg-output-buffer))) + +(luna-define-method pgg-scheme-snarf-keys-region ((scheme pgg-scheme-pgp) + start end) + (let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id)) + (key-file (make-temp-file "pgg")) + (args + (list "+verbose=1" "+batchmode" "+language=us" "-kaf" + key-file))) + (let ((coding-system-for-write 'raw-text-dos)) + (write-region start end key-file)) + (pgg-pgp-process-region start end nil pgg-pgp-program args) + (delete-file key-file) + (pgg-process-when-success nil))) + +(provide 'pgg-pgp) + +;;; pgg-pgp.el ends here diff --git a/semi-1.14.6/pgg-pgp5.el b/semi-1.14.6/pgg-pgp5.el new file mode 100644 index 0000000..515ca5a --- /dev/null +++ b/semi-1.14.6/pgg-pgp5.el @@ -0,0 +1,251 @@ +;;; pgg-pgp5.el --- PGP 5.* support for PGG. + +;; Copyright (C) 1999,2000 Daiki Ueno + +;; Author: Daiki Ueno <ueno@ueda.info.waseda.ac.jp> +;; Created: 1999/11/02 +;; Keywords: PGP, OpenPGP + +;; This file is part of SEMI (Secure Emacs MIME Interface). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Code: + +(require 'mel) ; binary-to-text-funcall, binary-write-decoded-region +(eval-when-compile (require 'pgg)) + +(defgroup pgg-pgp5 () + "PGP 5.* interface" + :group 'pgg) + +(defcustom pgg-pgp5-pgpe-program "pgpe" + "PGP 5.* 'pgpe' executable." + :group 'pgg-pgp5 + :type 'string) + +(defcustom pgg-pgp5-pgps-program "pgps" + "PGP 5.* 'pgps' executable." + :group 'pgg-pgp5 + :type 'string) + +(defcustom pgg-pgp5-pgpk-program "pgpk" + "PGP 5.* 'pgpk' executable." + :group 'pgg-pgp5 + :type 'string) + +(defcustom pgg-pgp5-pgpv-program "pgpv" + "PGP 5.* 'pgpv' executable." + :group 'pgg-pgp5 + :type 'string) + +(defcustom pgg-pgp5-shell-file-name "/bin/sh" + "File name to load inferior shells from. +Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"." + :group 'pgg-pgp5 + :type 'string) + +(defcustom pgg-pgp5-shell-command-switch "-c" + "Switch used to have the shell execute its command line argument." + :group 'pgg-pgp5 + :type 'string) + +(defcustom pgg-pgp5-extra-args nil + "Extra arguments for every PGP 5.* invocation." + :group 'pgg-pgp5 + :type 'string) + +(eval-and-compile + (luna-define-class pgg-scheme-pgp5 (pgg-scheme))) + +(defvar pgg-pgp5-user-id nil + "PGP 5.* ID of your default identity.") + +(defvar pgg-scheme-pgp5-instance nil) + +;;;###autoload +(defun pgg-make-scheme-pgp5 () + (or pgg-scheme-pgp5-instance + (setq pgg-scheme-pgp5-instance + (luna-make-entity 'pgg-scheme-pgp5)))) + +(defun pgg-pgp5-process-region (start end passphrase program args) + (let* ((errors-file-name (make-temp-file "pgg-errors")) + (args + (append args + pgg-pgp5-extra-args + (list (concat "2>" errors-file-name)))) + (shell-file-name pgg-pgp5-shell-file-name) + (shell-command-switch pgg-pgp5-shell-command-switch) + (process-environment process-environment) + (output-buffer pgg-output-buffer) + (errors-buffer pgg-errors-buffer) + (process-connection-type nil) + process status exit-status) + (with-current-buffer (get-buffer-create output-buffer) + (buffer-disable-undo) + (erase-buffer)) + (when passphrase + (setenv "PGPPASSFD" "0")) + (unwind-protect + (progn + (setq process + (apply #'binary-funcall + #'start-process-shell-command "*PGP*" output-buffer + program args)) + (set-process-sentinel process #'ignore) + (when passphrase + (process-send-string process (concat passphrase "\n"))) + (process-send-region process start end) + (process-send-eof process) + (while (eq 'run (process-status process)) + (accept-process-output process 5)) + (setq status (process-status process) + exit-status (process-exit-status process)) + (delete-process process) + (with-current-buffer output-buffer + (pgg-convert-lbt-region (point-min)(point-max) 'LF) + + (if (memq status '(stop signal)) + (error "%s exited abnormally: '%s'" program exit-status)) + (if (= 127 exit-status) + (error "%s could not be found" program)) + + (set-buffer (get-buffer-create errors-buffer)) + (buffer-disable-undo) + (erase-buffer) + (insert-file-contents errors-file-name))) + (if (and process (eq 'run (process-status process))) + (interrupt-process process)) + (condition-case nil + (delete-file errors-file-name) + (file-error nil))))) + +(luna-define-method pgg-scheme-lookup-key ((scheme pgg-scheme-pgp5) + string &optional type) + (let ((args (list "+language=en" "-l" string))) + (with-current-buffer (get-buffer-create pgg-output-buffer) + (buffer-disable-undo) + (erase-buffer) + (apply #'call-process pgg-pgp5-pgpk-program nil t nil args) + (goto-char (point-min)) + (when (re-search-forward "^sec" nil t) + (substring + (nth 2 (split-string + (buffer-substring (match-end 0)(progn (end-of-line)(point))))) + 2))))) + +(luna-define-method pgg-scheme-encrypt-region ((scheme pgg-scheme-pgp5) + start end recipients) + (let* ((pgg-pgp5-user-id (or pgg-pgp5-user-id pgg-default-user-id)) + (args + `("+NoBatchInvalidKeys=off" "-fat" "+batchmode=1" + ,@(if recipients + (apply #'append + (mapcar (lambda (rcpt) + (list "-r" + (concat "\"" rcpt "\""))) + (append recipients + (if pgg-encrypt-for-me + (list pgg-pgp5-user-id))))))))) + (pgg-pgp5-process-region start end nil pgg-pgp5-pgpe-program args) + (pgg-process-when-success nil))) + +(luna-define-method pgg-scheme-decrypt-region ((scheme pgg-scheme-pgp5) + start end) + (let* ((pgg-pgp5-user-id (or pgg-pgp5-user-id pgg-default-user-id)) + (passphrase + (pgg-read-passphrase + (format "PGP passphrase for %s: " pgg-pgp5-user-id) + (pgg-scheme-lookup-key scheme pgg-pgp5-user-id 'encrypt))) + (args + '("+verbose=1" "+batchmode=1" "+language=us" "-f"))) + (pgg-pgp5-process-region start end passphrase pgg-pgp5-pgpv-program args) + (pgg-process-when-success nil))) + +(luna-define-method pgg-scheme-sign-region ((scheme pgg-scheme-pgp5) + start end &optional clearsign) + (let* ((pgg-pgp5-user-id (or pgg-pgp5-user-id pgg-default-user-id)) + (passphrase + (pgg-read-passphrase + (format "PGP passphrase for %s: " pgg-pgp5-user-id) + (pgg-scheme-lookup-key scheme pgg-pgp5-user-id 'sign))) + (args + (list (if clearsign "-fat" "-fbat") + "+verbose=1" "+language=us" "+batchmode=1" + "-u" pgg-pgp5-user-id))) + (pgg-pgp5-process-region start end passphrase pgg-pgp5-pgps-program args) + (pgg-process-when-success + (when (re-search-forward "^-+BEGIN PGP SIGNATURE" nil t);XXX + (let ((packet + (cdr (assq 2 (pgg-parse-armor-region + (progn (beginning-of-line 2) + (point)) + (point-max)))))) + (if pgg-cache-passphrase + (pgg-add-passphrase-cache + (cdr (assq 'key-identifier packet)) + passphrase))))))) + +(luna-define-method pgg-scheme-verify-region ((scheme pgg-scheme-pgp5) + start end &optional signature) + (let* ((orig-file (make-temp-file "pgg")) + (args '("+verbose=1" "+batchmode=1" "+language=us")) + (orig-mode (default-file-modes))) + (unwind-protect + (progn + (set-default-file-modes 448) + (binary-write-decoded-region start end orig-file)) + (set-default-file-modes orig-mode)) + (when (stringp signature) + (copy-file signature (setq signature (concat orig-file ".asc"))) + (setq args (append args (list signature)))) + (pgg-pgp5-process-region (point)(point) nil pgg-pgp5-pgpv-program args) + (delete-file orig-file) + (if signature (delete-file signature)) + (with-current-buffer pgg-errors-buffer + (goto-char (point-min)) + (if (re-search-forward "^Good signature" nil t) + (progn + (set-buffer pgg-output-buffer) + (insert-buffer-substring pgg-errors-buffer) + t) + nil)))) + +(luna-define-method pgg-scheme-insert-key ((scheme pgg-scheme-pgp5)) + (let* ((pgg-pgp5-user-id (or pgg-pgp5-user-id pgg-default-user-id)) + (args + (list "+verbose=1" "+batchmode=1" "+language=us" "-x" + (concat "\"" pgg-pgp5-user-id "\"")))) + (pgg-pgp5-process-region (point)(point) nil pgg-pgp5-pgpk-program args) + (insert-buffer-substring pgg-output-buffer))) + +(luna-define-method pgg-scheme-snarf-keys-region ((scheme pgg-scheme-pgp5) + start end) + (let* ((pgg-pgp5-user-id (or pgg-pgp5-user-id pgg-default-user-id)) + (key-file (make-temp-file "pgg")) + (args + (list "+verbose=1" "+batchmode=1" "+language=us" "-a" + key-file))) + (let ((coding-system-for-write 'raw-text-dos)) + (write-region start end key-file)) + (pgg-pgp5-process-region start end nil pgg-pgp5-pgpk-program args) + (delete-file key-file) + (pgg-process-when-success nil))) + +(provide 'pgg-pgp5) + +;;; pgg-pgp5.el ends here diff --git a/semi-1.14.6/pgg.el b/semi-1.14.6/pgg.el new file mode 100644 index 0000000..1b40d48 --- /dev/null +++ b/semi-1.14.6/pgg.el @@ -0,0 +1,421 @@ +;;; pgg.el --- glue for the various PGP implementations. + +;; Copyright (C) 1999,2000 Free Software Foundation, Inc. + +;; Author: Daiki Ueno <ueno@unixuser.org> +;; Created: 1999/10/28 +;; Keywords: PGP + +;; This file is part of SEMI (Secure Emacs MIME Interface). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + + +;;; Commentary: +;; + +;;; Code: + +(require 'calist) + +(eval-and-compile (require 'luna)) + +(require 'pgg-def) +(require 'pgg-parse) + +(eval-when-compile + (ignore-errors + (require 'w3) + (require 'url))) + +(in-calist-package 'pgg) + +(defun pgg-field-match-method-with-containment + (calist field-type field-value) + (let ((s-field (assq field-type calist))) + (cond ((null s-field) + (cons (cons field-type field-value) calist)) + ((memq (cdr s-field) field-value) + calist)))) + +(define-calist-field-match-method 'signature-version + #'pgg-field-match-method-with-containment) + +(define-calist-field-match-method 'symmetric-key-algorithm + #'pgg-field-match-method-with-containment) + +(define-calist-field-match-method 'public-key-algorithm + #'pgg-field-match-method-with-containment) + +(define-calist-field-match-method 'hash-algorithm + #'pgg-field-match-method-with-containment) + +(defvar pgg-verify-condition nil + "Condition-tree about which PGP implementation is used for verifying.") + +(defvar pgg-decrypt-condition nil + "Condition-tree about which PGP implementation is used for decrypting.") + +(ctree-set-calist-strictly + 'pgg-verify-condition + '((signature-version 3)(public-key-algorithm RSA)(hash-algorithm MD5) + (scheme . pgp))) + +(ctree-set-calist-strictly + 'pgg-decrypt-condition + '((public-key-algorithm RSA)(symmetric-key-algorithm IDEA) + (scheme . pgp))) + +(ctree-set-calist-strictly + 'pgg-verify-condition + '((signature-version 3 4) + (public-key-algorithm RSA ELG DSA) + (hash-algorithm MD5 SHA1 RIPEMD160) + (scheme . pgp5))) + +(ctree-set-calist-strictly + 'pgg-decrypt-condition + '((public-key-algorithm RSA ELG DSA) + (symmetric-key-algorithm 3DES CAST5 IDEA) + (scheme . pgp5))) + +(ctree-set-calist-strictly + 'pgg-verify-condition + '((signature-version 3 4) + (public-key-algorithm ELG-E DSA ELG) + (hash-algorithm MD5 SHA1 RIPEMD160) + (scheme . gpg))) + +(ctree-set-calist-strictly + 'pgg-decrypt-condition + '((public-key-algorithm ELG-E DSA ELG) + (symmetric-key-algorithm 3DES CAST5 BLOWFISH TWOFISH) + (scheme . gpg))) + +;;; @ definition of the implementation scheme +;;; + +(eval-and-compile + (luna-define-class pgg-scheme ()) + + (luna-define-internal-accessors 'pgg-scheme)) + +(luna-define-generic pgg-scheme-lookup-key (scheme string &optional type) + "Search keys associated with STRING.") + +(luna-define-generic pgg-scheme-encrypt-region (scheme start end recipients) + "Encrypt the current region between START and END.") + +(luna-define-generic pgg-scheme-decrypt-region (scheme start end) + "Decrypt the current region between START and END.") + +(luna-define-generic pgg-scheme-sign-region + (scheme start end &optional cleartext) + "Make detached signature from text between START and END.") + +(luna-define-generic pgg-scheme-verify-region + (scheme start end &optional signature) + "Verify region between START and END as the detached signature SIGNATURE.") + +(luna-define-generic pgg-scheme-insert-key (scheme) + "Insert public key at point.") + +(luna-define-generic pgg-scheme-snarf-keys-region (scheme start end) + "Add all public keys in region between START and END to the keyring.") + +;;; @ utility functions +;;; + +(defvar pgg-fetch-key-function (function pgg-fetch-key-with-w3)) + +(defmacro pgg-make-scheme (scheme) + `(progn + (require (intern (format "pgg-%s" ,scheme))) + (funcall (intern (format "pgg-make-scheme-%s" + ,scheme))))) + +(put 'pgg-save-coding-system 'lisp-indent-function 2) + +(defmacro pgg-save-coding-system (start end &rest body) + `(if (interactive-p) + (let ((buffer (current-buffer))) + (with-temp-buffer + (let (buffer-undo-list) + (insert-buffer-substring buffer ,start ,end) + (encode-coding-region (point-min)(point-max) + buffer-file-coding-system) + (prog1 (save-excursion ,@body) + (push nil buffer-undo-list) + (ignore-errors (undo)))))) + (save-restriction + (narrow-to-region ,start ,end) + ,@body))) + +(defun pgg-temp-buffer-show-function (buffer) + (let ((window (split-window-vertically))) + (set-window-buffer window buffer) + (shrink-window-if-larger-than-buffer window))) + +(defun pgg-display-output-buffer (start end status) + (if status + (progn + (delete-region start end) + (insert-buffer-substring pgg-output-buffer) + (decode-coding-region start (point) buffer-file-coding-system)) + (let ((temp-buffer-show-function + (function pgg-temp-buffer-show-function))) + (with-output-to-temp-buffer pgg-echo-buffer + (set-buffer standard-output) + (insert-buffer-substring pgg-errors-buffer))))) + +(defvar pgg-passphrase-cache-expiry 16) +(defvar pgg-passphrase-cache (make-vector 7 0)) + +(defvar pgg-read-passphrase nil) +(defun pgg-read-passphrase (prompt &optional key) + (if (not pgg-read-passphrase) + (if (functionp 'read-passwd) + (setq pgg-read-passphrase 'read-passwd) + (if (load "passwd" t) + (setq pgg-read-passphrase 'read-passwd) + (autoload 'ange-ftp-read-passwd "ange-ftp") + (setq pgg-read-passphrase 'ange-ftp-read-passwd)))) + (or (and pgg-cache-passphrase + key (setq key (pgg-truncate-key-identifier key)) + (symbol-value (intern-soft key pgg-passphrase-cache))) + (funcall pgg-read-passphrase prompt))) + +(defun pgg-add-passphrase-cache (key passphrase) + (setq key (pgg-truncate-key-identifier key)) + (set (intern key pgg-passphrase-cache) + passphrase) + (run-at-time pgg-passphrase-cache-expiry nil + #'pgg-remove-passphrase-cache + key)) + +(defun pgg-remove-passphrase-cache (key) + (let ((passphrase (symbol-value (intern-soft key pgg-passphrase-cache)))) + (when passphrase + (fillarray passphrase ?_) + (unintern key pgg-passphrase-cache)))) + +(defmacro pgg-convert-lbt-region (start end lbt) + `(let ((pgg-conversion-end (set-marker (make-marker) ,end))) + (goto-char ,start) + (case ,lbt + (CRLF + (while (progn + (end-of-line) + (> (marker-position pgg-conversion-end) (point))) + (insert "\r") + (forward-line 1))) + (LF + (while (re-search-forward "\r$" pgg-conversion-end t) + (replace-match "")))))) + +(put 'pgg-as-lbt 'lisp-indent-function 3) + +(defmacro pgg-as-lbt (start end lbt &rest body) + `(let ((inhibit-read-only t) + buffer-read-only + buffer-undo-list) + (pgg-convert-lbt-region ,start ,end ,lbt) + (let ((,end (point))) + ,@body) + (push nil buffer-undo-list) + (ignore-errors (undo)))) + +(put 'pgg-process-when-success 'lisp-indent-function 0) + +(defmacro pgg-process-when-success (&rest body) + `(with-current-buffer pgg-output-buffer + (if (zerop (buffer-size)) nil ,@body t))) + + +;;; @ interface functions +;;; + +;;;###autoload +(defun pgg-encrypt-region (start end rcpts) + "Encrypt the current region between START and END for RCPTS." + (interactive + (list (region-beginning)(region-end) + (split-string (read-string "Recipients: ") "[ \t,]+"))) + (let* ((entity (pgg-make-scheme pgg-default-scheme)) + (status + (pgg-save-coding-system start end + (pgg-scheme-encrypt-region entity (point-min)(point-max) rcpts)))) + (when (interactive-p) + (pgg-display-output-buffer start end status)) + status)) + +;;;###autoload +(defun pgg-decrypt-region (start end) + "Decrypt the current region between START and END." + (interactive "r") + (let* ((packet (cdr (assq 1 (pgg-parse-armor-region start end)))) + (scheme + (or pgg-scheme + (cdr (assq 'scheme + (progn + (in-calist-package 'pgg) + (ctree-match-calist pgg-decrypt-condition + packet)))) + pgg-default-scheme)) + (entity (pgg-make-scheme scheme)) + (status + (pgg-save-coding-system start end + (pgg-scheme-decrypt-region entity (point-min)(point-max))))) + (when (interactive-p) + (pgg-display-output-buffer start end status)) + status)) + +;;;###autoload +(defun pgg-sign-region (start end &optional cleartext) + "Make the signature from text between START and END. +If the optional 3rd argument CLEARTEXT is non-nil, it does not create +a detached signature." + (interactive "r") + (let* ((entity (pgg-make-scheme pgg-default-scheme)) + (status (pgg-save-coding-system start end + (pgg-scheme-sign-region entity (point-min)(point-max) + (or (interactive-p) cleartext))))) + (when (interactive-p) + (pgg-display-output-buffer start end status)) + status)) + +;;;###autoload +(defun pgg-verify-region (start end &optional signature fetch) + "Verify the current region between START and END. +If the optional 3rd argument SIGNATURE is non-nil, it is treated as +the detached signature of the current region. + +If the optional 4th argument FETCH is non-nil, we attempt to fetch the +signer's public key from `pgg-default-keyserver-address'." + (interactive "r") + (let* ((packet + (if (null signature) nil + (with-temp-buffer + (buffer-disable-undo) + (set-buffer-multibyte nil) + (insert-file-contents signature) + (cdr (assq 2 (pgg-decode-armor-region + (point-min)(point-max))))))) + (scheme + (or pgg-scheme + (cdr (assq 'scheme + (progn + (in-calist-package 'pgg) + (ctree-match-calist pgg-verify-condition + packet)))) + pgg-default-scheme)) + (entity (pgg-make-scheme scheme)) + (key (cdr (assq 'key-identifier packet))) + status keyserver) + (and (stringp key) + (setq key (concat "0x" (pgg-truncate-key-identifier key))) + (null (let ((pgg-scheme scheme)) + (pgg-lookup-key key))) + (or fetch (interactive-p)) + (y-or-n-p (format "Key %s not found; attempt to fetch? " key)) + (setq keyserver + (or (cdr (assq 'preferred-key-server packet)) + pgg-default-keyserver-address)) + (pgg-fetch-key keyserver key)) + (setq status (pgg-save-coding-system start end + (pgg-scheme-verify-region entity (point-min)(point-max) + signature))) + (when (interactive-p) + (let ((temp-buffer-show-function + (function pgg-temp-buffer-show-function))) + (with-output-to-temp-buffer pgg-echo-buffer + (set-buffer standard-output) + (insert-buffer-substring (if status pgg-output-buffer + pgg-errors-buffer))))) + status)) + +;;;###autoload +(defun pgg-insert-key () + "Insert the ASCII armored public key." + (interactive) + (let ((entity (pgg-make-scheme (or pgg-scheme pgg-default-scheme)))) + (pgg-scheme-insert-key entity))) + +;;;###autoload +(defun pgg-snarf-keys-region (start end) + "Import public keys in the current region between START and END." + (interactive "r") + (let ((entity (pgg-make-scheme (or pgg-scheme pgg-default-scheme)))) + (pgg-save-coding-system start end + (pgg-scheme-snarf-keys-region entity start end)))) + +(defun pgg-lookup-key (string &optional type) + (let ((entity (pgg-make-scheme (or pgg-scheme pgg-default-scheme)))) + (pgg-scheme-lookup-key entity string type))) + +(defvar pgg-insert-url-function (function pgg-insert-url-with-w3)) + +(defun pgg-insert-url-with-w3 (url) + (require 'w3) + (require 'url) + (let (buffer-file-name) + (url-insert-file-contents url))) + +(defvar pgg-insert-url-extra-arguments nil) +(defvar pgg-insert-url-program nil) + +(defun pgg-insert-url-with-program (url) + (let ((args (copy-sequence pgg-insert-url-extra-arguments)) + process) + (insert + (with-temp-buffer + (setq process + (apply #'start-process " *PGG url*" (current-buffer) + pgg-insert-url-program (nconc args (list url)))) + (set-process-sentinel process #'ignore) + (while (eq 'run (process-status process)) + (accept-process-output process 5)) + (delete-process process) + (if (and process (eq 'run (process-status process))) + (interrupt-process process)) + (buffer-string))))) + +(defun pgg-fetch-key (keyserver key) + "Attempt to fetch a KEY from KEYSERVER for addition to PGP or GnuPG keyring." + (with-current-buffer (get-buffer-create pgg-output-buffer) + (buffer-disable-undo) + (erase-buffer) + (let ((proto (if (string-match "^[a-zA-Z\\+\\.\\\\-]+:" keyserver) + (substring keyserver 0 (1- (match-end 0)))))) + (save-excursion + (funcall pgg-insert-url-function + (if proto keyserver + (format "http://%s:11371/pks/lookup?op=get&search=%s" + keyserver key)))) + (when (re-search-forward "^-+BEGIN" nil 'last) + (delete-region (point-min) (match-beginning 0)) + (when (re-search-forward "^-+END" nil t) + (delete-region (progn (end-of-line) (point)) + (point-max))) + (insert "\n") + (with-temp-buffer + (insert-buffer-substring pgg-output-buffer) + (pgg-snarf-keys-region (point-min)(point-max))))))) + + +(provide 'pgg) + +;;; pgg.el ends here diff --git a/semi-1.14.6/postpet.el b/semi-1.14.6/postpet.el new file mode 100644 index 0000000..4284cf6 --- /dev/null +++ b/semi-1.14.6/postpet.el @@ -0,0 +1,153 @@ +;;; postpet.el --- Postpet support for GNU Emacs + +;; Copyright (C) 1999,2000 Free Software Foundation, Inc. + +;; Author: Tanaka Akira <akr@jaist.ac.jp> +;; Keywords: Postpet, MIME, multimedia, mail, news + +;; This file is part of SEMI (Sample of Elastic MIME Interfaces). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Code: + +(require 'mime) +(require 'alist) + +(put 'unpack 'lisp-indent-function 1) +(defmacro unpack (string &rest body) + `(let* ((*unpack*string* (string-as-unibyte ,string)) + (*unpack*index* 0)) + ,@body)) + +(defun unpack-skip (len) + (setq *unpack*index* (+ len *unpack*index*))) + +(defun unpack-fixed (len) + (prog1 + (substring *unpack*string* *unpack*index* (+ *unpack*index* len)) + (unpack-skip len))) + +(defun unpack-byte () + (char-int (aref (unpack-fixed 1) 0))) + +(defun unpack-short () + (let* ((b0 (unpack-byte)) + (b1 (unpack-byte))) + (+ (* 256 b0) b1))) + +(defun unpack-long () + (let* ((s0 (unpack-short)) + (s1 (unpack-short))) + (+ (* 65536 s0) s1))) + +(defun unpack-string () + (let ((len (unpack-byte))) + (unpack-fixed len))) + +(defun unpack-string-sjis () + (decode-mime-charset-string (unpack-string) 'shift_jis)) + +;;;###autoload +(defun postpet-decode (string) + (condition-case nil + (unpack string + (let (res) + (unpack-skip 4) + (set-alist 'res 'carryingcount (unpack-long)) + (unpack-skip 8) + (set-alist 'res 'sentyear (unpack-short)) + (set-alist 'res 'sentmonth (unpack-short)) + (set-alist 'res 'sentday (unpack-short)) + (unpack-skip 8) + (set-alist 'res 'petname (unpack-string-sjis)) + (set-alist 'res 'owner (unpack-string-sjis)) + (set-alist 'res 'pettype (unpack-fixed 4)) + (set-alist 'res 'health (unpack-short)) + (unpack-skip 2) + (set-alist 'res 'sex (unpack-long)) + (unpack-skip 1) + (set-alist 'res 'brain (unpack-byte)) + (unpack-skip 39) + (set-alist 'res 'happiness (unpack-byte)) + (unpack-skip 14) + (set-alist 'res 'petbirthyear (unpack-short)) + (set-alist 'res 'petbirthmonth (unpack-short)) + (set-alist 'res 'petbirthday (unpack-short)) + (unpack-skip 8) + (set-alist 'res 'from (unpack-string)) + (unpack-skip 5) + (unpack-skip 160) + (unpack-skip 4) + (unpack-skip 8) + (unpack-skip 8) + (unpack-skip 26) + (set-alist 'res 'treasure (unpack-short)) + (set-alist 'res 'money (unpack-long)) + res)) + (error nil))) + +;;;###autoload +(defun mime-display-application/x-postpet (entity situation) + (save-restriction + (narrow-to-region (point-max)(point-max)) + (let ((pet (postpet-decode (mime-entity-content entity)))) + (if pet + (insert + "Petname: " (cdr (assq 'petname pet)) + "\n" + "Owner: " (cdr (assq 'owner pet)) + "\n" + "Pettype: " (cdr (assq 'pettype pet)) + "\n" + "From: " (cdr (assq 'from pet)) + "\n" + "CarryingCount: " (int-to-string (cdr (assq 'carryingcount pet))) + "\n" + "SentYear: " (int-to-string (cdr (assq 'sentyear pet))) + "\n" + "SentMonth: " (int-to-string (cdr (assq 'sentmonth pet))) + "\n" + "SentDay: " (int-to-string (cdr (assq 'sentday pet))) + "\n" + "PetbirthYear: " (int-to-string (cdr (assq 'petbirthyear pet))) + "\n" + "PetbirthMonth: " (int-to-string (cdr (assq 'petbirthmonth pet))) + "\n" + "PetbirthDay: " (int-to-string (cdr (assq 'petbirthday pet))) + "\n" + "Health: " (int-to-string (cdr (assq 'health pet))) + "\n" + "Sex: " (int-to-string (cdr (assq 'sex pet))) + "\n" + "Brain: " (int-to-string (cdr (assq 'brain pet))) + "\n" + "Happiness: " (int-to-string (cdr (assq 'happiness pet))) + "\n" + "Treasure: " (int-to-string (cdr (assq 'treasure pet))) + "\n" + "Money: " (int-to-string (cdr (assq 'money pet))) + "\n") + (insert "Invalid format\n")) + (run-hooks 'mime-display-application/x-postpet-hook)))) + + +;;; @ end +;;; + +(provide 'postpet) + +;;; postpet.el ends here diff --git a/semi-1.14.6/semi-def.el b/semi-1.14.6/semi-def.el new file mode 100644 index 0000000..a88b32d --- /dev/null +++ b/semi-1.14.6/semi-def.el @@ -0,0 +1,211 @@ +;;; semi-def.el --- definition module for SEMI -*- coding: iso-8859-4; -*- + +;; Copyright (C) 1995,96,97,98,99,2000,01,03 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko <tomo@m17n.org> +;; Keywords: definition, MIME, multimedia, mail, news + +;; This file is part of SEMI (Sample of Emacs MIME Implementation). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Code: + +(eval-when-compile (require 'cl)) + +(require 'custom) + +(defconst mime-user-interface-product ["SEMI" (1 14 6) "Maruoka"] + "Product name, version number and code name of MIME-kernel package.") + +(autoload 'mule-caesar-region "mule-caesar" + "Caesar rotation of current region." t) + + +;;; @ constants +;;; + +(defconst mime-echo-buffer-name "*MIME-echo*" + "Name of buffer to display MIME-playing information.") + +(defconst mime-temp-buffer-name " *MIME-temp*") + + +;;; @ button +;;; + +(defcustom mime-button-face 'bold + "Face used for content-button or URL-button of MIME-Preview buffer." + :group 'mime + :type 'face) + +(defcustom mime-button-mouse-face 'highlight + "Face used for MIME-preview buffer mouse highlighting." + :group 'mime + :type 'face) + +(defsubst mime-add-button (from to function &optional data) + "Create a button between FROM and TO with callback FUNCTION and DATA." + (and mime-button-face + (put-text-property from to 'face mime-button-face)) + (and mime-button-mouse-face + (put-text-property from to 'mouse-face mime-button-mouse-face)) + (put-text-property from to 'mime-button-callback function) + (and data + (put-text-property from to 'mime-button-data data)) + ) + +(defsubst mime-insert-button (string function &optional data) + "Insert STRING as button with callback FUNCTION and DATA." + (save-restriction + (narrow-to-region (point)(point)) + (insert (concat "[" string "]\n")) + (mime-add-button (point-min)(point-max) function data) + )) + +(defvar mime-button-mother-dispatcher nil) + +(defun mime-button-dispatcher (event) + "Select the button under point." + (interactive "e") + (let (buf point func data) + (save-window-excursion + (mouse-set-point event) + (setq buf (current-buffer) + point (point) + func (get-text-property (point) 'mime-button-callback) + data (get-text-property (point) 'mime-button-data) + )) + (save-excursion + (set-buffer buf) + (goto-char point) + (if func + (apply func data) + (if (fboundp mime-button-mother-dispatcher) + (funcall mime-button-mother-dispatcher event) + ))))) + + +;;; @ for URL +;;; + +(defcustom mime-browse-url-regexp + (concat "\\(https?\\|ftps?\\|file\\|gopher\\|news\\|nntps?\\|telnets?\\|wais\\|mailto\\):" + "\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?" + "[-a-zA-Z0-9_=?#$@~`%&*+|\\/.,]*[-a-zA-Z0-9_=#$@~`%&*+|\\/]") + "*Regexp to match URL in text body." + :group 'mime + :type 'regexp) + +(defcustom mime-browse-url-function (function browse-url) + "*Function to browse URL." + :group 'mime + :type 'function) + +(defsubst mime-add-url-buttons () + "Add URL-buttons for text body." + (goto-char (point-min)) + (while (re-search-forward mime-browse-url-regexp nil t) + (let ((beg (match-beginning 0)) + (end (match-end 0))) + (mime-add-button beg end mime-browse-url-function + (list (buffer-substring beg end)))))) + + +;;; @ menu +;;; + +(static-cond ((featurep 'xemacs) + (defun mime-should-use-popup-menu () + (and window-system + (mouse-event-p last-command-event))) + (defun mime-select-menu-alist (title menu-alist) + (if (mime-should-use-popup-menu) + (let (ret) + (popup-menu + (list* title + "---" + (mapcar (function + (lambda (cell) + (vector (car cell) + `(progn + (setq ret ',(cdr cell)) + (throw 'exit nil)) + t))) + menu-alist))) + (recursive-edit) + ret) + (cdr + (assoc (completing-read (concat title " : ") menu-alist) + menu-alist))))) + (t + (defun mime-should-use-popup-menu () + (and window-system + (memq (event-basic-type last-command-event) + '(mouse-1 mouse-2 mouse-3)))) + (defun mime-select-menu-alist (title menu-alist) + (if (mime-should-use-popup-menu) + (x-popup-menu + (list '(1 1) (selected-window)) + (list title (cons title menu-alist))) + (cdr + (assoc (completing-read (concat title " : ") menu-alist) + menu-alist)))))) + +;;; @ Other Utility +;;; + +(defvar mime-condition-type-alist + '((preview . mime-preview-condition) + (action . mime-acting-condition))) + +(defvar mime-condition-mode-alist + '((with-default . ctree-set-calist-with-default) + (t . ctree-set-calist-strictly))) + +(defun mime-add-condition (target-type condition &optional mode file) + "Add CONDITION to database specified by TARGET-TYPE. +TARGET-TYPE must be 'preview or 'action. +If optional argument MODE is 'strict or nil (omitted), CONDITION is +added strictly. +If optional argument MODE is 'with-default, CONDITION is added with +default rule. +If optional argument FILE is specified, it is loaded when CONDITION is +activate." + (let ((sym (cdr (assq target-type mime-condition-type-alist)))) + (if sym + (let ((func (cdr (or (assq mode mime-condition-mode-alist) + (assq t mime-condition-mode-alist))))) + (if (fboundp func) + (progn + (funcall func sym condition) + (if file + (let ((method (cdr (assq 'method condition)))) + (autoload method file) + )) + ) + (error "Function for mode `%s' is not found." mode) + )) + (error "Variable for target-type `%s' is not found." target-type) + ))) + + +;;; @ end +;;; + +(provide 'semi-def) + +;;; semi-def.el ends here diff --git a/semi-1.14.6/semi-setup.el b/semi-1.14.6/semi-setup.el new file mode 100644 index 0000000..ecdf2ae --- /dev/null +++ b/semi-1.14.6/semi-setup.el @@ -0,0 +1,208 @@ +;;; semi-setup.el --- setup file for MIME-View. + +;; Copyright (C) 1994,95,96,97,98,99,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko <tomo@m17n.org> +;; Keywords: mail, news, MIME, multimedia, multilingual, encoded-word + +;; This file is part of SEMI (Setting for Emacs MIME Interfaces). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Code: + +(require 'semi-def) +(require 'path-util) + +(defun call-after-loaded (module func &optional hook-name) + "If MODULE is provided, then FUNC is called. +Otherwise func is set to MODULE-load-hook. +If optional argument HOOK-NAME is specified, +it is used as hook to set." + (if (featurep module) + (funcall func) + (or hook-name + (setq hook-name (intern (concat (symbol-name module) "-load-hook"))) + ) + (add-hook hook-name func) + )) + + +;; for image/* +(defvar mime-setup-enable-inline-image + (and window-system + (or (featurep 'xemacs)(featurep 'mule))) + "*If it is non-nil, semi-setup sets up to use mime-image.") + +(if mime-setup-enable-inline-image + (eval-after-load "mime-view" + '(require 'mime-image))) + +;; for text/html +(defvar mime-setup-enable-inline-html + (module-installed-p 'w3) + "*If it is non-nil, semi-setup sets up to use mime-w3.") + +(if mime-setup-enable-inline-html + (eval-after-load "mime-view" + '(progn + (autoload 'mime-preview-text/html "mime-w3") + + (ctree-set-calist-strictly + 'mime-preview-condition + '((type . text)(subtype . html) + (body . visible) + (body-presentation-method . mime-preview-text/html))) + + (set-alist 'mime-view-type-subtype-score-alist + '(text . html) 3) + ))) + + +;; for PGP +(defvar mime-setup-enable-pgp t + "*If it is non-nil, semi-setup sets uf to use mime-pgp.") + +(if mime-setup-enable-pgp + (eval-after-load "mime-view" + '(progn + (mime-add-condition + 'preview '((type . application)(subtype . pgp) + (message-button . visible))) + (mime-add-condition + 'action '((type . application)(subtype . pgp) + (method . mime-view-application/pgp)) + 'strict "mime-pgp") + (mime-add-condition + 'action '((type . text)(subtype . x-pgp) + (method . mime-view-application/pgp))) + + (mime-add-condition + 'action '((type . multipart)(subtype . signed) + (method . mime-verify-multipart/signed)) + 'strict "mime-pgp") + + (mime-add-condition + 'action + '((type . application)(subtype . pgp-signature) + (method . mime-verify-application/pgp-signature)) + 'strict "mime-pgp") + + (mime-add-condition + 'action + '((type . application)(subtype . pgp-encrypted) + (method . mime-decrypt-application/pgp-encrypted)) + 'strict "mime-pgp") + + (mime-add-condition + 'action + '((type . application)(subtype . pgp-keys) + (method . mime-add-application/pgp-keys)) + 'strict "mime-pgp") + + (mime-add-condition + 'action + '((type . application)(subtype . pkcs7-signature) + (method . mime-verify-application/pkcs7-signature)) + 'strict "mime-pgp") + + (mime-add-condition + 'action + '((type . application)(subtype . x-pkcs7-signature) + (method . mime-verify-application/pkcs7-signature)) + 'strict "mime-pgp") + + (mime-add-condition + 'action + '((type . application)(subtype . pkcs7-mime) + (method . mime-view-application/pkcs7-mime)) + 'strict "mime-pgp") + + (mime-add-condition + 'action + '((type . application)(subtype . x-pkcs7-mime) + (method . mime-view-application/pkcs7-mime)) + 'strict "mime-pgp") + )) + ) + + +;;; @ for mime-edit +;;; + +;; (defun mime-setup-decode-message-header () +;; (save-excursion +;; (save-restriction +;; (goto-char (point-min)) +;; (narrow-to-region +;; (point-min) +;; (if (re-search-forward +;; (concat "^" (regexp-quote mail-header-separator) "$") +;; nil t) +;; (match-beginning 0) +;; (point-max) +;; )) +;; (mime-decode-header-in-buffer) +;; (set-buffer-modified-p nil) +;; ))) + +;; (add-hook 'mime-edit-mode-hook 'mime-setup-decode-message-header) + + +;;; @@ variables +;;; + +(defvar mime-setup-use-signature t + "If it is not nil, mime-setup sets up to use signature.el.") + +(defvar mime-setup-default-signature-key "\C-c\C-s" + "*Key to insert signature.") + +(defvar mime-setup-signature-key-alist '((mail-mode . "\C-c\C-w")) + "Alist of major-mode vs. key to insert signature.") + + +;;; @@ for signature +;;; + +(defun mime-setup-set-signature-key () + (let ((keymap (current-local-map))) + (if keymap + (let ((key + (or (cdr (assq major-mode mime-setup-signature-key-alist)) + mime-setup-default-signature-key))) + (define-key keymap key (function insert-signature)) + )))) + +(when mime-setup-use-signature + (autoload 'insert-signature "signature" "Insert signature" t) + (add-hook 'mime-edit-mode-hook 'mime-setup-set-signature-key) + ;; (setq message-signature nil) + ) + + +;;; @ for mu-cite +;;; + +;; (add-hook 'mu-cite/pre-cite-hook 'eword-decode-header) + + +;;; @ end +;;; + +(provide 'semi-setup) + +;;; semi-setup.el ends here diff --git a/semi-1.14.6/signature.el b/semi-1.14.6/signature.el new file mode 100644 index 0000000..6bd81c3 --- /dev/null +++ b/semi-1.14.6/signature.el @@ -0,0 +1,158 @@ +;;; signature.el --- a signature utility for GNU Emacs + +;; Copyright (C) 1994,1995,1996,1997,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko <tomo@m17n.org> +;; OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp> +;; Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp> +;; Maintainer: Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp> +;; Created: 1994/7/11 +;; Keywords: mail, news, signature + +;; This file is part of SEMI (SEMI is Emacs MIME Interfaces). + +;; 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 2, 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., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Code: + +(require 'std11) + + +;;; @ valiables +;;; + +(defvar signature-insert-at-eof nil + "*If non-nil, insert signature at the end of file.") + +(defvar signature-delete-blank-lines-at-eof nil + "*If non-nil, signature-insert-at-eof deletes blank lines at the end +of file.") + +(defvar signature-load-hook nil + "*List of functions called after signature.el is loaded.") + +(defvar signature-separator "-- \n" + "*String to separate contents and signature. +It is inserted when signature is inserted at end of file.") + +(defvar signature-file-name "~/.signature" + "*Name of file containing the user's signature.") + +(defvar signature-file-alist nil + "*Alist of the form: + (((FIELD . PATTERN) . FILENAME) + ...) +PATTERN is a string or list of string. If PATTERN matches the contents of +FIELD, the contents of FILENAME is inserted.") + +(defvar signature-file-prefix nil + "*String containing optional prefix for the signature file names") + +(defvar signature-insert-hook nil + "*List of functions called before inserting a signature.") + +(defvar signature-use-bbdb nil + "*If non-nil, Register sigtype to BBDB.") + +(autoload 'signature/get-sigtype-from-bbdb "mime-bbdb") + +(defun signature/get-sigtype-interactively (&optional default) + (read-file-name "Insert your signature: " + (or default (concat signature-file-name "-")) + (or default signature-file-name) + nil)) + +(defun signature/get-signature-file-name () + (save-excursion + (save-restriction + (narrow-to-region + (goto-char (point-min)) + (if (re-search-forward + (concat "^" (regexp-quote mail-header-separator) "$") + nil t) + (match-beginning 0) + (point-max) + )) + (catch 'found + (let ((alist signature-file-alist) cell field value) + (while alist + (setq cell (car alist) + field (std11-field-body (car (car cell))) + value (cdr (car cell))) + (cond ((functionp value) + (let ((name (apply value field (cdr cell)))) + (if name + (throw 'found + (concat signature-file-prefix name)) + ))) + ((stringp field) + (cond ((consp value) + (while value + (if (string-match (car value) field) + (throw 'found + (concat + signature-file-prefix (cdr cell))) + (setq value (cdr value)) + ))) + ((stringp value) + (if (string-match value field) + (throw 'found + (concat + signature-file-prefix (cdr cell))) + ))))) + (setq alist (cdr alist)) + )) + signature-file-name)))) + +(defun insert-signature (&optional arg) + "Insert the file named by signature-file-name. +It is inserted at the end of file if signature-insert-at-eof is non-nil, +and otherwise at the current point. A prefix argument enables user to +specify a file named <signature-file-name>-DISTRIBUTION interactively." + (interactive "P") + (let ((signature-file-name + (expand-file-name + (or (and signature-use-bbdb + (signature/get-sigtype-from-bbdb arg)) + (and arg + (signature/get-sigtype-interactively)) + (signature/get-signature-file-name)) + ))) + (or (file-readable-p signature-file-name) + (error "Cannot open signature file: %s" signature-file-name)) + (if signature-insert-at-eof + (progn + (goto-char (point-max)) + (or (bolp) (insert "\n")) + (if signature-delete-blank-lines-at-eof (delete-blank-lines)) + )) + (run-hooks 'signature-insert-hook) + (if (= (point)(point-max)) + (insert signature-separator) + ) + (insert-file-contents signature-file-name) + (force-mode-line-update) + signature-file-name)) + + +;;; @ end +;;; + +(provide 'signature) + +(run-hooks 'signature-load-hook) + +;;; signature.el ends here diff --git a/semi-1.14.6/smime.el b/semi-1.14.6/smime.el new file mode 100644 index 0000000..f13d811 --- /dev/null +++ b/semi-1.14.6/smime.el @@ -0,0 +1,319 @@ +;;; smime.el --- S/MIME interface. + +;; Copyright (C) 1999 Daiki Ueno + +;; Author: Daiki Ueno <ueno@ueda.info.waseda.ac.jp> +;; Created: 1999/12/08 +;; Keywords: S/MIME, OpenSSL + +;; This file is part of SEMI (Secure Emacs MIME Interface). + +;; 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 2, 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 GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + + +;;; Commentary: + +;; This module is based on + +;; [SMIMEV3] RFC 2633: "S/MIME Version 3 Message Specification" +;; by Crocker, D., Flanigan, B., Hoffman, P., Housley, R., +;; Pawling, J. and Schaad, J. (1999/06) + +;; [SMIMEV2] RFC 2311: "S/MIME Version 2 Message Specification" +;; by Dusse, S., Hoffman, P., Ramsdell, B., Lundblade, L. +;; and L. Repka. (1998/03) + +;;; Code: + +(require 'path-util) +(require 'mel) +;; binary-funcall, binary-write-decoded-region, binary-insert-encoded-file +(eval-when-compile (require 'static)) + +(defgroup smime () + "S/MIME interface" + :group 'mime) + +(defcustom smime-program "smime" + "The S/MIME executable." + :group 'smime + :type 'string) + +(defcustom smime-shell-file-name "/bin/sh" + "File name to load inferior shells from. Bourne shell or its equivalent +\(not tcsh) is needed for \"2>\"." + :group 'smime + :type 'string) + +(defcustom smime-shell-command-switch "-c" + "Switch used to have the shell execute its command line argument." + :group 'smime + :type 'string) + +(defcustom smime-x509-program + (let ((file (exec-installed-p "openssl"))) + (and file (list file "x509" "-noout"))) + "External program for x509 parser." + :group 'smime + :type 'string) + +(defcustom smime-cache-passphrase t + "Cache passphrase." + :group 'smime + :type 'boolean) + +(defcustom smime-certificate-directory "~/.w3/certs" + "Certificate directory." + :group 'smime + :type 'directory) + +(defcustom smime-public-key-file nil + "Public key file." + :group 'smime + :type 'boolean) + +(defcustom smime-private-key-file nil + "Private key file." + :group 'smime + :type 'boolean) + +(defvar smime-errors-buffer " *S/MIME errors*") +(defvar smime-output-buffer " *S/MIME output*") + +;;; @ utility functions +;;; +(put 'smime-process-when-success 'lisp-indent-function 0) + +(defmacro smime-process-when-success (&rest body) + `(with-current-buffer smime-output-buffer + (if (zerop (buffer-size)) nil ,@body t))) + +(defvar smime-passphrase-cache-expiry 16) +(defvar smime-passphrase-cache (make-vector 7 0)) + +(defvar smime-read-passphrase nil) +(defun smime-read-passphrase (prompt &optional key) + (if (not smime-read-passphrase) + (if (functionp 'read-passwd) + (setq smime-read-passphrase 'read-passwd) + (if (load "passwd" t) + (setq smime-read-passphrase 'read-passwd) + (autoload 'ange-ftp-read-passwd "ange-ftp") + (setq smime-read-passphrase 'ange-ftp-read-passwd)))) + (or (and smime-cache-passphrase + (symbol-value (intern-soft key smime-passphrase-cache))) + (funcall smime-read-passphrase prompt))) + +(defun smime-add-passphrase-cache (key passphrase) + (set (intern key smime-passphrase-cache) + passphrase) + (run-at-time smime-passphrase-cache-expiry nil + #'smime-remove-passphrase-cache + key)) + +(defun smime-remove-passphrase-cache (key) + (let ((passphrase (symbol-value (intern-soft key smime-passphrase-cache)))) + (when passphrase + (fillarray passphrase ?_) + (unintern key smime-passphrase-cache)))) + +(defsubst smime-parse-attribute (string) + (delq nil (mapcar + (lambda (attr) + (if (string-match "=" attr) + (cons (intern (substring attr 0 (match-beginning 0))) + (substring attr (match-end 0))) + nil)) + (split-string string "/")))) + +(defsubst smime-query-signer (start end) + (smime-process-region start end smime-program (list "-qs")) + (with-current-buffer smime-output-buffer + (if (zerop (buffer-size)) nil + (goto-char (point-min)) + (when (re-search-forward "^/" nil t) + (smime-parse-attribute + (buffer-substring (point) (progn (end-of-line)(point))))) + ))) + +(defsubst smime-x509-hash (cert-file) + (with-current-buffer (get-buffer-create smime-output-buffer) + (buffer-disable-undo) + (erase-buffer) + (apply #'call-process (car smime-x509-program) nil t nil + (append (cdr smime-x509-program) + (list "-hash" "-in" cert-file))) + (if (zerop (buffer-size)) nil + (buffer-substring (point-min) (1- (point-max)))))) + +(defsubst smime-x509-subject (cert-file) + (with-current-buffer (get-buffer-create smime-output-buffer) + (buffer-disable-undo) + (erase-buffer) + (apply #'call-process (car smime-x509-program) nil t nil + (append (cdr smime-x509-program) + (list "-subject" "-in" cert-file))) + (if (zerop (buffer-size)) nil + (goto-char (point-min)) + (when (re-search-forward "^subject=" nil t) + (smime-parse-attribute + (buffer-substring (point)(progn (end-of-line)(point)))))))) + +(defsubst smime-find-certificate (attr) + (let ((files + (and (file-directory-p smime-certificate-directory) + (delq nil (mapcar (lambda (file) + (if (file-directory-p file) nil + file)) + (directory-files + smime-certificate-directory + 'full)))))) + (catch 'found + (while files + (if (or (string-equal + (cdr (assq 'CN (smime-x509-subject (car files)))) + (cdr (assq 'CN attr))) + (string-equal + (cdr (assq 'Email (smime-x509-subject (car files)))) + (cdr (assq 'Email attr)))) + (throw 'found (car files))) + (pop files))))) + +(defun smime-process-region (start end program args) + (let* ((errors-file-name (make-temp-file "smime-errors")) + (args (append args (list (concat "2>" errors-file-name)))) + (shell-file-name smime-shell-file-name) + (shell-command-switch smime-shell-command-switch) + (process-connection-type nil) + process status exit-status) + (with-current-buffer (get-buffer-create smime-output-buffer) + (buffer-disable-undo) + (erase-buffer)) + (setq process + (apply #'binary-funcall #'start-process-shell-command + "*S/MIME*" smime-output-buffer + program args)) + (set-process-sentinel process 'ignore) + (process-send-region process start end) + (process-send-eof process) + (while (eq 'run (process-status process)) + (accept-process-output process 5)) + (setq status (process-status process) + exit-status (process-exit-status process)) + (delete-process process) + (with-current-buffer smime-output-buffer + (goto-char (point-min)) + (while (re-search-forward "\r$" (point-max) t) + (replace-match "")) + + (if (memq status '(stop signal)) + (error "%s exited abnormally: '%s'" program exit-status)) + (if (= 127 exit-status) + (error "%s could not be found" program)) + + (set-buffer (get-buffer-create smime-errors-buffer)) + (buffer-disable-undo) + (erase-buffer) + (insert-file-contents errors-file-name) + (delete-file errors-file-name) + + (if (and process (eq 'run (process-status process))) + (interrupt-process process)) + ) + )) + +;;; @ interface functions +;;; + +;;;###autoload +(defun smime-encrypt-region (start end) + "Encrypt the current region between START and END." + (let* ((key-file + (or smime-private-key-file + (expand-file-name (read-file-name "Public key file: ")))) + (args (list "-e" key-file))) + (smime-process-region start end smime-program args) + (smime-process-when-success + (goto-char (point-min)) + (delete-region (point-min) (progn + (re-search-forward "^$" nil t) + (1+ (point))))))) + +;;;###autoload +(defun smime-decrypt-region (start end) + "Decrypt the current region between START and END." + (let* ((key-file + (or smime-private-key-file + (expand-file-name (read-file-name "Private key file: ")))) + (hash (smime-x509-hash key-file)) + (passphrase (smime-read-passphrase + (format "S/MIME passphrase for %s: " hash) + hash)) + (args (list "-d" key-file passphrase))) + (smime-process-region start end smime-program args) + (smime-process-when-success + (when smime-cache-passphrase + (smime-add-passphrase-cache hash passphrase))))) + +;;;###autoload +(defun smime-sign-region (start end &optional cleartext) + "Make the signature from text between START and END. +If the optional 3rd argument CLEARTEXT is non-nil, it does not create +a detached signature." + (let* ((key-file + (or smime-private-key-file + (expand-file-name (read-file-name "Private key file: ")))) + (hash (smime-x509-hash key-file)) + (passphrase (smime-read-passphrase + (format "S/MIME passphrase for %s: " hash) + hash)) + (args (list "-ds" key-file passphrase))) + (smime-process-region start end smime-program args) + (smime-process-when-success + (goto-char (point-min)) + (delete-region (point-min) (progn + (re-search-forward "^$" nil t) + (1+ (point)))) + (when smime-cache-passphrase + (smime-add-passphrase-cache hash passphrase))))) + +;;;###autoload +(defun smime-verify-region (start end signature) + "Verify the current region between START and END. +If the optional 3rd argument SIGNATURE is non-nil, it is treated as +the detached signature of the current region." + (let* ((orig-file (make-temp-file "smime")) + (orig-mode (default-file-modes))) + (unwind-protect + (progn + (set-default-file-modes 448) + (binary-write-decoded-region start end orig-file)) + (set-default-file-modes orig-mode)) + (with-temp-buffer + (binary-insert-encoded-file signature) + (goto-char (point-max)) + (binary-insert-encoded-file + (or (smime-find-certificate + (smime-query-signer (point-min)(point-max))) + (expand-file-name + (read-file-name "Certificate file: ")))) + (smime-process-region (point-min)(point-max) smime-program + (list "-dv" orig-file))) + (smime-process-when-success nil))) + +(provide 'smime) + +;;; smime.el ends here