From: Gerd Moellmann Date: Sun, 12 Mar 2000 16:24:20 +0000 (+0000) Subject: (Fread_file_name): Handle case that DIR contains a X-Git-Tag: emacs-pretest-21.0.90~4667 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9172b88ddf0f6cf94bdf9df36c74235ce09754dc;p=emacs.git (Fread_file_name): Handle case that DIR contains a file name. --- diff --git a/src/ChangeLog b/src/ChangeLog index 05fe2b51de5..41fd1d6d768 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2000-03-12 Gerd Moellmann + * 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 diff --git a/src/fileio.c b/src/fileio.c index 8c03a5b595b..726d3fca803 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -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; }