From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9993 invoked from network); 20 Mar 2006 14:37:31 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.1 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 20 Mar 2006 14:37:31 -0000 Received: (qmail 43175 invoked from network); 20 Mar 2006 14:37:25 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 20 Mar 2006 14:37:25 -0000 Received: (qmail 26336 invoked by alias); 20 Mar 2006 14:37:21 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22371 Received: (qmail 26321 invoked from network); 20 Mar 2006 14:37:20 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 20 Mar 2006 14:37:19 -0000 Received: (qmail 42841 invoked from network); 20 Mar 2006 14:37:19 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 20 Mar 2006 14:37:18 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id 68C7170086; Mon, 20 Mar 2006 09:37:16 -0500 (EST) Date: Mon, 20 Mar 2006 09:37:16 -0500 From: Clint Adams To: zsh-workers@sunsite.dk Cc: Samuel Thibault , 357934@bugs.debian.org Subject: Re: Bug#357934: zsh: '-', '.' etc. shouldn't be recognized as word chars Message-ID: <20060320143716.GA28570@scowler.net> Mail-Followup-To: zsh-workers@sunsite.dk, Samuel Thibault , 357934@bugs.debian.org References: <20060320112411.GA7879@implementation.labri.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20060320112411.GA7879@implementation.labri.fr> User-Agent: Mutt/1.5.11+cvs20060126 > Hi, > > Vi mode now recognizes '-', '.', as word chars: > > $ a-b > > When pressing 'w' with cursor on 'a', the cursor skips the whole "a-b" > string. But it should rather stop at '-'. > > One can override this by defining WORDCHARS to letters, but the default > should really be what documentation says: > > « word characters are alphanumeric characters » > (which include all characters for which libc's isalnum() returns true). > > This wasn't the case in version 4.3.1-1. The fix for #357313 probably > needs fixing. This will do alphanumerics and underscores. I no longer have any idea what the correct behavior is supposed to be. Index: Src/Zle/zle.h =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/zle.h,v retrieving revision 1.27 diff -u -r1.27 zle.h --- Src/Zle/zle.h 9 Feb 2006 22:12:54 -0000 1.27 +++ Src/Zle/zle.h 20 Mar 2006 14:27:14 -0000 @@ -72,6 +72,7 @@ /* Functions that operate on ZLE_CHAR_T. */ #define ZC_ialpha iswalpha +#define ZC_ialnum iswalnum #define ZC_iblank wcsiblank #define ZC_icntrl iswcntrl #define ZC_idigit iswdigit @@ -137,6 +138,7 @@ /* Functions that operate on ZLE_CHAR_T. */ #define ZC_ialpha ialpha +#define ZC_ialpha ialnum #define ZC_iblank iblank #define ZC_icntrl icntrl #define ZC_idigit idigit Index: Src/Zle/zle_word.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_word.c,v retrieving revision 1.8 diff -u -r1.8 zle_word.c --- Src/Zle/zle_word.c 17 Mar 2006 23:45:44 -0000 1.8 +++ Src/Zle/zle_word.c 20 Mar 2006 14:27:14 -0000 @@ -54,7 +54,7 @@ return 0; } -#define Z_vident(X) (ZC_iword(X) || (ZWC('_') == X)) +#define Z_vialnum(X) (ZC_ialnum(X) || (ZWC('_') == X)) /**/ int @@ -70,11 +70,11 @@ return ret; } while (n--) { - if (Z_vident(zleline[zlecs])) - while (zlecs != zlell && Z_vident(zleline[zlecs])) + if (Z_vialnum(zleline[zlecs])) + while (zlecs != zlell && Z_vialnum(zleline[zlecs])) zlecs++; else - while (zlecs != zlell && !Z_vident(zleline[zlecs]) && !ZC_iblank(zleline[zlecs])) + while (zlecs != zlell && !Z_vialnum(zleline[zlecs]) && !ZC_iblank(zleline[zlecs])) zlecs++; if (wordflag && !n) return 0; @@ -168,11 +168,11 @@ if (ZC_iblank(zleline[zlecs + 1])) while (zlecs != zlell && ZC_iblank(zleline[zlecs + 1])) zlecs++; - if (Z_vident(zleline[zlecs + 1])) - while (zlecs != zlell && Z_vident(zleline[zlecs + 1])) + if (Z_vialnum(zleline[zlecs + 1])) + while (zlecs != zlell && Z_vialnum(zleline[zlecs + 1])) zlecs++; else - while (zlecs != zlell && !Z_vident(zleline[zlecs + 1]) && !ZC_iblank(zleline[zlecs + 1])) + while (zlecs != zlell && !Z_vialnum(zleline[zlecs + 1]) && !ZC_iblank(zleline[zlecs + 1])) zlecs++; } if (zlecs != zlell && virangeflag) @@ -218,11 +218,11 @@ while (n--) { while (zlecs && ZC_iblank(zleline[zlecs - 1])) zlecs--; - if (Z_vident(zleline[zlecs - 1])) - while (zlecs && Z_vident(zleline[zlecs - 1])) + if (Z_vialnum(zleline[zlecs - 1])) + while (zlecs && Z_vialnum(zleline[zlecs - 1])) zlecs--; else - while (zlecs && !Z_vident(zleline[zlecs - 1]) && !ZC_iblank(zleline[zlecs - 1])) + while (zlecs && !Z_vialnum(zleline[zlecs - 1]) && !ZC_iblank(zleline[zlecs - 1])) zlecs--; } return 0; @@ -308,11 +308,11 @@ while (n--) { while ((x > lim) && ZC_iblank(zleline[x - 1])) x--; - if (Z_vident(zleline[x - 1])) - while ((x > lim) && Z_vident(zleline[x - 1])) + if (Z_vialnum(zleline[x - 1])) + while ((x > lim) && Z_vialnum(zleline[x - 1])) x--; else - while ((x > lim) && !Z_vident(zleline[x - 1]) && !ZC_iblank(zleline[x - 1])) + while ((x > lim) && !Z_vialnum(zleline[x - 1]) && !ZC_iblank(zleline[x - 1])) x--; } backkill(zlecs - x, 1);