From: yamaoka Date: Wed, 10 Nov 1999 04:15:43 +0000 (+0000) Subject: Sync up with semi-1_13. X-Git-Tag: wemi-1_13-last-~9 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=ebcfdaaa8c0475436b76249f3835c41af8d555e0;p=elisp%2Fsemi.git Sync up with semi-1_13. --- diff --git a/ChangeLog b/ChangeLog index 73ee175..abac3cd 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 Katsumi Yamaoka * semi-def.el (mime-insert-button): Simplify. 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)) ))