emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/abbrev.c


From: Kenichi Handa
Subject: [Emacs-diffs] Changes to emacs/src/abbrev.c
Date: Tue, 20 Aug 2002 03:21:58 -0400

Index: emacs/src/abbrev.c
diff -c emacs/src/abbrev.c:1.55 emacs/src/abbrev.c:1.56
*** emacs/src/abbrev.c:1.55     Sun Jul 14 20:00:35 2002
--- emacs/src/abbrev.c  Tue Aug 20 03:07:19 2002
***************
*** 238,249 ****
  {
    register char *buffer, *p;
    int wordstart, wordend;
!   register int wordstart_byte, wordend_byte, idx;
    int whitecnt;
    int uccount = 0, lccount = 0;
    register Lisp_Object sym;
    Lisp_Object expansion, hook, tem;
    Lisp_Object value;
  
    value = Qnil;
  
--- 238,250 ----
  {
    register char *buffer, *p;
    int wordstart, wordend;
!   register int wordstart_byte, wordend_byte, idx, idx_byte;
    int whitecnt;
    int uccount = 0, lccount = 0;
    register Lisp_Object sym;
    Lisp_Object expansion, hook, tem;
    Lisp_Object value;
+   int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
  
    value = Qnil;
  
***************
*** 289,314 ****
  
    p = buffer = (char *) alloca (wordend_byte - wordstart_byte);
  
!   for (idx = wordstart_byte; idx < wordend_byte; idx++)
      {
!       /* ??? This loop needs to go by characters!  */
!       register int c = FETCH_BYTE (idx);
        if (UPPERCASEP (c))
        c = DOWNCASE (c), uccount++;
        else if (! NOCASEP (c))
        lccount++;
!       *p++ = c;
      }
  
    if (VECTORP (current_buffer->abbrev_table))
      sym = oblookup (current_buffer->abbrev_table, buffer,
!                   wordend - wordstart, wordend_byte - wordstart_byte);
    else
      XSETFASTINT (sym, 0);
  
    if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym)))
      sym = oblookup (Vglobal_abbrev_table, buffer,
!                   wordend - wordstart, wordend_byte - wordstart_byte);
    if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym)))
      return value;
  
--- 290,328 ----
  
    p = buffer = (char *) alloca (wordend_byte - wordstart_byte);
  
!   for (idx = wordstart, idx_byte = wordstart_byte; idx < wordend; )
      {
!       register int c;
! 
!       if (multibyte)
!       {
!         FETCH_CHAR_ADVANCE (c, idx, idx_byte);
!       }
!       else
!       {
!         c = FETCH_BYTE (idx_byte);
!         idx++, idx_byte++;
!       }
!         
        if (UPPERCASEP (c))
        c = DOWNCASE (c), uccount++;
        else if (! NOCASEP (c))
        lccount++;
!       if (multibyte)
!       p += CHAR_STRING (c, p);
!       else
!       *p++ = c;
      }
  
    if (VECTORP (current_buffer->abbrev_table))
      sym = oblookup (current_buffer->abbrev_table, buffer,
!                   wordend - wordstart, p - buffer);
    else
      XSETFASTINT (sym, 0);
  
    if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym)))
      sym = oblookup (Vglobal_abbrev_table, buffer,
!                   wordend - wordstart, p - buffer);
    if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym)))
      return value;
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]