From: morioka Date: Sun, 20 Sep 1998 05:55:18 +0000 (+0000) Subject: (mel-define-service): New macro (moved from mel.el); fixed problem in X-Git-Tag: chao-1_9-2-199811302358~13 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8957996e13599000fa35f0751810edf6467a03a;p=elisp%2Fflim.git (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'. --- diff --git a/mime-def.el b/mime-def.el index 9c351b8..9e25ee1 100644 --- a/mime-def.el +++ b/mime-def.el @@ -355,11 +355,25 @@ message/rfc822, `mime-entity' structures of them are included in ;;; @ for mel-backend ;;; +(defmacro mel-define-service (name &optional args &rest rest) + (if args + `(progn + (defvar ,(intern (format "%s-obarray" name)) (make-vector 1 nil)) + (defun ,name ,args + ,@rest + (funcall (mel-find-function ',name ,(car (last args))) + ,@(mm-arglist-to-arguments (butlast args))) + )) + `(defvar ,(intern (format "%s-obarray" name)) (make-vector 1 nil)) + )) + +(put 'mel-define-service 'lisp-indent-function 'defun) + (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]) + (mel-define-service ,name) (fset (intern ,class ,(intern (format "%s-obarray" name))) (lambda ,(butlast args) ,@body))))) @@ -372,7 +386,7 @@ message/rfc822, `mime-entity' structures of them are included in (specializer (car (last args))) (class (nth 1 specializer))) `(progn - (defvar ,(intern (format "%s-obarray" name)) [nil]) + (mel-define-service ,name) (fset (intern ,class ,(intern (format "%s-obarray" name))) (symbol-function ,function)))))