Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: fix 4, was Re: unpatch: metafying zle line



On Friday 12 August 2005 14:21, Peter Stephenson wrote:
> After this, completion is basically working with ZLE_UNICODE_SUPPORT
> defined when you stick to using single-byte characters.  It's almost
> time to allow that to be enabled by default, which will help picking up
> the remaining problems with multi-byte characters:  those are likely to
> be widespread, but probably in most cases fixable by local changes.
>


Hat off to you, Sir! It is worth more than pizza ...

Multibyte basically works (ru_RU.UTF-8, Mandrake^H^H^Hiva cooker, gcc 4.0.1, 
glibc 2.3.5). I.e. basic line editing (movement char, word, emacs or vi 
mode). Completion - i.e. listing etc.

Some random problems.

1. attempt to use a-a-m-c results in

{pts/2}% ll кккккккк ккккккккккк/home/bor/src/zsh/Src/Zle/compresult.c:690: 
line not metafied
zsh: segmentation fault (core dumped)  pkg/bin/zsh
#0  0xb7bef892 in hasbrpsfx (m=0x8178a50, pre=0x0, suf=0x0)
    at /home/bor/src/zsh/Src/Zle/compresult.c:699
699             memcpy(oline, zlemetaline, zlemetall);
(gdb) bt
#0  0xb7bef892 in hasbrpsfx (m=0x8178a50, pre=0x0, suf=0x0)
    at /home/bor/src/zsh/Src/Zle/compresult.c:699
#1  0xb7bf1e67 in calclist (showall=1)
    at /home/bor/src/zsh/Src/Zle/compresult.c:1489
#2  0xb7f4e3a4 in complistmatches (dummy=0xb7bf6ab0, dat=0xbff669b0)
    at /home/bor/src/zsh/Src/Zle/complist.c:1608
#3  0x080961f4 in runhookdef (h=0xb7bf6ab0, d=0xbff669b0)
    at /home/bor/src/zsh/Src/module.c:1889
#4  0xb7bf4761 in list_matches (dummy=0xb7c2cec0, dummy2=0x0)
    at /home/bor/src/zsh/Src/Zle/compresult.c:2200
#5  0x080961f4 in runhookdef (h=0xb7c2cec0, d=0x0)
    at /home/bor/src/zsh/Src/module.c:1889
#6  0xb7c14a5e in zrefresh ()
    at /home/bor/src/zsh/Src/Zle/zle_refresh.c:752
#7  0xb7f5027c in domenuselect (dummy=0xb7bf6a74, dat=0xbff66fe0)
    at /home/bor/src/zsh/Src/Zle/complist.c:2153
#8  0x0809618f in runhookdef (h=0xb7bf6a74, d=0xbff66fe0)
    at /home/bor/src/zsh/Src/module.c:1883
#9  0xb7bdea62 in after_complete (dummy=0xb7c2cefc, dat=0xbff6706c)
    at /home/bor/src/zsh/Src/Zle/compcore.c:506
#10 0x080961f4 in runhookdef (h=0xb7c2cefc, d=0xbff6706c)
    at /home/bor/src/zsh/Src/module.c:1889
#11 0xb7c19e55 in docomplete (lst=0)
    at /home/bor/src/zsh/Src/Zle/zle_tricky.c:851
#12 0xb7c18544 in completeword (args=0xb7c2d13c)
    at /home/bor/src/zsh/Src/Zle/zle_tricky.c:232
#13 0xb7c18421 in completecall (args=0xb7c2d13c)
    at /home/bor/src/zsh/Src/Zle/zle_tricky.c:208
#14 0xb7c0b09f in execzlefunc (func=0xb7c2b050, args=0xb7c2d13c)
    at /home/bor/src/zsh/Src/Zle/zle_main.c:1063
#15 0xb7c0a62b in zlecore ()
    at /home/bor/src/zsh/Src/Zle/zle_main.c:838
#16 0xb7c0ad1b in zleread (lp=0x80e63e0, rp=0x0, flags=7, context=0)
    at /home/bor/src/zsh/Src/Zle/zle_main.c:992
#17 0x08080ac3 in inputline () at /home/bor/src/zsh/Src/input.c:278
#18 0x08080978 in ingetc () at /home/bor/src/zsh/Src/input.c:214
#19 0x0807775b in ihgetc () at /home/bor/src/zsh/Src/hist.c:240
#20 0x080880f4 in gettok () at /home/bor/src/zsh/Src/lex.c:628
#21 0x0808792c in yylex () at /home/bor/src/zsh/Src/lex.c:344
#22 0x080a1269 in parse_event () at /home/bor/src/zsh/Src/parse.c:451
#23 0x0807d8d6 in loop (toplevel=1, justonce=0)
    at /home/bor/src/zsh/Src/init.c:128
#24 0x080805ba in zsh_main (argc=1, argv=0xbff67614)
    at /home/bor/src/zsh/Src/init.c:1315
#25 0x08052652 in main (argc=1, argv=0xbff67614)
    at /home/bor/src/zsh/Src/main.c:93

apparently it correctly inserts first match but crashes at recursive 
completion attempt.


2. Attempt to complete anything beyond U'd183' results in

{pts/2}% ll уBUG: substring ends in the middle of a metachar in 
ztrsub()mpleting `files'
         ll у
{pts/2}% echo у | xxd
0000000: d183 0a                                  ...

I do not know what is magic about it; all characters before are completed 
normally. Probably it somehow clashes with META characters. The above is in 
UTF-8, it is 0400 unicode plane, character in question is 0443.

3. emacs ^W sometimes removes too much not just a previous word in Russian 
(where word delimiter in this case is space):

{pts/2}% ll    АААААА ББББББББ ВВВВВВВВВ^W
{pts/2}% 

4. Undo (in emacs or vi) often puts cursor not at previous position but at 
some random position. In the above example, if I have anyhing after cursor:

{pts/2}% ll А Б В^W
                 ^cursor here
{pts/2}% ^_
         ^ cursor here
{pts/2}% ll А Б В
            ^ cursor here

the position is really random, sometimes it is end of buffer sometimes more.

But yes, I think it makes sense enable UNICODE by default now. It seems to be 
usable, at least for simple filename completion.

Thank you

-andrey

Attachment: pgp4l3ke63Q63.pgp
Description: PGP signature



Messages sorted by: Reverse Date, Date, Thread, Author