]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fread_file_name): Handle case that DIR contains a
authorGerd Moellmann <gerd@gnu.org>
Sun, 12 Mar 2000 16:24:20 +0000 (16:24 +0000)
committerGerd Moellmann <gerd@gnu.org>
Sun, 12 Mar 2000 16:24:20 +0000 (16:24 +0000)
file name.

src/ChangeLog
src/fileio.c

index 05fe2b51de5cea429012a82d0c9230e22aba4651..41fd1d6d768c757231c900c00e4daadd70bc76f5 100644 (file)
@@ -1,5 +1,8 @@
 2000-03-12  Gerd Moellmann  <gerd@gnu.org>
 
+       * fileio.c (Fread_file_name): Handle case that DIR contains a 
+       file name.
+
        * window.c (Fsave_window_excursion): Doc fix.
 
        * xfns.c (x_defined_color): Rewritten to use
index 8c03a5b595ba578f5cdb8b715037fb7151b16ccd..726d3fca803a3104db4fea2472f9e6ea9f38b898 100644 (file)
@@ -5596,6 +5596,15 @@ DIR defaults to current buffer's directory default.")
       && use_dialog_box
       && have_menus_p ())
     {
+      /* If DIR contains a file name, split it.  */
+      Lisp_Object file;
+      file = Ffile_name_nondirectory (dir);
+      if (XSTRING (file)->size && NILP (default_filename))
+       {
+         default_filename = file;
+         dir = Ffile_name_directory (dir);
+       }
+      default_filename = Fexpand_file_name (default_filename, dir);
       val = Fx_file_dialog (prompt, dir, default_filename, mustmatch);
       add_to_history = 1;
     }