X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=mime-def.el;h=00f4d54c39b35e585a6978c1ee9a27377853152d;hb=3c07ee018fb2fa3178e4eef483aee0326a2a52a6;hp=a9521213acc7a93750ac552df2632e761c49dd13;hpb=57f9c6aeeb190fe45d405b0b059445bba3d6edfd;p=elisp%2Fflim.git diff --git a/mime-def.el b/mime-def.el index a952121..00f4d54 100644 --- a/mime-def.el +++ b/mime-def.el @@ -1,6 +1,6 @@ ;;; mime-def.el --- definition module about MIME -;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc. +;; Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc. ;; Author: MORIOKA Tomohiko ;; Keywords: definition, MIME, multimedia, mail, news @@ -24,8 +24,10 @@ ;;; Code: +(require 'mcharset) + (eval-and-compile - (defconst mime-library-product ["FLAM-DOODLE" (1 11 0) "小豆 2.5R3.5/5.0"] + (defconst mime-library-product ["FLAM-DOODLE" (1 12 2) "代赭 10R4.5/8.0"] "Product name, version number and code name of MIME-library package.") ) @@ -61,16 +63,6 @@ (custom-handle-keyword 'default-mime-charset :group 'mime 'custom-variable) -(defcustom mime-temp-directory (or (getenv "MIME_TMP_DIR") - (getenv "TM_TMP_DIR") - (getenv "TMPDIR") - (getenv "TMP") - (getenv "TEMP") - "/tmp/") - "*Directory for temporary files." - :group 'mime - :type 'directory) - (defcustom mime-uuencode-encoding-name-list '("x-uue" "x-uuencode") "*List of encoding names for uuencode format." :group 'mime @@ -80,12 +72,6 @@ ;;; @ required functions ;;; -(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)) - (defsubst regexp-* (regexp) (concat regexp "*")) @@ -96,22 +82,28 @@ ;;; @ about STD 11 ;;; -(defconst std11-quoted-pair-regexp "\\\\.") -(defconst std11-non-qtext-char-list '(?\" ?\\ ?\r ?\n)) -(defconst std11-qtext-regexp - (concat "[^" (char-list-to-string std11-non-qtext-char-list) "]")) +(eval-and-compile + (defconst std11-quoted-pair-regexp "\\\\.") + (defconst std11-non-qtext-char-list '(?\" ?\\ ?\r ?\n)) + (defconst std11-qtext-regexp + (eval-when-compile + (concat "[^" (apply #'string std11-non-qtext-char-list) "]")))) (defconst std11-quoted-string-regexp - (concat "\"" - (regexp-* - (regexp-or std11-qtext-regexp std11-quoted-pair-regexp)) - "\"")) + (eval-when-compile + (concat "\"" + (regexp-* + (regexp-or std11-qtext-regexp std11-quoted-pair-regexp)) + "\""))) ;;; @ about MIME ;;; -(defconst mime-tspecials "][()<>@,\;:\\\"/?=") -(defconst mime-token-regexp (concat "[^" mime-tspecials "\000-\040]+")) +(defconst mime-tspecial-char-list + '(?\] ?\[ ?\( ?\) ?< ?> ?@ ?, ?\; ?: ?\\ ?\" ?/ ?? ?=)) +(defconst mime-token-regexp + (eval-when-compile + (concat "[^" mime-tspecial-char-list "\000-\040]+"))) (defconst mime-charset-regexp mime-token-regexp) (defconst mime-media-type/subtype-regexp @@ -407,8 +399,27 @@ specialized parameter. (car (car ARGS)) is name of variable and (nth )))) (put 'mm-define-method 'lisp-indent-function 'defun) -(put 'mm-define-method 'edebug-form-spec - '(&define name ((arg symbolp) &rest arg) def-body)) + +(eval-when-compile + (defmacro eval-module-depended-macro (module definition) + (condition-case nil + (progn + (require (eval module)) + definition) + (error `(eval-after-load ,(symbol-name (eval module)) ',definition)) + )) + ) + +(eval-module-depended-macro + 'edebug + (def-edebug-spec mm-define-method + (&define name ((arg symbolp) + [&rest arg] + [&optional ["&optional" arg &rest arg]] + &optional ["&rest" arg] + ) + def-body)) + ) (defsubst mm-arglist-to-arguments (arglist) (let (dest) @@ -527,10 +538,14 @@ variable and (nth 1 (car (last ARGS))) is name of backend (encoding)." ))) (defvar base64-dl-module - (and (fboundp 'dynamic-link) - (let ((path (expand-file-name "base64.so" exec-directory))) - (and (file-exists-p path) - path)))) + (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