Mats Lidell <matsl(a)xemacs.org> writes:
>>>>> Michael wrote:
Michael> I touch that file outside of XEmacs and then do M-x
Michael> revert-buffer RET.
Don't know if this is related but I have this situation in a folder:
----------------------------------------------------------------------
/tmp/TEST:
totalt 28
-rw-r--r-- 1 matsl users 0 20 okt 23.28 ÄÄÄ
-rw-r--r-- 1 matsl users 0 20 okt 23.28 ÖÖÖ
----------------------------------------------------------------------
Now I open the file 'ÄÄÄ' for editing, (modeline says it i ÄÄÄ) insert
some chars and save it. This is what I get in dired:
----------------------------------------------------------------------
/tmp/TEST:
totalt 32
-rw-r--r-- 1 matsl users 4 23 okt 12.40 ÄÄÄ
-rw-r--r-- 1 matsl users 0 20 okt 23.28 ÄÄÄ
-rw-r--r-- 1 matsl users 0 20 okt 23.28 ÖÖÖ
----------------------------------------------------------------------
In a shell, outside XEmacs, I get:
----------------------------------------------------------------------
spencer:/tmp/TEST% ls -l
totalt 4
-rw-r--r-- 1 matsl users 4 23 okt 12.40 ???
-rw-r--r-- 1 matsl users 0 20 okt 23.28 ÄÄÄ
-rw-r--r-- 1 matsl users 0 20 okt 23.28 ÖÖÖ
----------------------------------------------------------------------
The file I saved from XEmacs, and is shown as ÄÄÄ in dired is in my
shell shown as ???. Both XEmacs and the shell uses the same locale
sv_SE.UTF-8.
If I remove the file ??? in the shell, and update dired, XEmacs is
smart and gets the names back readable again.
Is this a bug or should it be like this?
I can reproduce the situation on a MULE XEmacs in an UTF-8 locale. (It
also breaks on a non-MULE XEmacs, but in a different way. Fixing it
there is harder.) The reason is that `default-process-coding-system' is
'undecided in the read direction, and UTF-8 fails to get detected. My
suggestion is to align the coding system in `insert-directory' with the
locale's coding system. Works for me.
Maybe the MULE experts could review? I'd appreciate that!
2008-01-13 Michael Sperber <mike(a)xemacs.org>
* files.el (insert-directory): Bind `coding-system-for-read'
according to the current locale where available. (Previously, the
default ended up being undecided, which doesn't work well for
UTF-8-based locales, for example.)
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
diff --git a/lisp/files.el b/lisp/files.el
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4177,6 +4177,12 @@ If WILDCARD, it also runs the shell spec
file switches wildcard full-directory-p)))
(t
(let* ((beg (point))
+ ;; on Unix, assume that ls will output in what the
+ ;; current locale specifies
+ (coding-system-for-read
+ (if (fboundp 'get-coding-system-from-locale)
+ (declare-fboundp (get-coding-system-from-locale (current-locale)))
+ coding-system-from-read))
(result
(if wildcard
;; Run ls in the directory of the file pattern we asked for.
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta