unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* 23.0.60; Can't start emacs when filename contains national character
@ 2008-03-29  2:20 Lennart Borgman (gmail)
  2008-03-29  9:34 ` Juanma Barranquero
  0 siblings, 1 reply; 27+ messages in thread
From: Lennart Borgman (gmail) @ 2008-03-29  2:20 UTC (permalink / raw)
  To: emacs-pretest-bug

When starting Emacs with "emacs -Q" it crashes if the path to ~/.emacs 
contains a Swedish national character. Running under gdb I get the 
following backtrace:

(gdb) run -Q
Starting program: C:\pf\Emacs\emacs\bin/emacs.exe -Q

Program received signal SIGTRAP, Trace/breakpoint trap.
0x7c901231 in _end__ ()
(gdb) bt
#0  0x7c901231 in _end__ ()
#1  0x011b5ebe in w32_abort () at w32fns.c:9382
#2  0x01148216 in multibyte_chars_in_text (
     ptr=0x82f60d "õker/Application Data", nbytes=48) at character.c:616
#3  0x010287c5 in make_specified_string (
     contents=0x82f5f2 "c:/Documents and Settings/Sõker/Application Data",
     nchars=-1, nbytes=48, multibyte=1) at alloc.c:2446
#4  0x0107b3b3 in Fexpand_file_name (name=33726579, 
default_directory=39479299)
     at fileio.c:1723
#5  0x01022e85 in Ffuncall (nargs=2, args=0x82f7a8) at eval.c:3028
#6  0x01152efc in Fbyte_code (bytestr=18878979, vector=18878996, 
maxdepth=48)
     at bytecode.c:679
#7  0x0102359e in funcall_lambda (fun=18878940, nargs=1, 
arg_vector=0x82f9d4)
     at eval.c:3212
#8  0x0102307d in Ffuncall (nargs=2, args=0x82f9d0) at eval.c:3071
#9  0x01152efc in Fbyte_code (bytestr=18957467, vector=18957484, 
maxdepth=48)
     at bytecode.c:679
#10 0x0102359e in funcall_lambda (fun=18957444, nargs=0, 
arg_vector=0x82fb70)
     at eval.c:3212
#11 0x01023289 in apply_lambda (fun=18957444, args=24229889, eval_flag=1)
     at eval.c:3136
#12 0x010221aa in Feval (form=24972573) at eval.c:2398
#13 0x01005dbf in top_level_2 () at keyboard.c:1379
---Type <return> to continue, or q <return> to quit---
#14 0x010209e5 in internal_condition_case (bfun=0x1005dac <top_level_2>,
     handlers=24293521, hfun=0x1005a32 <cmd_error>) at eval.c:1494
#15 0x01005df1 in top_level_1 () at keyboard.c:1387
#16 0x010204d6 in internal_catch (tag=24289617, func=0x1005dc1 
<top_level_1>,
     arg=24229889) at eval.c:1230
#17 0x01005d33 in command_loop () at keyboard.c:1342
#18 0x0100564e in recursive_edit_1 () at keyboard.c:958
#19 0x010057b2 in Frecursive_edit () at keyboard.c:1020
#20 0x0100279f in main (argc=2, argv=0xa82748) at emacs.c:1784
#21 0x0100124b in __mingw_CRTStartup ()
#22 0x01001298 in mainCRTStartup ()
(gdb)



In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
  of 2008-03-29
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags 
-Ic:/g/include -fno-crossjumping'





^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29  2:20 23.0.60; Can't start emacs when filename contains national character Lennart Borgman (gmail)
@ 2008-03-29  9:34 ` Juanma Barranquero
  2008-03-29 11:23   ` Eli Zaretskii
  0 siblings, 1 reply; 27+ messages in thread
From: Juanma Barranquero @ 2008-03-29  9:34 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: emacs-pretest-bug

On Sat, Mar 29, 2008 at 3:20 AM, Lennart Borgman (gmail)
<lennart.borgman@gmail.com> wrote:
> When starting Emacs with "emacs -Q" it crashes if the path to ~/.emacs
>  contains a Swedish national character. Running under gdb I get the
>  following backtrace:

This is a backtrace in my system. The HOME dir was C:\año

(gdb) backtrace
#0  w32_abort () at w32fns.c:9368
#1  0x010c8a85 in multibyte_chars_in_text (ptr=0x82f932 "c:/a\361o",
nbytes=6) at character.c:616
#2  0x01022765 in make_specified_string (contents=0x82f932
"c:/a\361o", nchars=-1, nbytes=6, multibyte=1) at alloc.c:2446
#3  0x01010e63 in Fexpand_file_name (name=19162171,
default_directory=41388995) at fileio.c:1723
#4  0x0101cb46 in Ffuncall (nargs=2, args=0x82faa8) at eval.c:3028
#5  0x0115741d in Fbyte_code (bytestr=19161779, vector=19161916,
maxdepth=48) at bytecode.c:679
#6  0x0101c39a in funcall_lambda (fun=19161740, nargs=1,
arg_vector=0x82fbe4) at eval.c:3212
#7  0x0101c817 in Ffuncall (nargs=2, args=0x82fbe0) at eval.c:3071
#8  0x0115741d in Fbyte_code (bytestr=19258811, vector=19259028,
maxdepth=48) at bytecode.c:679
#9  0x0101c39a in funcall_lambda (fun=19258788, nargs=0,
arg_vector=0x82fcb0) at eval.c:3212
#10 0x0101c613 in apply_lambda (fun=19258788, args=26077185,
eval_flag=1) at eval.c:3136
#11 0x0101b8a9 in Feval (form=26826045) at eval.c:2398
#12 0x01099c8a in top_level_2 () at keyboard.c:1379
#13 0x0101afd7 in internal_condition_case (bfun=0x1099c77
<top_level_2>, handlers=26140817, hfun=0x109e88b <cmd_error>)
    at eval.c:1494
#14 0x0109dba7 in top_level_1 () at keyboard.c:1387
#15 0x0101b072 in internal_catch (tag=26136913, func=0x109db77
<top_level_1>, arg=26077185) at eval.c:1230
#16 0x0109e6a6 in command_loop () at keyboard.c:1342
#17 0x0109ea17 in recursive_edit_1 () at keyboard.c:958
#18 0x0109eb82 in Frecursive_edit () at keyboard.c:1020
#19 0x01002b01 in main (argc=8585136, argv=0xa82750) at emacs.c:1784

Lisp Backtrace:
"expand-file-name" (0x82faac)
"abbreviate-file-name" (0x82fbe4)
"normal-top-level" (0x82fcb0)
(gdb)

 Juanma

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29  9:34 ` Juanma Barranquero
@ 2008-03-29 11:23   ` Eli Zaretskii
  2008-03-29 12:21     ` Sven Joachim
  2008-03-29 12:23     ` Andreas Schwab
  0 siblings, 2 replies; 27+ messages in thread
From: Eli Zaretskii @ 2008-03-29 11:23 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: emacs-pretest-bug, lennart.borgman

> Date: Sat, 29 Mar 2008 10:34:59 +0100
> From: "Juanma Barranquero" <lekktu@gmail.com>
> Cc: emacs-pretest-bug@gnu.org
> 
> On Sat, Mar 29, 2008 at 3:20 AM, Lennart Borgman (gmail)
> <lennart.borgman@gmail.com> wrote:
> > When starting Emacs with "emacs -Q" it crashes if the path to ~/.emacs
> >  contains a Swedish national character. Running under gdb I get the
> >  following backtrace:
> 
> This is a backtrace in my system. The HOME dir was C:\año
> 
> (gdb) backtrace
> #0  w32_abort () at w32fns.c:9368
> #1  0x010c8a85 in multibyte_chars_in_text (ptr=0x82f932 "c:/a\361o",
> nbytes=6) at character.c:616
> #2  0x01022765 in make_specified_string (contents=0x82f932
> "c:/a\361o", nchars=-1, nbytes=6, multibyte=1) at alloc.c:2446
> #3  0x01010e63 in Fexpand_file_name (name=19162171,
> default_directory=41388995) at fileio.c:1723

It looks like this is happening because expand-file-name calls egetenv
to expand "~", but egetenv returns a unibyte string, while
expand-file-name is not prepared for this, because it makes up its
mind about multibyteness of the file name too early.

Unless I'm missing something, the same should happen on Unix as well.
Could someone try this on Unix or GNU system with HOME set to a
directory with non-ASCII characters, and see if Emacs crashes there as
well?  (This is important for me to know whether to prepare a
Windows-only change or a change that should fix all systems.)




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 11:23   ` Eli Zaretskii
@ 2008-03-29 12:21     ` Sven Joachim
  2008-03-29 13:01       ` Eli Zaretskii
  2008-03-29 12:23     ` Andreas Schwab
  1 sibling, 1 reply; 27+ messages in thread
From: Sven Joachim @ 2008-03-29 12:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Juanma Barranquero, lennart.borgman, emacs-pretest-bug

On 2008-03-29 12:23 +0100, Eli Zaretskii wrote:

> It looks like this is happening because expand-file-name calls egetenv
> to expand "~", but egetenv returns a unibyte string, while
> expand-file-name is not prepared for this, because it makes up its
> mind about multibyteness of the file name too early.
>
> Unless I'm missing something, the same should happen on Unix as well.
> Could someone try this on Unix or GNU system with HOME set to a
> directory with non-ASCII characters, and see if Emacs crashes there as
> well?  (This is important for me to know whether to prepare a
> Windows-only change or a change that should fix all systems.)

I've tested that.  If the directory contains a non-ASCII character,
Emacs crashes on GNU/Linux as well:

(gdb) bt
#0  abort () at emacs.c:430
#1  0x080bccb5 in multibyte_chars_in_text (ptr=0xbfe8400c "\344h", nbytes=14) at character.c:616
#2  0x0816c9c6 in make_specified_string (contents=0xbfe84000 "/home/sven/b\344h", nchars=-1, nbytes=14, multibyte=1)
    at alloc.c:2446
#3  0x0814651d in Fexpand_file_name (name=136391979, default_directory=148045091) at fileio.c:1723
#4  0x081823a2 in Ffuncall (nargs=2, args=0xbfe84108) at eval.c:3028
#5  0x081abe4c in Fbyte_code (bytestr=136391731, vector=136391748, maxdepth=<value optimized out>) at bytecode.c:679
#6  0x08181d24 in funcall_lambda (fun=136391692, nargs=1, arg_vector=0xbfe84244) at eval.c:3212
#7  0x0818213f in Ffuncall (nargs=2, args=0xbfe84240) at eval.c:3082
#8  0x081abe4c in Fbyte_code (bytestr=136470267, vector=136470284, maxdepth=<value optimized out>) at bytecode.c:679
#9  0x08181d24 in funcall_lambda (fun=136470244, nargs=0, arg_vector=0xbfe84310) at eval.c:3212
#10 0x08181f20 in apply_lambda (fun=136470244, args=137743641, eval_flag=1) at eval.c:3136
#11 0x081815d4 in Feval (form=138225021) at eval.c:2416
#12 0x0811dbf3 in top_level_2 () at keyboard.c:1379
#13 0x08180c60 in internal_condition_case (bfun=0x811dbe0 <top_level_2>, handlers=137786737, hfun=0x8122510 <cmd_error>)
    at eval.c:1494
#14 0x08121930 in top_level_1 () at keyboard.c:1387
#15 0x08180d3a in internal_catch (tag=137782737, func=0x8121900 <top_level_1>, arg=137743641) at eval.c:1230
#16 0x08122359 in command_loop () at keyboard.c:1342
#17 0x081226db in recursive_edit_1 () at keyboard.c:958
#18 0x08122811 in Frecursive_edit () at keyboard.c:1020
#19 0x081171ec in main (argc=1, argv=0xbfe849c4) at emacs.c:1784

Lisp Backtrace:
"expand-file-name" (0xbfe8410c)
"abbreviate-file-name" (0xbfe84244)
"normal-top-level" (0xbfe84310)
(gdb) 

The crash does not happen with a UTF-8 encoded non-ASCII character.

Sven




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 11:23   ` Eli Zaretskii
  2008-03-29 12:21     ` Sven Joachim
@ 2008-03-29 12:23     ` Andreas Schwab
  2008-03-29 12:31       ` Sven Joachim
  1 sibling, 1 reply; 27+ messages in thread
From: Andreas Schwab @ 2008-03-29 12:23 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Juanma Barranquero, lennart.borgman, emacs-pretest-bug

Eli Zaretskii <eliz@gnu.org> writes:

> Unless I'm missing something, the same should happen on Unix as well.
> Could someone try this on Unix or GNU system with HOME set to a
> directory with non-ASCII characters, and see if Emacs crashes there as
> well?  (This is important for me to know whether to prepare a
> Windows-only change or a change that should fix all systems.)

I'm unable to reproduce the problem on powerpc64-suse-linux.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 12:23     ` Andreas Schwab
@ 2008-03-29 12:31       ` Sven Joachim
  2008-03-29 13:20         ` Andreas Schwab
  0 siblings, 1 reply; 27+ messages in thread
From: Sven Joachim @ 2008-03-29 12:31 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Juanma Barranquero, Eli Zaretskii, lennart.borgman,
	emacs-pretest-bug

Am 29.03.2008 um 13:23 schrieb Andreas Schwab:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>> Unless I'm missing something, the same should happen on Unix as well.
>> Could someone try this on Unix or GNU system with HOME set to a
>> directory with non-ASCII characters, and see if Emacs crashes there as
>> well?  (This is important for me to know whether to prepare a
>> Windows-only change or a change that should fix all systems.)
>
> I'm unable to reproduce the problem on powerpc64-suse-linux.

Did you try it with a UTF-8 locale and UTF-8 encoded directory name?  If
so, retry with a directory name that is _not_ encoded in UTF-8.

Sven 




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 12:21     ` Sven Joachim
@ 2008-03-29 13:01       ` Eli Zaretskii
  2008-03-29 13:53         ` Eli Zaretskii
  0 siblings, 1 reply; 27+ messages in thread
From: Eli Zaretskii @ 2008-03-29 13:01 UTC (permalink / raw)
  To: Sven Joachim; +Cc: lekktu, lennart.borgman, emacs-pretest-bug

> From: Sven Joachim <svenjoac@gmx.de>
> Date: Sat, 29 Mar 2008 13:21:18 +0100
> Cc: Juanma Barranquero <lekktu@gmail.com>, lennart.borgman@gmail.com,
> 	emacs-pretest-bug@gnu.org
> 
> I've tested that.  If the directory contains a non-ASCII character,
> Emacs crashes on GNU/Linux as well:

Thanks, I'll try to fix this soon.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 12:31       ` Sven Joachim
@ 2008-03-29 13:20         ` Andreas Schwab
  2008-03-29 13:54           ` Eli Zaretskii
  0 siblings, 1 reply; 27+ messages in thread
From: Andreas Schwab @ 2008-03-29 13:20 UTC (permalink / raw)
  To: Sven Joachim
  Cc: Juanma Barranquero, Eli Zaretskii, lennart.borgman,
	emacs-pretest-bug

Sven Joachim <svenjoac@gmx.de> writes:

> If so, retry with a directory name that is _not_ encoded in UTF-8.

Ok, that's the key to the problem.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 13:01       ` Eli Zaretskii
@ 2008-03-29 13:53         ` Eli Zaretskii
  2008-03-29 14:45           ` Sven Joachim
  0 siblings, 1 reply; 27+ messages in thread
From: Eli Zaretskii @ 2008-03-29 13:53 UTC (permalink / raw)
  To: svenjoac, lekktu, lennart.borgman, emacs-pretest-bug

> Date: Sat, 29 Mar 2008 16:01:56 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: lekktu@gmail.com, lennart.borgman@gmail.com, emacs-pretest-bug@gnu.org
> 
> > From: Sven Joachim <svenjoac@gmx.de>
> > Date: Sat, 29 Mar 2008 13:21:18 +0100
> > Cc: Juanma Barranquero <lekktu@gmail.com>, lennart.borgman@gmail.com,
> > 	emacs-pretest-bug@gnu.org
> > 
> > I've tested that.  If the directory contains a non-ASCII character,
> > Emacs crashes on GNU/Linux as well:
> 
> Thanks, I'll try to fix this soon.

Done.  Please try again.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 13:20         ` Andreas Schwab
@ 2008-03-29 13:54           ` Eli Zaretskii
  2008-03-29 16:08             ` Andreas Schwab
  0 siblings, 1 reply; 27+ messages in thread
From: Eli Zaretskii @ 2008-03-29 13:54 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: lekktu, lennart.borgman, svenjoac, emacs-pretest-bug

> From: Andreas Schwab <schwab@suse.de>
> Date: Sat, 29 Mar 2008 14:20:43 +0100
> Cc: Juanma Barranquero <lekktu@gmail.com>, Eli Zaretskii <eliz@gnu.org>,
> 	lennart.borgman@gmail.com, emacs-pretest-bug@gnu.org
> 
> Sven Joachim <svenjoac@gmx.de> writes:
> 
> > If so, retry with a directory name that is _not_ encoded in UTF-8.
> 
> Ok, that's the key to the problem.

Could you please check the fix I committed just now with a directory
name that is UTF-8 encoded?

TIA




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 13:53         ` Eli Zaretskii
@ 2008-03-29 14:45           ` Sven Joachim
  2008-03-29 15:07             ` Eli Zaretskii
  0 siblings, 1 reply; 27+ messages in thread
From: Sven Joachim @ 2008-03-29 14:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: lekktu, lennart.borgman, emacs-pretest-bug

On 2008-03-29 14:53 +0100, Eli Zaretskii wrote:

> Done.  Please try again.

The crash is fixed, but the name of the home directory is displayed
funnily: with HOME set to /home/sven/bäh (iso-latin-1 encoded "ä"),
(expand-file-name "~") gives "/home/sven/b\344h" as result.  Emacs 22
decodes the non-ASCII character correctly, LC_ALL being set to de_DE.

Sven




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 14:45           ` Sven Joachim
@ 2008-03-29 15:07             ` Eli Zaretskii
  2008-03-29 15:31               ` Eli Zaretskii
                                 ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Eli Zaretskii @ 2008-03-29 15:07 UTC (permalink / raw)
  To: Sven Joachim; +Cc: lekktu, lennart.borgman, emacs-pretest-bug

> From: Sven Joachim <svenjoac@gmx.de>
> Date: Sat, 29 Mar 2008 15:45:13 +0100
> Cc: lekktu@gmail.com, lennart.borgman@gmail.com, emacs-pretest-bug@gnu.org
> 
> On 2008-03-29 14:53 +0100, Eli Zaretskii wrote:
> 
> > Done.  Please try again.
> 
> The crash is fixed, but the name of the home directory is displayed
> funnily: with HOME set to /home/sven/bäh (iso-latin-1 encoded "ä"),
> (expand-file-name "~") gives "/home/sven/b\344h" as result.  Emacs 22
> decodes the non-ASCII character correctly, LC_ALL being set to de_DE.

That probably means I used the wrong to/make-multibyte function to fix
the problem.  Will look into it, thanks.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 15:07             ` Eli Zaretskii
@ 2008-03-29 15:31               ` Eli Zaretskii
  2008-03-29 16:02                 ` Sven Joachim
  2008-03-29 15:43               ` Lennart Borgman (gmail)
  2008-03-29 19:15               ` Stefan Monnier
  2 siblings, 1 reply; 27+ messages in thread
From: Eli Zaretskii @ 2008-03-29 15:31 UTC (permalink / raw)
  To: svenjoac, lekktu, lennart.borgman, emacs-pretest-bug

> Date: Sat, 29 Mar 2008 18:07:36 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: lekktu@gmail.com, lennart.borgman@gmail.com, emacs-pretest-bug@gnu.org
> 
> > From: Sven Joachim <svenjoac@gmx.de>
> > Date: Sat, 29 Mar 2008 15:45:13 +0100
> > Cc: lekktu@gmail.com, lennart.borgman@gmail.com, emacs-pretest-bug@gnu.org
> > 
> > On 2008-03-29 14:53 +0100, Eli Zaretskii wrote:
> > 
> > > Done.  Please try again.
> > 
> > The crash is fixed, but the name of the home directory is displayed
> > funnily: with HOME set to /home/sven/bäh (iso-latin-1 encoded "ä"),
> > (expand-file-name "~") gives "/home/sven/b\344h" as result.  Emacs 22
> > decodes the non-ASCII character correctly, LC_ALL being set to de_DE.
> 
> That probably means I used the wrong to/make-multibyte function to fix
> the problem.  Will look into it, thanks.

Please try again, both with Latin-1 and UTF-8 encoded file names in
$HOME.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 15:07             ` Eli Zaretskii
  2008-03-29 15:31               ` Eli Zaretskii
@ 2008-03-29 15:43               ` Lennart Borgman (gmail)
  2008-03-29 15:53                 ` Eli Zaretskii
  2008-03-29 19:15               ` Stefan Monnier
  2 siblings, 1 reply; 27+ messages in thread
From: Lennart Borgman (gmail) @ 2008-03-29 15:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: lekktu, Sven Joachim, emacs-pretest-bug

Eli Zaretskii wrote:
>> From: Sven Joachim <svenjoac@gmx.de>
>> Date: Sat, 29 Mar 2008 15:45:13 +0100
>> Cc: lekktu@gmail.com, lennart.borgman@gmail.com, emacs-pretest-bug@gnu.org
>>
>> On 2008-03-29 14:53 +0100, Eli Zaretskii wrote:
>>
>>> Done.  Please try again.
>> The crash is fixed, but the name of the home directory is displayed
>> funnily: with HOME set to /home/sven/bäh (iso-latin-1 encoded "ä"),
>> (expand-file-name "~") gives "/home/sven/b\344h" as result.  Emacs 22
>> decodes the non-ASCII character correctly, LC_ALL being set to de_DE.
> 
> That probably means I used the wrong to/make-multibyte function to fix
> the problem.  Will look into it, thanks.

FYI: I get the same results as Sven.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 15:43               ` Lennart Borgman (gmail)
@ 2008-03-29 15:53                 ` Eli Zaretskii
  2008-03-29 17:55                   ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 27+ messages in thread
From: Eli Zaretskii @ 2008-03-29 15:53 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: lekktu, svenjoac, emacs-pretest-bug

> Date: Sat, 29 Mar 2008 16:43:01 +0100
> From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
> Cc: lekktu@gmail.com, Sven Joachim <svenjoac@gmx.de>, emacs-pretest-bug@gnu.org
> 
> Eli Zaretskii wrote:
> >> From: Sven Joachim <svenjoac@gmx.de>
> >> Date: Sat, 29 Mar 2008 15:45:13 +0100
> >> Cc: lekktu@gmail.com, lennart.borgman@gmail.com, emacs-pretest-bug@gnu.org
> >>
> >> On 2008-03-29 14:53 +0100, Eli Zaretskii wrote:
> >>
> >>> Done.  Please try again.
> >> The crash is fixed, but the name of the home directory is displayed
> >> funnily: with HOME set to /home/sven/bäh (iso-latin-1 encoded "ä"),
> >> (expand-file-name "~") gives "/home/sven/b\344h" as result.  Emacs 22
> >> decodes the non-ASCII character correctly, LC_ALL being set to de_DE.
> > 
> > That probably means I used the wrong to/make-multibyte function to fix
> > the problem.  Will look into it, thanks.
> 
> FYI: I get the same results as Sven.

Please try again with the latest CVS.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 15:31               ` Eli Zaretskii
@ 2008-03-29 16:02                 ` Sven Joachim
  2008-03-29 16:12                   ` Eli Zaretskii
  0 siblings, 1 reply; 27+ messages in thread
From: Sven Joachim @ 2008-03-29 16:02 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: lekktu, lennart.borgman, emacs-pretest-bug

On 2008-03-29 16:31 +0100, Eli Zaretskii wrote:

>> That probably means I used the wrong to/make-multibyte function to fix
>> the problem.  Will look into it, thanks.
>
> Please try again, both with Latin-1 and UTF-8 encoded file names in
> $HOME.

Works fine now, thanks.  The encoding of the file names need to match
the locale, but that's to be expected, I think.

Sven




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 13:54           ` Eli Zaretskii
@ 2008-03-29 16:08             ` Andreas Schwab
  2008-03-29 16:12               ` Eli Zaretskii
  0 siblings, 1 reply; 27+ messages in thread
From: Andreas Schwab @ 2008-03-29 16:08 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: lekktu, lennart.borgman, svenjoac, emacs-pretest-bug

Eli Zaretskii <eliz@gnu.org> writes:

> Could you please check the fix I committed just now with a directory
> name that is UTF-8 encoded?

Looks good.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 16:02                 ` Sven Joachim
@ 2008-03-29 16:12                   ` Eli Zaretskii
  2008-03-29 16:43                     ` Sven Joachim
  0 siblings, 1 reply; 27+ messages in thread
From: Eli Zaretskii @ 2008-03-29 16:12 UTC (permalink / raw)
  To: Sven Joachim; +Cc: lekktu, lennart.borgman, emacs-pretest-bug

> From: Sven Joachim <svenjoac@gmx.de>
> Date: Sat, 29 Mar 2008 17:02:06 +0100
> Cc: lekktu@gmail.com, lennart.borgman@gmail.com, emacs-pretest-bug@gnu.org
> 
> On 2008-03-29 16:31 +0100, Eli Zaretskii wrote:
> 
> >> That probably means I used the wrong to/make-multibyte function to fix
> >> the problem.  Will look into it, thanks.
> >
> > Please try again, both with Latin-1 and UTF-8 encoded file names in
> > $HOME.
> 
> Works fine now, thanks.

Thanks for testing.

> The encoding of the file names need to match the locale, but that's
> to be expected, I think.

DECODE_FILE use file-name-coding-system, not locale-coding-system.  So
even if those are different, I think the code should work fine.  Or am
I missing something?




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 16:08             ` Andreas Schwab
@ 2008-03-29 16:12               ` Eli Zaretskii
  0 siblings, 0 replies; 27+ messages in thread
From: Eli Zaretskii @ 2008-03-29 16:12 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: lekktu, lennart.borgman, svenjoac, emacs-pretest-bug

> From: Andreas Schwab <schwab@suse.de>
> Date: Sat, 29 Mar 2008 17:08:14 +0100
> Cc: lekktu@gmail.com, lennart.borgman@gmail.com, svenjoac@gmx.de,
> 	emacs-pretest-bug@gnu.org
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Could you please check the fix I committed just now with a directory
> > name that is UTF-8 encoded?
> 
> Looks good.

Thanks.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 16:12                   ` Eli Zaretskii
@ 2008-03-29 16:43                     ` Sven Joachim
  0 siblings, 0 replies; 27+ messages in thread
From: Sven Joachim @ 2008-03-29 16:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: lekktu, lennart.borgman, emacs-pretest-bug

On 2008-03-29 17:12 +0100, Eli Zaretskii wrote:

>> From: Sven Joachim <svenjoac@gmx.de>
>> The encoding of the file names need to match the locale, but that's
>> to be expected, I think.
>
> DECODE_FILE use file-name-coding-system, not locale-coding-system.  So
> even if those are different, I think the code should work fine.  Or am
> I missing something?

No, you're right.  I had not set file-name-coding-system, if I do, Emacs
displays the file name correctly.

Sven




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 15:53                 ` Eli Zaretskii
@ 2008-03-29 17:55                   ` Lennart Borgman (gmail)
  2008-03-29 18:35                     ` Eli Zaretskii
  0 siblings, 1 reply; 27+ messages in thread
From: Lennart Borgman (gmail) @ 2008-03-29 17:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: lekktu, svenjoac, emacs-pretest-bug

Eli Zaretskii wrote:
>> Date: Sat, 29 Mar 2008 16:43:01 +0100
>> From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
>> Cc: lekktu@gmail.com, Sven Joachim <svenjoac@gmx.de>, emacs-pretest-bug@gnu.org
>>
>> Eli Zaretskii wrote:
>>>> From: Sven Joachim <svenjoac@gmx.de>
>>>> Date: Sat, 29 Mar 2008 15:45:13 +0100
>>>> Cc: lekktu@gmail.com, lennart.borgman@gmail.com, emacs-pretest-bug@gnu.org
>>>>
>>>> On 2008-03-29 14:53 +0100, Eli Zaretskii wrote:
>>>>
>>>>> Done.  Please try again.
>>>> The crash is fixed, but the name of the home directory is displayed
>>>> funnily: with HOME set to /home/sven/bäh (iso-latin-1 encoded "ä"),
>>>> (expand-file-name "~") gives "/home/sven/b\344h" as result.  Emacs 22
>>>> decodes the non-ASCII character correctly, LC_ALL being set to de_DE.
>>> That probably means I used the wrong to/make-multibyte function to fix
>>> the problem.  Will look into it, thanks.
>> FYI: I get the same results as Sven.
> 
> Please try again with the latest CVS.

Thanks Eli, it works ok here too.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 17:55                   ` Lennart Borgman (gmail)
@ 2008-03-29 18:35                     ` Eli Zaretskii
  0 siblings, 0 replies; 27+ messages in thread
From: Eli Zaretskii @ 2008-03-29 18:35 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: lekktu, svenjoac, emacs-pretest-bug

> Date: Sat, 29 Mar 2008 18:55:50 +0100
> From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
> Cc: lekktu@gmail.com, svenjoac@gmx.de, emacs-pretest-bug@gnu.org
> 
> Eli Zaretskii wrote:
> >> Date: Sat, 29 Mar 2008 16:43:01 +0100
> >> From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
> >> Cc: lekktu@gmail.com, Sven Joachim <svenjoac@gmx.de>, emacs-pretest-bug@gnu.org
> >>
> >> Eli Zaretskii wrote:
> >>>> From: Sven Joachim <svenjoac@gmx.de>
> >>>> Date: Sat, 29 Mar 2008 15:45:13 +0100
> >>>> Cc: lekktu@gmail.com, lennart.borgman@gmail.com, emacs-pretest-bug@gnu.org
> >>>>
> >>>> On 2008-03-29 14:53 +0100, Eli Zaretskii wrote:
> >>>>
> >>>>> Done.  Please try again.
> >>>> The crash is fixed, but the name of the home directory is displayed
> >>>> funnily: with HOME set to /home/sven/bäh (iso-latin-1 encoded "ä"),
> >>>> (expand-file-name "~") gives "/home/sven/b\344h" as result.  Emacs 22
> >>>> decodes the non-ASCII character correctly, LC_ALL being set to de_DE.
> >>> That probably means I used the wrong to/make-multibyte function to fix
> >>> the problem.  Will look into it, thanks.
> >> FYI: I get the same results as Sven.
> > 
> > Please try again with the latest CVS.
> 
> Thanks Eli, it works ok here too.

Thanks for testing.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 15:07             ` Eli Zaretskii
  2008-03-29 15:31               ` Eli Zaretskii
  2008-03-29 15:43               ` Lennart Borgman (gmail)
@ 2008-03-29 19:15               ` Stefan Monnier
  2008-03-29 19:47                 ` Eli Zaretskii
  2 siblings, 1 reply; 27+ messages in thread
From: Stefan Monnier @ 2008-03-29 19:15 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: lekktu, lennart.borgman, Sven Joachim, emacs-pretest-bug

> That probably means I used the wrong to/make-multibyte function to fix
> the problem.  Will look into it, thanks.

I recommend to stay as far away from string-to/as/make-unit/multibyte
as possible.  Use en/decode-coding-string instead.  That will make it
much more clear what's going on and will help you make the right decision.


        Stefan




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 19:15               ` Stefan Monnier
@ 2008-03-29 19:47                 ` Eli Zaretskii
  2008-03-29 20:22                   ` Stefan Monnier
  2008-03-29 23:29                   ` YAMAMOTO Mitsuharu
  0 siblings, 2 replies; 27+ messages in thread
From: Eli Zaretskii @ 2008-03-29 19:47 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: lekktu, lennart.borgman, svenjoac, emacs-pretest-bug

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Sat, 29 Mar 2008 15:15:47 -0400
> Cc: lekktu@gmail.com, lennart.borgman@gmail.com, Sven Joachim <svenjoac@gmx.de>,
> 	emacs-pretest-bug@gnu.org
> 
> > That probably means I used the wrong to/make-multibyte function to fix
> > the problem.  Will look into it, thanks.
> 
> I recommend to stay as far away from string-to/as/make-unit/multibyte
> as possible.  Use en/decode-coding-string instead.

That's what I did eventually.  I tried to be smart at first, to maybe
avoid the overhead of full-fledged decoding, but gave up and used
DECODE_FILE instead.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 19:47                 ` Eli Zaretskii
@ 2008-03-29 20:22                   ` Stefan Monnier
  2008-03-29 20:54                     ` Eli Zaretskii
  2008-03-29 23:29                   ` YAMAMOTO Mitsuharu
  1 sibling, 1 reply; 27+ messages in thread
From: Stefan Monnier @ 2008-03-29 20:22 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: lekktu, lennart.borgman, svenjoac, emacs-pretest-bug

>> > That probably means I used the wrong to/make-multibyte function to fix
>> > the problem.  Will look into it, thanks.
>> 
>> I recommend to stay as far away from string-to/as/make-unit/multibyte
>> as possible.  Use en/decode-coding-string instead.

> That's what I did eventually.  I tried to be smart at first, to maybe
> avoid the overhead of full-fledged decoding, but gave up and used
> DECODE_FILE instead.

If the issue is performance, maybe we should just improve
(en|de)code-coding-string to recognize those few special cases and
redirect them to string-(to|as)-(uni|multi)byte.

Note that is set-unibyte-charset is never called (which should always be
the case now), string-make-foo is identical to string-to-foo.

So the remaining two cases ("to" and "as") work as follows:

    "to" = `binary'
    "as" = internal CS (i.e. `utf-8-emacs', but was `emacs-mule' before)

Funnily enough we do not have a coding-system `emacs-internal' which
would be `emacs-mule' in Emacs-22 and `utf-8-emacs' in Emacs-23.
I guess we can use

  (if (coding-system-p 'utf-8-emacs) 'utf-8-emacs 'emacs-mule)

if we need it.


        Stefan




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 20:22                   ` Stefan Monnier
@ 2008-03-29 20:54                     ` Eli Zaretskii
  0 siblings, 0 replies; 27+ messages in thread
From: Eli Zaretskii @ 2008-03-29 20:54 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: lekktu, lennart.borgman, svenjoac, emacs-pretest-bug

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Sat, 29 Mar 2008 16:22:53 -0400
> Cc: lekktu@gmail.com, lennart.borgman@gmail.com, svenjoac@gmx.de,
> 	emacs-pretest-bug@gnu.org
> 
> > That's what I did eventually.  I tried to be smart at first, to maybe
> > avoid the overhead of full-fledged decoding, but gave up and used
> > DECODE_FILE instead.
> 
> If the issue is performance, maybe we should just improve
> (en|de)code-coding-string to recognize those few special cases and
> redirect them to string-(to|as)-(uni|multi)byte.

I'm not sure it's warranted: we do something like

    if (STRING_MULTIBYTE (foo))
      foo = ENCODE_FILE (foo);

in quite a few more places, so it's probably efficient enough.  It's
just that en/decode_coding is so scarily large, while string-to/make-*
are so seductively compact and simple...




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 23.0.60; Can't start emacs when filename contains national character
  2008-03-29 19:47                 ` Eli Zaretskii
  2008-03-29 20:22                   ` Stefan Monnier
@ 2008-03-29 23:29                   ` YAMAMOTO Mitsuharu
  1 sibling, 0 replies; 27+ messages in thread
From: YAMAMOTO Mitsuharu @ 2008-03-29 23:29 UTC (permalink / raw)
  To: Eli Zaretskii
  Cc: lekktu, lennart.borgman, Stefan Monnier, emacs-pretest-bug,
	svenjoac

>>>>> On Sat, 29 Mar 2008 22:47:19 +0300, Eli Zaretskii <eliz@gnu.org> said:

>> I recommend to stay as far away from
>> string-to/as/make-unit/multibyte as possible.  Use
>> en/decode-coding-string instead.

> That's what I did eventually.  I tried to be smart at first, to
> maybe avoid the overhead of full-fledged decoding, but gave up and
> used DECODE_FILE instead.

Encoding/decoding should be used with care because they may cause GC
and thus string data relocation.  Actually, your fix has the same
problem as I pointed out in
http://lists.gnu.org/archive/html/bug-gnu-emacs/2008-03/msg00026.html

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp




^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2008-03-29 23:29 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-29  2:20 23.0.60; Can't start emacs when filename contains national character Lennart Borgman (gmail)
2008-03-29  9:34 ` Juanma Barranquero
2008-03-29 11:23   ` Eli Zaretskii
2008-03-29 12:21     ` Sven Joachim
2008-03-29 13:01       ` Eli Zaretskii
2008-03-29 13:53         ` Eli Zaretskii
2008-03-29 14:45           ` Sven Joachim
2008-03-29 15:07             ` Eli Zaretskii
2008-03-29 15:31               ` Eli Zaretskii
2008-03-29 16:02                 ` Sven Joachim
2008-03-29 16:12                   ` Eli Zaretskii
2008-03-29 16:43                     ` Sven Joachim
2008-03-29 15:43               ` Lennart Borgman (gmail)
2008-03-29 15:53                 ` Eli Zaretskii
2008-03-29 17:55                   ` Lennart Borgman (gmail)
2008-03-29 18:35                     ` Eli Zaretskii
2008-03-29 19:15               ` Stefan Monnier
2008-03-29 19:47                 ` Eli Zaretskii
2008-03-29 20:22                   ` Stefan Monnier
2008-03-29 20:54                     ` Eli Zaretskii
2008-03-29 23:29                   ` YAMAMOTO Mitsuharu
2008-03-29 12:23     ` Andreas Schwab
2008-03-29 12:31       ` Sven Joachim
2008-03-29 13:20         ` Andreas Schwab
2008-03-29 13:54           ` Eli Zaretskii
2008-03-29 16:08             ` Andreas Schwab
2008-03-29 16:12               ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).