From c9a00dad88f19787c0d03888a4d78e3b015ab52c Mon Sep 17 00:00:00 2001 From: tomo Date: Thu, 10 Feb 2000 10:10:05 +0000 Subject: [PATCH] (mime-preview-follow-current-entity): Use `mime-view-entity-body' to find body. --- mime-view.el | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/mime-view.el b/mime-view.el index e33aecc..7541b43 100644 --- a/mime-view.el +++ b/mime-view.el @@ -1449,21 +1449,17 @@ It calls following-method selected from variable (interactive) (let ((entity (mime-preview-find-boundary-info t)) p-beg p-end - ph-end) + pb-beg) (setq p-beg (aref entity 0) p-end (aref entity 1) entity (aref entity 2)) - (let ((situation (get-text-property (point) 'mime-view-situation))) - (if (eq (cdr (or (assq '*header situation) - (assq 'header situation))) - 'visible) - (progn - (setq ph-end - (next-single-property-change p-beg 'mime-view-entity-header)) - (if (or (null ph-end) - (> ph-end p-end)) - (setq ph-end p-end))) - (setq ph-end p-beg))) + (if (get-text-property p-beg 'mime-view-entity-body) + (setq pb-beg p-beg) + (setq pb-beg + (next-single-property-change + p-beg 'mime-view-entity-body nil + (or (next-single-property-change p-beg 'mime-view-entity) + p-end)))) (let* ((mode (mime-preview-original-major-mode 'recursive)) (entity-node-id (mime-entity-node-id entity)) (new-name @@ -1474,10 +1470,8 @@ It calls following-method selected from variable (save-excursion (set-buffer (setq new-buf (get-buffer-create new-name))) (erase-buffer) - (insert-buffer-substring the-buf ph-end p-end) - (when (= ph-end p-beg) - (goto-char (point-min)) - (insert ?\n)) + (insert ?\n) + (insert-buffer-substring the-buf pb-beg p-end) (goto-char (point-min)) (let ((current-entity (if (and (eq (mime-entity-media-type entity) 'message) -- 1.7.10.4