From: morioka Date: Wed, 17 Jun 1998 19:35:52 +0000 (+0000) Subject: (mime-entity-uu-filename): fixed. X-Git-Tag: remi-199811302358~9 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=4217a9c4a256317db64046224b50b4ca022c5580;p=elisp%2Fsemi.git (mime-entity-uu-filename): fixed. (mime-entity-filename): Moved from mime-play.el. (mime-view-entity-title): Use `mime-entity-filename'. --- diff --git a/mime-view.el b/mime-view.el index 694e1e1..9109f57 100644 --- a/mime-view.el +++ b/mime-view.el @@ -248,14 +248,15 @@ If optional argument MESSAGE-INFO is not specified, mime-view-uuencode-encoding-name-list) (save-excursion (set-buffer (mime-entity-buffer entity)) - (if (re-search-forward "^begin [0-9]+ " nil t) + (goto-char (mime-entity-body-start entity)) + (if (re-search-forward "^begin [0-9]+ " + (mime-entity-body-end entity) t) (if (looking-at ".+$") (buffer-substring (match-beginning 0)(match-end 0)) ))))) -(defun mime-view-entity-title (entity) - (or (mime-entity-read-field entity 'Content-Description) - (mime-entity-read-field entity 'Subject) +(defun mime-entity-filename (entity) + (or (mime-entity-uu-filename entity) (let ((ret (mime-entity-content-disposition entity))) (and ret (setq ret (mime-content-disposition-filename ret)) @@ -271,7 +272,12 @@ If optional argument MESSAGE-INFO is not specified, ))) (std11-strip-quoted-string ret) )) - (mime-entity-uu-filename entity) + )) + +(defun mime-view-entity-title (entity) + (or (mime-entity-read-field entity 'Content-Description) + (mime-entity-read-field entity 'Subject) + (mime-entity-filename entity) "")) @@ -772,14 +778,9 @@ The compressed face will be piped to this command.") (setq preview-buffer (current-buffer))) (let* ((raw-buffer (mime-entity-buffer entity)) (start (mime-entity-point-min entity)) - (end (mime-entity-point-max entity)) - e nb ne subj) + e nb ne) (set-buffer raw-buffer) (goto-char start) - (save-restriction - (narrow-to-region start end) - (setq subj (mime-view-entity-title entity)) - ) (or situation (setq situation (or (ctree-match-calist mime-preview-condition @@ -801,7 +802,8 @@ The compressed face will be piped to this command.") (narrow-to-region nb nb) (or button-is-invisible (if (mime-view-entity-button-visible-p entity) - (mime-view-insert-entity-button entity subj) + (mime-view-insert-entity-button entity + (mime-view-entity-title entity)) )) (when header-is-visible (if header-presentation-method @@ -820,21 +822,14 @@ The compressed face will be piped to this command.") (run-hooks 'mime-display-header-hook) ) (cond (children) - ;; ((eq body-presentation-method 'with-filter) - ;; (let ((body-filter (cdr (assq 'body-filter situation)))) - ;; (save-restriction - ;; (narrow-to-region (point-max)(point-max)) - ;; (insert-buffer-substring - ;; raw-buffer (mime-entity-body-start entity) end) - ;; (funcall body-filter situation) - ;; ))) - ((functionp body-presentation-method) + ((functionp body-presentation-method) (funcall body-presentation-method entity situation) ) (t (when button-is-invisible (goto-char (point-max)) - (mime-view-insert-entity-button entity subj) + (mime-view-insert-entity-button entity + (mime-view-entity-title entity)) ) (or header-is-visible (progn