From 560fd9f1b407bdd6c4cd52f4544b63183fe7814e Mon Sep 17 00:00:00 2001 From: morioka Date: Tue, 7 Jul 1998 08:21:11 +0000 Subject: [PATCH] Move `mime-entity-implementation-alist' to mime-def.el. (mime-find-function): New implementation. (mime-entity-cooked-p): Use `mime-entity-send'. (mime-entity-point-min): Change message to `point-min'. (mime-entity-point-max): Change message to `point-max'. (mime-entity-header-start): Change message to `header-start'. (mime-entity-header-end): Change message to `header-end'. (mime-entity-body-start): Change message to `body-start'. (mime-entity-body-end): Change message to `body-end'. --- mime.el | 39 +++++++++++++-------------------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/mime.el b/mime.el index 7961592..67f15b4 100644 --- a/mime.el +++ b/mime.el @@ -63,25 +63,14 @@ current-buffer, and return it.") ;;; @ Entity Representation and Implementation ;;; -(defvar mime-entity-implementation-alist nil) - (defsubst mime-find-function (service type) (let ((imps (cdr (assq type mime-entity-implementation-alist)))) (if imps - (let ((func (cdr (assq service imps)))) - (unless func - (setq func (intern (format "mm%s-%s" type service))) - (set-alist 'mime-entity-implementation-alist - type (put-alist service func imps)) - ) - func) - (let ((prefix (format "mm%s" type))) - (require (intern prefix)) - (let ((func (intern (format "%s-%s" prefix service)))) - (set-alist 'mime-entity-implementation-alist - type - (list (cons service func))) - func))))) + (cdr (assq service imps)) + (require (intern (format "mm%s" type))) + (cdr (assq service + (cdr (assq type mime-entity-implementation-alist)))) + ))) (defsubst mime-entity-function (entity service) (mime-find-function service @@ -98,13 +87,11 @@ current-buffer, and return it.") TYPE is representation-type. LOCATION is location of entity. Specification of it is depended on representation-type." - (funcall (mime-find-function 'open-entity type) location) - ) + (funcall (mime-find-function 'open-entity type) location)) (defun mime-entity-cooked-p (entity) "Return non-nil if contents of ENTITY has been already code-converted." - (funcall (mime-entity-function entity 'cooked-p)) - ) + (mime-entity-send entity 'cooked-p)) ;;; @ Entity as node of message @@ -161,26 +148,26 @@ ENTITY is used." (mime-entity-send entity 'entity-buffer))) (defun mime-entity-point-min (entity) - (mime-entity-send entity 'entity-point-min)) + (mime-entity-send entity 'point-min)) (defun mime-entity-point-max (entity) - (mime-entity-send entity 'entity-point-max)) + (mime-entity-send entity 'point-max)) (defun mime-entity-header-start (entity) (or (mime-entity-header-start-internal entity) - (mime-entity-send entity 'entity-header-start))) + (mime-entity-send entity 'header-start))) (defun mime-entity-header-end (entity) (or (mime-entity-header-end-internal entity) - (mime-entity-send entity 'entity-header-end))) + (mime-entity-send entity 'header-end))) (defun mime-entity-body-start (entity) (or (mime-entity-body-start-internal entity) - (mime-entity-send entity 'entity-body-start))) + (mime-entity-send entity 'body-start))) (defun mime-entity-body-end (entity) (or (mime-entity-body-end-internal entity) - (mime-entity-send entity 'entity-body-end))) + (mime-entity-send entity 'body-end))) ;;; @ Entity Header -- 1.7.10.4