while (p.x > 0 && wordness[ldata[p.x - 1] & CHAR_MASK] == wvalue) p.x--;
while (p.x > 0 && wordtype(ldata[p.x - 1]) == wvalue) p.x--;
static pos sel_spread_half(pos p, int dir){    unsigned long *ldata;    short wvalue;    ldata = lineptr(p.y);    switch (selmode) {      case SM_CHAR:	/*	 * In this mode, every character is a separate unit, except	 * for runs of spaces at the end of a non-wrapping line.	 */	if (!(ldata[cols] & ATTR_WRAPPED)) {	    unsigned long *q = ldata + cols;	    while (q > ldata && (q[-1] & CHAR_MASK) == 0x20)		q--;	    if (q == ldata + cols)		q--;	    if (p.x >= q - ldata)		p.x = (dir == -1 ? q - ldata : cols - 1);	}	break;      case SM_WORD:	/*	 * In this mode, the units are maximal runs of characters	 * whose `wordness' has the same value.	 */	wvalue = wordness[ldata[p.x] & CHAR_MASK];	if (dir == +1) {	    while (p.x < cols		   && wordness[ldata[p.x + 1] & CHAR_MASK] ==		   wvalue) p.x++;	} else {	    while (p.x > 0		   && wordness[ldata[p.x - 1] & CHAR_MASK] ==		   wvalue) p.x--;	}	break;      case SM_LINE:	/*	 * In this mode, every line is a unit.	 */	p.x = (dir == -1 ? 0 : cols - 1);	break;    }    return p;}