set_buffer_internal (XBUFFER (buffer));
adjust_markers_for_delete (BEG, BEG_BYTE, Z, Z_BYTE);
adjust_overlays_for_delete (BEG, Z - BEG);
- BUF_INTERVALS (current_buffer) = 0;
+ buffer_set_intervals (current_buffer, NULL);
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;
}
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;
- eassert (buf->overlays_before == NULL);
- eassert (buf->overlays_after == NULL);
+ 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);
/* If display currently starts at beginning of line,
keep it that way. */
- if (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) == current_buffer)
+ if (XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer)
XWINDOW (selected_window)->start_at_line_beg = !NILP (Fbolp ());
replace_handled = 1;
/* If display currently starts at beginning of line,
keep it that way. */
- if (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) == current_buffer)
+ if (XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer)
XWINDOW (selected_window)->start_at_line_beg = !NILP (Fbolp ());
/* Replace the chars that we need to replace,
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))
&& 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));
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;
/* 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))
{
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
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);
}
{
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;
{
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)
msg = Fformat (3, args);
GCPRO1 (msg);
nbytes = SBYTES (msg);
- SAFE_ALLOCA (msgbuf, char *, nbytes);
+ msgbuf = SAFE_ALLOCA (nbytes);
memcpy (msgbuf, SDATA (msg), nbytes);
for (i = 0; i < 3; ++i)