From: morioka Date: Fri, 19 Jun 1998 22:19:36 +0000 (+0000) Subject: (mime-save-content): Use `mime-entity-body-start' and X-Git-Tag: semi-1_7_1~32 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=d053c7790b94f427bf6d7431b2f0e13f8e227bc1;p=elisp%2Fsemi.git (mime-save-content): Use `mime-entity-body-start' and `mime-entity-body-end'. --- 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