From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9727 invoked from network); 17 Apr 2008 08:52:22 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 17 Apr 2008 08:52:22 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 92004 invoked from network); 17 Apr 2008 08:52:18 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Apr 2008 08:52:18 -0000 Received: (qmail 3886 invoked by alias); 17 Apr 2008 08:52:15 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24821 Received: (qmail 3872 invoked from network); 17 Apr 2008 08:52:14 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 17 Apr 2008 08:52:14 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [217.69.20.190]) by bifrost.dotsrc.org (Postfix) with ESMTP id 03D20808B2EA for ; Thu, 17 Apr 2008 10:52:00 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly31d.srv.mailcontrol.com (MailControl) with ESMTP id m3G8mGtb022250 for ; Wed, 16 Apr 2008 09:48:26 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Wed, 16 Apr 2008 09:47:57 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.14.2/8.13.4) with ESMTP id m3G8lwGR005946 for ; Wed, 16 Apr 2008 09:47:58 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.14.2/8.14.2/Submit) with ESMTP id m3G8lsth005941 for ; Wed, 16 Apr 2008 09:47:58 +0100 Message-Id: <200804160847.m3G8lsth005941@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: "Zsh Hackers' List" Subject: Re: PATCH: (large) initial support for combining characters in ZLE. In-reply-to: <237967ef0804151828k4d09afc1p1a86283359d78d97@mail.gmail.com> References: <20080413175442.0e95a241@pws-pc> <237967ef0804140634l7e02ce6fofff7f3f3ec6c8d7c@mail.gmail.com> <20080414145425.566bcb92@news01> <237967ef0804150658h1f8df5e5w422955fc6b92fe29@mail.gmail.com> <20080415174645.0590d589@news01> <237967ef0804151828k4d09afc1p1a86283359d78d97@mail.gmail.com> Comments: In-reply-to "Mikael Magnusson" message dated "Wed, 16 Apr 2008 03:28:35 +0200." Date: Wed, 16 Apr 2008 09:47:54 +0100 From: Peter Stephenson X-OriginalArrivalTime: 16 Apr 2008 08:47:57.0629 (UTC) FILETIME=[9196D6D0:01C89F9E] X-Scanned-By: MailControl A-08-00-05 (www.mailcontrol.com) on 10.68.0.141 X-Virus-Scanned: ClamAV 0.91.2/6801/Wed Apr 16 18:40:47 2008 on bifrost X-Virus-Status: Clean "Mikael Magnusson" wrote: > zsh -f > setopt interactivecomments > function toggleopt() { > #is there some easier way to do this? > [[ $options[$1] = on ]] && setopt no$1 || setopt $1 > } > compdef _options toggleopt=setopt > function _togglecombining() { > toggleopt combiningchars > } > zle -N _togglecombining > bindkey ^K _togglecombining > print -z $'a\u0342' > I haven't looked at the behaviour of user-defined widgets at all, which will need much more work, but on exit from a widget is a good place to fix up the cursor position. Some more for the FAQ, too. Index: Etc/FAQ.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Etc/FAQ.yo,v retrieving revision 1.38 diff -u -r1.38 FAQ.yo --- Etc/FAQ.yo 14 Apr 2008 12:53:37 -0000 1.38 +++ Etc/FAQ.yo 16 Apr 2008 08:45:51 -0000 @@ -2045,7 +2045,8 @@ be displayed within the same screen area as the base character. As not all terminals handle this, even if they correctly display the base multibyte character, this option is not on by default. The KDE terminal - emulator tt(konsole) is known to handle combining characters. + emulator tt(konsole), tt(rxvt-unicode), and the Unicode version of + xterm, tt(uxterm), are known to handle combining characters. The tt(COMBINING_CHARS) option only affects output; combining characters may always be input, but when the option is off will be displayed @@ -2157,7 +2158,7 @@ however, using UTF-8 massively extends the number of valid characters that can be produced. - See also url(http://www.cl.cam.ac.uk/~mgk25/unicode.html#input)http://www.cl.cam.ac.uk/~mgk25/unicode.html#input) + See also url(http://www.cl.cam.ac.uk/~mgk25/unicode.html#input)(http://www.cl.cam.ac.uk/~mgk25/unicode.html#input) for general information on entering Unicode characters from a keyboard. Index: Src/Zle/zle_main.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_main.c,v retrieving revision 1.107 diff -u -r1.107 zle_main.c --- Src/Zle/zle_main.c 3 Apr 2008 15:30:44 -0000 1.107 +++ Src/Zle/zle_main.c 16 Apr 2008 08:45:52 -0000 @@ -1344,6 +1344,12 @@ } if (set_bindk) bindk = save_bindk; + /* + * Goodness knows where the user's left us; make sure + * it's not on a combining character that won't be displayed + * directly. + */ + CCRIGHT(); return ret; } -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070