emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

menu-find-file-existing' can't open file with non-ascii filename


From: Zhang Wei
Subject: menu-find-file-existing' can't open file with non-ascii filename
Date: Sun, 19 Feb 2006 20:22:00 +0800

I have reported this bug to the emacs-devel mail list several days
ago. It seems it is vanished into the flood.

`read-file-name' returns an undecoded filename if it was invoked with
the mouse, but returns a decoded filename if it was invoked with
the keyboard.

If it is an undecoded non-ascii filename, (file-directory-p filename)
or something like that will report `t' falsely, that cause the file
can't be opened.

I think the `x-file-dialog' function should return a decoded filename,
rather an undecoded filename.

--- orig/src/xfns.c
+++ mod/src/xfns.c
@@ -5313,6 +5313,7 @@
   int result;
   struct frame *f = SELECTED_FRAME ();
   Lisp_Object file = Qnil;
+  Lisp_Object decoded_file;
   Widget dialog, text, help;
   Arg al[10];
   int ac = 0;
@@ -5453,7 +5454,9 @@
   if (NILP (file))
     Fsignal (Qquit, Qnil);
 
-  return unbind_to (count, file);
+  decoded_file = DECODE_FILE (file);
+
+  return unbind_to (count, decoded_file);
 }
 
 #endif /* USE_MOTIF */
@@ -5481,6 +5484,7 @@
   FRAME_PTR f = SELECTED_FRAME ();
   char *fn;
   Lisp_Object file = Qnil;
+  Lisp_Object decoded_file;
   int count = SPECPDL_INDEX ();
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
   char *cdef_file;
@@ -5521,7 +5525,9 @@
   if (NILP (file))
     Fsignal (Qquit, Qnil);
 
-  return unbind_to (count, file);
+  decoded_file = DECODE_FILE (file);
+
+  return unbind_to (count, decoded_file);
 }
 
 #endif /* USE_GTK */


-- 
Zhang Wei or Brep
<address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]