emacs-diffs
[Top][All Lists]
Advanced

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

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


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

Index: emacs/src/buffer.c
diff -c emacs/src/buffer.c:1.391 emacs/src/buffer.c:1.392
*** emacs/src/buffer.c:1.391    Thu Jul 11 10:08:13 2002
--- emacs/src/buffer.c  Sun Jul 14 20:00:35 2002
***************
*** 193,199 ****
       Lisp_Object spec;
  {
    if (STRINGP (spec))
!     error ("No buffer named %s", XSTRING (spec)->data);
    error ("Invalid buffer argument");
  }
  
--- 193,199 ----
       Lisp_Object spec;
  {
    if (STRINGP (spec))
!     error ("No buffer named %s", SDATA (spec));
    error ("Invalid buffer argument");
  }
  
***************
*** 341,347 ****
    if (!NILP (buf))
      return buf;
  
!   if (XSTRING (name)->size == 0)
      error ("Empty string for buffer name is not allowed");
  
    b = (struct buffer *) allocate_buffer ();
--- 341,347 ----
    if (!NILP (buf))
      return buf;
  
!   if (SCHARS (name) == 0)
      error ("Empty string for buffer name is not allowed");
  
    b = (struct buffer *) allocate_buffer ();
***************
*** 397,406 ****
    b->zv_marker = Qnil;
  
    name = Fcopy_sequence (name);
!   XSTRING (name)->intervals = NULL_INTERVAL;
    b->name = name;
  
!   if (XSTRING (name)->data[0] != ' ')
      b->undo_list = Qnil;
    else
      b->undo_list = Qt;
--- 397,406 ----
    b->zv_marker = Qnil;
  
    name = Fcopy_sequence (name);
!   STRING_INTERVALS (name) = NULL_INTERVAL;
    b->name = name;
  
!   if (SREF (name, 0) != ' ')
      b->undo_list = Qnil;
    else
      b->undo_list = Qt;
***************
*** 520,532 ****
  
    buf = Fget_buffer (name);
    if (!NILP (buf))
!     error ("Buffer name `%s' is in use", XSTRING (name)->data);
  
    base_buffer = Fget_buffer (base_buffer);
    if (NILP (base_buffer))
!     error ("No such buffer: `%s'", XSTRING (name)->data);
  
!   if (XSTRING (name)->size == 0)
      error ("Empty string for buffer name is not allowed");
  
    b = (struct buffer *) allocate_buffer ();
--- 520,532 ----
  
    buf = Fget_buffer (name);
    if (!NILP (buf))
!     error ("Buffer name `%s' is in use", SDATA (name));
  
    base_buffer = Fget_buffer (base_buffer);
    if (NILP (base_buffer))
!     error ("No such buffer: `%s'", SDATA (name));
  
!   if (SCHARS (name) == 0)
      error ("Empty string for buffer name is not allowed");
  
    b = (struct buffer *) allocate_buffer ();
***************
*** 556,562 ****
    all_buffers = b;
  
    name = Fcopy_sequence (name);
!   XSTRING (name)->intervals = NULL_INTERVAL;
    b->name = name;
  
    reset_buffer (b);
--- 556,562 ----
    all_buffers = b;
  
    name = Fcopy_sequence (name);
!   STRING_INTERVALS (name) = NULL_INTERVAL;
    b->name = name;
  
    reset_buffer (b);
***************
*** 1091,1097 ****
  
    CHECK_STRING (newname);
  
!   if (XSTRING (newname)->size == 0)
      error ("Empty string is invalid as a buffer name");
  
    tem = Fget_buffer (newname);
--- 1091,1097 ----
  
    CHECK_STRING (newname);
  
!   if (SCHARS (newname) == 0)
      error ("Empty string is invalid as a buffer name");
  
    tem = Fget_buffer (newname);
***************
*** 1106,1112 ****
        if (!NILP (unique))
        newname = Fgenerate_new_buffer_name (newname, current_buffer->name);
        else
!       error ("Buffer name `%s' is in use", XSTRING (newname)->data);
      }
  
    current_buffer->name = newname;
--- 1106,1112 ----
        if (!NILP (unique))
        newname = Fgenerate_new_buffer_name (newname, current_buffer->name);
        else
!       error ("Buffer name `%s' is in use", SDATA (newname));
      }
  
    current_buffer->name = newname;
***************
*** 1163,1169 ****
        buf = Fcdr (Fcar (tail));
        if (EQ (buf, buffer))
        continue;
!       if (XSTRING (XBUFFER (buf)->name)->data[0] == ' ')
        continue;
        /* If the selected frame has a buffer_predicate,
         disregard buffers that don't fit the predicate.  */
--- 1163,1169 ----
        buf = Fcdr (Fcar (tail));
        if (EQ (buf, buffer))
        continue;
!       if (SDATA (XBUFFER (buf)->name)[0] == ' ')
        continue;
        /* If the selected frame has a buffer_predicate,
         disregard buffers that don't fit the predicate.  */
***************
*** 1289,1295 ****
      {
        GCPRO1 (buf);
        tem = do_yes_or_no_p (format1 ("Buffer %s modified; kill anyway? ",
!                                    XSTRING (b->name)->data));
        UNGCPRO;
        if (NILP (tem))
        return Qnil;
--- 1289,1295 ----
      {
        GCPRO1 (buf);
        tem = do_yes_or_no_p (format1 ("Buffer %s modified; kill anyway? ",
!                                    SDATA (b->name)));
        UNGCPRO;
        if (NILP (tem))
        return Qnil;
***************
*** 1535,1541 ****
    Lisp_Object function;
  
    if (STRINGP (XBUFFER (buffer)->name)
!       && strcmp (XSTRING (XBUFFER (buffer)->name)->data, "*scratch*") == 0)
      function = find_symbol_value (intern ("initial-major-mode"));
    else
      {
--- 1535,1541 ----
    Lisp_Object function;
  
    if (STRINGP (XBUFFER (buffer)->name)
!       && strcmp (SDATA (XBUFFER (buffer)->name), "*scratch*") == 0)
      function = find_symbol_value (intern ("initial-major-mode"));
    else
      {
***************
*** 2883,2906 ****
    ssl->used++;
  
    if (NILP (current_buffer->enable_multibyte_characters))
!     nbytes = XSTRING (str)->size;
    else if (! STRING_MULTIBYTE (str))
!     nbytes = count_size_as_multibyte (XSTRING (str)->data,
!                                     STRING_BYTES (XSTRING (str)));
    else
!     nbytes = STRING_BYTES (XSTRING (str));
  
    ssl->bytes += nbytes;
  
    if (STRINGP (str2))
      {
        if (NILP (current_buffer->enable_multibyte_characters))
!       nbytes = XSTRING (str2)->size;
        else if (! STRING_MULTIBYTE (str2))
!       nbytes = count_size_as_multibyte (XSTRING (str2)->data,
!                                         STRING_BYTES (XSTRING (str2)));
        else
!       nbytes = STRING_BYTES (XSTRING (str2));
  
        ssl->bytes += nbytes;
      }
--- 2883,2906 ----
    ssl->used++;
  
    if (NILP (current_buffer->enable_multibyte_characters))
!     nbytes = SCHARS (str);
    else if (! STRING_MULTIBYTE (str))
!     nbytes = count_size_as_multibyte (SDATA (str),
!                                     SBYTES (str));
    else
!     nbytes = SBYTES (str);
  
    ssl->bytes += nbytes;
  
    if (STRINGP (str2))
      {
        if (NILP (current_buffer->enable_multibyte_characters))
!       nbytes = SCHARS (str2);
        else if (! STRING_MULTIBYTE (str2))
!       nbytes = count_size_as_multibyte (SDATA (str2),
!                                         SBYTES (str2));
        else
!       nbytes = SBYTES (str2);
  
        ssl->bytes += nbytes;
      }
***************
*** 3012,3019 ****
        {
          int nbytes;
          tem = overlay_tails.buf[i].string;
!         nbytes = copy_text (XSTRING (tem)->data, p,
!                             STRING_BYTES (XSTRING (tem)),
                              STRING_MULTIBYTE (tem), multibyte);
          p += nbytes;
        }
--- 3012,3019 ----
        {
          int nbytes;
          tem = overlay_tails.buf[i].string;
!         nbytes = copy_text (SDATA (tem), p,
!                             SBYTES (tem),
                              STRING_MULTIBYTE (tem), multibyte);
          p += nbytes;
        }
***************
*** 3021,3035 ****
        {
          int nbytes;
          tem = overlay_heads.buf[i].string;
!         nbytes = copy_text (XSTRING (tem)->data, p,
!                             STRING_BYTES (XSTRING (tem)),
                              STRING_MULTIBYTE (tem), multibyte);
          p += nbytes;
          tem = overlay_heads.buf[i].string2;
          if (STRINGP (tem))
            {
!             nbytes = copy_text (XSTRING (tem)->data, p,
!                                 STRING_BYTES (XSTRING (tem)),
                                  STRING_MULTIBYTE (tem), multibyte);
              p += nbytes;
            }
--- 3021,3035 ----
        {
          int nbytes;
          tem = overlay_heads.buf[i].string;
!         nbytes = copy_text (SDATA (tem), p,
!                             SBYTES (tem),
                              STRING_MULTIBYTE (tem), multibyte);
          p += nbytes;
          tem = overlay_heads.buf[i].string2;
          if (STRINGP (tem))
            {
!             nbytes = copy_text (SDATA (tem), p,
!                                 SBYTES (tem),
                                  STRING_MULTIBYTE (tem), multibyte);
              p += nbytes;
            }
***************
*** 4282,4288 ****
  
    sym = PER_BUFFER_SYMBOL (offset);
    error ("Only %s should be stored in the buffer-local variable %s",
!        type_name, XSTRING (SYMBOL_NAME (sym))->data);
  }
  
  
--- 4282,4288 ----
  
    sym = PER_BUFFER_SYMBOL (offset);
    error ("Only %s should be stored in the buffer-local variable %s",
!        type_name, SDATA (SYMBOL_NAME (sym)));
  }
  
  
***************
*** 5066,5072 ****
         because of the ange-ftp completion handler.
         However, it is not necessary to turn / into /:/.
         So avoid doing that.  */
!       && strcmp ("/", XSTRING (current_buffer->directory)->data))
      current_buffer->directory
        = concat2 (build_string ("/:"), current_buffer->directory);
  
--- 5066,5072 ----
         because of the ange-ftp completion handler.
         However, it is not necessary to turn / into /:/.
         So avoid doing that.  */
!       && strcmp ("/", SDATA (current_buffer->directory)))
      current_buffer->directory
        = concat2 (build_string ("/:"), current_buffer->directory);
  



reply via email to

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