emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Ken Raeburn
Subject: [Emacs-diffs] Changes to emacs/src/keyboard.c
Date: Sun, 14 Jul 2002 20:00:52 -0400

Index: emacs/src/keyboard.c
diff -c emacs/src/keyboard.c:1.693 emacs/src/keyboard.c:1.694
*** emacs/src/keyboard.c:1.693  Sun Jul 14 18:52:48 2002
--- emacs/src/keyboard.c        Sun Jul 14 20:00:36 2002
***************
*** 855,861 ****
    echoing = 1;
    message3_nolog (current_kboard->echo_string,
                  SBYTES (current_kboard->echo_string),
!                 SMBP (current_kboard->echo_string));
    echoing = 0;
  
    /* Record in what buffer we echoed, and from which kboard.  */
--- 855,861 ----
    echoing = 1;
    message3_nolog (current_kboard->echo_string,
                  SBYTES (current_kboard->echo_string),
!                 STRING_MULTIBYTE (current_kboard->echo_string));
    echoing = 0;
  
    /* Record in what buffer we echoed, and from which kboard.  */
***************
*** 1204,1210 ****
         *Messages*.  */
        if (!NILP (Vsignaling_function) && SYMBOLP (Vsignaling_function))
        {
!         char *name = XSTRING (SYMBOL_NAME (Vsignaling_function))->data;
          message_dolog (name, strlen (name), 0, 0);
          message_dolog (": ", 2, 0, 0);
          Vsignaling_function = Qnil;
--- 1204,1210 ----
         *Messages*.  */
        if (!NILP (Vsignaling_function) && SYMBOLP (Vsignaling_function))
        {
!         char *name = SDATA (SYMBOL_NAME (Vsignaling_function));
          message_dolog (name, strlen (name), 0, 0);
          message_dolog (": ", 2, 0, 0);
          Vsignaling_function = Qnil;
***************
*** 2111,2124 ****
                Vpre_help_message = current_message ();
              
              specbind (Qmessage_truncate_lines, Qt);
!             message3_nolog (help, STRING_BYTES (XSTRING (help)),
                              STRING_MULTIBYTE (help));
              unbind_to (count, Qnil);
            }
          else if (STRINGP (Vpre_help_message))
            {
              message3_nolog (Vpre_help_message,
!                             STRING_BYTES (XSTRING (Vpre_help_message)),
                              STRING_MULTIBYTE (Vpre_help_message));
              Vpre_help_message = Qnil;
            }
--- 2111,2124 ----
                Vpre_help_message = current_message ();
              
              specbind (Qmessage_truncate_lines, Qt);
!             message3_nolog (help, SBYTES (help),
                              STRING_MULTIBYTE (help));
              unbind_to (count, Qnil);
            }
          else if (STRINGP (Vpre_help_message))
            {
              message3_nolog (Vpre_help_message,
!                             SBYTES (Vpre_help_message),
                              STRING_MULTIBYTE (Vpre_help_message));
              Vpre_help_message = Qnil;
            }
***************
*** 2745,2751 ****
        RETURN_UNGCPRO (c);
  
        if ((STRINGP (Vkeyboard_translate_table)
!          && XSTRING (Vkeyboard_translate_table)->size > (unsigned) XFASTINT 
(c))
          || (VECTORP (Vkeyboard_translate_table)
              && XVECTOR (Vkeyboard_translate_table)->size > (unsigned) 
XFASTINT (c))
          || (CHAR_TABLE_P (Vkeyboard_translate_table)
--- 2745,2751 ----
        RETURN_UNGCPRO (c);
  
        if ((STRINGP (Vkeyboard_translate_table)
!          && SCHARS (Vkeyboard_translate_table) > (unsigned) XFASTINT (c))
          || (VECTORP (Vkeyboard_translate_table)
              && XVECTOR (Vkeyboard_translate_table)->size > (unsigned) 
XFASTINT (c))
          || (CHAR_TABLE_P (Vkeyboard_translate_table)
***************
*** 3161,3168 ****
          if (SYMBOLP (dribblee))
            {
              putc ('<', dribble);
!             fwrite (XSTRING (SYMBOL_NAME (dribblee))->data, sizeof (char),
!                     STRING_BYTES (XSTRING (SYMBOL_NAME (dribblee))),
                      dribble);
              putc ('>', dribble);
            }
--- 3161,3168 ----
          if (SYMBOLP (dribblee))
            {
              putc ('<', dribble);
!             fwrite (SDATA (SYMBOL_NAME (dribblee)), sizeof (char),
!                     SBYTES (SYMBOL_NAME (dribblee)),
                      dribble);
              putc ('>', dribble);
            }
***************
*** 4929,4935 ****
                    if (NILP (string))
                      break;
                    if (column >= XINT (pos)
!                       && column < XINT (pos) + XSTRING (string)->size)
                      {
                        item = AREF (items, i);
                        break;
--- 4929,4935 ----
                    if (NILP (string))
                      break;
                    if (column >= XINT (pos)
!                       && column < XINT (pos) + SCHARS (string))
                      {
                        item = AREF (items, i);
                        break;
***************
*** 5703,5710 ****
  
      new_name = make_uninit_multibyte_string (mod_len + base_len,
                                             mod_len + base_len_byte);
!     bcopy (new_mods, XSTRING (new_name)->data,               mod_len);
!     bcopy (base,     XSTRING (new_name)->data + mod_len, base_len_byte);
  
      return Fintern (new_name, Qnil);
    }
--- 5703,5710 ----
  
      new_name = make_uninit_multibyte_string (mod_len + base_len,
                                             mod_len + base_len_byte);
!     bcopy (new_mods, SDATA (new_name),               mod_len);
!     bcopy (base,     SDATA (new_name) + mod_len, base_len_byte);
  
      return Fintern (new_name, Qnil);
    }
***************
*** 5762,5769 ****
        Lisp_Object unmodified;
        Lisp_Object mask;
  
!       unmodified = Fintern (make_string (XSTRING (SYMBOL_NAME (symbol))->data 
+ end,
!                                        STRING_BYTES (XSTRING (SYMBOL_NAME 
(symbol))) - end),
                            Qnil);
  
        if (modifiers & ~VALMASK)
--- 5762,5769 ----
        Lisp_Object unmodified;
        Lisp_Object mask;
  
!       unmodified = Fintern (make_string (SDATA (SYMBOL_NAME (symbol)) + end,
!                                        SBYTES (SYMBOL_NAME (symbol)) - end),
                            Qnil);
  
        if (modifiers & ~VALMASK)
***************
*** 5816,5824 ****
      {
        /* We have to create the symbol ourselves.  */
        new_symbol = apply_modifiers_uncached (modifiers,
!                                            XSTRING (SYMBOL_NAME (base))->data,
!                                            XSTRING (SYMBOL_NAME (base))->size,
!                                            STRING_BYTES (XSTRING (SYMBOL_NAME 
(base))));
  
        /* Add the new symbol to the base's cache.  */
        entry = Fcons (index, new_symbol);
--- 5816,5824 ----
      {
        /* We have to create the symbol ourselves.  */
        new_symbol = apply_modifiers_uncached (modifiers,
!                                            SDATA (SYMBOL_NAME (base)),
!                                            SCHARS (SYMBOL_NAME (base)),
!                                            SBYTES (SYMBOL_NAME (base)));
  
        /* Add the new symbol to the base's cache.  */
        entry = Fcons (index, new_symbol);
***************
*** 5956,5964 ****
        value = Fcdr_safe (Fassq (symbol_int, name_alist_or_stem));
        else if (STRINGP (name_alist_or_stem))
        {
!         int len = STRING_BYTES (XSTRING (name_alist_or_stem));
          char *buf = (char *) alloca (len + 50);
!         sprintf (buf, "%s-%d", XSTRING (name_alist_or_stem)->data,
                   XINT (symbol_int) + 1);
          value = intern (buf);
        }
--- 5956,5964 ----
        value = Fcdr_safe (Fassq (symbol_int, name_alist_or_stem));
        else if (STRINGP (name_alist_or_stem))
        {
!         int len = SBYTES (name_alist_or_stem);
          char *buf = (char *) alloca (len + 50);
!         sprintf (buf, "%s-%d", SDATA (name_alist_or_stem),
                   XINT (symbol_int) + 1);
          value = intern (buf);
        }
***************
*** 6039,6046 ****
      }
  
    /* Let the symbol A refer to the character A.  */
!   if (SYMBOLP (base) && XSTRING (SYMBOL_NAME (base))->size == 1)
!     XSETINT (base, XSTRING (SYMBOL_NAME (base))->data[0]);
  
    if (INTEGERP (base))
      {
--- 6039,6046 ----
      }
  
    /* Let the symbol A refer to the character A.  */
!   if (SYMBOLP (base) && SCHARS (SYMBOL_NAME (base)) == 1)
!     XSETINT (base, SDATA (SYMBOL_NAME (base))[0]);
  
    if (INTEGERP (base))
      {
***************
*** 7720,7727 ****
      return Qnil;
  
    /* Prompt string always starts with map's prompt, and a space.  */
!   strcpy (menu, XSTRING (name)->data);
!   nlength = STRING_BYTES (XSTRING (name));
    menu[nlength++] = ':';
    menu[nlength++] = ' ';
    menu[nlength] = 0;
--- 7720,7727 ----
      return Qnil;
  
    /* Prompt string always starts with map's prompt, and a space.  */
!   strcpy (menu, SDATA (name));
!   nlength = SBYTES (name);
    menu[nlength++] = ':';
    menu[nlength++] = ' ';
    menu[nlength] = 0;
***************
*** 7799,7806 ****
  
                  upcased_event = Fupcase (event);
                  downcased_event = Fdowncase (event);
!                 char_matches = (XINT (upcased_event) == XSTRING (s)->data[0]
!                                 || XINT (downcased_event) == XSTRING 
(s)->data[0]);
                  if (! char_matches)
                    desc = Fsingle_key_description (event, Qnil);
  
--- 7799,7806 ----
  
                  upcased_event = Fupcase (event);
                  downcased_event = Fdowncase (event);
!                 char_matches = (XINT (upcased_event) == SREF (s, 0)
!                                 || XINT (downcased_event) == SREF (s, 0));
                  if (! char_matches)
                    desc = Fsingle_key_description (event, Qnil);
  
***************
*** 7829,7836 ****
  
                  /* If we have room for the prompt string, add it to this line.
                     If this is the first on the line, always add it.  */
!                 if ((XSTRING (s)->size + i + 2
!                      + (char_matches ? 0 : XSTRING (desc)->size + 3))
                      < width
                      || !notfirst)
                    {
--- 7829,7836 ----
  
                  /* If we have room for the prompt string, add it to this line.
                     If this is the first on the line, always add it.  */
!                 if ((SCHARS (s) + i + 2
!                      + (char_matches ? 0 : SCHARS (desc) + 3))
                      < width
                      || !notfirst)
                    {
***************
*** 7850,7869 ****
                      if (! char_matches)
                        {
                          /* Add as much of string as fits.  */
!                         thiswidth = XSTRING (desc)->size;
                          if (thiswidth + i > width)
                            thiswidth = width - i;
!                         bcopy (XSTRING (desc)->data, menu + i, thiswidth);
                          i += thiswidth;
                          strcpy (menu + i, " = ");
                          i += 3;
                        }
  
                      /* Add as much of string as fits.  */
!                     thiswidth = XSTRING (s)->size;
                      if (thiswidth + i > width)
                        thiswidth = width - i;
!                     bcopy (XSTRING (s)->data, menu + i, thiswidth);
                      i += thiswidth;
                      menu[i] = 0;
                    }
--- 7850,7869 ----
                      if (! char_matches)
                        {
                          /* Add as much of string as fits.  */
!                         thiswidth = SCHARS (desc);
                          if (thiswidth + i > width)
                            thiswidth = width - i;
!                         bcopy (SDATA (desc), menu + i, thiswidth);
                          i += thiswidth;
                          strcpy (menu + i, " = ");
                          i += 3;
                        }
  
                      /* Add as much of string as fits.  */
!                     thiswidth = SCHARS (s);
                      if (thiswidth + i > width)
                        thiswidth = width - i;
!                     bcopy (SDATA (s), menu + i, thiswidth);
                      i += thiswidth;
                      menu[i] = 0;
                    }
***************
*** 8594,8600 ****
                      pos = XCDR (string);
                      string = XCAR (string);
                        if (XINT (pos) >= 0
!                         && XINT (pos) < XSTRING (string)->size)
                          {
                            map = Fget_text_property (pos, Qlocal_map, string);
                            if (!NILP (map))
--- 8594,8600 ----
                      pos = XCDR (string);
                      string = XCAR (string);
                        if (XINT (pos) >= 0
!                         && XINT (pos) < SCHARS (string))
                          {
                            map = Fget_text_property (pos, Qlocal_map, string);
                            if (!NILP (map))
***************
*** 8622,8628 ****
                  pos = XCDR (string);
                  string = XCAR (string);
                  if (XINT (pos) >= 0
!                     && XINT (pos) < XSTRING (string)->size)
                    {
                      map = Fget_text_property (pos, Qlocal_map, string);
                      if (!NILP (map))
--- 8622,8628 ----
                  pos = XCDR (string);
                  string = XCAR (string);
                  if (XINT (pos) >= 0
!                     && XINT (pos) < SCHARS (string))
                    {
                      map = Fget_text_property (pos, Qlocal_map, string);
                      if (!NILP (map))
***************
*** 8923,8929 ****
  
                      for (i = 0; i < len; i++)
                        XSETFASTINT (keybuf[fkey_start + i],
!                                    XSTRING (fkey_next)->data[i]);
                    }
  
                  mock_input = t;
--- 8923,8929 ----
  
                      for (i = 0; i < len; i++)
                        XSETFASTINT (keybuf[fkey_start + i],
!                                    SREF (fkey_next, i));
                    }
  
                  mock_input = t;
***************
*** 9462,9468 ****
                               Qt, Qnil, Qextended_command_history, Qnil,
                               Qnil);
  
!   if (STRINGP (function) && XSTRING (function)->size == 0)
      error ("No command name given");
  
    /* Set this_command_keys to the concatenation of saved_keys and
--- 9462,9468 ----
                               Qt, Qnil, Qextended_command_history, Qnil,
                               Qnil);
  
!   if (STRINGP (function) && SCHARS (function) == 0)
      error ("No command name given");
  
    /* Set this_command_keys to the concatenation of saved_keys and
***************
*** 9538,9549 ****
          binding = Fkey_description (bindings);
  
          newmessage
!           = (char *) alloca (XSTRING (SYMBOL_NAME (function))->size
!                              + STRING_BYTES (XSTRING (binding))
                               + 100);
          sprintf (newmessage, "You can run the command `%s' with %s",
!                  XSTRING (SYMBOL_NAME (function))->data,
!                  XSTRING (binding)->data);
          message2_nolog (newmessage,
                          strlen (newmessage),
                          STRING_MULTIBYTE (binding));
--- 9538,9549 ----
          binding = Fkey_description (bindings);
  
          newmessage
!           = (char *) alloca (SCHARS (SYMBOL_NAME (function))
!                              + SBYTES (binding)
                               + 100);
          sprintf (newmessage, "You can run the command `%s' with %s",
!                  SDATA (SYMBOL_NAME (function)),
!                  SDATA (binding));
          message2_nolog (newmessage,
                          strlen (newmessage),
                          STRING_MULTIBYTE (binding));
***************
*** 9769,9775 ****
    if (!NILP (file))
      {
        file = Fexpand_file_name (file, Qnil);
!       dribble = fopen (XSTRING (file)->data, "w");
        if (dribble == 0)
        report_file_error ("Opening dribble", Fcons (file, Qnil));
      }
--- 9769,9775 ----
    if (!NILP (file))
      {
        file = Fexpand_file_name (file, Qnil);
!       dribble = fopen (SDATA (file), "w");
        if (dribble == 0)
        report_file_error ("Opening dribble", Fcons (file, Qnil));
      }
***************
*** 9869,9876 ****
      {
        register int count;
  
!       p = XSTRING (stuffstring)->data;
!       count = STRING_BYTES (XSTRING (stuffstring));
        while (count-- > 0)
        stuff_char (*p++);
        stuff_char ('\n');
--- 9869,9876 ----
      {
        register int count;
  
!       p = SDATA (stuffstring);
!       count = SBYTES (stuffstring);
        while (count-- > 0)
        stuff_char (*p++);
        stuff_char ('\n');



reply via email to

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