From ac44adb5ae97f30ab7af3e24b1aaf1a988b8158c Mon Sep 17 00:00:00 2001 From: hayashi Date: Mon, 20 Mar 2000 13:20:29 +0000 Subject: [PATCH] Fix the error finding boundary of entity with composite part --- ChangeLog | 7 +++++++ mime-view.el | 43 +++++++++++++++++++++++++++++-------------- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 32b24ab..aa5afb7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2000-03-20 Yoshiki Hayashi + + * mime-view.el (mime-preview-follow-current-entity): Fix the bug + without header part. + (mime-preview-entity-boundary): Fix the case that last part + is composite type. + 2000-03-18 Yoshiki Hayashi * mime-view.el (mime-display-gzipped): Temporaly hack for FSF Emacs diff --git a/mime-view.el b/mime-view.el index 09f0134..f33dd26 100644 --- a/mime-view.el +++ b/mime-view.el @@ -1525,6 +1525,7 @@ It calls following-method selected from variable (if header-exists (delete-region (goto-char (point-min)) (re-search-forward "^$")) + (goto-char (point-min)) (insert "\n")) (goto-char (point-min)) (let ((current-entity @@ -1730,20 +1731,34 @@ If LINES is negative, scroll up LINES lines." (let ((entity (get-text-property point 'mime-view-entity)) (start (previous-single-property-change (1+ point) 'mime-view-entity nil (point-min))) - (end point) - done) - (while (and (mime-entity-children entity) - (not done)) - (if (not (mime-view-body-is-visible - (get-text-property point 'mime-view-situation))) - (setq done t) - ;; If the part is shown, search the last part. - (let ((child (car (last (mime-entity-children entity))))) - (while (not (eq (get-text-property point 'mime-view-entity) child)) - (setq point (next-single-property-change point 'mime-view-entity))) - (setq entity child)))) - (setq end (next-single-property-change point 'mime-view-entity - nil (point-max))) + end done) + (if (not (mime-entity-node-id entity)) + (setq end (point-max)) + (while (and (mime-entity-children entity) + (not done)) + (if (not (mime-view-body-is-visible + (get-text-property point 'mime-view-situation))) + (setq done t) + ;; If the part is shown, search the last part. + (let* ((child (car (last (mime-entity-children entity)))) + (node-id (mime-entity-node-id child)) + (tmp-node-id (mime-entity-node-id + (get-text-property point + 'mime-view-entity)))) + (while (or (< (length tmp-node-id) + (length node-id)) + (not (eq (nthcdr (- (length tmp-node-id) + (length node-id)) + tmp-node-id) + node-id))) + (setq point + (next-single-property-change point 'mime-view-entity) + tmp-node-id (mime-entity-node-id + (get-text-property point + 'mime-view-entity)))) + (setq entity child)))) + (setq end (next-single-property-change + point 'mime-view-entity nil (point-max)))) (cons start end))) (defun mime-preview-toggle-header (&optional show) -- 1.7.10.4