237 |
{ |
{ |
238 |
register char *buffer, *p; |
register char *buffer, *p; |
239 |
int wordstart, wordend; |
int wordstart, wordend; |
240 |
register int wordstart_byte, wordend_byte, idx; |
register int wordstart_byte, wordend_byte, idx, idx_byte; |
241 |
int whitecnt; |
int whitecnt; |
242 |
int uccount = 0, lccount = 0; |
int uccount = 0, lccount = 0; |
243 |
register Lisp_Object sym; |
register Lisp_Object sym; |
244 |
Lisp_Object expansion, hook, tem; |
Lisp_Object expansion, hook, tem; |
245 |
Lisp_Object value; |
Lisp_Object value; |
246 |
|
int multibyte = ! NILP (current_buffer->enable_multibyte_characters); |
247 |
|
|
248 |
value = Qnil; |
value = Qnil; |
249 |
|
|
289 |
|
|
290 |
p = buffer = (char *) alloca (wordend_byte - wordstart_byte); |
p = buffer = (char *) alloca (wordend_byte - wordstart_byte); |
291 |
|
|
292 |
for (idx = wordstart_byte; idx < wordend_byte; idx++) |
for (idx = wordstart, idx_byte = wordstart_byte; idx < wordend;) |
293 |
{ |
{ |
294 |
/* ??? This loop needs to go by characters! */ |
register int c; |
295 |
register int c = FETCH_BYTE (idx); |
|
296 |
|
FETCH_CHAR_ADVANCE (c, idx, idx_byte); |
297 |
|
if (! multibyte) |
298 |
|
{ |
299 |
|
MAKE_CHAR_MULTIBYTE (c); |
300 |
|
} |
301 |
|
|
302 |
if (UPPERCASEP (c)) |
if (UPPERCASEP (c)) |
303 |
c = DOWNCASE (c), uccount++; |
c = DOWNCASE (c), uccount++; |
304 |
else if (! NOCASEP (c)) |
else if (! NOCASEP (c)) |
305 |
lccount++; |
lccount++; |
306 |
*p++ = c; |
if (multibyte) |
307 |
|
CHAR_STRING_ADVANCE (c, p); |
308 |
|
else |
309 |
|
{ |
310 |
|
MAKE_CHAR_UNIBYTE (c); |
311 |
|
*p++ = c; |
312 |
|
} |
313 |
} |
} |
314 |
|
|
315 |
if (VECTORP (current_buffer->abbrev_table)) |
if (VECTORP (current_buffer->abbrev_table)) |
316 |
sym = oblookup (current_buffer->abbrev_table, buffer, |
sym = oblookup (current_buffer->abbrev_table, buffer, |
317 |
wordend - wordstart, wordend_byte - wordstart_byte); |
wordend - wordstart, p - buffer); |
318 |
else |
else |
319 |
XSETFASTINT (sym, 0); |
XSETFASTINT (sym, 0); |
320 |
|
|
321 |
if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym))) |
if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym))) |
322 |
sym = oblookup (Vglobal_abbrev_table, buffer, |
sym = oblookup (Vglobal_abbrev_table, buffer, |
323 |
wordend - wordstart, wordend_byte - wordstart_byte); |
wordend - wordstart, p - buffer); |
324 |
if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym))) |
if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym))) |
325 |
return value; |
return value; |
326 |
|
|