Use BSET for write access to Lisp_Object members of struct buffer.
[bpt/emacs.git] / src / fileio.c
index 886f9b9..4fdc902 100644 (file)
@@ -3149,8 +3149,8 @@ decide_coding_unwind (Lisp_Object unwind_data)
   TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
 
   /* Now we are safe to change the buffer's multibyteness directly.  */
-  BVAR (current_buffer, enable_multibyte_characters) = multibyte;
-  BVAR (current_buffer, undo_list) = undo_list;
+  BSET (current_buffer, enable_multibyte_characters, multibyte);
+  BSET (current_buffer, undo_list, undo_list);
 
   return Qnil;
 }
@@ -3486,16 +3486,16 @@ variable `last-coding-system-used' to the coding system actually used.  */)
                  buf = XBUFFER (workbuf);
 
                  delete_all_overlays (buf);
-                 BVAR (buf, directory) = BVAR (current_buffer, directory);
-                 BVAR (buf, read_only) = Qnil;
-                 BVAR (buf, filename) = Qnil;
-                 BVAR (buf, undo_list) = Qt;
+                 BSET (buf, directory, BVAR (current_buffer, directory));
+                 BSET (buf, read_only, Qnil);
+                 BSET (buf, filename, Qnil);
+                 BSET (buf, undo_list, Qt);
                  eassert (buffer_get_overlays (buf, OV_BEFORE) == NULL);
                  eassert (buffer_get_overlays (buf, OV_AFTER) == NULL);
 
                  set_buffer_internal (buf);
                  Ferase_buffer ();
-                 BVAR (buf, enable_multibyte_characters) = Qnil;
+                 BSET (buf, enable_multibyte_characters, Qnil);
 
                  insert_1_both ((char *) read_buf, nread, nread, 0, 0, 0);
                  TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
@@ -4104,8 +4104,8 @@ variable `last-coding-system-used' to the coding system actually used.  */)
          unwind_data = Fcons (BVAR (current_buffer, enable_multibyte_characters),
                               Fcons (BVAR (current_buffer, undo_list),
                                      Fcurrent_buffer ()));
-         BVAR (current_buffer, enable_multibyte_characters) = Qnil;
-         BVAR (current_buffer, undo_list) = Qt;
+         BSET (current_buffer, enable_multibyte_characters, Qnil);
+         BSET (current_buffer, undo_list, Qt);
          record_unwind_protect (decide_coding_unwind, unwind_data);
 
          if (inserted > 0 && ! NILP (Vset_auto_coding_function))
@@ -4153,7 +4153,7 @@ variable `last-coding-system-used' to the coding system actually used.  */)
          && NILP (replace))
        /* Visiting a file with these coding system makes the buffer
           unibyte. */
-       BVAR (current_buffer, enable_multibyte_characters) = Qnil;
+       BSET (current_buffer, enable_multibyte_characters, Qnil);
     }
 
   coding.dst_multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
@@ -4196,13 +4196,13 @@ variable `last-coding-system-used' to the coding system actually used.  */)
   if (!NILP (visit))
     {
       if (!EQ (BVAR (current_buffer, undo_list), Qt) && !nochange)
-       BVAR (current_buffer, undo_list) = Qnil;
+       BSET (current_buffer, undo_list, Qnil);
 
       if (NILP (handler))
        {
          current_buffer->modtime = mtime;
          current_buffer->modtime_size = st.st_size;
-         BVAR (current_buffer, filename) = orig_filename;
+         BSET (current_buffer, filename, orig_filename);
        }
 
       SAVE_MODIFF = MODIFF;
@@ -4247,7 +4247,7 @@ variable `last-coding-system-used' to the coding system actually used.  */)
 
       /* Save old undo list and don't record undo for decoding.  */
       old_undo = BVAR (current_buffer, undo_list);
-      BVAR (current_buffer, undo_list) = Qt;
+      BSET (current_buffer, undo_list, Qt);
 
       if (NILP (replace))
        {
@@ -4339,7 +4339,7 @@ variable `last-coding-system-used' to the coding system actually used.  */)
 
       if (NILP (visit))
        {
-         BVAR (current_buffer, undo_list) = old_undo;
+         BSET (current_buffer, undo_list, old_undo);
          if (CONSP (old_undo) && inserted != old_inserted)
            {
              /* Adjust the last undo record for the size change during
@@ -4354,7 +4354,7 @@ variable `last-coding-system-used' to the coding system actually used.  */)
       else
        /* If undo_list was Qt before, keep it that way.
           Otherwise start with an empty undo_list.  */
-       BVAR (current_buffer, undo_list) = EQ (old_undo, Qt) ? Qt : Qnil;
+       BSET (current_buffer, undo_list, EQ (old_undo, Qt) ? Qt : Qnil);
 
       unbind_to (count1, Qnil);
     }
@@ -4594,7 +4594,7 @@ This calls `write-region-annotate-functions' at the start, and
        {
          SAVE_MODIFF = MODIFF;
          XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG);
-         BVAR (current_buffer, filename) = visit_file;
+         BSET (current_buffer, filename, visit_file);
        }
       UNGCPRO;
       return val;
@@ -4810,7 +4810,7 @@ This calls `write-region-annotate-functions' at the start, and
     {
       SAVE_MODIFF = MODIFF;
       XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG);
-      BVAR (current_buffer, filename) = visit_file;
+      BSET (current_buffer, filename, visit_file);
       update_mode_lines++;
     }
   else if (quietly)