From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16150 invoked from network); 23 Mar 2005 00:37:08 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 23 Mar 2005 00:37:08 -0000 Received: (qmail 48517 invoked from network); 23 Mar 2005 00:37:02 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 23 Mar 2005 00:37:02 -0000 Received: (qmail 25047 invoked by alias); 23 Mar 2005 00:36:58 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21054 Received: (qmail 25038 invoked from network); 23 Mar 2005 00:36:57 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 23 Mar 2005 00:36:57 -0000 Received: (qmail 48186 invoked from network); 23 Mar 2005 00:36:57 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 23 Mar 2005 00:36:53 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id 54BBD7004D; Tue, 22 Mar 2005 19:36:52 -0500 (EST) Date: Tue, 22 Mar 2005 19:36:52 -0500 From: Clint Adams To: Zsh hackers list Subject: Re: PATCH: zle TODOs etc. Message-ID: <20050323003652.GA11877@scowler.net> Mail-Followup-To: Zsh hackers list References: <20050321013910.GA32327@scowler.net> <1050321020913.ZM11750@candle.brasslantern.com> <200502251446.j1PEkID6019392@news01.csr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1050321020913.ZM11750@candle.brasslantern.com> <200502251446.j1PEkID6019392@news01.csr.com> User-Agent: Mutt/1.5.6+20040907i X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 On Mon, Mar 21, 2005 at 02:09:13AM +0000, Bart Schaefer wrote: > Some discussion of this is in zsh-workers/20869. Oops. Thanks. On Fri, Feb 25, 2005 at 02:46:17PM +0000, Peter Stephenson wrote: > Word stuff: this will need a whole new way of doing iword(). Probably > that's going to have to be a function call. The obvious thing to do is > to have it on each call check that either the character iswalnum() or > the multibyte representation of the character is in the string set by > $WORDCHARS (which we could cache as wchar_t in zle). That's slower, but > probably not prohibitively so. (The functions supplied with the shell > can in principle do much more, but the underlying pattern matching tests > there don't no about multibyte characters either.) Is this the right way to go about this? M Src/Zle/zle_main.c M Src/init.c M Src/params.c * modified files --- orig/Src/Zle/zle_main.c +++ mod/Src/Zle/zle_main.c @@ -101,6 +101,11 @@ /**/ mod_export int lastchar_wide_valid; + +/**/ +mod_export ZLE_STRING_T zle_wordchars; +#else +# define zle_wordchars wordchars; #endif /* the bindings for the previous and for this key */ @@ -1507,6 +1512,15 @@ kungetct = 0; } +/**/ +mod_export void +wordcharshook(void) +{ +#ifdef ZLE_UNICODE_SUPPORT + /* TODO: convert wordchars to wchar zle_wordchars */ +#endif +} + /* Hook functions. Used to allow access to zle parameters if zle is * active. */ @@ -1560,6 +1574,7 @@ zlegetlineptr = zlegetline; zlereadptr = zleread; zlesetkeymapptr = zlesetkeymap; + wordcharshookptr = wordcharshook; getkeyptr = getbyte; @@ -1645,6 +1660,7 @@ zlegetlineptr = NULL; zlereadptr = fallback_zleread; zlesetkeymapptr= noop_function_int; + wordcharshookptr = noop_function; getkeyptr = NULL; --- orig/Src/init.c +++ mod/Src/init.c @@ -1150,6 +1150,9 @@ #endif /* !LINKED_XMOD_zshQszle */ /**/ +mod_export ZleVoidFn wordcharshookptr = noop_function; + +/**/ unsigned char * autoload_zleread(char **lp, char **rp, int ha, int con) { --- orig/Src/params.c +++ mod/Src/params.c @@ -3316,6 +3316,7 @@ zsfree(wordchars); wordchars = x; inittyptab(); + wordcharshookptr(); } /* Function to get value for special parameter `_' */