From d053c7790b94f427bf6d7431b2f0e13f8e227bc1 Mon Sep 17 00:00:00 2001 From: morioka Date: Fri, 19 Jun 1998 22:19:36 +0000 Subject: [PATCH] (mime-save-content): Use `mime-entity-body-start' and `mime-entity-body-end'. --- mime-play.el | 55 +++++++++++++++++++++++++------------------------------ 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/mime-play.el b/mime-play.el index 8c94c23..b5f1ac0 100644 --- a/mime-play.el +++ b/mime-play.el @@ -308,36 +308,31 @@ window.") ;;; @ file extraction ;;; -(defun mime-save-content (entity cal) - (let ((beg (mime-entity-point-min entity)) - (end (mime-entity-point-max entity))) - (goto-char beg) - (let* ((name (save-restriction - (narrow-to-region beg end) - (mime-entity-safe-filename entity) - )) - (encoding (or (cdr (assq 'encoding cal)) "7bit")) - (filename (if (and name (not (string-equal name ""))) - (expand-file-name name - (save-window-excursion - (call-interactively - (function - (lambda (dir) - (interactive "DDirectory: ") - dir))))) - (save-window-excursion - (call-interactively - (function - (lambda (file) - (interactive "FFilename: ") - (expand-file-name file))))))) - ) - (if (file-exists-p filename) - (or (yes-or-no-p (format "File %s exists. Save anyway? " filename)) - (error ""))) - (re-search-forward "\n\n") - (mime-write-decoded-region (match-end 0) end filename encoding) - ))) +(defun mime-save-content (entity situation) + (let* ((name (mime-entity-safe-filename entity)) + (encoding (or (mime-entity-encoding entity) "7bit")) + (filename (if (and name (not (string-equal name ""))) + (expand-file-name name + (save-window-excursion + (call-interactively + (function + (lambda (dir) + (interactive "DDirectory: ") + dir))))) + (save-window-excursion + (call-interactively + (function + (lambda (file) + (interactive "FFilename: ") + (expand-file-name file))))))) + ) + (if (file-exists-p filename) + (or (yes-or-no-p (format "File %s exists. Save anyway? " filename)) + (error ""))) + (mime-write-decoded-region (mime-entity-body-start entity) + (mime-entity-body-end entity) + filename encoding) + )) ;;; @ file detection -- 1.7.10.4