From: morioka Date: Sat, 29 May 1999 10:48:43 +0000 (+0000) Subject: (mime-entity-fetch-field): New implementation. X-Git-Tag: chao-1_13_0~7 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=3d084e7f364943a6c99446cbfa9ec479947ca0f3;p=elisp%2Fflim.git (mime-entity-fetch-field): New implementation. --- diff --git a/mmbuffer.el b/mmbuffer.el index 8754e2b..bb2a31c 100644 --- a/mmbuffer.el +++ b/mmbuffer.el @@ -191,15 +191,24 @@ (mm-define-method entity-point-max ((entity buffer)) (mime-buffer-entity-body-end-internal entity)) -(luna-define-method mime-entity-fetch-field ((entity mime-buffer-entity) - field-name) - (save-excursion - (set-buffer (mime-buffer-entity-buffer-internal entity)) - (save-restriction - (narrow-to-region (mime-buffer-entity-header-start-internal entity) - (mime-buffer-entity-header-end-internal entity)) - (std11-fetch-field field-name) - ))) +(luna-define-method mime-entity-fetch-field :around + ((entity mime-buffer-entity) field-name) + (or (luna-call-next-method) + (save-excursion + (set-buffer (mime-buffer-entity-buffer-internal entity)) + (save-restriction + (narrow-to-region (mime-buffer-entity-header-start-internal entity) + (mime-buffer-entity-header-end-internal entity)) + (let ((ret (std11-fetch-field field-name))) + (when ret + (or (symbolp field-name) + (setq field-name + (intern (capitalize (capitalize field-name))))) + (mime-entity-set-original-header-internal + entity + (put-alist field-name ret + (mime-entity-original-header-internal entity))) + ret)))))) (mm-define-method insert-entity-content ((entity buffer)) (insert (with-current-buffer (mime-buffer-entity-buffer-internal entity)