Re: Experimental: editors/nvi 2.0.1 (UTF-8 vi)

2011-11-15 Thread Michael Knudsen
On Mon, Nov 14, 2011 at 02:24:15PM +, Christian Weisgerber wrote:
  I'm running nvi in tmux with -u, ksh and the following LC_* settings:
 [...]
  LC_TIME=en_DK.UTF-8
 
 English as spoken in Denmark, really?  That locale doesn't exit.

This is something you really don't want to listen to. (:

-m.

-- 
Rumour is information distilled so finely that it can filter through
anything.
-- (Terry Pratchett, Feet of Clay)



Re: Experimental: editors/nvi 2.0.1 (UTF-8 vi)

2011-11-14 Thread Christian Weisgerber
Simon Kuhnle si...@blarzwurst.de wrote:

 I just built it on sparc64.
 
 Opened and edited a few files.
 
 http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt
 looks good in it, too.

Actually, I get a warning Invalid input. Truncated.

 One problem is, that 'undo' (hitting 'u') leads to SIGBUS.

That too.

-- 
Christian naddy Weisgerber  na...@mips.inka.de



Re: Experimental: editors/nvi 2.0.1 (UTF-8 vi)

2011-11-14 Thread Simon Kuhnle
On Mon, Nov 14, 2011 at 01:07:21PM +, Christian Weisgerber wrote:
 Simon Kuhnle si...@blarzwurst.de wrote:
 
  I just built it on sparc64.
  
  Opened and edited a few files.
  
  http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt
  looks good in it, too.
 
 Actually, I get a warning Invalid input. Truncated.

Really?

I'm running nvi in tmux with -u, ksh and the following LC_* settings:
LC_ADDRESS=de_DE.UTF-8
LC_PAPER=de_DE.UTF-8
LC_COLLATE=en_US.UTF-8
LANG=en_US.UTF-8
LC_NAME=de_DE.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_TIME=en_DK.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MONETARY=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_NUMERIC=de_DE.UTF-8

Regards,
-- 
Simon



Re: Experimental: editors/nvi 2.0.1 (UTF-8 vi)

2011-11-14 Thread Christian Weisgerber
Simon Kuhnle si...@blarzwurst.de wrote:

   http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt
   looks good in it, too.
  
  Actually, I get a warning Invalid input. Truncated.
 
 Really?

Yep.  Just LANG=en_US.UTF-8 here.

 I'm running nvi in tmux with -u, ksh and the following LC_* settings:
[...]
 LC_TIME=en_DK.UTF-8

English as spoken in Denmark, really?  That locale doesn't exit.
(Not that it would matter for nvi.)

-- 
Christian naddy Weisgerber  na...@mips.inka.de



Re: Experimental: editors/nvi 2.0.1 (UTF-8 vi)

2011-11-14 Thread Christian Weisgerber
Simon Kuhnle si...@blarzwurst.de wrote:

   http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt
  
  Actually, I get a warning Invalid input. Truncated.
 
 Really?

Oops, my bad.  I had some ISO Latin 1 cruft left in my ~/.exrc.
nvi's error/warning is perfectly correct.

-- 
Christian naddy Weisgerber  na...@mips.inka.de



Re: Experimental: editors/nvi 2.0.1 (UTF-8 vi)

2011-11-14 Thread Simon Kuhnle
On Mon, Nov 14, 2011 at 02:24:15PM +, Christian Weisgerber wrote:
  I'm running nvi in tmux with -u, ksh and the following LC_* settings:
 [...]
  LC_TIME=en_DK.UTF-8
 
 English as spoken in Denmark, really?  That locale doesn't exit.
 (Not that it would matter for nvi.)

I just had to look up the reason for this, too.
Something about ISO time formats (-MM-DD).

Regards,
Simon



Re: Experimental: editors/nvi 2.0.1 (UTF-8 vi)

2011-11-13 Thread Simon Kuhnle
On Sun, Nov 13, 2011 at 12:14:18PM +0100, Christian Weisgerber wrote:
 nvi2 is a Google Summer of Code project by Zhihao Yuan for FreeBSD
 that keeps the behaviors and the license of nvi-1.79 in the base
 system and adopts the multibyte encoding support from nvi-1.8x.
 
 This will be a potential path for adding multibyte support to our
 base vi as well.  I've attached a port for nvi-2.0.1 for people
 who want to play with this now.

I just built it on sparc64.

Opened and edited a few files.

http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt
looks good in it, too.

One problem is, that 'undo' (hitting 'u') leads to SIGBUS.
nvi UTF-8-demo.txt
delete random character with 'x'
undo with 'u'
BUS ERROR

I built nvi with -O0 -ggdb:
slayer:~$ gdb /usr/local/bin/nvi nvi.core
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type show copying to see the conditions.
There is absolutely no warranty for GDB.  Type show warranty for details.
This GDB was configured as sparc64-unknown-openbsd5.0...
Core was generated by `nvi'.
Program terminated with signal 10, Bus error.
Reading symbols from /usr/lib/libncursesw.so.12.1...done.
Loaded symbols for /usr/lib/libncursesw.so.12.1
Reading symbols from /usr/lib/libc.so.61.0...done.
Loaded symbols for /usr/lib/libc.so.61.0
Reading symbols from /usr/libexec/ld.so...done.
oaded symbols for /usr/libexec/ld.so
#0  0x0010b984 in default_int2char (sp=0x20ba29000, str=0x204feff1d, 
len=62, cw=0x20ba29018, tolen=0x7448, pdst=0x7450, 
enc=0x0) at /usr/ports/pobj/nvi-2.0.1/nvi2-2012/common/conv.c:276
276 n = wcrtomb(dst+j, str[i], mbs);
(gdb) bt
#0  0x0010b984 in default_int2char (sp=0x20ba29000, str=0x204feff1d, 
len=62, cw=0x20ba29018, tolen=0x7448, pdst=0x7450, 
enc=0x0) at /usr/ports/pobj/nvi-2.0.1/nvi2-2012/common/conv.c:276
#1  0x0010bc60 in fe_int2char (sp=0x20ba29000, str=0x204feff1d, len=62, 
cw=0x20ba29018, tolen=0x7448, dst=0x7450) at 
/usr/ports/pobj/nvi-2.0.1/nvi2-2012/common/conv.c:314
#2  0x00115294 in db_set (sp=0x20ba29000, lno=2, p=0x204feff1d, len=62) 
at /usr/ports/pobj/nvi-2.0.1/nvi2-2012/common/line.c:442
#3  0x00116980 in log_backward (sp=0x20ba29000, rp=0x77f8) 
at /usr/ports/pobj/nvi-2.0.1/nvi2-2012/common/log.c:441
#4  0x0016f464 in v_undo (sp=0x20ba29000, vp=0x7768) at 
/usr/ports/pobj/nvi-2.0.1/nvi2-2012/vi/v_undo.c:128
#5  0x001723bc in vi (spp=0x7a28) at 
/usr/ports/pobj/nvi-2.0.1/nvi2-2012/vi/vi.c:233
#6  0x0011862c in editor (gp=0x20ba28000, argc=1, 
argv=0x7dd0) at 
/usr/ports/pobj/nvi-2.0.1/nvi2-2012/common/main.c:425
#7  0x00105d94 in main (argc=2, argv=0x7dc8) at 
/usr/ports/pobj/nvi-2.0.1/nvi2-2012/cl/cl_main.c:123

slayer:~$ sysctl kern.version
kern.version=OpenBSD 5.0-current (GENERIC.MP) #72: Thu Oct 27 12:49:59 MDT 2011
dera...@sparc64.openbsd.org:/usr/src/sys/arch/sparc64/compile/GENERIC.MP


Let me know if you need further information.

Regards,
-- 
Simon