[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: address@hidden: File name encoding confusion when renaming]
From: |
Kenichi Handa |
Subject: |
Re: address@hidden: File name encoding confusion when renaming] |
Date: |
Thu, 22 Mar 2007 21:21:31 +0900 |
User-agent: |
SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.95 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) |
In article <address@hidden>, Richard Stallman <address@hidden> writes:
> [I sent this message a week ago but did not get a response.]
> Can someone please DTRT and ack?
Sorry for the late response. I've just installed a fix.
The problem was that the first argument ABSNAME of
barf_or_query_if_file_exists was not consistent in
multibyteness. The function expects it not yet encoded and
Fwrite_region calls it with non-encoded filename. But the
other functions calls it with already encoded filename.
Considering that barf_or_query_if_file_exists signals an
error or show a message with ABSNAME, I think it should be a
non-encoded filename. So I've installed the following
change.
2007-03-22 Kenichi Handa <address@hidden>
* fileio.c (Fcopy_file): Call barf_or_query_if_file_exists with
non-encoded file name.
(Frename_file): Likewise.
(Fadd_name_to_file): Likewise.
(Fmake_symbolic_link): Likewise.
---
Kenichi Handa
address@hidden
> ------- Start of forwarded message -------
> X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY
> autolearn=failed version=3.1.0
> From: Magnus Henoch <address@hidden>
> To: address@hidden
> Jabber-Id: address@hidden
> Date: Wed, 14 Mar 2007 06:57:21 +0100
> MIME-Version: 1.0
> Content-Type: text/plain; charset=iso-8859-1
> Subject: File name encoding confusion when renaming
> I'm using a UTF-8 locale, and want my files to have UTF-8 filenames,
> but some of them have Latin-1 names. For the purpose of bug
> reproduction, such a file can be created with:
> echo foo > $(printf '\345')
> That is, the file's name is "å" in Latin-1.
> I want to rename this file to the same name in UTF-8:
> M-: (rename-file "\345" "å")
> This fails with:
> Debugger entered--Lisp error: (file-already-exists "File already exists"
> "/tmp/Ã¥")
> rename-file("Ã¥" "\x8e5")
> eval((rename-file "Ã¥" "\x8e5"))
> eval-expression((rename-file "Ã¥" "\x8e5") nil)
> call-interactively(eval-expression)
> However, if I set the OK-IF-ALREADY-EXISTS argument to t, renaming
> succeeds:
> M-: (rename-file "\345" "å" t)
> Also, renaming the file to anything else succeeds.
> If Emacs crashed, and you have the Emacs process in the gdb debugger,
> please include the output from the following gdb commands:
> `bt full' and `xbacktrace'.
> If you would like to further debug the crash, please read the file
> /usr/local/share/emacs/22.0.93/etc/DEBUG for instructions.
> In GNU Emacs 22.0.93.1 (powerpc-unknown-netbsd4.99.7, X toolkit, Xaw3d scroll
> bars)
> of 2007-02-08 on zemdatav
> X server distributor `The XFree86 Project, Inc', version 11.0.40500000
> Important settings:
> value of $LC_ALL: nil
> value of $LC_COLLATE: C
> value of $LC_CTYPE: en_US.UTF-8
> value of $LC_MESSAGES: sv
> value of $LC_MONETARY: sv_SE
> value of $LC_NUMERIC: nil
> value of $LC_TIME: nil
> value of $LANG: nil
> locale-coding-system: utf-8
> default-enable-multibyte-characters: t
> Major mode: Emacs-Lisp
> Minor modes in effect:
> shell-dirtrack-mode: t
> display-time-mode: t
> jabber-activity-mode: t
> jabber-mode-line-mode: t
> iswitchb-mode: t
> icomplete-mode: t
> tooltip-mode: t
> mouse-wheel-mode: t
> file-name-shadow-mode: t
> global-font-lock-mode: t
> font-lock-mode: t
> blink-cursor-mode: t
> unify-8859-on-encoding-mode: t
> utf-translate-cjk-mode: t
> auto-compression-mode: t
> line-number-mode: t
> transient-mark-mode: t
> Recent input:
> <s-down> <s-down> <s-down> <s-down> <s-down> <s-down>
> <s-down> <s-down> <s-down> <s-down> <s-down> <s-down>
> <s-down> <s-down> <s-down> <s-down> <s-down> <s-down>
> <s-down> <s-down> <s-down> <s-down> <s-down> <s-down>
> <s-down> <s-down> <s-down> <s-down> <s-down> <s-down>
> <s-down> <s-down> <s-down> <s-down> <s-down> <s-down>
> <s-down> <s-down> <s-down> <s-down> <s-down> <s-down>
> <s-down> <s-down> <s-down> <s-down> <down> <down> <down>
> <down> <down> <down> <down> <down> <down> <down> <down>
> <down> <down> <down> <down> <down> <down> <down> <down>
> <down> <down> <up> <s-up> <s-up> <s-up> <s-up> <s-up>
> <s-up> <s-up> <s-up> <s-up> <s-up> <s-up> <right> <right>
> <right> C-u C-SPC <right> <right> <right> <right> <right>
> <right> <right> M-x r e p o SPC r t <return>
> Recent messages:
> mouse-2, RET: find function's definition
> Loading jka-compr...done
> uncompressing dired-aux.el.gz...done
> Note: file is write protected
> Magnus Rutgersson is now Online
> Mark saved where search started
> Making completion list...
> Loading emacsbug...done
> _______________________________________________
> emacs-pretest-bug mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
> ------- End of forwarded message -------