From f306610bfdf4a79c261c844118d4f44031ab9efb Mon Sep 17 00:00:00 2001 From: morioka Date: Fri, 2 Oct 1998 19:49:01 +0000 Subject: [PATCH] Use `generic' as mother backend; abolish method `entity-header-start', `entity-header-end' and `fetch-field'. (entity-buffer): New method. --- lisp/mmgnus.el | 64 +++++++++++++++++++++----------------------------------- 1 file changed, 24 insertions(+), 40 deletions(-) diff --git a/lisp/mmgnus.el b/lisp/mmgnus.el index 0ecc7f9..489065d 100644 --- a/lisp/mmgnus.el +++ b/lisp/mmgnus.el @@ -26,47 +26,31 @@ (require 'mmbuffer) -(mm-define-backend gnus (buffer)) - -(mm-define-method entity-header-start ((entity gnus)) - (save-excursion - (set-buffer (mime-entity-buffer-internal entity)) - (goto-char (point-min)) - )) - -(mm-define-method entity-header-end ((entity gnus)) - (save-excursion - (set-buffer (mime-entity-buffer-internal entity)) - (goto-char (point-min)) +(mm-define-backend gnus (generic)) + +(mm-define-method entity-buffer ((entity gnus)) + ;; (if (with-current-buffer gnus-summary-buffer + ;; (eq gnus-current-article (mail-header-number entity))) + ;; ...) + (unless (mime-entity-header-start-internal entity) + (set-buffer gnus-original-article-buffer) + (mime-entity-set-header-start-internal entity (point-min)) + (mime-entity-set-body-end-internal entity (point-max)) (if (re-search-forward "^$" nil t) - (match-end 0) - ))) - -(mm-define-method fetch-field ((entity gnus) field-name) - (save-excursion - (set-buffer (mime-entity-buffer-internal entity)) - (unless (mime-entity-header-start-internal entity) - (mime-entity-set-header-start-internal entity (point-min)) - (mime-entity-set-body-end-internal entity (point-max)) - (if (re-search-forward "^$" nil t) - (progn - (mime-entity-set-header-end-internal entity (match-end 0)) - (mime-entity-set-body-start-internal - entity - (if (= (mime-entity-header-end-internal entity) - (mime-entity-body-end-internal entity)) - (mime-entity-body-end-internal entity) - (1+ (mime-entity-header-end-internal entity)) - )) - ) - (mime-entity-set-header-end-internal entity (point-min)) - (mime-entity-set-body-start-internal entity (point-min)) - )) - (save-restriction - (narrow-to-region (mime-entity-header-start-internal entity) - (mime-entity-header-end-internal entity)) - (std11-fetch-field field-name) - ))) + (progn + (mime-entity-set-header-end-internal entity (match-end 0)) + (mime-entity-set-body-start-internal + entity + (if (= (mime-entity-header-end-internal entity) + (mime-entity-body-end-internal entity)) + (mime-entity-body-end-internal entity) + (1+ (mime-entity-header-end-internal entity)) + )) + ) + (mime-entity-set-header-end-internal entity (point-min)) + (mime-entity-set-body-start-internal entity (point-min)) + )) + gnus-original-article-buffer) ;;; @ end -- 1.7.10.4