# HG changeset patch # User Jan Dj¸«£rv # Date 1157220615 0 # Node ID af91ff74c7546eb029db91a5a41b335c94282afa # Parent 760e84d650e1b7f42157c4647d98e01f1443a777 * gtkutil.c (xg_get_file_with_chooser): Change file chooser message for writing files. Call gtk_file_chooser_set_current_name to keep default filename. diff -r 760e84d650e1 -r af91ff74c754 src/ChangeLog --- a/src/ChangeLog Sat Sep 02 17:37:26 2006 +0000 +++ b/src/ChangeLog Sat Sep 02 18:10:15 2006 +0000 @@ -1,5 +1,9 @@ 2006-09-02 Jan Dj,Ad(Brv + * gtkutil.c (xg_get_file_with_chooser): Change file chooser message + for writing files. Call gtk_file_chooser_set_current_name to keep + default filename. + * minibuf.c (Finternal_complete_buffer): Move after DEFUN:s it calls 2006-09-02 Jindrich Makovicka (tiny change) diff -r 760e84d650e1 -r af91ff74c754 src/gtkutil.c --- a/src/gtkutil.c Sat Sep 02 17:37:26 2006 +0000 +++ b/src/gtkutil.c Sat Sep 02 18:10:15 2006 +0000 @@ -1327,8 +1327,12 @@ if (action != GTK_FILE_CHOOSER_ACTION_SAVE) strcat (message, "\nType C-l to display a file name text entry box.\n"); strcat (message, "\nIf you don't like this file selector, customize " - "use-file-dialog\nto turn it off, or type C-x C-f to visit files."); - + "use-file-dialog\nto turn it off, or type "); + if (action != GTK_FILE_CHOOSER_ACTION_SAVE) + strcat (message, "C-x C-f to visit files."); + else + strcat (message, "C-x C-w to write files."); + wmessage = gtk_label_new (message); gtk_widget_show (wmessage); gtk_box_pack_start (GTK_BOX (wbox), wtoggle, FALSE, FALSE, 0); @@ -1340,6 +1344,7 @@ Lisp_Object file; struct gcpro gcpro1; GCPRO1 (file); + char *utf8_filename; file = build_string (default_filename); @@ -1347,14 +1352,20 @@ an absolute name starting with /. */ if (default_filename[0] != '/') file = Fexpand_file_name (file, Qnil); - - default_filename = SSDATA (file); - if (Ffile_directory_p (file)) + + utf8_filename = SSDATA (ENCODE_UTF_8 (file)); + if (! NILP (Ffile_directory_p (file))) gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (filewin), - default_filename); + utf8_filename); else - gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (filewin), - default_filename); + { + char *cp = strrchr (utf8_filename, '/'); + if (cp) ++cp; + else cp = utf8_filename; + gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (filewin), + utf8_filename); + gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (filewin), cp); + } UNGCPRO; }