From c8957996e13599000fa35f0751810edf6467a03a Mon Sep 17 00:00:00 2001 From: morioka Date: Sun, 20 Sep 1998 05:55:18 +0000 Subject: [PATCH] (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'. --- mime-def.el | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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))))) -- 1.7.10.4