From: morioka Date: Sat, 19 Sep 1998 17:51:48 +0000 (+0000) Subject: (base64-token-regexp): New constant (moved from eword-decode.el). X-Git-Tag: chao-1_9-2-199811302358~25 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=6683c34cff14f8142c5d0265f58fc385000e0446;p=elisp%2Fflim.git (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. --- diff --git a/mime-def.el b/mime-def.el index 2e308c7..b693925 100644 --- a/mime-def.el +++ b/mime-def.el @@ -107,7 +107,30 @@ (concat mime-token-regexp "/" mime-token-regexp)) -;;; @@ Quoted-Printable +;;; @@ 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") @@ -116,6 +139,12 @@ (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 ;;; @@ -275,6 +304,8 @@ message/rfc822, `mime-entity' structures of them are included in ;;; @ for mm-backend ;;; +(require 'alist) + (defvar mime-entity-implementation-alist nil) (defmacro mm-define-backend (type &optional parents) @@ -310,6 +341,51 @@ message/rfc822, `mime-entity' structures of them are included in (put 'mm-define-method 'edebug-form-spec '(&define name ((arg symbolp) &rest arg) def-body)) +(defsubst mm-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))) + + +;;; @ for mel-backend +;;; + +(defmacro mel-define-method (name args &rest body) + (let* ((specializer (car (last args))) + (class (nth 1 specializer))) + `(progn + (defvar ,(intern (format "%s-obarray" name)) [nil]) + (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) + (let* ((name (car spec)) + (args (cdr spec)) + (specializer (car (last args))) + (class (nth 1 specializer))) + `(progn + (defvar ,(intern (format "%s-obarray" name)) [nil]) + (fset (intern ,class ,(intern (format "%s-obarray" name))) + (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)))) + ))) + ;;; @ end ;;;