/[emacs]/emacs/src/abbrev.c
ViewVC logotype

Diff of /emacs/src/abbrev.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.49.2.1 by handa, Fri Mar 1 01:02:24 2002 UTC revision 1.49.2.2 by handa, Tue Aug 20 07:21:58 2002 UTC
# Line 237  Returns the abbrev symbol, if expansion Line 237  Returns the abbrev symbol, if expansion
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    
# Line 288  Returns the abbrev symbol, if expansion Line 289  Returns the abbrev symbol, if expansion
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    

Legend:
Removed from v.1.49.2.1  
changed lines
  Added in v.1.49.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26