From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7350 invoked from network); 24 Nov 2005 15:02:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 24 Nov 2005 15:02:03 -0000 Received: (qmail 12333 invoked from network); 24 Nov 2005 15:01:57 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 24 Nov 2005 15:01:57 -0000 Received: (qmail 6626 invoked by alias); 24 Nov 2005 15:01:53 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22024 Received: (qmail 6614 invoked from network); 24 Nov 2005 15:01:53 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 24 Nov 2005 15:01:53 -0000 Received: (qmail 11918 invoked from network); 24 Nov 2005 15:01:53 -0000 Received: from mailgw2.technion.ac.il (132.68.238.33) by a.mx.sunsite.dk with SMTP; 24 Nov 2005 15:01:51 -0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mailgw2.technion.ac.il (Postfix) with ESMTP id 22AEF39030D for ; Thu, 24 Nov 2005 17:01:51 +0200 (IST) Received: from mailgw2.technion.ac.il ([127.0.0.1]) by localhost (mailgw2.technion.ac.il [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 22640-01-59 for ; Thu, 24 Nov 2005 17:01:51 +0200 (IST) Received: from fermat.math.technion.ac.il (fermat.math.technion.ac.il [132.68.115.6]) by mailgw2.technion.ac.il (Postfix) with ESMTP id E1F45390267 for ; Thu, 24 Nov 2005 17:01:50 +0200 (IST) Received: from fermat.math.technion.ac.il (localhost [127.0.0.1]) by fermat.math.technion.ac.il (8.12.10/8.12.10) with ESMTP id jAOF1jlf029397; Thu, 24 Nov 2005 17:01:45 +0200 (IST) Received: (from rl@localhost) by fermat.math.technion.ac.il (8.12.10/8.12.10/Submit) id jAOF1jko029395; Thu, 24 Nov 2005 17:01:45 +0200 (IST) X-Authentication-Warning: fermat.math.technion.ac.il: rl set sender to rl@math.technion.ac.il using -f Date: Thu, 24 Nov 2005 17:01:45 +0200 From: "Zvi Har'El" To: Peter Stephenson Cc: Zsh hackers list Subject: Re: insert-unicode-char Message-ID: <20051124150145.GC1880@fermat.math.technion.ac.il> References: <20051124140854.GA25283@fermat.math.technion.ac.il> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2i Organization: Technion--Israel Institute of Technology Hebrew-Date: 22 Heshvan 5766 X-PGP-Public-Key: http://www.math.technion.ac.il/~rl/etc/pubkey.html X-Virus-Scanned: by amavisd-new at technion.ac.il Thanks, it works! On Thu, 24 Nov 2005 14:39:09 +0000, Peter Stephenson wrote about "Re: insert-unicode-char": > "Zvi Har'El" wrote: > > I am trying to use the new insert-unicode-char in a vi emulation - insetmode, > > using > > > > autoload insert-unicode-char > > zle -N insert-unicode-char > > bindkey -v '^y' insert-unicode-char > > > > It works, accept I cannot enter two unicode characters in a row. > > Yes, that was an oversight. It needs an extra flag to check that it's > really on the second stage rather than the first, otherwise it gets > confused by back-to-back uses. > > Index: Functions/Zle/insert-unicode-char > =================================================================== > RCS file: /cvsroot/zsh/zsh/Functions/Zle/insert-unicode-char,v > retrieving revision 1.3 > diff -u -r1.3 insert-unicode-char > --- Functions/Zle/insert-unicode-char 24 Nov 2005 10:25:34 -0000 1.3 > +++ Functions/Zle/insert-unicode-char 24 Nov 2005 14:35:35 -0000 > @@ -1,7 +1,10 @@ > # Make hex integers appear as 0x... > setopt localoptions cbases > > -if [[ $LASTWIDGET = insert-unicode-char ]]; then > +integer -g _insert_unicode_ready > + > +if [[ $LASTWIDGET = insert-unicode-char && $_insert_unicode_ready -eq 1 ]] > +then > # Second call; we should have a usable prefix. > # If we don't, give up. > (( ${+NUMERIC} )) || return 1 > @@ -9,9 +12,11 @@ > local -i 16 -Z 10 arg=$NUMERIC > # ...and use print to turn this into a Unicode character. > LBUFFER+="$(print -n "\U${arg##0x}")" > + _insert_unicode_ready=0 > else > # Set the base to 16... > zle argument-base 16 > # ...wait for user to type hex keys then call this widget again. > zle universal-argument > + _insert_unicode_ready=1 > fi > > -- > Peter Stephenson Software Engineer > CSR PLC, Churchill House, Cambridge Business Park, Cowley Road > Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 > > > This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com -- Dr. Zvi Har'El mailto:rl@math.technion.ac.il Department of Mathematics tel:+972-54-4227607 icq:179294841 Technion - Israel Institute of Technology fax:+972-4-8293388 http://www.math.technion.ac.il/~rl/ Haifa 32000, ISRAEL "If you can't say somethin' nice, don't say nothin' at all." -- Thumper (1942) Thursday, 22 Heshvan 5766, 24 November 2005, 5:01PM