From: Jan Djärv Date: Thu, 4 Nov 2004 14:18:22 +0000 (+0000) Subject: * gtkutil.c (xg_get_file_with_chooser): Expand DEFAULT_FILENAME if X-Git-Tag: ttn-vms-21-2-B4~4191 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a872928c524e28d328ad5abd87ed3bb0f0ebc771;p=emacs.git * gtkutil.c (xg_get_file_with_chooser): Expand DEFAULT_FILENAME if it doesn't start with /. --- diff --git a/src/ChangeLog b/src/ChangeLog index 01d35ba8e9b..4b88374e71e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-11-04 Jan Dj,Ad(Brv + + * gtkutil.c (xg_get_file_with_chooser): Expand DEFAULT_FILENAME if + it doesn't start with /. + 2004-11-04 Kenichi Handa * fontset.c (fontset_pattern_regexp): If '*' is preceded by '\', diff --git a/src/gtkutil.c b/src/gtkutil.c index e1331891140..f59ccecbcb8 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -1178,8 +1178,24 @@ xg_get_file_with_chooser (f, prompt, default_filename, mustmatch_p, only_dir_p) if (default_filename) - gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (filewin), - default_filename); + { + Lisp_Object file; + struct gcpro gcpro1; + GCPRO1 (file); + + /* File chooser does not understand ~/... in the file name. It must be + an absolute name starting with /. */ + if (default_filename[0] != '/') + { + file = Fexpand_file_name (build_string (default_filename), Qnil); + default_filename = SDATA (file); + } + + gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (filewin), + default_filename); + + UNGCPRO; + } gtk_widget_show (filewin);