From 7b31c3a274539d4cd385acec38274e03517f44eb Mon Sep 17 00:00:00 2001 From: hmurata Date: Sun, 27 Mar 2005 17:43:09 +0000 Subject: [PATCH] * modb-entity.el (initialize-instance): Define. (modb-entity-handler-mime-charset): New internal function. (modb-standard-entity-set-field): Use it. (elmo-msgdb-message-entity-field): Ditto. (elmo-msgdb-message-entity-field): Ditto. --- elmo/ChangeLog | 6 ++++++ elmo/modb-entity.el | 20 ++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 0982a00..c9b8102 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,5 +1,11 @@ 2005-03-27 Hiroya Murata + * modb-entity.el (initialize-instance): Define. + (modb-entity-handler-mime-charset): New internal function. + (modb-standard-entity-set-field): Use it. + (elmo-msgdb-message-entity-field): Ditto. + (elmo-msgdb-message-entity-field): Ditto. + * modb.el (elmo-msgdb-match-condition): Rewrite with `elmo-condition-match'. (elmo-msgdb-match-condition-primitive): New function. diff --git a/elmo/modb-entity.el b/elmo/modb-entity.el index a6a445b..413d352 100644 --- a/elmo/modb-entity.el +++ b/elmo/modb-entity.el @@ -133,6 +133,12 @@ Header region is supposed to be narrowed.") "Return non-nil when the entity matches the condition.") ;; Generic implementation. +(luna-define-method initialize-instance :after ((handler modb-entity-handler) + &rest init-args) + (unless (modb-entity-handler-mime-charset-internal handler) + (modb-entity-handler-set-mime-charset-internal handler elmo-mime-charset)) + handler) + (luna-define-method modb-entity-handler-list-parameters ((handler modb-entity-handler)) (list 'mime-charset)) @@ -191,6 +197,11 @@ Header region is supposed to be narrowed.") (setq updated t))) updated)) +;; helper functions +(defsubst modb-entity-handler-mime-charset (handler) + (or (modb-entity-handler-mime-charset-internal handler) + elmo-mime-charset)) + (defun modb-entity-handler-equal-p (handler other) "Return non-nil, if OTHER hanlder is equal this HANDLER." (and (eq (luna-class-name handler) @@ -619,8 +630,7 @@ If each field is t, function is set as default converter." (let (index) (unless as-is (let ((elmo-mime-charset - (or (modb-entity-handler-mime-charset-internal (car entity)) - elmo-mime-charset))) + (modb-entity-handler-mime-charset (car entity)))) (setq value (modb-convert-field-value modb-standard-entity-normalizer field value)))) (cond ((memq field '(message-id :message-id)) @@ -667,8 +677,7 @@ If each field is t, function is set as default converter." ((handler modb-standard-entity-handler) entity field &optional type) (and entity (let ((elmo-mime-charset - (or (modb-entity-handler-mime-charset-internal handler) - elmo-mime-charset)) + (modb-entity-handler-mime-charset handler)) index) (modb-convert-field-value modb-standard-entity-specializer @@ -869,8 +878,7 @@ If each field is t, function is set as default converter." ((handler modb-buffer-entity-handler) entity field &optional type) (and entity (let ((elmo-mime-charset - (or (modb-entity-handler-mime-charset-internal handler) - elmo-mime-charset))) + (modb-entity-handler-mime-charset handler))) (modb-convert-field-value modb-buffer-entity-specializer field -- 1.7.10.4