all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: [mange@freemail.hu: File name encoding confusion when renaming]
       [not found] <E1HUFRf-0006mg-C1@fencepost.gnu.org>
@ 2007-03-22 12:21 ` Kenichi Handa
  0 siblings, 0 replies; only message in thread
From: Kenichi Handa @ 2007-03-22 12:21 UTC (permalink / raw)
  To: rms; +Cc: mange, emacs-devel

In article <E1HUFRf-0006mg-C1@fencepost.gnu.org>, Richard Stallman <rms@gnu.org> 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  <handa@m17n.org>

	* 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
handa@m17n.org

> ------- 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 <mange@freemail.hu>
> To: emacs-pretest-bug@gnu.org
> Jabber-Id: legoscia@jabber.cd.chalmers.se
> 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
> emacs-pretest-bug@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
> ------- End of forwarded message -------

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-03-22 12:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E1HUFRf-0006mg-C1@fencepost.gnu.org>
2007-03-22 12:21 ` [mange@freemail.hu: File name encoding confusion when renaming] Kenichi Handa

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.