From: yamaoka Date: Wed, 10 Nov 1999 04:15:53 +0000 (+0000) Subject: Sync up with semi-1_13. X-Git-Tag: emiko-1_13_7~25 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb2268bf1b9edd20fbc65d6d94166139d95715fb;p=elisp%2Fsemi.git Sync up with semi-1_13. --- diff --git a/ChangeLog b/ChangeLog index 8738d62..f6ce0f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +1999-11-10 Yoshiki Hayashi + + * mime-play.el: (mime-save-directory): New variable. + (mime-save-content): Don't force filename parameter to be used. + 1999-11-09 Daiki Ueno * pgg-pgp.el, pgg-pgp5.el diff --git a/mime-play.el b/mime-play.el index b4a03a2..b98ccea 100644 --- a/mime-play.el +++ b/mime-play.el @@ -36,6 +36,13 @@ (error (defvar bbdb-buffer-name nil))) ) +(defcustom mime-save-directory "~/" + "*Name of the directory where MIME entity will be saved in. +If t, it means current directory." + :group 'mime-view + :type '(choice (const :tag "Current directory" t) + (directory))) + (defvar mime-acting-situation-example-list nil) (defvar mime-acting-situation-example-list-max-size 16) @@ -459,26 +466,25 @@ window.") ;;; (defun mime-save-content (entity situation) - (let* ((name (mime-entity-safe-filename entity)) - (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))))))) - ) + (let ((name (or (mime-entity-safe-filename entity) + (format "%s" (mime-entity-media-type entity)))) + (dir (if (eq t mime-save-directory) + default-directory + mime-save-directory)) + filename) + (setq filename (read-file-name + (concat "File name: (default " + (file-name-nondirectory name) ") ") + dir + (concat (file-name-as-directory dir) + (file-name-nondirectory name)))) + (if (file-directory-p filename) + (setq filename (concat (file-name-as-directory filename) + (file-name-nondirectory name)))) (if (file-exists-p filename) (or (yes-or-no-p (format "File %s exists. Save anyway? " filename)) (error ""))) - (mime-write-entity-content entity filename) + (mime-write-entity-content entity (expand-file-name filename)) ))