]> code.delx.au - gnu-emacs/commitdiff
Use BSET for write access to Lisp_Object members of struct buffer.
authorDmitry Antipov <dmantipov@yandex.ru>
Mon, 13 Aug 2012 03:39:07 +0000 (07:39 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Mon, 13 Aug 2012 03:39:07 +0000 (07:39 +0400)
* buffer.h (BSET): New macro.
* buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
* fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
* minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
* window.c, xdisp.c, xfns.c: Adjust users.

23 files changed:
src/ChangeLog
src/buffer.c
src/buffer.h
src/casetab.c
src/cmds.c
src/coding.c
src/data.c
src/editfns.c
src/fileio.c
src/frame.c
src/indent.c
src/insdel.c
src/intervals.c
src/keymap.c
src/minibuf.c
src/print.c
src/process.c
src/syntax.c
src/undo.c
src/w32fns.c
src/window.c
src/xdisp.c
src/xfns.c

index ce40a4c0baf1b6e56770bc927a4f97cdb7354fc2..606b3fe64a3ae6dd5302fbd982041f5583be7cbf 100644 (file)
@@ -1,3 +1,12 @@
+2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Use BSET for write access to Lisp_Object members of struct buffer.
+       * buffer.h (BSET): New macro.
+       * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
+       * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
+       * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
+       * window.c, xdisp.c, xfns.c: Adjust users.
+
 2012-08-11  BT Templeton  <bpt@hcoop.net>  (tiny change)
 
        * lread.c (syms_of_lread): Initialize Vlexical_binding.
index 6b68f34bb154ee1e9b86e442ac81c72264158476..ffc9daeb9a701588e6d2abc067edb1dcefcbf494 100644 (file)
@@ -370,7 +370,7 @@ even if it is dead.  The return value is never nil.  */)
 
   b->newline_cache = 0;
   b->width_run_cache = 0;
-  BVAR (b, width_table) = Qnil;
+  BSET (b, width_table, Qnil);
   b->prevent_redisplay_optimizations_p = 1;
 
   /* Put this on the chain of all buffers including killed ones.  */
@@ -379,20 +379,20 @@ even if it is dead.  The return value is never nil.  */)
 
   /* An ordinary buffer normally doesn't need markers
      to handle BEGV and ZV.  */
-  BVAR (b, pt_marker) = Qnil;
-  BVAR (b, begv_marker) = Qnil;
-  BVAR (b, zv_marker) = Qnil;
+  BSET (b, pt_marker, Qnil);
+  BSET (b, begv_marker, Qnil);
+  BSET (b, zv_marker, Qnil);
 
   name = Fcopy_sequence (buffer_or_name);
   string_set_intervals (name, NULL);
-  BVAR (b, name) = name;
+  BSET (b, name, name);
 
-  BVAR (b, undo_list) = (SREF (name, 0) != ' ') ? Qnil : Qt;
+  BSET (b, undo_list, (SREF (name, 0) != ' ') ? Qnil : Qt);
 
   reset_buffer (b);
   reset_buffer_local_variables (b, 1);
 
-  BVAR (b, mark) = Fmake_marker ();
+  BSET (b, mark, Fmake_marker ());
   BUF_MARKERS (b) = NULL;
 
   /* Put this in the alist of all live buffers.  */
@@ -481,7 +481,7 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to)
 
   /* Get (a copy of) the alist of Lisp-level local variables of FROM
      and install that in TO.  */
-  BVAR (to, local_var_alist) = buffer_lisp_local_variables (from, 1);
+  BSET (to, local_var_alist, buffer_lisp_local_variables (from, 1));
 }
 
 
@@ -584,7 +584,7 @@ CLONE nil means the indirect buffer's state is reset to default values.  */)
 
   b->newline_cache = 0;
   b->width_run_cache = 0;
-  BVAR (b, width_table) = Qnil;
+  BSET (b, width_table, Qnil);
 
   /* Put this on the chain of all buffers including killed ones.  */
   b->header.next.buffer = all_buffers;
@@ -592,7 +592,7 @@ CLONE nil means the indirect buffer's state is reset to default values.  */)
 
   name = Fcopy_sequence (name);
   string_set_intervals (name, NULL);
-  BVAR (b, name) = name;
+  BSET (b, name, name);
 
   reset_buffer (b);
   reset_buffer_local_variables (b, 1);
@@ -601,10 +601,10 @@ CLONE nil means the indirect buffer's state is reset to default values.  */)
   XSETBUFFER (buf, b);
   Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil));
 
-  BVAR (b, mark) = Fmake_marker ();
+  BSET (b, mark, Fmake_marker ());
 
   /* The multibyte status belongs to the base buffer.  */
-  BVAR (b, enable_multibyte_characters) = BVAR (b->base_buffer, enable_multibyte_characters);
+  BSET (b, enable_multibyte_characters, BVAR (b->base_buffer, enable_multibyte_characters));
 
   /* Make sure the base buffer has markers for its narrowing.  */
   if (NILP (BVAR (b->base_buffer, pt_marker)))
@@ -612,14 +612,14 @@ CLONE nil means the indirect buffer's state is reset to default values.  */)
       eassert (NILP (BVAR (b->base_buffer, begv_marker)));
       eassert (NILP (BVAR (b->base_buffer, zv_marker)));
 
-      BVAR (b->base_buffer, pt_marker)
-       = build_marker (b->base_buffer, b->base_buffer->pt, b->base_buffer->pt_byte);
+      BSET (b->base_buffer, pt_marker,
+           build_marker (b->base_buffer, b->base_buffer->pt, b->base_buffer->pt_byte));
 
-      BVAR (b->base_buffer, begv_marker)
-       = build_marker (b->base_buffer, b->base_buffer->begv, b->base_buffer->begv_byte);
+      BSET (b->base_buffer, begv_marker,
+           build_marker (b->base_buffer, b->base_buffer->begv, b->base_buffer->begv_byte));
 
-      BVAR (b->base_buffer, zv_marker)
-       = build_marker (b->base_buffer, b->base_buffer->zv, b->base_buffer->zv_byte);
+      BSET (b->base_buffer, zv_marker,
+           build_marker (b->base_buffer, b->base_buffer->zv, b->base_buffer->zv_byte));
 
       XMARKER (BVAR (b->base_buffer, zv_marker))->insertion_type = 1;
     }
@@ -627,9 +627,9 @@ CLONE nil means the indirect buffer's state is reset to default values.  */)
   if (NILP (clone))
     {
       /* Give the indirect buffer markers for its narrowing.  */
-      BVAR (b, pt_marker) = build_marker (b, b->pt, b->pt_byte);
-      BVAR (b, begv_marker) = build_marker (b, b->begv, b->begv_byte);
-      BVAR (b, zv_marker) = build_marker (b, b->zv, b->zv_byte);
+      BSET (b, pt_marker, build_marker (b, b->pt, b->pt_byte));
+      BSET (b, begv_marker, build_marker (b, b->begv, b->begv_byte));
+      BSET (b, zv_marker, build_marker (b, b->zv, b->zv_byte));
       XMARKER (BVAR (b, zv_marker))->insertion_type = 1;
     }
   else
@@ -637,11 +637,11 @@ CLONE nil means the indirect buffer's state is reset to default values.  */)
       struct buffer *old_b = current_buffer;
 
       clone_per_buffer_values (b->base_buffer, b);
-      BVAR (b, filename) = Qnil;
-      BVAR (b, file_truename) = Qnil;
-      BVAR (b, display_count) = make_number (0);
-      BVAR (b, backed_up) = Qnil;
-      BVAR (b, auto_save_file_name) = Qnil;
+      BSET (b, filename, Qnil);
+      BSET (b, file_truename, Qnil);
+      BSET (b, display_count, make_number (0));
+      BSET (b, backed_up, Qnil);
+      BSET (b, auto_save_file_name, Qnil);
       set_buffer_internal_1 (b);
       Fset (intern ("buffer-save-without-query"), Qnil);
       Fset (intern ("buffer-file-number"), Qnil);
@@ -704,9 +704,10 @@ delete_all_overlays (struct buffer *b)
 void
 reset_buffer (register struct buffer *b)
 {
-  BVAR (b, filename) = Qnil;
-  BVAR (b, file_truename) = Qnil;
-  BVAR (b, directory) = (current_buffer) ? BVAR (current_buffer, directory) : Qnil;
+  BSET (b, filename, Qnil);
+  BSET (b, file_truename, Qnil);
+  BSET (b, directory,
+       (current_buffer) ? BVAR (current_buffer, directory) : Qnil);
   b->modtime = make_emacs_time (0, UNKNOWN_MODTIME_NSECS);
   b->modtime_size = -1;
   XSETFASTINT (BVAR (b, save_length), 0);
@@ -714,24 +715,25 @@ reset_buffer (register struct buffer *b)
   /* It is more conservative to start out "changed" than "unchanged".  */
   b->clip_changed = 0;
   b->prevent_redisplay_optimizations_p = 1;
-  BVAR (b, backed_up) = Qnil;
+  BSET (b, backed_up, Qnil);
   BUF_AUTOSAVE_MODIFF (b) = 0;
   b->auto_save_failure_time = 0;
-  BVAR (b, auto_save_file_name) = Qnil;
-  BVAR (b, read_only) = Qnil;
+  BSET (b, auto_save_file_name, Qnil);
+  BSET (b, read_only, Qnil);
   buffer_set_overlays (b, NULL, OV_BEFORE);
   buffer_set_overlays (b, NULL, OV_AFTER);
   b->overlay_center = BEG;
-  BVAR (b, mark_active) = Qnil;
-  BVAR (b, point_before_scroll) = Qnil;
-  BVAR (b, file_format) = Qnil;
-  BVAR (b, auto_save_file_format) = Qt;
-  BVAR (b, last_selected_window) = Qnil;
-  XSETINT (BVAR (b, display_count), 0);
-  BVAR (b, display_time) = Qnil;
-  BVAR (b, enable_multibyte_characters) = BVAR (&buffer_defaults, enable_multibyte_characters);
-  BVAR (b, cursor_type) = BVAR (&buffer_defaults, cursor_type);
-  BVAR (b, extra_line_spacing) = BVAR (&buffer_defaults, extra_line_spacing);
+  BSET (b, mark_active, Qnil);
+  BSET (b, point_before_scroll, Qnil);
+  BSET (b, file_format, Qnil);
+  BSET (b, auto_save_file_format, Qt);
+  BSET (b, last_selected_window, Qnil);
+  BSET (b, display_count, make_number (0));
+  BSET (b, display_time, Qnil);
+  BSET (b, enable_multibyte_characters,
+       BVAR (&buffer_defaults, enable_multibyte_characters));
+  BSET (b, cursor_type, BVAR (&buffer_defaults, cursor_type));
+  BSET (b, extra_line_spacing, BVAR (&buffer_defaults, extra_line_spacing));
 
   b->display_error_modiff = 0;
 }
@@ -755,10 +757,10 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
      things that depend on the major mode.
      default-major-mode is handled at a higher level.
      We ignore it here.  */
-  BVAR (b, major_mode) = Qfundamental_mode;
-  BVAR (b, keymap) = Qnil;
-  BVAR (b, mode_name) = QSFundamental;
-  BVAR (b, minor_modes) = Qnil;
+  BSET (b, major_mode, Qfundamental_mode);
+  BSET (b, keymap, Qnil);
+  BSET (b, mode_name, QSFundamental);
+  BSET (b, minor_modes, Qnil);
 
   /* If the standard case table has been altered and invalidated,
      fix up its insides first.  */
@@ -767,15 +769,15 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
         && CHAR_TABLE_P (XCHAR_TABLE (Vascii_downcase_table)->extras[2])))
     Fset_standard_case_table (Vascii_downcase_table);
 
-  BVAR (b, downcase_table) = Vascii_downcase_table;
-  BVAR (b, upcase_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[0];
-  BVAR (b, case_canon_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[1];
-  BVAR (b, case_eqv_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[2];
-  BVAR (b, invisibility_spec) = Qt;
+  BSET (b, downcase_table, Vascii_downcase_table);
+  BSET (b, upcase_table, XCHAR_TABLE (Vascii_downcase_table)->extras[0]);
+  BSET (b, case_canon_table, XCHAR_TABLE (Vascii_downcase_table)->extras[1]);
+  BSET (b, case_eqv_table, XCHAR_TABLE (Vascii_downcase_table)->extras[2]);
+  BSET (b, invisibility_spec, Qt);
 
   /* Reset all (or most) per-buffer variables to their defaults.  */
   if (permanent_too)
-    BVAR (b, local_var_alist) = Qnil;
+    BSET (b, local_var_alist, Qnil);
   else
     {
       Lisp_Object tmp, prop, last = Qnil;
@@ -809,7 +811,7 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
          }
        /* Delete this local variable.  */
        else if (NILP (last))
-         BVAR (b, local_var_alist) = XCDR (tmp);
+         BSET (b, local_var_alist, XCDR (tmp));
        else
          XSETCDR (last, XCDR (tmp));
     }
@@ -1286,7 +1288,7 @@ This does not change the name of the visited file (if any).  */)
        error ("Buffer name `%s' is in use", SDATA (newname));
     }
 
-  BVAR (current_buffer, name) = newname;
+  BSET (current_buffer, name, newname);
 
   /* Catch redisplay's attention.  Unless we do this, the mode lines for
      any windows displaying current_buffer will stay unchanged.  */
@@ -1431,7 +1433,7 @@ No argument or nil as argument means do this for the current buffer.  */)
     }
 
   if (EQ (BVAR (XBUFFER (real_buffer), undo_list), Qt))
-    BVAR (XBUFFER (real_buffer), undo_list) = Qnil;
+    BSET (XBUFFER (real_buffer), undo_list, Qnil);
 
   return Qnil;
 }
@@ -1703,7 +1705,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
   swap_out_buffer_local_variables (b);
   reset_buffer_local_variables (b, 1);
 
-  BVAR (b, name) = Qnil;
+  BSET (b, name, Qnil);
 
   BLOCK_INPUT;
   if (b->base_buffer)
@@ -1727,9 +1729,9 @@ cleaning up all windows currently displaying the buffer to be killed. */)
       free_region_cache (b->width_run_cache);
       b->width_run_cache = 0;
     }
-  BVAR (b, width_table) = Qnil;
+  BSET (b, width_table, Qnil);
   UNBLOCK_INPUT;
-  BVAR (b, undo_list) = Qnil;
+  BSET (b, undo_list, Qnil);
 
   /* Run buffer-list-update-hook.  */
   if (!NILP (Vrun_hooks))
@@ -1910,7 +1912,7 @@ set_buffer_internal_1 (register struct buffer *b)
       /* Put the undo list back in the base buffer, so that it appears
         that an indirect buffer shares the undo list of its base.  */
       if (old_buf->base_buffer)
-       BVAR (old_buf->base_buffer, undo_list) = BVAR (old_buf, undo_list);
+       BSET (old_buf->base_buffer, undo_list, BVAR (old_buf, undo_list));
 
       /* If the old current buffer has markers to record PT, BEGV and ZV
         when it is not current, update them now.  */
@@ -1920,7 +1922,7 @@ set_buffer_internal_1 (register struct buffer *b)
   /* Get the undo list from the base buffer, so that it appears
      that an indirect buffer shares the undo list of its base.  */
   if (b->base_buffer)
-    BVAR (b, undo_list) = BVAR (b->base_buffer, undo_list);
+    BSET (b, undo_list, BVAR (b->base_buffer, undo_list));
 
   /* If the new current buffer has markers to record PT, BEGV and ZV
      when it is not current, fetch them now.  */
@@ -2118,8 +2120,8 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
 #define swapfield_(field, type) \
   do {                                                 \
     type tmp##field = BVAR (other_buffer, field);              \
-    BVAR (other_buffer, field) = BVAR (current_buffer, field); \
-    BVAR (current_buffer, field) = tmp##field;                 \
+    BSET (other_buffer, field, BVAR (current_buffer, field));  \
+    BSET (current_buffer, field, tmp##field);                  \
   } while (0)
 
   swapfield (own_text, struct buffer_text);
@@ -2159,8 +2161,8 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
   swapfield_ (pt_marker, Lisp_Object);
   swapfield_ (begv_marker, Lisp_Object);
   swapfield_ (zv_marker, Lisp_Object);
-  BVAR (current_buffer, point_before_scroll) = Qnil;
-  BVAR (other_buffer, point_before_scroll) = Qnil;
+  BSET (current_buffer, point_before_scroll, Qnil);
+  BSET (other_buffer, point_before_scroll, Qnil);
 
   current_buffer->text->modiff++;        other_buffer->text->modiff++;
   current_buffer->text->chars_modiff++;          other_buffer->text->chars_modiff++;
@@ -2249,7 +2251,7 @@ current buffer is cleared.  */)
 
   /* Don't record these buffer changes.  We will put a special undo entry
      instead.  */
-  BVAR (current_buffer, undo_list) = Qt;
+  BSET (current_buffer, undo_list, Qt);
 
   /* If the cached position is for this buffer, clear it out.  */
   clear_charpos_cache (current_buffer);
@@ -2271,7 +2273,7 @@ current buffer is cleared.  */)
         to calculate the old correspondences.  */
       set_intervals_multibyte (0);
 
-      BVAR (current_buffer, enable_multibyte_characters) = Qnil;
+      BSET (current_buffer, enable_multibyte_characters, Qnil);
 
       Z = Z_BYTE;
       BEGV = BEGV_BYTE;
@@ -2409,7 +2411,7 @@ current buffer is cleared.  */)
 
       /* Do this first, so that chars_in_text asks the right question.
         set_intervals_multibyte needs it too.  */
-      BVAR (current_buffer, enable_multibyte_characters) = Qt;
+      BSET (current_buffer, enable_multibyte_characters, Qt);
 
       GPT_BYTE = advance_to_char_boundary (GPT_BYTE);
       GPT = chars_in_text (BEG_ADDR, GPT_BYTE - BEG_BYTE) + BEG;
@@ -2467,10 +2469,11 @@ current buffer is cleared.  */)
   if (!EQ (old_undo, Qt))
     {
       /* Represent all the above changes by a special undo entry.  */
-      BVAR (current_buffer, undo_list) = Fcons (list3 (Qapply,
-                                               intern ("set-buffer-multibyte"),
-                                               NILP (flag) ? Qt : Qnil),
-                                        old_undo);
+      BSET (current_buffer, undo_list,
+           Fcons (list3 (Qapply,
+                         intern ("set-buffer-multibyte"),
+                         NILP (flag) ? Qt : Qnil),
+                  old_undo));
     }
 
   UNGCPRO;
@@ -4929,55 +4932,55 @@ init_buffer_once (void)
   /* Must do these before making the first buffer! */
 
   /* real setup is done in bindings.el */
-  BVAR (&buffer_defaults, mode_line_format) = build_pure_c_string ("%-");
-  BVAR (&buffer_defaults, header_line_format) = Qnil;
-  BVAR (&buffer_defaults, abbrev_mode) = Qnil;
-  BVAR (&buffer_defaults, overwrite_mode) = Qnil;
-  BVAR (&buffer_defaults, case_fold_search) = Qt;
-  BVAR (&buffer_defaults, auto_fill_function) = Qnil;
-  BVAR (&buffer_defaults, selective_display) = Qnil;
-  BVAR (&buffer_defaults, selective_display_ellipses) = Qt;
-  BVAR (&buffer_defaults, abbrev_table) = Qnil;
-  BVAR (&buffer_defaults, display_table) = Qnil;
-  BVAR (&buffer_defaults, undo_list) = Qnil;
-  BVAR (&buffer_defaults, mark_active) = Qnil;
-  BVAR (&buffer_defaults, file_format) = Qnil;
-  BVAR (&buffer_defaults, auto_save_file_format) = Qt;
+  BSET (&buffer_defaults, mode_line_format, build_pure_c_string ("%-"));
+  BSET (&buffer_defaults, header_line_format, Qnil);
+  BSET (&buffer_defaults, abbrev_mode, Qnil);
+  BSET (&buffer_defaults, overwrite_mode, Qnil);
+  BSET (&buffer_defaults, case_fold_search, Qt);
+  BSET (&buffer_defaults, auto_fill_function, Qnil);
+  BSET (&buffer_defaults, selective_display, Qnil);
+  BSET (&buffer_defaults, selective_display_ellipses, Qt);
+  BSET (&buffer_defaults, abbrev_table, Qnil);
+  BSET (&buffer_defaults, display_table, Qnil);
+  BSET (&buffer_defaults, undo_list, Qnil);
+  BSET (&buffer_defaults, mark_active, Qnil);
+  BSET (&buffer_defaults, file_format, Qnil);
+  BSET (&buffer_defaults, auto_save_file_format, Qt);
   buffer_defaults.overlays_before = NULL;
   buffer_defaults.overlays_after = NULL;
   buffer_defaults.overlay_center = BEG;
 
   XSETFASTINT (BVAR (&buffer_defaults, tab_width), 8);
-  BVAR (&buffer_defaults, truncate_lines) = Qnil;
-  BVAR (&buffer_defaults, word_wrap) = Qnil;
-  BVAR (&buffer_defaults, ctl_arrow) = Qt;
-  BVAR (&buffer_defaults, bidi_display_reordering) = Qt;
-  BVAR (&buffer_defaults, bidi_paragraph_direction) = Qnil;
-  BVAR (&buffer_defaults, cursor_type) = Qt;
-  BVAR (&buffer_defaults, extra_line_spacing) = Qnil;
-  BVAR (&buffer_defaults, cursor_in_non_selected_windows) = Qt;
-
-  BVAR (&buffer_defaults, enable_multibyte_characters) = Qt;
-  BVAR (&buffer_defaults, buffer_file_coding_system) = Qnil;
+  BSET (&buffer_defaults, truncate_lines, Qnil);
+  BSET (&buffer_defaults, word_wrap, Qnil);
+  BSET (&buffer_defaults, ctl_arrow, Qt);
+  BSET (&buffer_defaults, bidi_display_reordering, Qt);
+  BSET (&buffer_defaults, bidi_paragraph_direction, Qnil);
+  BSET (&buffer_defaults, cursor_type, Qt);
+  BSET (&buffer_defaults, extra_line_spacing, Qnil);
+  BSET (&buffer_defaults, cursor_in_non_selected_windows, Qt);
+
+  BSET (&buffer_defaults, enable_multibyte_characters, Qt);
+  BSET (&buffer_defaults, buffer_file_coding_system, Qnil);
   XSETFASTINT (BVAR (&buffer_defaults, fill_column), 70);
   XSETFASTINT (BVAR (&buffer_defaults, left_margin), 0);
-  BVAR (&buffer_defaults, cache_long_line_scans) = Qnil;
-  BVAR (&buffer_defaults, file_truename) = Qnil;
+  BSET (&buffer_defaults, cache_long_line_scans, Qnil);
+  BSET (&buffer_defaults, file_truename, Qnil);
   XSETFASTINT (BVAR (&buffer_defaults, display_count), 0);
   XSETFASTINT (BVAR (&buffer_defaults, left_margin_cols), 0);
   XSETFASTINT (BVAR (&buffer_defaults, right_margin_cols), 0);
-  BVAR (&buffer_defaults, left_fringe_width) = Qnil;
-  BVAR (&buffer_defaults, right_fringe_width) = Qnil;
-  BVAR (&buffer_defaults, fringes_outside_margins) = Qnil;
-  BVAR (&buffer_defaults, scroll_bar_width) = Qnil;
-  BVAR (&buffer_defaults, vertical_scroll_bar_type) = Qt;
-  BVAR (&buffer_defaults, indicate_empty_lines) = Qnil;
-  BVAR (&buffer_defaults, indicate_buffer_boundaries) = Qnil;
-  BVAR (&buffer_defaults, fringe_indicator_alist) = Qnil;
-  BVAR (&buffer_defaults, fringe_cursor_alist) = Qnil;
-  BVAR (&buffer_defaults, scroll_up_aggressively) = Qnil;
-  BVAR (&buffer_defaults, scroll_down_aggressively) = Qnil;
-  BVAR (&buffer_defaults, display_time) = Qnil;
+  BSET (&buffer_defaults, left_fringe_width, Qnil);
+  BSET (&buffer_defaults, right_fringe_width, Qnil);
+  BSET (&buffer_defaults, fringes_outside_margins, Qnil);
+  BSET (&buffer_defaults, scroll_bar_width, Qnil);
+  BSET (&buffer_defaults, vertical_scroll_bar_type, Qt);
+  BSET (&buffer_defaults, indicate_empty_lines, Qnil);
+  BSET (&buffer_defaults, indicate_buffer_boundaries, Qnil);
+  BSET (&buffer_defaults, fringe_indicator_alist, Qnil);
+  BSET (&buffer_defaults, fringe_cursor_alist, Qnil);
+  BSET (&buffer_defaults, scroll_up_aggressively, Qnil);
+  BSET (&buffer_defaults, scroll_down_aggressively, Qnil);
+  BSET (&buffer_defaults, display_time, Qnil);
 
   /* Assign the local-flags to the slots that have default values.
      The local flag is a bit that is used in the buffer
@@ -4989,24 +4992,24 @@ init_buffer_once (void)
 
   /* 0 means not a lisp var, -1 means always local, else mask */
   memset (&buffer_local_flags, 0, sizeof buffer_local_flags);
-  XSETINT (BVAR (&buffer_local_flags, filename), -1);
-  XSETINT (BVAR (&buffer_local_flags, directory), -1);
-  XSETINT (BVAR (&buffer_local_flags, backed_up), -1);
-  XSETINT (BVAR (&buffer_local_flags, save_length), -1);
-  XSETINT (BVAR (&buffer_local_flags, auto_save_file_name), -1);
-  XSETINT (BVAR (&buffer_local_flags, read_only), -1);
-  XSETINT (BVAR (&buffer_local_flags, major_mode), -1);
-  XSETINT (BVAR (&buffer_local_flags, mode_name), -1);
-  XSETINT (BVAR (&buffer_local_flags, undo_list), -1);
-  XSETINT (BVAR (&buffer_local_flags, mark_active), -1);
-  XSETINT (BVAR (&buffer_local_flags, point_before_scroll), -1);
-  XSETINT (BVAR (&buffer_local_flags, file_truename), -1);
-  XSETINT (BVAR (&buffer_local_flags, invisibility_spec), -1);
-  XSETINT (BVAR (&buffer_local_flags, file_format), -1);
-  XSETINT (BVAR (&buffer_local_flags, auto_save_file_format), -1);
-  XSETINT (BVAR (&buffer_local_flags, display_count), -1);
-  XSETINT (BVAR (&buffer_local_flags, display_time), -1);
-  XSETINT (BVAR (&buffer_local_flags, enable_multibyte_characters), -1);
+  BSET (&buffer_local_flags, filename, make_number (-1));
+  BSET (&buffer_local_flags, directory, make_number (-1));
+  BSET (&buffer_local_flags, backed_up, make_number (-1));
+  BSET (&buffer_local_flags, save_length, make_number (-1));
+  BSET (&buffer_local_flags, auto_save_file_name, make_number (-1));
+  BSET (&buffer_local_flags, read_only, make_number (-1));
+  BSET (&buffer_local_flags, major_mode, make_number (-1));
+  BSET (&buffer_local_flags, mode_name, make_number (-1));
+  BSET (&buffer_local_flags, undo_list, make_number (-1));
+  BSET (&buffer_local_flags, mark_active, make_number (-1));
+  BSET (&buffer_local_flags, point_before_scroll, make_number (-1));
+  BSET (&buffer_local_flags, file_truename, make_number (-1));
+  BSET (&buffer_local_flags, invisibility_spec, make_number (-1));
+  BSET (&buffer_local_flags, file_format, make_number (-1));
+  BSET (&buffer_local_flags, auto_save_file_format, make_number (-1));
+  BSET (&buffer_local_flags, display_count, make_number (-1));
+  BSET (&buffer_local_flags, display_time, make_number (-1));
+  BSET (&buffer_local_flags, enable_multibyte_characters, make_number (-1));
 
   idx = 1;
   XSETFASTINT (BVAR (&buffer_local_flags, mode_line_format), idx); ++idx;
@@ -5062,7 +5065,7 @@ init_buffer_once (void)
   QSFundamental = build_pure_c_string ("Fundamental");
 
   Qfundamental_mode = intern_c_string ("fundamental-mode");
-  BVAR (&buffer_defaults, major_mode) = Qfundamental_mode;
+  BSET (&buffer_defaults, major_mode, Qfundamental_mode);
 
   Qmode_class = intern_c_string ("mode-class");
 
@@ -5125,13 +5128,13 @@ init_buffer (void)
       len++;
     }
 
-  BVAR (current_buffer, directory) = make_unibyte_string (pwd, len);
+  BSET (current_buffer, directory, make_unibyte_string (pwd, len));
   if (! NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))
     /* At this moment, we still don't know how to decode the
        directory name.  So, we keep the bytes in multibyte form so
        that ENCODE_FILE correctly gets the original bytes.  */
-    BVAR (current_buffer, directory)
-      = string_to_multibyte (BVAR (current_buffer, directory));
+    BSET (current_buffer, directory,
+         string_to_multibyte (BVAR (current_buffer, directory)));
 
   /* Add /: to the front of the name
      if it would otherwise be treated as magic.  */
@@ -5142,11 +5145,11 @@ init_buffer (void)
         However, it is not necessary to turn / into /:/.
         So avoid doing that.  */
       && strcmp ("/", SSDATA (BVAR (current_buffer, directory))))
-    BVAR (current_buffer, directory)
-      = concat2 (build_string ("/:"), BVAR (current_buffer, directory));
+    BSET (current_buffer, directory,
+         concat2 (build_string ("/:"), BVAR (current_buffer, directory)));
 
   temp = get_minibuffer (0);
-  BVAR (XBUFFER (temp), directory) = BVAR (current_buffer, directory);
+  BSET (XBUFFER (temp), directory, BVAR (current_buffer, directory));
 
   free (pwd);
 }
index a52ca7193e484360d09eb5a0f65b661619ecbeff..286c20d9e9c74b1996108f742c77d47e168414c6 100644 (file)
@@ -477,6 +477,7 @@ struct buffer_text
 /* Most code should use this macro to access Lisp fields in struct buffer.  */
 
 #define BVAR(buf, field) ((buf)->INTERNAL_FIELD (field))
+#define BSET(buf, field, value) ((buf)->INTERNAL_FIELD (field) = (value))
 
 /* This is the structure that the buffer Lisp object points to.  */
 
index 86dbca4d026471e029106600de17029a4242794d..4b29c091ca917747dcad4ed3ea19ed85bc77589e 100644 (file)
@@ -158,10 +158,10 @@ set_case_table (Lisp_Object table, int standard)
     }
   else
     {
-      BVAR (current_buffer, downcase_table) = table;
-      BVAR (current_buffer, upcase_table) = up;
-      BVAR (current_buffer, case_canon_table) = canon;
-      BVAR (current_buffer, case_eqv_table) = eqv;
+      BSET (current_buffer, downcase_table, table);
+      BSET (current_buffer, upcase_table, up);
+      BSET (current_buffer, case_canon_table, canon);
+      BSET (current_buffer, case_eqv_table, eqv);
     }
 
   return table;
index c06a9edd1607f5a82b08d5aaaa789596afd4cda5..24778fae6e32e6653cff1884210cdb801a3faedf 100644 (file)
@@ -301,7 +301,7 @@ At the end, it runs `post-self-insert-hook'.  */)
         added be explicit calls to undo-boundary.  */
       && EQ (BVAR (current_buffer, undo_list), last_undo_boundary))
     /* Remove the undo_boundary that was just pushed.  */
-    BVAR (current_buffer, undo_list) = XCDR (BVAR (current_buffer, undo_list));
+    BSET (current_buffer, undo_list, XCDR (BVAR (current_buffer, undo_list)));
 
   /* Barf if the key that invoked this was not a character.  */
   if (!CHARACTERP (last_command_event))
index 5bed11b8241480bec0edbe356500ed0fe8546692..08633d8bcff03b1ad33194a55e019123ee5e0463 100644 (file)
@@ -7103,7 +7103,7 @@ decode_coding (struct coding_system *coding)
       if (GPT != PT)
        move_gap_both (PT, PT_BYTE);
       undo_list = BVAR (current_buffer, undo_list);
-      BVAR (current_buffer, undo_list) = Qt;
+      BSET (current_buffer, undo_list, Qt);
     }
 
   coding->consumed = coding->consumed_char = 0;
@@ -7200,7 +7200,7 @@ decode_coding (struct coding_system *coding)
     decode_eol (coding);
   if (BUFFERP (coding->dst_object))
     {
-      BVAR (current_buffer, undo_list) = undo_list;
+      BSET (current_buffer, undo_list, undo_list);
       record_insert (coding->dst_pos, coding->produced_char);
     }
   return coding->result;
@@ -7568,8 +7568,8 @@ make_conversion_work_buffer (int multibyte)
      doesn't compile new regexps.  */
   Fset (Fmake_local_variable (Qinhibit_modification_hooks), Qt);
   Ferase_buffer ();
-  BVAR (current_buffer, undo_list) = Qt;
-  BVAR (current_buffer, enable_multibyte_characters) = multibyte ? Qt : Qnil;
+  BSET (current_buffer, undo_list, Qt);
+  BSET (current_buffer, enable_multibyte_characters, multibyte ? Qt : Qnil);
   set_buffer_internal (current);
   return workbuf;
 }
index c4519fc5e02ce812a8e16443e18e522888190c69..3e278e8bac3aa1cd3aca7ad6f2f2bb1dc9cf6cb6 100644 (file)
@@ -1211,8 +1211,8 @@ set_internal (register Lisp_Object symbol, register Lisp_Object newval, register
                       bindings, not for frame-local bindings.  */
                    eassert (!blv->frame_local);
                    tem1 = Fcons (symbol, XCDR (blv->defcell));
-                   BVAR (XBUFFER (where), local_var_alist)
-                     = Fcons (tem1, BVAR (XBUFFER (where), local_var_alist));
+                   BSET (XBUFFER (where), local_var_alist,
+                         Fcons (tem1, BVAR (XBUFFER (where), local_var_alist)));
                  }
              }
 
@@ -1651,9 +1651,9 @@ Instead, use `add-hook' and specify t for the LOCAL argument.  */)
         default value.  */
       find_symbol_value (variable);
 
-      BVAR (current_buffer, local_var_alist)
-        = Fcons (Fcons (variable, XCDR (blv->defcell)),
-                BVAR (current_buffer, local_var_alist));
+      BSET (current_buffer, local_var_alist,
+           Fcons (Fcons (variable, XCDR (blv->defcell)),
+                  BVAR (current_buffer, local_var_alist)));
 
       /* Make sure symbol does not think it is set up for this buffer;
         force it to look once again for this buffer's value.  */
@@ -1721,8 +1721,8 @@ From now on the default value will apply in this buffer.  Return VARIABLE.  */)
   XSETSYMBOL (variable, sym);  /* Propagate variable indirection.  */
   tem = Fassq (variable, BVAR (current_buffer, local_var_alist));
   if (!NILP (tem))
-    BVAR (current_buffer, local_var_alist)
-      = Fdelq (tem, BVAR (current_buffer, local_var_alist));
+    BSET (current_buffer, local_var_alist,
+         Fdelq (tem, BVAR (current_buffer, local_var_alist)));
 
   /* If the symbol is set up with the current buffer's binding
      loaded, recompute its value.  We have to do it now, or else
index 246e51cb0d569172adc696f72cacf07ea36b3b62..60f61d0b4310f92689d88673cd4529d9c33b61ad 100644 (file)
@@ -882,7 +882,7 @@ save_excursion_restore (Lisp_Object info)
   info = XCDR (info);
   tem = XCAR (info);
   tem1 = BVAR (current_buffer, mark_active);
-  BVAR (current_buffer, mark_active) = tem;
+  BSET (current_buffer, mark_active, tem);
 
   /* If mark is active now, and either was not active
      or was at a different place, run the activate hook.  */
@@ -2816,13 +2816,13 @@ determines whether case is significant or ignored.  */)
 static Lisp_Object
 subst_char_in_region_unwind (Lisp_Object arg)
 {
-  return BVAR (current_buffer, undo_list) = arg;
+  return BSET (current_buffer, undo_list, arg);
 }
 
 static Lisp_Object
 subst_char_in_region_unwind_1 (Lisp_Object arg)
 {
-  return BVAR (current_buffer, filename) = arg;
+  return BSET (current_buffer, filename, arg);
 }
 
 DEFUN ("subst-char-in-region", Fsubst_char_in_region,
@@ -2896,11 +2896,11 @@ Both characters must have the same length of multi-byte form.  */)
     {
       record_unwind_protect (subst_char_in_region_unwind,
                             BVAR (current_buffer, undo_list));
-      BVAR (current_buffer, undo_list) = Qt;
+      BSET (current_buffer, undo_list, Qt);
       /* Don't do file-locking.  */
       record_unwind_protect (subst_char_in_region_unwind_1,
                             BVAR (current_buffer, filename));
-      BVAR (current_buffer, filename) = Qnil;
+      BSET (current_buffer, filename, Qnil);
     }
 
   if (pos_byte < GPT_BYTE)
@@ -2982,7 +2982,7 @@ Both characters must have the same length of multi-byte form.  */)
                INC_POS (pos_byte_next);
 
              if (! NILP (noundo))
-               BVAR (current_buffer, undo_list) = tem;
+               BSET (current_buffer, undo_list, tem);
 
              UNGCPRO;
            }
index 886f9b9b1030679750195e9635a5870a1545a0f8..4fdc902a9a243b5978dcac66f81c10b48364bfa0 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)
index 09049ddae7285275d0b265b5bf5b9d9dba98bc1d..768cec4c7e7a931cd8185ede1f6c70697cf6a36d 100644 (file)
@@ -1677,7 +1677,7 @@ make_frame_visible_1 (Lisp_Object window)
       w = XWINDOW (window);
 
       if (!NILP (w->buffer))
-       BVAR (XBUFFER (w->buffer), display_time) = Fcurrent_time ();
+       BSET (XBUFFER (w->buffer), display_time, Fcurrent_time ());
 
       if (!NILP (w->vchild))
        make_frame_visible_1 (w->vchild);
index 597f05da99098cdb77ccf4238bb9db026061f3d6..881e5d7ddafaed739d425dc3454880237447afd1 100644 (file)
@@ -141,7 +141,7 @@ recompute_width_table (struct buffer *buf, struct Lisp_Char_Table *disptab)
   struct Lisp_Vector *widthtab;
 
   if (!VECTORP (BVAR (buf, width_table)))
-    BVAR (buf, width_table) = Fmake_vector (make_number (256), make_number (0));
+    BSET (buf, width_table, Fmake_vector (make_number (256), make_number (0)));
   widthtab = XVECTOR (BVAR (buf, width_table));
   if (widthtab->header.size != 256)
     abort ();
@@ -166,7 +166,7 @@ width_run_cache_on_off (void)
         {
           free_region_cache (current_buffer->width_run_cache);
           current_buffer->width_run_cache = 0;
-          BVAR (current_buffer, width_table) = Qnil;
+          BSET (current_buffer, width_table, Qnil);
         }
     }
   else
index f058ffc2bda3fb9251110a3a50c93e68fc117dd0..14d2dab084dffb2cade2827fdcc7c2fe1deaf1a9 100644 (file)
@@ -1792,7 +1792,7 @@ modify_region (struct buffer *buffer, ptrdiff_t start, ptrdiff_t end,
   if (! preserve_chars_modiff)
     CHARS_MODIFF = MODIFF;
 
-  BVAR (buffer, point_before_scroll) = Qnil;
+  BSET (buffer, point_before_scroll, Qnil);
 
   if (buffer != old_buffer)
     set_buffer_internal (old_buffer);
index c3bcdb1ae62bde37791310a22c2909fc0e62cd1b..145882f6146499a0b1929ae6e1d3fd914520f93c 100644 (file)
@@ -1858,7 +1858,7 @@ set_point_both (ptrdiff_t charpos, ptrdiff_t bytepos)
   int have_overlays;
   ptrdiff_t original_position;
 
-  BVAR (current_buffer, point_before_scroll) = Qnil;
+  BSET (current_buffer, point_before_scroll, Qnil);
 
   if (charpos == PT)
     return;
index e337147ad417ec3c5648ddee8e9170e5826614c8..c550b37c1d6e4b07c256c69b5af4c7fe4f69862a 100644 (file)
@@ -1854,7 +1854,7 @@ If KEYMAP is nil, that means no local keymap.  */)
   if (!NILP (keymap))
     keymap = get_keymap (keymap, 1, 1);
 
-  BVAR (current_buffer, keymap) = keymap;
+  BSET (current_buffer, keymap, keymap);
 
   return Qnil;
 }
index 928bdadefc8e29724c6a0ddf98c85d7b32e61444..3a384bf57bbaa9be464d601c62991f1bf7ca98a0 100644 (file)
@@ -562,11 +562,11 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
 
   /* Defeat (setq-default truncate-lines t), since truncated lines do
      not work correctly in minibuffers.  (Bug#5715, etc)  */
-  BVAR (current_buffer, truncate_lines) = Qnil;
+  BSET (current_buffer, truncate_lines, Qnil);
 
   /* If appropriate, copy enable-multibyte-characters into the minibuffer.  */
   if (inherit_input_method)
-    BVAR (current_buffer, enable_multibyte_characters) = enable_multibyte;
+    BSET (current_buffer, enable_multibyte_characters, enable_multibyte);
 
   /* The current buffer's default directory is usually the right thing
      for our minibuffer here.  However, if you're typing a command at
@@ -577,7 +577,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
      you think of something better to do?  Find another buffer with a
      better directory, and use that one instead.  */
   if (STRINGP (ambient_dir))
-    BVAR (current_buffer, directory) = ambient_dir;
+    BSET (current_buffer, directory, ambient_dir);
   else
     {
       Lisp_Object buf_list;
@@ -591,7 +591,8 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
          other_buf = XCDR (XCAR (buf_list));
          if (STRINGP (BVAR (XBUFFER (other_buf), directory)))
            {
-             BVAR (current_buffer, directory) = BVAR (XBUFFER (other_buf), directory);
+             BSET (current_buffer, directory,
+                   BVAR (XBUFFER (other_buf), directory));
              break;
            }
        }
@@ -664,7 +665,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
     }
 
   clear_message (1, 1);
-  BVAR (current_buffer, keymap) = map;
+  BSET (current_buffer, keymap, map);
 
   /* Turn on an input method stored in INPUT_METHOD if any.  */
   if (STRINGP (input_method) && !NILP (Ffboundp (Qactivate_input_method)))
@@ -673,7 +674,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
   Frun_hooks (1, &Qminibuffer_setup_hook);
 
   /* Don't allow the user to undo past this point.  */
-  BVAR (current_buffer, undo_list) = Qnil;
+  BSET (current_buffer, undo_list, Qnil);
 
   recursive_edit_1 ();
 
index 718e6a963297296eb19865dccf55f226ed1064aa..0938dd6e9aea19540d12869d695f78f0de268324 100644 (file)
@@ -494,14 +494,14 @@ temp_output_buffer_setup (const char *bufname)
 
   Fkill_all_local_variables ();
   delete_all_overlays (current_buffer);
-  BVAR (current_buffer, directory) = BVAR (old, directory);
-  BVAR (current_buffer, read_only) = Qnil;
-  BVAR (current_buffer, filename) = Qnil;
-  BVAR (current_buffer, undo_list) = Qt;
+  BSET (current_buffer, directory, BVAR (old, directory));
+  BSET (current_buffer, read_only, Qnil);
+  BSET (current_buffer, filename, Qnil);
+  BSET (current_buffer, undo_list, Qt);
   eassert (buffer_get_overlays (NULL, OV_BEFORE) == NULL);
   eassert (buffer_get_overlays (NULL, OV_AFTER) == NULL);
-  BVAR (current_buffer, enable_multibyte_characters)
-    = BVAR (&buffer_defaults, enable_multibyte_characters);
+  BSET (current_buffer, enable_multibyte_characters,
+       BVAR (&buffer_defaults, enable_multibyte_characters));
   specbind (Qinhibit_read_only, Qt);
   specbind (Qinhibit_modification_hooks, Qt);
   Ferase_buffer ();
index 0be624af0d2e0b30b262e4a95a4786476bddb4fe..a43655e4da86272110f5163b6e2efe210117c8af 100644 (file)
@@ -5246,7 +5246,7 @@ read_process_output (Lisp_Object proc, register int channel)
       old_begv_byte = BEGV_BYTE;
       old_zv_byte = ZV_BYTE;
 
-      BVAR (current_buffer, read_only) = Qnil;
+      BSET (current_buffer, read_only, Qnil);
 
       /* Insert new output into buffer
         at the current end-of-output marker,
@@ -5337,7 +5337,7 @@ read_process_output (Lisp_Object proc, register int channel)
        Fnarrow_to_region (make_number (old_begv), make_number (old_zv));
 
 
-      BVAR (current_buffer, read_only) = old_read_only;
+      BSET (current_buffer, read_only, old_read_only);
       SET_PT_BOTH (opoint, opoint_byte);
     }
   /* Handling the process output should not deactivate the mark.  */
@@ -6671,13 +6671,13 @@ status_notify (struct Lisp_Process *deleting_process)
              before_byte = PT_BYTE;
 
              tem = BVAR (current_buffer, read_only);
-             BVAR (current_buffer, read_only) = Qnil;
+             BSET (current_buffer, read_only, Qnil);
              insert_string ("\nProcess ");
              { /* FIXME: temporary kludge */
                Lisp_Object tem2 = p->name; Finsert (1, &tem2); }
              insert_string (" ");
              Finsert (1, &msg);
-             BVAR (current_buffer, read_only) = tem;
+             BSET (current_buffer, read_only, tem);
              set_marker_both (p->mark, p->buffer, PT, PT_BYTE);
 
              if (opoint >= before)
index c031c2b07afdb752d7a836f779ead42fef239e83..08a63e033b2af27ae895fe7ce860de648260ce4c 100644 (file)
@@ -836,7 +836,7 @@ One argument, a syntax table.  */)
 {
   int idx;
   check_syntax_table (table);
-  BVAR (current_buffer, syntax_table) = table;
+  BSET (current_buffer, syntax_table, table);
   /* Indicate that this buffer now has a specified syntax table.  */
   idx = PER_BUFFER_VAR_IDX (syntax_table);
   SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1);
index c90e7b62405cf9ed145cbf304354598e151c8494..cfb67ba5bc8478406ad5960aafc790dbcd219c0c 100644 (file)
@@ -104,8 +104,9 @@ record_point (ptrdiff_t pt)
   if (at_boundary
       && current_buffer == last_boundary_buffer
       && last_boundary_position != pt)
-    BVAR (current_buffer, undo_list)
-      = Fcons (make_number (last_boundary_position), BVAR (current_buffer, undo_list));
+    BSET (current_buffer, undo_list,
+         Fcons (make_number (last_boundary_position),
+                BVAR (current_buffer, undo_list)));
 }
 
 /* Record an insertion that just happened or is about to happen,
@@ -141,8 +142,8 @@ record_insert (ptrdiff_t beg, ptrdiff_t length)
 
   XSETFASTINT (lbeg, beg);
   XSETINT (lend, beg + length);
-  BVAR (current_buffer, undo_list) = Fcons (Fcons (lbeg, lend),
-                                     BVAR (current_buffer, undo_list));
+  BSET (current_buffer, undo_list,
+       Fcons (Fcons (lbeg, lend), BVAR (current_buffer, undo_list)));
 }
 
 /* Record that a deletion is about to take place,
@@ -167,8 +168,8 @@ record_delete (ptrdiff_t beg, Lisp_Object string)
       record_point (beg);
     }
 
-  BVAR (current_buffer, undo_list)
-    = Fcons (Fcons (string, sbeg), BVAR (current_buffer, undo_list));
+  BSET (current_buffer, undo_list,
+       Fcons (Fcons (string, sbeg), BVAR (current_buffer, undo_list)));
 }
 
 /* Record the fact that MARKER is about to be adjusted by ADJUSTMENT.
@@ -190,9 +191,9 @@ record_marker_adjustment (Lisp_Object marker, ptrdiff_t adjustment)
     Fundo_boundary ();
   last_undo_buffer = current_buffer;
 
-  BVAR (current_buffer, undo_list)
-    = Fcons (Fcons (marker, make_number (adjustment)),
-            BVAR (current_buffer, undo_list));
+  BSET (current_buffer, undo_list,
+       Fcons (Fcons (marker, make_number (adjustment)),
+              BVAR (current_buffer, undo_list)));
 }
 
 /* Record that a replacement is about to take place,
@@ -225,9 +226,9 @@ record_first_change (void)
   if (base_buffer->base_buffer)
     base_buffer = base_buffer->base_buffer;
 
-  BVAR (current_buffer, undo_list) =
-    Fcons (Fcons (Qt, make_lisp_time (base_buffer->modtime)),
-          BVAR (current_buffer, undo_list));
+  BSET (current_buffer, undo_list,
+       Fcons (Fcons (Qt, make_lisp_time (base_buffer->modtime)),
+              BVAR (current_buffer, undo_list)));
 }
 
 /* Record a change in property PROP (whose old value was VAL)
@@ -265,7 +266,8 @@ record_property_change (ptrdiff_t beg, ptrdiff_t length,
   XSETINT (lbeg, beg);
   XSETINT (lend, beg + length);
   entry = Fcons (Qnil, Fcons (prop, Fcons (value, Fcons (lbeg, lend))));
-  BVAR (current_buffer, undo_list) = Fcons (entry, BVAR (current_buffer, undo_list));
+  BSET (current_buffer, undo_list,
+       Fcons (entry, BVAR (current_buffer, undo_list)));
 
   current_buffer = obuf;
 }
@@ -288,11 +290,11 @@ but another undo command will undo to the previous boundary.  */)
          /* If we have preallocated the cons cell to use here,
             use that one.  */
          XSETCDR (pending_boundary, BVAR (current_buffer, undo_list));
-         BVAR (current_buffer, undo_list) = pending_boundary;
+         BSET (current_buffer, undo_list, pending_boundary);
          pending_boundary = Qnil;
        }
       else
-       BVAR (current_buffer, undo_list) = Fcons (Qnil, BVAR (current_buffer, undo_list));
+       BSET (current_buffer, undo_list, Fcons (Qnil, BVAR (current_buffer, undo_list)));
     }
   last_boundary_position = PT;
   last_boundary_buffer = current_buffer;
@@ -433,7 +435,7 @@ truncate_undo_list (struct buffer *b)
     XSETCDR (last_boundary, Qnil);
   /* There's nothing we decided to keep, so clear it out.  */
   else
-    BVAR (b, undo_list) = Qnil;
+    BSET (b, undo_list, Qnil);
 
   unbind_to (count, Qnil);
 }
@@ -648,8 +650,8 @@ Return what remains of the list.  */)
      will work right.  */
   if (did_apply
       && EQ (oldlist, BVAR (current_buffer, undo_list)))
-    BVAR (current_buffer, undo_list)
-      = Fcons (list3 (Qapply, Qcdr, Qnil), BVAR (current_buffer, undo_list));
+    BSET (current_buffer, undo_list,
+         Fcons (list3 (Qapply, Qcdr, Qnil), BVAR (current_buffer, undo_list)));
 
   UNGCPRO;
   return unbind_to (count, list);
index 1464f867077553c217d0bd18670fdbb59c07ce27..ebe382f75d20a3ab3eaf036ce4e6f27fdb0537f9 100644 (file)
@@ -5240,7 +5240,7 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
   Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil);
   old_buffer = current_buffer;
   set_buffer_internal_1 (XBUFFER (buffer));
-  BVAR (current_buffer, truncate_lines) = Qnil;
+  BSET (current_buffer, truncate_lines, Qnil);
   specbind (Qinhibit_read_only, Qt);
   specbind (Qinhibit_modification_hooks, Qt);
   Ferase_buffer ();
@@ -5670,7 +5670,7 @@ Text larger than the specified size is clipped.  */)
   /* Display the tooltip text in a temporary buffer.  */
   old_buffer = current_buffer;
   set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer));
-  BVAR (current_buffer, truncate_lines) = Qnil;
+  BSET (current_buffer, truncate_lines, Qnil);
   clear_glyph_matrix (w->desired_matrix);
   clear_glyph_matrix (w->current_matrix);
   SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
index 1348eab0ff62c9983a1adf1b12bec2a9509eac9a..f5622b217d79a2f07460542c066afbc4516d949b 100644 (file)
@@ -373,7 +373,7 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
 
   Fset_buffer (w->buffer);
 
-  BVAR (XBUFFER (w->buffer), last_selected_window) = window;
+  BSET (XBUFFER (w->buffer), last_selected_window, window);
 
   /* Go to the point recorded in the window.
      This is important when the buffer is in more
@@ -1812,7 +1812,7 @@ unshow_buffer (register struct window *w)
 
   if (WINDOWP (BVAR (b, last_selected_window))
       && w == XWINDOW (BVAR (b, last_selected_window)))
-    BVAR (b, last_selected_window) = Qnil;
+    BSET (b, last_selected_window, Qnil);
 }
 
 /* Put NEW into the window structure in place of OLD.  SETFLAG zero
@@ -2990,15 +2990,15 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
   WSET (w, buffer, buffer);
 
   if (EQ (window, selected_window))
-    BVAR (b, last_selected_window) = window;
+    BSET (b, last_selected_window, window);
 
   /* Let redisplay errors through.  */
   b->display_error_modiff = 0;
 
   /* Update time stamps of buffer display.  */
   if (INTEGERP (BVAR (b, display_count)))
-    XSETINT (BVAR (b, display_count), XINT (BVAR (b, display_count)) + 1);
-  BVAR (b, display_time) = Fcurrent_time ();
+    BSET (b, display_count, make_number (XINT (BVAR (b, display_count)) + 1));
+  BSET (b, display_time, Fcurrent_time ());
 
   WSET (w, window_end_pos, make_number (0));
   WSET (w, window_end_vpos, make_number (0));
@@ -3189,7 +3189,7 @@ temp_output_buffer_show (register Lisp_Object buf)
   register Lisp_Object window;
   register struct window *w;
 
-  BVAR (XBUFFER (buf), directory) = BVAR (current_buffer, directory);
+  BSET (XBUFFER (buf), directory, BVAR (current_buffer, directory));
 
   Fset_buffer (buf);
   BUF_SAVE_MODIFF (XBUFFER (buf)) = MODIFF;
index 3f1c97e601f72c853b08403448a27dd73f20e672..5895684279637d287a8654baecefa240619d3f4c 100644 (file)
@@ -9318,7 +9318,7 @@ message_dolog (const char *m, ptrdiff_t nbytes, int nlflag, int multibyte)
       old_deactivate_mark = Vdeactivate_mark;
       oldbuf = current_buffer;
       Fset_buffer (Fget_buffer_create (Vmessages_buffer_name));
-      BVAR (current_buffer, undo_list) = Qt;
+      BSET (current_buffer, undo_list, Qt);
 
       oldpoint = message_dolog_marker1;
       set_marker_restricted (oldpoint, make_number (PT), Qnil);
@@ -9880,7 +9880,7 @@ ensure_echo_area_buffers (void)
        old_buffer = echo_buffer[i];
        echo_buffer[i] = Fget_buffer_create
          (make_formatted_string (name, " *Echo Area %d*", i));
-       BVAR (XBUFFER (echo_buffer[i]), truncate_lines) = Qnil;
+       BSET (XBUFFER (echo_buffer[i]), truncate_lines, Qnil);
        /* to force word wrap in echo area -
           it was decided to postpone this*/
        /* XBUFFER (echo_buffer[i])->word_wrap = Qt; */
@@ -9973,8 +9973,8 @@ with_echo_area_buffer (struct window *w, int which,
       set_marker_both (w->pointm, buffer, BEG, BEG_BYTE);
     }
 
-  BVAR (current_buffer, undo_list) = Qt;
-  BVAR (current_buffer, read_only) = Qnil;
+  BSET (current_buffer, undo_list, Qt);
+  BSET (current_buffer, read_only, Qnil);
   specbind (Qinhibit_read_only, Qt);
   specbind (Qinhibit_modification_hooks, Qt);
 
@@ -10087,7 +10087,7 @@ setup_echo_area_for_printing (int multibyte_p)
 
       /* Switch to that buffer and clear it.  */
       set_buffer_internal (XBUFFER (echo_area_buffer[0]));
-      BVAR (current_buffer, truncate_lines) = Qnil;
+      BSET (current_buffer, truncate_lines, Qnil);
 
       if (Z > BEG)
        {
@@ -10130,7 +10130,7 @@ setup_echo_area_for_printing (int multibyte_p)
        {
          /* Someone switched buffers between print requests.  */
          set_buffer_internal (XBUFFER (echo_area_buffer[0]));
-         BVAR (current_buffer, truncate_lines) = Qnil;
+         BSET (current_buffer, truncate_lines, Qnil);
        }
     }
 }
@@ -10582,9 +10582,9 @@ set_message_1 (ptrdiff_t a1, Lisp_Object a2, ptrdiff_t nbytes, ptrdiff_t multiby
       != !NILP (BVAR (current_buffer, enable_multibyte_characters)))
     Fset_buffer_multibyte (message_enable_multibyte ? Qt : Qnil);
 
-  BVAR (current_buffer, truncate_lines) = message_truncate_lines ? Qt : Qnil;
+  BSET (current_buffer, truncate_lines, message_truncate_lines ? Qt : Qnil);
   if (!NILP (BVAR (current_buffer, bidi_display_reordering)))
-    BVAR (current_buffer, bidi_paragraph_direction) = Qleft_to_right;
+    BSET (current_buffer, bidi_paragraph_direction, Qleft_to_right);
 
   /* Insert new message at BEG.  */
   TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
index 26c96e99c0f34b4d7cdefac831faafa4af7e17c2..9c9fcb16abad727c096988a11d9ddf4932114f5d 100644 (file)
@@ -4594,7 +4594,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
   Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil);
   old_buffer = current_buffer;
   set_buffer_internal_1 (XBUFFER (buffer));
-  BVAR (current_buffer, truncate_lines) = Qnil;
+  BSET (current_buffer, truncate_lines, Qnil);
   specbind (Qinhibit_read_only, Qt);
   specbind (Qinhibit_modification_hooks, Qt);
   Ferase_buffer ();
@@ -5091,7 +5091,7 @@ Text larger than the specified size is clipped.  */)
   /* Display the tooltip text in a temporary buffer.  */
   old_buffer = current_buffer;
   set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer));
-  BVAR (current_buffer, truncate_lines) = Qnil;
+  BSET (current_buffer, truncate_lines, Qnil);
   clear_glyph_matrix (w->desired_matrix);
   clear_glyph_matrix (w->current_matrix);
   SET_TEXT_POS (pos, BEGV, BEGV_BYTE);