From a872928c524e28d328ad5abd87ed3bb0f0ebc771 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 4 Nov 2004 14:18:22 +0000 Subject: [PATCH] * gtkutil.c (xg_get_file_with_chooser): Expand DEFAULT_FILENAME if it doesn't start with /. --- src/ChangeLog | 5 +++++ src/gtkutil.c | 20 ++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) 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); -- 2.39.5