summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2004-11-04 14:18:22 +0000
committerJan Djärv <jan.h.d@swipnet.se>2004-11-04 14:18:22 +0000
commita872928c524e28d328ad5abd87ed3bb0f0ebc771 (patch)
tree1f42b201d1934ebfe952b2f4df6d2a5a3e624950
parentfb54e72e289a810b1c4c90e78c720c23c4e1d47d (diff)
downloademacs-a872928c524e28d328ad5abd87ed3bb0f0ebc771.tar.gz
emacs-a872928c524e28d328ad5abd87ed3bb0f0ebc771.tar.bz2
emacs-a872928c524e28d328ad5abd87ed3bb0f0ebc771.zip
* gtkutil.c (xg_get_file_with_chooser): Expand DEFAULT_FILENAME if
it doesn't start with /.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/gtkutil.c20
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 <jan.h.d@swipnet.se>
+
+ * gtkutil.c (xg_get_file_with_chooser): Expand DEFAULT_FILENAME if
+ it doesn't start with /.
+
2004-11-04 Kenichi Handa <handa@m17n.org>
* 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);