From xemacs-m  Tue Feb 25 00:00:16 1997
Received: from mecca.spd.louisville.edu (mecca.spd.louisville.edu [136.165.40.148])
	by xemacs.org (8.8.5/8.8.5) with SMTP id AAA21698
	for <xemacs-beta@xemacs.org>; Tue, 25 Feb 1997 00:00:13 -0600 (CST)
Received: (from tjchol01@localhost) by mecca.spd.louisville.edu (950413.SGI.8.6.12/8.6.12) id GAA29963; Tue, 25 Feb 1997 06:00:17 GMT
Date: Tue, 25 Feb 1997 06:00:17 GMT
Message-Id: <199702250600.GAA29963@mecca.spd.louisville.edu>
From: "Tomasz J. Cholewo" <tjchol01@mecca.spd.louisville.edu>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: XEmacs-Beta Listserv <xemacs-beta@xemacs.org>
Subject: [patch; bug] VM-6.15 vm-mime-send-body-to-file (again); button gone

Hello,

I still think that the behavior of saving mime attachments should be
close to `write-file', i.e., when the default filename exists supplying
only a directory should just save the file there.  The following patch
implements this using Kyle's idea to repeat attempts until success.

ObBug: After saving an attachment the button representing it usually
mysteriously disappears and one needs to move to another message and
back to see it again.  I noticed it on a tty and I don't know if it
happens also under X.

Tom
--- vm-mime.el.orig	Sat Feb 22 15:04:23 1997
+++ vm-mime.el	Tue Feb 25 00:47:37 1997
@@ -1946,17 +1946,17 @@
 			 default-filename)
 	       "Write MIME body to file: ")
 	     dir default-filename)
-	  file (expand-file-name file dir))
-      (if (not (file-directory-p file))
-	  (setq done t)
-	(if default-filename
-	    (message "%s is a directory" file)
-	  (error "%s is a directory" file))
-	(sit-for 2)
-	(setq dir file
-	      default-filename (if (string-match "/$" file)
-				   (concat file default-filename)
-				 (concat file "/" default-filename)))))
+	    file (expand-file-name file dir))
+      (setq done t)
+      (if (file-directory-p file)
+	  (if default-filename
+	      (setq file (concat (file-name-as-directory file)
+				 (file-name-nondirectory default-filename)))
+	    (setq dir (file-name-as-directory file))
+	    (message "%s is a directory" dir)
+	    (sit-for 2)
+	    (setq file nil
+		  done nil))))
     (save-excursion
       (unwind-protect
 	  (progn

