[gnus git] branch master updated: m0-5-257-g48cc7e3 =1= mm-decode.el (mm-save-part): Handle invalid read-file-name results

Katsumi Yamaoka <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  48cc7e320a61269896fa2309bfc70b4f290bfaad (commit)
      from  6e4ace6efa3f7082c50d70c9bc83f8b1d1584db5 (commit)


- Log -----------------------------------------------------------------
commit 48cc7e320a61269896fa2309bfc70b4f290bfaad
Author: Christopher Schmidt <[email protected]>
Date:   Wed Jan 30 09:44:33 2013 +0000

    mm-decode.el (mm-save-part): Handle invalid read-file-name results

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b4f426e..62f5d38 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2013-01-30  Christopher Schmidt  <[email protected]>
+
+	* mm-decode.el (mm-save-part): Handle invalid read-file-name results.
+
 2013-01-21  Lars Magne Ingebrigtsen  <[email protected]>
 
 	* gnus-sum.el (gnus-summary-read-group-1): Protect against not being
diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el
index b5e4d3e..812ee73 100644
--- a/lisp/mm-decode.el
+++ b/lisp/mm-decode.el
@@ -1298,6 +1298,8 @@ PROMPT overrides the default one used to ask user for a file name."
     (when filename
       (setq filename (gnus-map-function mm-file-name-rewrite-functions
 					(file-name-nondirectory filename))))
+    (while
+	(progn
     (setq file
           (read-file-name
 	   (or prompt
@@ -1306,6 +1308,16 @@ PROMPT overrides the default one used to ask user for a file name."
 	   (or mm-default-directory default-directory)
 	   (expand-file-name (or filename "")
 			     (or mm-default-directory default-directory))))
+	  (cond ((or (not file) (equal file ""))
+		 (message "Please enter a file name")
+		 t)
+		((and (file-directory-p file)
+		      (not filename))
+		 (message "Please enter a non-directory file name")
+		 t)
+		(t nil)))
+      (sit-for 2)
+      (discard-input))
     (if (file-directory-p file)
 	(setq file (expand-file-name filename file))
       (setq file (expand-file-name

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog    |    4 ++++
 lisp/mm-decode.el |   28 ++++++++++++++++++++--------
 2 files changed, 24 insertions(+), 8 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.