check_markers (void)
{
register struct Lisp_Marker *tail;
- int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters));
for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next)
{
unsigned char str[MAX_MULTIBYTE_LENGTH];
int len;
- if (! NILP (current_buffer->enable_multibyte_characters))
+ if (! NILP (B_ (current_buffer, enable_multibyte_characters)))
len = CHAR_STRING (c, str);
else
{
if (nchars == 0)
return;
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
nchars = nbytes;
if (prepare)
/* Make OUTGOING_NBYTES describe the text
as it will be inserted in this buffer. */
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
outgoing_nbytes = nchars;
else if (! STRING_MULTIBYTE (string))
outgoing_nbytes
between single-byte and multibyte. */
copy_text (SDATA (string) + pos_byte, GPT_ADDR, nbytes,
STRING_MULTIBYTE (string),
- ! NILP (current_buffer->enable_multibyte_characters));
+ ! NILP (B_ (current_buffer, enable_multibyte_characters)));
#ifdef BYTE_COMBINING_DEBUG
/* We have copied text into the gap, but we have not altered
void
insert_from_gap (EMACS_INT nchars, EMACS_INT nbytes)
{
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
nchars = nbytes;
record_insert (GPT, nchars);
/* Make OUTGOING_NBYTES describe the text
as it will be inserted in this buffer. */
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
outgoing_nbytes = nchars;
- else if (NILP (buf->enable_multibyte_characters))
+ else if (NILP (B_ (buf, enable_multibyte_characters)))
{
EMACS_INT outgoing_before_gap = 0;
EMACS_INT outgoing_after_gap = 0;
chunk_expanded
= copy_text (BUF_BYTE_ADDRESS (buf, from_byte),
GPT_ADDR, chunk,
- ! NILP (buf->enable_multibyte_characters),
- ! NILP (current_buffer->enable_multibyte_characters));
+ ! NILP (B_ (buf, enable_multibyte_characters)),
+ ! NILP (B_ (current_buffer, enable_multibyte_characters)));
}
else
chunk_expanded = chunk = 0;
if (chunk < incoming_nbytes)
copy_text (BUF_BYTE_ADDRESS (buf, from_byte + chunk),
GPT_ADDR + chunk_expanded, incoming_nbytes - chunk,
- ! NILP (buf->enable_multibyte_characters),
- ! NILP (current_buffer->enable_multibyte_characters));
+ ! NILP (B_ (buf, enable_multibyte_characters)),
+ ! NILP (B_ (current_buffer, enable_multibyte_characters)));
#ifdef BYTE_COMBINING_DEBUG
/* We have copied text into the gap, but we have not altered
adjust_markers_for_insert (from, from_byte,
from + len, from_byte + len_byte, 0);
- if (! EQ (current_buffer->undo_list, Qt))
+ if (! EQ (B_ (current_buffer, undo_list), Qt))
{
if (nchars_del > 0)
record_delete (from, prev_text);
/* Make OUTGOING_INSBYTES describe the text
as it will be inserted in this buffer. */
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
outgoing_insbytes = inschars;
else if (! STRING_MULTIBYTE (new))
outgoing_insbytes
/* Even if we don't record for undo, we must keep the original text
because we may have to recover it because of inappropriate byte
combining. */
- if (! EQ (current_buffer->undo_list, Qt))
+ if (! EQ (B_ (current_buffer, undo_list), Qt))
deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1);
GAP_SIZE += nbytes_del;
between single-byte and multibyte. */
copy_text (SDATA (new), GPT_ADDR, insbytes,
STRING_MULTIBYTE (new),
- ! NILP (current_buffer->enable_multibyte_characters));
+ ! NILP (B_ (current_buffer, enable_multibyte_characters)));
#ifdef BYTE_COMBINING_DEBUG
/* We have copied text into the gap, but we have not marked
abort ();
#endif
- if (! EQ (current_buffer->undo_list, Qt))
+ if (! EQ (B_ (current_buffer, undo_list), Qt))
{
/* Record the insertion first, so that when we undo,
the deletion will be undone first. Thus, undo
abort ();
#endif
- if (ret_string || ! EQ (current_buffer->undo_list, Qt))
+ if (ret_string || ! EQ (B_ (current_buffer, undo_list), Qt))
deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1);
else
deletion = Qnil;
so that undo handles this after reinserting the text. */
adjust_markers_for_delete (from, from_byte, to, to_byte);
- if (! EQ (current_buffer->undo_list, Qt))
+ if (! EQ (B_ (current_buffer, undo_list), Qt))
record_delete (from, deletion);
MODIFF++;
CHARS_MODIFF = MODIFF;
if (! preserve_chars_modiff)
CHARS_MODIFF = MODIFF;
- buffer->point_before_scroll = Qnil;
+ B_ (buffer, point_before_scroll) = Qnil;
if (buffer != old_buffer)
set_buffer_internal (old_buffer);
{
struct buffer *base_buffer;
- if (!NILP (current_buffer->read_only))
+ if (!NILP (B_ (current_buffer, read_only)))
Fbarf_if_buffer_read_only ();
/* Let redisplay consider other windows than selected_window
base_buffer = current_buffer;
#ifdef CLASH_DETECTION
- if (!NILP (base_buffer->file_truename)
+ if (!NILP (B_ (base_buffer, file_truename))
/* Make binding buffer-file-name to nil effective. */
- && !NILP (base_buffer->filename)
+ && !NILP (B_ (base_buffer, filename))
&& SAVE_MODIFF >= MODIFF)
- lock_file (base_buffer->file_truename);
+ lock_file (B_ (base_buffer, file_truename));
#else
/* At least warn if this file has changed on disk since it was visited. */
if (!NILP (base_buffer->filename)
#endif /* not CLASH_DETECTION */
/* If `select-active-regions' is non-nil, save the region text. */
- if (!NILP (current_buffer->mark_active)
+ if (!NILP (B_ (current_buffer, mark_active))
&& !inhibit_modification_hooks
- && XMARKER (current_buffer->mark)->buffer
+ && XMARKER (B_ (current_buffer, mark))->buffer
&& NILP (Vsaved_region_selection)
&& (EQ (Vselect_active_regions, Qonly)
? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
: (!NILP (Vselect_active_regions)
&& !NILP (Vtransient_mark_mode))))
{
- EMACS_INT b = XMARKER (current_buffer->mark)->charpos;
+ EMACS_INT b = XMARKER (B_ (current_buffer, mark))->charpos;
EMACS_INT e = PT;
if (b < e)
Vsaved_region_selection = make_buffer_string (b, e, 0);
non-nil, and insertion calls a file handler (e.g. through
lock_file) which scribbles into a temp file -- cyd */
if (!BUFFERP (combine_after_change_buffer)
- || NILP (XBUFFER (combine_after_change_buffer)->name))
+ || NILP (B_ (XBUFFER (combine_after_change_buffer), name)))
{
combine_after_change_list = Qnil;
return Qnil;