Commit 4c31be61 authored by Dmitry Antipov's avatar Dmitry Antipov

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.
parent 1439443b
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.
......
This diff is collapsed.
......@@ -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. */
......
......@@ -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;
......
......@@ -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))
......
......@@ -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;
}
......
......@@ -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
......
......@@ -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;
}
......
......@@ -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)
......
......@@ -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);
......
......@@ -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
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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 ();
......
......@@ -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 ();
......
......@@ -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)
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
......@@ -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];