+2011-02-14 Tom Tromey <tromey@parfait>
+
+ * composite.c (fill_gstring_header)
+ (composition_compute_stop_pos, composition_adjust_point)
+ (Ffind_composition_internal): Use B_.
+ * intervals.c (set_point_both, get_local_map): Use B_.
+ * callproc.c (Fcall_process, Fcall_process_region): Use B_.
+ * process.c (get_process, list_processes_1, Fstart_process)
+ (Fmake_serial_process, Fmake_network_process)
+ (read_process_output, send_process, exec_sentinel)
+ (status_notify, setup_process_coding_systems): Use B_.
+ * bytecode.c (Fbyte_code): Use B_.
+ * syntax.c (update_syntax_table, dec_bytepos, Fsyntax_table)
+ (Fset_syntax_table, Fmodify_syntax_entry, skip_chars)
+ (skip_syntaxes, scan_lists): Use B_.
+ * lread.c (readchar, unreadchar, openp, readevalloop)
+ (Feval_buffer, Feval_region): Use B_.
+ * print.c (printchar, strout, print_string, PRINTDECLARE)
+ (PRINTPREPARE, PRINTFINISH, temp_output_buffer_setup)
+ (print_object): Use B_.
+ * font.c (font_at): Use B_.
+ * fns.c (Fbase64_encode_region, Fbase64_decode_region, Fmd5): Use
+ B_.
+ * callint.c (check_mark, Fcall_interactively): Use B_.
+ * editfns.c (region_limit, Fmark_marker, save_excursion_save)
+ (save_excursion_restore, Fprevious_char, Fchar_before)
+ (general_insert_function, Finsert_char, Finsert_byte)
+ (make_buffer_string_both, Finsert_buffer_substring)
+ (Fcompare_buffer_substrings, subst_char_in_region_unwind)
+ (subst_char_in_region_unwind_1, Fsubst_char_in_region)
+ (Ftranslate_region_internal, save_restriction_restore)
+ (Fchar_equal): Use B_.
+ * data.c (swap_in_symval_forwarding, set_internal)
+ (Fmake_local_variable, Fkill_local_variable, Flocal_variable_p):
+ Use B_.
+ * undo.c (record_point, record_insert, record_delete)
+ (record_marker_adjustment, record_first_change)
+ (record_property_change, Fundo_boundary, truncate_undo_list)
+ (Fprimitive_undo): Use B_.
+ * search.c (compile_pattern_1, compile_pattern, looking_at_1)
+ (string_match_1, fast_looking_at, newline_cache_on_off)
+ (search_command, search_buffer, simple_search, boyer_moore)
+ (Freplace_match): Use B_.
+ * indent.c (buffer_display_table, recompute_width_table)
+ (width_run_cache_on_off, current_column, scan_for_column)
+ (Findent_to, position_indentation, compute_motion, vmotion): Use
+ B_.
+ * casefiddle.c (casify_object, casify_region): Use B_.
+ * casetab.c (Fcurrent_case_table, set_case_table): Use B_.
+ * cmds.c (Fself_insert_command, internal_self_insert): Use B_.
+ * fileio.c (Fexpand_file_name, Ffile_directory_p)
+ (Ffile_regular_p, Ffile_selinux_context)
+ (Fset_file_selinux_context, Ffile_modes, Fset_file_modes)
+ (Fset_file_times, Ffile_newer_than_file_p, decide_coding_unwind)
+ (Finsert_file_contents, choose_write_coding_system)
+ (Fwrite_region, build_annotations, Fverify_visited_file_modtime)
+ (Fset_visited_file_modtime, auto_save_error, auto_save_1)
+ (Fdo_auto_save, Fset_buffer_auto_saved): Use B_.
+ * minibuf.c (read_minibuf, get_minibuffer, Fread_buffer): Use B_.
+ * marker.c (Fmarker_buffer, Fset_marker, set_marker_restricted)
+ (set_marker_both, set_marker_restricted_both, unchain_marker): Use
+ B_.
+ * insdel.c (check_markers, insert_char, insert_1_both)
+ (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
+ (adjust_after_replace, replace_range, del_range_2)
+ (modify_region, prepare_to_modify_buffer)
+ (Fcombine_after_change_execute): Use B_.
+ * filelock.c (unlock_all_files, Flock_buffer, Funlock_buffer)
+ (unlock_buffer): Use B_.
+ * keymap.c (Flocal_key_binding, Fuse_local_map)
+ (Fcurrent_local_map, push_key_description)
+ (Fdescribe_buffer_bindings): Use B_.
+ * keyboard.c (command_loop_1, read_char_minibuf_menu_prompt)
+ (read_key_sequence): Use B_.
+ * fringe.c (get_logical_cursor_bitmap)
+ (get_logical_fringe_bitmap, update_window_fringes): Use B_.
+ * xfns.c (x_create_tip_frame, Fx_show_tip): Use B_.
+ * xfaces.c (compute_char_face): Use B_.
+ * character.c (chars_in_text, Fget_byte): Use B_.
+ * category.c (check_category_table, Fcategory_table)
+ (Fset_category_table, char_category_set): Use B_.
+ * coding.c (decode_coding, encode_coding)
+ (make_conversion_work_buffer, decode_coding_gap)
+ (decode_coding_object, encode_coding_object)
+ (Fdetect_coding_region, Ffind_coding_systems_region_internal)
+ (Funencodable_char_position, Fcheck_coding_systems_region): Use
+ B_.
+ * charset.c (Ffind_charset_region): Use B_.
+ * window.c (window_display_table, unshow_buffer, window_loop)
+ (window_min_size_2, set_window_buffer, Fset_window_buffer)
+ (select_window, Fforce_window_update, temp_output_buffer_show)
+ (Fset_window_configuration, save_window_save): Use B_.
+ * xdisp.c (pos_visible_p, init_iterator, reseat_1)
+ (message_dolog, update_echo_area, ensure_echo_area_buffers)
+ (with_echo_area_buffer, setup_echo_area_for_printing)
+ (set_message_1, update_menu_bar, update_tool_bar)
+ (text_outside_line_unchanged_p, redisplay_internal)
+ (try_scrolling, try_cursor_movement, redisplay_window)
+ (try_window_reusing_current_matrix, row_containing_pos)
+ (try_window_id, get_overlay_arrow_glyph_row, display_line)
+ (Fcurrent_bidi_paragraph_direction, display_mode_lines)
+ (decode_mode_spec_coding, decode_mode_spec, display_count_lines)
+ (get_window_cursor_type, note_mouse_highlight): Use B_.
+ * frame.c (make_frame_visible_1): Use B_.
+ * dispnew.c (Fframe_or_buffer_changed_p): Use B_.
+ * dispextern.h (WINDOW_WANTS_HEADER_LINE_P)
+ (WINDOW_WANTS_MODELINE_P): Use B_.
+ * syntax.h (Vstandard_syntax_table): Update.
+ (CURRENT_SYNTAX_TABLE, SETUP_BUFFER_SYNTAX_TABLE): Use B_.
+ * intervals.h (TEXT_PROP_MEANS_INVISIBLE): Update.
+ (TEXT_PROP_MEANS_INVISIBLE): Use B_.
+ * character.h (FETCH_CHAR_ADVANCE): Update.
+ (INC_BOTH, ASCII_CHAR_WIDTH, DEC_BOTH): Use B_.
+ * category.h (Vstandard_category_table): Update.
+ * lisp.h (DEFVAR_BUFFER_DEFAULTS): Update for change to field
+ names.
+ (DOWNCASE_TABLE, UPCASE_TABLE): Use B_.
+ * buffer.c (swapfield_): New macro.
+ (Fbuffer_swap_text): Use swapfield_ where appropriate.
+ (Fbuffer_live_p, Fget_file_buffer, get_truename_buffer)
+ (Fget_buffer_create, clone_per_buffer_values)
+ (Fmake_indirect_buffer, reset_buffer)
+ (reset_buffer_local_variables, Fbuffer_name, Fbuffer_file_name)
+ (Fbuffer_local_value, buffer_lisp_local_variables)
+ (Fset_buffer_modified_p, Frestore_buffer_modified_p)
+ (Frename_buffer, Fother_buffer, Fbuffer_enable_undo)
+ (Fkill_buffer, Fset_buffer_major_mode, set_buffer_internal_1)
+ (set_buffer_temp, Fset_buffer, set_buffer_if_live)
+ (Fbarf_if_buffer_read_only, Fbury_buffer, Ferase_buffer)
+ (Fbuffer_swap_text, Fset_buffer_multibyte)
+ (swap_out_buffer_local_variables, record_overlay_string)
+ (overlay_strings, init_buffer_once, init_buffer, syms_of_buffer):
+ Use B_.
+ * buffer.h (struct buffer): Rename all Lisp_Object fields.
+ (BUFFER_INTERNAL_FIELD, B_): New macro.
+ (FETCH_CHAR, FETCH_CHAR_AS_MULTIBYTE): Use B_.
+
2011-02-14 Jan Djärv <jan.h.d@swipnet.se>
* gtkutil.c (xg_tool_bar_menu_proxy): Handle case when tool bar label
must not have been killed. */
return (m->type == MEM_TYPE_BUFFER
&& p == m->start
- && !NILP (((struct buffer *) p)->name));
+ && !NILP (((struct buffer *) p)->BUFFER_INTERNAL_FIELD (name)));
}
#endif /* GC_MARK_STACK || defined GC_MALLOC_CHECK */
turned off in that buffer. Calling truncate_undo_list on
Qt tends to return NULL, which effectively turns undo back on.
So don't call truncate_undo_list if undo_list is Qt. */
- if (! NILP (nextb->name) && ! EQ (nextb->undo_list, Qt))
+ if (! NILP (nextb->BUFFER_INTERNAL_FIELD (name)) && ! EQ (nextb->BUFFER_INTERNAL_FIELD (undo_list), Qt))
truncate_undo_list (nextb);
/* Shrink buffer gaps, but skip indirect and dead buffers. */
- if (nextb->base_buffer == 0 && !NILP (nextb->name)
+ if (nextb->base_buffer == 0 && !NILP (nextb->BUFFER_INTERNAL_FIELD (name))
&& ! nextb->text->inhibit_shrinking)
{
/* If a buffer's gap size is more than 10% of the buffer
turned off in that buffer. Calling truncate_undo_list on
Qt tends to return NULL, which effectively turns undo back on.
So don't call truncate_undo_list if undo_list is Qt. */
- if (! EQ (nextb->undo_list, Qt))
+ if (! EQ (nextb->BUFFER_INTERNAL_FIELD (undo_list), Qt))
{
Lisp_Object tail, prev;
- tail = nextb->undo_list;
+ tail = nextb->BUFFER_INTERNAL_FIELD (undo_list);
prev = Qnil;
while (CONSP (tail))
{
&& !XMARKER (XCAR (XCAR (tail)))->gcmarkbit)
{
if (NILP (prev))
- nextb->undo_list = tail = XCDR (tail);
+ nextb->BUFFER_INTERNAL_FIELD (undo_list) = tail = XCDR (tail);
else
{
tail = XCDR (tail);
}
/* Now that we have stripped the elements that need not be in the
undo_list any more, we can finally mark the list. */
- mark_object (nextb->undo_list);
+ mark_object (nextb->BUFFER_INTERNAL_FIELD (undo_list));
nextb = nextb->next;
}
/* buffer-local Lisp variables start at `undo_list',
tho only the ones from `name' on are GC'd normally. */
- for (ptr = &buffer->name;
+ for (ptr = &buffer->BUFFER_INTERNAL_FIELD (name);
(char *)ptr < (char *)buffer + sizeof (struct buffer);
ptr++)
mark_object (*ptr);
Value is nil if OBJECT is not a buffer or if it has been killed. */)
(Lisp_Object object)
{
- return ((BUFFERP (object) && ! NILP (XBUFFER (object)->name))
+ return ((BUFFERP (object) && ! NILP (B_ (XBUFFER (object), name)))
? Qt : Qnil);
}
{
buf = Fcdr (XCAR (tail));
if (!BUFFERP (buf)) continue;
- if (!STRINGP (XBUFFER (buf)->filename)) continue;
- tem = Fstring_equal (XBUFFER (buf)->filename, filename);
+ if (!STRINGP (B_ (XBUFFER (buf), filename))) continue;
+ tem = Fstring_equal (B_ (XBUFFER (buf), filename), filename);
if (!NILP (tem))
return buf;
}
{
buf = Fcdr (XCAR (tail));
if (!BUFFERP (buf)) continue;
- if (!STRINGP (XBUFFER (buf)->file_truename)) continue;
- tem = Fstring_equal (XBUFFER (buf)->file_truename, filename);
+ if (!STRINGP (B_ (XBUFFER (buf), file_truename))) continue;
+ tem = Fstring_equal (B_ (XBUFFER (buf), file_truename), filename);
if (!NILP (tem))
return buf;
}
b->newline_cache = 0;
b->width_run_cache = 0;
- b->width_table = Qnil;
+ B_ (b, width_table) = Qnil;
b->prevent_redisplay_optimizations_p = 1;
/* Put this on the chain of all buffers including killed ones. */
/* An ordinary buffer normally doesn't need markers
to handle BEGV and ZV. */
- b->pt_marker = Qnil;
- b->begv_marker = Qnil;
- b->zv_marker = Qnil;
+ B_ (b, pt_marker) = Qnil;
+ B_ (b, begv_marker) = Qnil;
+ B_ (b, zv_marker) = Qnil;
name = Fcopy_sequence (buffer_or_name);
STRING_SET_INTERVALS (name, NULL_INTERVAL);
- b->name = name;
+ B_ (b, name) = name;
- b->undo_list = (SREF (name, 0) != ' ') ? Qnil : Qt;
+ B_ (b, undo_list) = (SREF (name, 0) != ' ') ? Qnil : Qt;
reset_buffer (b);
reset_buffer_local_variables (b, 1);
- b->mark = Fmake_marker ();
+ B_ (b, mark) = Fmake_marker ();
BUF_MARKERS (b) = NULL;
- b->name = name;
+ B_ (b, name) = name;
/* Put this in the alist of all live buffers. */
XSETBUFFER (buffer, b);
/* Get (a copy of) the alist of Lisp-level local variables of FROM
and install that in TO. */
- to->local_var_alist = buffer_lisp_local_variables (from);
+ B_ (to, local_var_alist) = buffer_lisp_local_variables (from);
}
DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer,
base_buffer = Fget_buffer (base_buffer);
if (NILP (base_buffer))
error ("No such buffer: `%s'", SDATA (tem));
- if (NILP (XBUFFER (base_buffer)->name))
+ if (NILP (B_ (XBUFFER (base_buffer), name)))
error ("Base buffer has been killed");
if (SCHARS (name) == 0)
b->newline_cache = 0;
b->width_run_cache = 0;
- b->width_table = Qnil;
+ B_ (b, width_table) = Qnil;
/* Put this on the chain of all buffers including killed ones. */
b->next = all_buffers;
name = Fcopy_sequence (name);
STRING_SET_INTERVALS (name, NULL_INTERVAL);
- b->name = name;
+ B_ (b, name) = name;
reset_buffer (b);
reset_buffer_local_variables (b, 1);
XSETBUFFER (buf, b);
Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil));
- b->mark = Fmake_marker ();
- b->name = name;
+ B_ (b, mark) = Fmake_marker ();
+ B_ (b, name) = name;
/* The multibyte status belongs to the base buffer. */
- b->enable_multibyte_characters = b->base_buffer->enable_multibyte_characters;
+ B_ (b, enable_multibyte_characters) = B_ (b->base_buffer, enable_multibyte_characters);
/* Make sure the base buffer has markers for its narrowing. */
- if (NILP (b->base_buffer->pt_marker))
+ if (NILP (B_ (b->base_buffer, pt_marker)))
{
- b->base_buffer->pt_marker = Fmake_marker ();
- set_marker_both (b->base_buffer->pt_marker, base_buffer,
+ B_ (b->base_buffer, pt_marker) = Fmake_marker ();
+ set_marker_both (B_ (b->base_buffer, pt_marker), base_buffer,
BUF_PT (b->base_buffer),
BUF_PT_BYTE (b->base_buffer));
}
- if (NILP (b->base_buffer->begv_marker))
+ if (NILP (B_ (b->base_buffer, begv_marker)))
{
- b->base_buffer->begv_marker = Fmake_marker ();
- set_marker_both (b->base_buffer->begv_marker, base_buffer,
+ B_ (b->base_buffer, begv_marker) = Fmake_marker ();
+ set_marker_both (B_ (b->base_buffer, begv_marker), base_buffer,
BUF_BEGV (b->base_buffer),
BUF_BEGV_BYTE (b->base_buffer));
}
- if (NILP (b->base_buffer->zv_marker))
+ if (NILP (B_ (b->base_buffer, zv_marker)))
{
- b->base_buffer->zv_marker = Fmake_marker ();
- set_marker_both (b->base_buffer->zv_marker, base_buffer,
+ B_ (b->base_buffer, zv_marker) = Fmake_marker ();
+ set_marker_both (B_ (b->base_buffer, zv_marker), base_buffer,
BUF_ZV (b->base_buffer),
BUF_ZV_BYTE (b->base_buffer));
- XMARKER (b->base_buffer->zv_marker)->insertion_type = 1;
+ XMARKER (B_ (b->base_buffer, zv_marker))->insertion_type = 1;
}
if (NILP (clone))
{
/* Give the indirect buffer markers for its narrowing. */
- b->pt_marker = Fmake_marker ();
- set_marker_both (b->pt_marker, buf, BUF_PT (b), BUF_PT_BYTE (b));
- b->begv_marker = Fmake_marker ();
- set_marker_both (b->begv_marker, buf, BUF_BEGV (b), BUF_BEGV_BYTE (b));
- b->zv_marker = Fmake_marker ();
- set_marker_both (b->zv_marker, buf, BUF_ZV (b), BUF_ZV_BYTE (b));
- XMARKER (b->zv_marker)->insertion_type = 1;
+ B_ (b, pt_marker) = Fmake_marker ();
+ set_marker_both (B_ (b, pt_marker), buf, BUF_PT (b), BUF_PT_BYTE (b));
+ B_ (b, begv_marker) = Fmake_marker ();
+ set_marker_both (B_ (b, begv_marker), buf, BUF_BEGV (b), BUF_BEGV_BYTE (b));
+ B_ (b, zv_marker) = Fmake_marker ();
+ set_marker_both (B_ (b, zv_marker), buf, BUF_ZV (b), BUF_ZV_BYTE (b));
+ XMARKER (B_ (b, zv_marker))->insertion_type = 1;
}
else
{
struct buffer *old_b = current_buffer;
clone_per_buffer_values (b->base_buffer, b);
- b->filename = Qnil;
- b->file_truename = Qnil;
- b->display_count = make_number (0);
- b->backed_up = Qnil;
- b->auto_save_file_name = Qnil;
+ B_ (b, filename) = Qnil;
+ B_ (b, file_truename) = Qnil;
+ B_ (b, display_count) = make_number (0);
+ B_ (b, backed_up) = Qnil;
+ B_ (b, auto_save_file_name) = Qnil;
set_buffer_internal_1 (b);
Fset (intern ("buffer-save-without-query"), Qnil);
Fset (intern ("buffer-file-number"), Qnil);
void
reset_buffer (register struct buffer *b)
{
- b->filename = Qnil;
- b->file_truename = Qnil;
- b->directory = (current_buffer) ? current_buffer->directory : Qnil;
+ B_ (b, filename) = Qnil;
+ B_ (b, file_truename) = Qnil;
+ B_ (b, directory) = (current_buffer) ? B_ (current_buffer, directory) : Qnil;
b->modtime = 0;
b->modtime_size = -1;
- XSETFASTINT (b->save_length, 0);
+ XSETFASTINT (B_ (b, save_length), 0);
b->last_window_start = 1;
/* It is more conservative to start out "changed" than "unchanged". */
b->clip_changed = 0;
b->prevent_redisplay_optimizations_p = 1;
- b->backed_up = Qnil;
+ B_ (b, backed_up) = Qnil;
BUF_AUTOSAVE_MODIFF (b) = 0;
b->auto_save_failure_time = -1;
- b->auto_save_file_name = Qnil;
- b->read_only = Qnil;
+ B_ (b, auto_save_file_name) = Qnil;
+ B_ (b, read_only) = Qnil;
b->overlays_before = NULL;
b->overlays_after = NULL;
b->overlay_center = BEG;
- b->mark_active = Qnil;
- b->point_before_scroll = Qnil;
- b->file_format = Qnil;
- b->auto_save_file_format = Qt;
- b->last_selected_window = Qnil;
- XSETINT (b->display_count, 0);
- b->display_time = Qnil;
- b->enable_multibyte_characters = buffer_defaults.enable_multibyte_characters;
- b->cursor_type = buffer_defaults.cursor_type;
- b->extra_line_spacing = buffer_defaults.extra_line_spacing;
+ B_ (b, mark_active) = Qnil;
+ B_ (b, point_before_scroll) = Qnil;
+ B_ (b, file_format) = Qnil;
+ B_ (b, auto_save_file_format) = Qt;
+ B_ (b, last_selected_window) = Qnil;
+ XSETINT (B_ (b, display_count), 0);
+ B_ (b, display_time) = Qnil;
+ B_ (b, enable_multibyte_characters) = B_ (&buffer_defaults, enable_multibyte_characters);
+ B_ (b, cursor_type) = B_ (&buffer_defaults, cursor_type);
+ B_ (b, extra_line_spacing) = B_ (&buffer_defaults, extra_line_spacing);
b->display_error_modiff = 0;
}
things that depend on the major mode.
default-major-mode is handled at a higher level.
We ignore it here. */
- b->major_mode = Qfundamental_mode;
- b->keymap = Qnil;
- b->mode_name = QSFundamental;
- b->minor_modes = Qnil;
+ B_ (b, major_mode) = Qfundamental_mode;
+ B_ (b, keymap) = Qnil;
+ B_ (b, mode_name) = QSFundamental;
+ B_ (b, minor_modes) = Qnil;
/* If the standard case table has been altered and invalidated,
fix up its insides first. */
&& CHAR_TABLE_P (XCHAR_TABLE (Vascii_downcase_table)->extras[2])))
Fset_standard_case_table (Vascii_downcase_table);
- b->downcase_table = Vascii_downcase_table;
- b->upcase_table = XCHAR_TABLE (Vascii_downcase_table)->extras[0];
- b->case_canon_table = XCHAR_TABLE (Vascii_downcase_table)->extras[1];
- b->case_eqv_table = XCHAR_TABLE (Vascii_downcase_table)->extras[2];
- b->invisibility_spec = Qt;
+ B_ (b, downcase_table) = Vascii_downcase_table;
+ B_ (b, upcase_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[0];
+ B_ (b, case_canon_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[1];
+ B_ (b, case_eqv_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[2];
+ B_ (b, invisibility_spec) = Qt;
#ifndef DOS_NT
- b->buffer_file_type = Qnil;
+ B_ (b, buffer_file_type) = Qnil;
#endif
/* Reset all (or most) per-buffer variables to their defaults. */
if (permanent_too)
- b->local_var_alist = Qnil;
+ B_ (b, local_var_alist) = Qnil;
else
{
Lisp_Object tmp, prop, last = Qnil;
- for (tmp = b->local_var_alist; CONSP (tmp); tmp = XCDR (tmp))
+ for (tmp = B_ (b, local_var_alist); CONSP (tmp); tmp = XCDR (tmp))
if (!NILP (prop = Fget (XCAR (XCAR (tmp)), Qpermanent_local)))
{
/* If permanent-local, keep it. */
}
/* Delete this local variable. */
else if (NILP (last))
- b->local_var_alist = XCDR (tmp);
+ B_ (b, local_var_alist) = XCDR (tmp);
else
XSETCDR (last, XCDR (tmp));
}
(register Lisp_Object buffer)
{
if (NILP (buffer))
- return current_buffer->name;
+ return B_ (current_buffer, name);
CHECK_BUFFER (buffer);
- return XBUFFER (buffer)->name;
+ return B_ (XBUFFER (buffer), name);
}
DEFUN ("buffer-file-name", Fbuffer_file_name, Sbuffer_file_name, 0, 1, 0,
(register Lisp_Object buffer)
{
if (NILP (buffer))
- return current_buffer->filename;
+ return B_ (current_buffer, filename);
CHECK_BUFFER (buffer);
- return XBUFFER (buffer)->filename;
+ return B_ (XBUFFER (buffer), filename);
}
DEFUN ("buffer-base-buffer", Fbuffer_base_buffer, Sbuffer_base_buffer,
{ /* Look in local_var_alist. */
struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
XSETSYMBOL (variable, sym); /* Update In case of aliasing. */
- result = Fassoc (variable, buf->local_var_alist);
+ result = Fassoc (variable, B_ (buf, local_var_alist));
if (!NILP (result))
{
if (blv->fwd)
{
Lisp_Object result = Qnil;
register Lisp_Object tail;
- for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
+ for (tail = B_ (buf, local_var_alist); CONSP (tail); tail = XCDR (tail))
{
Lisp_Object val, elt;
/* If buffer becoming modified, lock the file.
If buffer becoming unmodified, unlock the file. */
- fn = current_buffer->file_truename;
+ fn = B_ (current_buffer, file_truename);
/* Test buffer-file-name so that binding it to nil is effective. */
- if (!NILP (fn) && ! NILP (current_buffer->filename))
+ if (!NILP (fn) && ! NILP (B_ (current_buffer, filename)))
{
already = SAVE_MODIFF < MODIFF;
if (!already && !NILP (flag))
/* If buffer becoming modified, lock the file.
If buffer becoming unmodified, unlock the file. */
- fn = current_buffer->file_truename;
+ fn = B_ (current_buffer, file_truename);
/* Test buffer-file-name so that binding it to nil is effective. */
- if (!NILP (fn) && ! NILP (current_buffer->filename))
+ if (!NILP (fn) && ! NILP (B_ (current_buffer, filename)))
{
int already = SAVE_MODIFF < MODIFF;
if (!already && !NILP (flag))
with the original name. It makes UNIQUE equivalent to
(rename-buffer (generate-new-buffer-name NEWNAME)). */
if (NILP (unique) && XBUFFER (tem) == current_buffer)
- return current_buffer->name;
+ return B_ (current_buffer, name);
if (!NILP (unique))
- newname = Fgenerate_new_buffer_name (newname, current_buffer->name);
+ newname = Fgenerate_new_buffer_name (newname, B_ (current_buffer, name));
else
error ("Buffer name `%s' is in use", SDATA (newname));
}
- current_buffer->name = newname;
+ B_ (current_buffer, name) = newname;
/* Catch redisplay's attention. Unless we do this, the mode lines for
any windows displaying current_buffer will stay unchanged. */
XSETBUFFER (buf, current_buffer);
Fsetcar (Frassq (buf, Vbuffer_alist), newname);
- if (NILP (current_buffer->filename)
- && !NILP (current_buffer->auto_save_file_name))
+ if (NILP (B_ (current_buffer, filename))
+ && !NILP (B_ (current_buffer, auto_save_file_name)))
call0 (intern ("rename-auto-save-file"));
/* Refetch since that last call may have done GC. */
- return current_buffer->name;
+ return B_ (current_buffer, name);
}
DEFUN ("other-buffer", Fother_buffer, Sother_buffer, 0, 3, 0,
continue;
if (NILP (buf))
continue;
- if (NILP (XBUFFER (buf)->name))
+ if (NILP (B_ (XBUFFER (buf), name)))
continue;
- if (SREF (XBUFFER (buf)->name, 0) == ' ')
+ if (SREF (B_ (XBUFFER (buf), name), 0) == ' ')
continue;
/* If the selected frame has a buffer_predicate,
disregard buffers that don't fit the predicate. */
nsberror (buffer);
}
- if (EQ (XBUFFER (real_buffer)->undo_list, Qt))
- XBUFFER (real_buffer)->undo_list = Qnil;
+ if (EQ (B_ (XBUFFER (real_buffer), undo_list), Qt))
+ B_ (XBUFFER (real_buffer), undo_list) = Qnil;
return Qnil;
}
b = XBUFFER (buffer);
/* Avoid trouble for buffer already dead. */
- if (NILP (b->name))
+ if (NILP (B_ (b, name)))
return Qnil;
/* Query if the buffer is still modified. */
- if (INTERACTIVE && !NILP (b->filename)
+ if (INTERACTIVE && !NILP (B_ (b, filename))
&& BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
{
GCPRO1 (buffer);
tem = do_yes_or_no_p (format2 ("Buffer %s modified; kill anyway? ",
- b->name, make_number (0)));
+ B_ (b, name), make_number (0)));
UNGCPRO;
if (NILP (tem))
return Qnil;
if (EQ (buffer, XWINDOW (minibuf_window)->buffer))
return Qnil;
- if (NILP (b->name))
+ if (NILP (B_ (b, name)))
return Qnil;
/* When we kill a base buffer, kill all its indirect buffers.
for (other = all_buffers; other; other = other->next)
/* all_buffers contains dead buffers too;
don't re-kill them. */
- if (other->base_buffer == b && !NILP (other->name))
+ if (other->base_buffer == b && !NILP (B_ (other, name)))
{
Lisp_Object buffer;
XSETBUFFER (buffer, other);
/* Killing buffer processes may run sentinels which may
have called kill-buffer. */
- if (NILP (b->name))
+ if (NILP (B_ (b, name)))
return Qnil;
clear_charpos_cache (b);
/* Delete any auto-save file, if we saved it in this session.
But not if the buffer is modified. */
- if (STRINGP (b->auto_save_file_name)
+ if (STRINGP (B_ (b, auto_save_file_name))
&& BUF_AUTOSAVE_MODIFF (b) != 0
&& BUF_SAVE_MODIFF (b) < BUF_AUTOSAVE_MODIFF (b)
&& BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)
Lisp_Object tem;
tem = Fsymbol_value (intern ("delete-auto-save-files"));
if (! NILP (tem))
- internal_delete_file (b->auto_save_file_name);
+ internal_delete_file (B_ (b, auto_save_file_name));
}
if (b->base_buffer)
swap_out_buffer_local_variables (b);
reset_buffer_local_variables (b, 1);
- b->name = Qnil;
+ B_ (b, name) = Qnil;
BLOCK_INPUT;
if (! b->base_buffer)
free_region_cache (b->width_run_cache);
b->width_run_cache = 0;
}
- b->width_table = Qnil;
+ B_ (b, width_table) = Qnil;
UNBLOCK_INPUT;
- b->undo_list = Qnil;
+ B_ (b, undo_list) = Qnil;
return Qt;
}
CHECK_BUFFER (buffer);
- if (STRINGP (XBUFFER (buffer)->name)
- && strcmp (SSDATA (XBUFFER (buffer)->name), "*scratch*") == 0)
+ if (STRINGP (B_ (XBUFFER (buffer), name))
+ && strcmp (SSDATA (B_ (XBUFFER (buffer), name)), "*scratch*") == 0)
function = find_symbol_value (intern ("initial-major-mode"));
else
{
- function = buffer_defaults.major_mode;
+ function = B_ (&buffer_defaults, major_mode);
if (NILP (function)
- && NILP (Fget (current_buffer->major_mode, Qmode_class)))
- function = current_buffer->major_mode;
+ && NILP (Fget (B_ (current_buffer, major_mode), Qmode_class)))
+ function = B_ (current_buffer, major_mode);
}
if (NILP (function) || EQ (function, Qfundamental_mode))
/* 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)
- old_buf->base_buffer->undo_list = old_buf->undo_list;
+ B_ (old_buf->base_buffer, undo_list) = B_ (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. */
- if (! NILP (old_buf->pt_marker))
+ if (! NILP (B_ (old_buf, pt_marker)))
{
Lisp_Object obuf;
XSETBUFFER (obuf, old_buf);
- set_marker_both (old_buf->pt_marker, obuf,
+ set_marker_both (B_ (old_buf, pt_marker), obuf,
BUF_PT (old_buf), BUF_PT_BYTE (old_buf));
}
- if (! NILP (old_buf->begv_marker))
+ if (! NILP (B_ (old_buf, begv_marker)))
{
Lisp_Object obuf;
XSETBUFFER (obuf, old_buf);
- set_marker_both (old_buf->begv_marker, obuf,
+ set_marker_both (B_ (old_buf, begv_marker), obuf,
BUF_BEGV (old_buf), BUF_BEGV_BYTE (old_buf));
}
- if (! NILP (old_buf->zv_marker))
+ if (! NILP (B_ (old_buf, zv_marker)))
{
Lisp_Object obuf;
XSETBUFFER (obuf, old_buf);
- set_marker_both (old_buf->zv_marker, obuf,
+ set_marker_both (B_ (old_buf, zv_marker), obuf,
BUF_ZV (old_buf), BUF_ZV_BYTE (old_buf));
}
}
/* 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)
- b->undo_list = b->base_buffer->undo_list;
+ B_ (b, undo_list) = B_ (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. */
- if (! NILP (b->pt_marker))
+ if (! NILP (B_ (b, pt_marker)))
{
- BUF_PT (b) = marker_position (b->pt_marker);
- BUF_PT_BYTE (b) = marker_byte_position (b->pt_marker);
+ BUF_PT (b) = marker_position (B_ (b, pt_marker));
+ BUF_PT_BYTE (b) = marker_byte_position (B_ (b, pt_marker));
}
- if (! NILP (b->begv_marker))
+ if (! NILP (B_ (b, begv_marker)))
{
- BUF_BEGV (b) = marker_position (b->begv_marker);
- BUF_BEGV_BYTE (b) = marker_byte_position (b->begv_marker);
+ BUF_BEGV (b) = marker_position (B_ (b, begv_marker));
+ BUF_BEGV_BYTE (b) = marker_byte_position (B_ (b, begv_marker));
}
- if (! NILP (b->zv_marker))
+ if (! NILP (B_ (b, zv_marker)))
{
- BUF_ZV (b) = marker_position (b->zv_marker);
- BUF_ZV_BYTE (b) = marker_byte_position (b->zv_marker);
+ BUF_ZV (b) = marker_position (B_ (b, zv_marker));
+ BUF_ZV_BYTE (b) = marker_byte_position (B_ (b, zv_marker));
}
/* Look down buffer's list of local Lisp variables
do
{
- for (tail = b->local_var_alist; CONSP (tail); tail = XCDR (tail))
+ for (tail = B_ (b, local_var_alist); CONSP (tail); tail = XCDR (tail))
{
Lisp_Object var = XCAR (XCAR (tail));
struct Lisp_Symbol *sym = XSYMBOL (var);
{
/* If the old current buffer has markers to record PT, BEGV and ZV
when it is not current, update them now. */
- if (! NILP (old_buf->pt_marker))
+ if (! NILP (B_ (old_buf, pt_marker)))
{
Lisp_Object obuf;
XSETBUFFER (obuf, old_buf);
- set_marker_both (old_buf->pt_marker, obuf,
+ set_marker_both (B_ (old_buf, pt_marker), obuf,
BUF_PT (old_buf), BUF_PT_BYTE (old_buf));
}
- if (! NILP (old_buf->begv_marker))
+ if (! NILP (B_ (old_buf, begv_marker)))
{
Lisp_Object obuf;
XSETBUFFER (obuf, old_buf);
- set_marker_both (old_buf->begv_marker, obuf,
+ set_marker_both (B_ (old_buf, begv_marker), obuf,
BUF_BEGV (old_buf), BUF_BEGV_BYTE (old_buf));
}
- if (! NILP (old_buf->zv_marker))
+ if (! NILP (B_ (old_buf, zv_marker)))
{
Lisp_Object obuf;
XSETBUFFER (obuf, old_buf);
- set_marker_both (old_buf->zv_marker, obuf,
+ set_marker_both (B_ (old_buf, zv_marker), obuf,
BUF_ZV (old_buf), BUF_ZV_BYTE (old_buf));
}
}
/* If the new current buffer has markers to record PT, BEGV and ZV
when it is not current, fetch them now. */
- if (! NILP (b->pt_marker))
+ if (! NILP (B_ (b, pt_marker)))
{
- BUF_PT (b) = marker_position (b->pt_marker);
- BUF_PT_BYTE (b) = marker_byte_position (b->pt_marker);
+ BUF_PT (b) = marker_position (B_ (b, pt_marker));
+ BUF_PT_BYTE (b) = marker_byte_position (B_ (b, pt_marker));
}
- if (! NILP (b->begv_marker))
+ if (! NILP (B_ (b, begv_marker)))
{
- BUF_BEGV (b) = marker_position (b->begv_marker);
- BUF_BEGV_BYTE (b) = marker_byte_position (b->begv_marker);
+ BUF_BEGV (b) = marker_position (B_ (b, begv_marker));
+ BUF_BEGV_BYTE (b) = marker_byte_position (B_ (b, begv_marker));
}
- if (! NILP (b->zv_marker))
+ if (! NILP (B_ (b, zv_marker)))
{
- BUF_ZV (b) = marker_position (b->zv_marker);
- BUF_ZV_BYTE (b) = marker_byte_position (b->zv_marker);
+ BUF_ZV (b) = marker_position (B_ (b, zv_marker));
+ BUF_ZV_BYTE (b) = marker_byte_position (B_ (b, zv_marker));
}
}
buffer = Fget_buffer (buffer_or_name);
if (NILP (buffer))
nsberror (buffer_or_name);
- if (NILP (XBUFFER (buffer)->name))
+ if (NILP (B_ (XBUFFER (buffer), name)))
error ("Selecting deleted buffer");
set_buffer_internal (XBUFFER (buffer));
return buffer;
Lisp_Object
set_buffer_if_live (Lisp_Object buffer)
{
- if (! NILP (XBUFFER (buffer)->name))
+ if (! NILP (B_ (XBUFFER (buffer), name)))
Fset_buffer (buffer);
return Qnil;
}
doc: /* Signal a `buffer-read-only' error if the current buffer is read-only. */)
(void)
{
- if (!NILP (current_buffer->read_only)
+ if (!NILP (B_ (current_buffer, read_only))
&& NILP (Vinhibit_read_only))
xsignal1 (Qbuffer_read_only, Fcurrent_buffer ());
return Qnil;
/* Move buffer to the end of the buffer list. Do nothing if the
buffer is killed. */
- if (!NILP (XBUFFER (buffer)->name))
+ if (!NILP (B_ (XBUFFER (buffer), name)))
{
Lisp_Object aelt, link;
/* Prevent warnings, or suspension of auto saving, that would happen
if future size is less than past size. Use of erase-buffer
implies that the future text is not really related to the past text. */
- XSETFASTINT (current_buffer->save_length, 0);
+ XSETFASTINT (B_ (current_buffer, save_length), 0);
return Qnil;
}
CHECK_BUFFER (buffer);
other_buffer = XBUFFER (buffer);
- if (NILP (other_buffer->name))
+ if (NILP (B_ (other_buffer, name)))
error ("Cannot swap a dead buffer's text");
/* Actually, it probably works just fine.
other_buffer->field = current_buffer->field; \
current_buffer->field = tmp##field; \
} while (0)
+#define swapfield_(field, type) \
+ do { \
+ type tmp##field = B_ (other_buffer, field); \
+ B_ (other_buffer, field) = B_ (current_buffer, field); \
+ B_ (current_buffer, field) = tmp##field; \
+ } while (0)
swapfield (own_text, struct buffer_text);
eassert (current_buffer->text == ¤t_buffer->own_text);
swapfield (overlays_before, struct Lisp_Overlay *);
swapfield (overlays_after, struct Lisp_Overlay *);
swapfield (overlay_center, EMACS_INT);
- swapfield (undo_list, Lisp_Object);
- swapfield (mark, Lisp_Object);
- swapfield (enable_multibyte_characters, Lisp_Object);
- swapfield (bidi_display_reordering, Lisp_Object);
- swapfield (bidi_paragraph_direction, Lisp_Object);
+ swapfield_ (undo_list, Lisp_Object);
+ swapfield_ (mark, Lisp_Object);
+ swapfield_ (enable_multibyte_characters, Lisp_Object);
+ swapfield_ (bidi_display_reordering, Lisp_Object);
+ swapfield_ (bidi_paragraph_direction, Lisp_Object);
/* FIXME: Not sure what we should do with these *_marker fields.
Hopefully they're just nil anyway. */
- swapfield (pt_marker, Lisp_Object);
- swapfield (begv_marker, Lisp_Object);
- swapfield (zv_marker, Lisp_Object);
- current_buffer->point_before_scroll = Qnil;
- other_buffer->point_before_scroll = Qnil;
+ swapfield_ (pt_marker, Lisp_Object);
+ swapfield_ (begv_marker, Lisp_Object);
+ swapfield_ (zv_marker, Lisp_Object);
+ B_ (current_buffer, point_before_scroll) = Qnil;
+ B_ (other_buffer, point_before_scroll) = Qnil;
current_buffer->text->modiff++; other_buffer->text->modiff++;
current_buffer->text->chars_modiff++; other_buffer->text->chars_modiff++;
EMACS_INT begv, zv;
int narrowed = (BEG != BEGV || Z != ZV);
int modified_p = !NILP (Fbuffer_modified_p (Qnil));
- Lisp_Object old_undo = current_buffer->undo_list;
+ Lisp_Object old_undo = B_ (current_buffer, undo_list);
struct gcpro gcpro1;
if (current_buffer->base_buffer)
error ("Cannot do `set-buffer-multibyte' on an indirect buffer");
/* Do nothing if nothing actually changes. */
- if (NILP (flag) == NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (flag) == NILP (B_ (current_buffer, enable_multibyte_characters)))
return flag;
GCPRO1 (old_undo);
/* Don't record these buffer changes. We will put a special undo entry
instead. */
- current_buffer->undo_list = Qt;
+ B_ (current_buffer, undo_list) = Qt;
/* If the cached position is for this buffer, clear it out. */
clear_charpos_cache (current_buffer);
to calculate the old correspondences. */
set_intervals_multibyte (0);
- current_buffer->enable_multibyte_characters = Qnil;
+ B_ (current_buffer, enable_multibyte_characters) = Qnil;
Z = Z_BYTE;
BEGV = BEGV_BYTE;
/* Do this first, so that chars_in_text asks the right question.
set_intervals_multibyte needs it too. */
- current_buffer->enable_multibyte_characters = Qt;
+ B_ (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;
if (!EQ (old_undo, Qt))
{
/* Represent all the above changes by a special undo entry. */
- current_buffer->undo_list = Fcons (list3 (Qapply,
+ B_ (current_buffer, undo_list) = Fcons (list3 (Qapply,
intern ("set-buffer-multibyte"),
NILP (flag) ? Qt : Qnil),
old_undo);
/* Copy this buffer's new multibyte status
into all of its indirect buffers. */
for (other = all_buffers; other; other = other->next)
- if (other->base_buffer == current_buffer && !NILP (other->name))
+ if (other->base_buffer == current_buffer && !NILP (B_ (other, name)))
{
- other->enable_multibyte_characters
- = current_buffer->enable_multibyte_characters;
+ B_ (other, enable_multibyte_characters)
+ = B_ (current_buffer, enable_multibyte_characters);
other->prevent_redisplay_optimizations_p = 1;
}
Lisp_Object oalist, alist, buffer;
XSETBUFFER (buffer, b);
- oalist = b->local_var_alist;
+ oalist = B_ (b, local_var_alist);
for (alist = oalist; CONSP (alist); alist = XCDR (alist))
{
ssl->buf[ssl->used].priority = (INTEGERP (pri) ? XINT (pri) : 0);
ssl->used++;
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
nbytes = SCHARS (str);
else if (! STRING_MULTIBYTE (str))
nbytes = count_size_as_multibyte (SDATA (str),
if (STRINGP (str2))
{
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
nbytes = SCHARS (str2);
else if (! STRING_MULTIBYTE (str2))
nbytes = count_size_as_multibyte (SDATA (str2),
Lisp_Object overlay, window, str;
struct Lisp_Overlay *ov;
EMACS_INT startpos, endpos;
- int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters));
overlay_heads.used = overlay_heads.bytes = 0;
overlay_tails.used = overlay_tails.bytes = 0;
/* Make sure all markable slots in buffer_defaults
are initialized reasonably, so mark_buffer won't choke. */
reset_buffer (&buffer_defaults);
- eassert (EQ (buffer_defaults.name, make_number (0)));
+ eassert (EQ (B_ (&buffer_defaults, name), make_number (0)));
reset_buffer_local_variables (&buffer_defaults, 1);
- eassert (EQ (buffer_local_symbols.name, make_number (0)));
+ eassert (EQ (B_ (&buffer_local_symbols, name), make_number (0)));
reset_buffer (&buffer_local_symbols);
reset_buffer_local_variables (&buffer_local_symbols, 1);
/* Prevent GC from getting confused. */
/* Must do these before making the first buffer! */
/* real setup is done in bindings.el */
- buffer_defaults.mode_line_format = make_pure_c_string ("%-");
- buffer_defaults.header_line_format = Qnil;
- buffer_defaults.abbrev_mode = Qnil;
- buffer_defaults.overwrite_mode = Qnil;
- buffer_defaults.case_fold_search = Qt;
- buffer_defaults.auto_fill_function = Qnil;
- buffer_defaults.selective_display = Qnil;
+ B_ (&buffer_defaults, mode_line_format) = make_pure_c_string ("%-");
+ B_ (&buffer_defaults, header_line_format) = Qnil;
+ B_ (&buffer_defaults, abbrev_mode) = Qnil;
+ B_ (&buffer_defaults, overwrite_mode) = Qnil;
+ B_ (&buffer_defaults, case_fold_search) = Qt;
+ B_ (&buffer_defaults, auto_fill_function) = Qnil;
+ B_ (&buffer_defaults, selective_display) = Qnil;
#ifndef old
- buffer_defaults.selective_display_ellipses = Qt;
+ B_ (&buffer_defaults, selective_display_ellipses) = Qt;
#endif
- buffer_defaults.abbrev_table = Qnil;
- buffer_defaults.display_table = Qnil;
- buffer_defaults.undo_list = Qnil;
- buffer_defaults.mark_active = Qnil;
- buffer_defaults.file_format = Qnil;
- buffer_defaults.auto_save_file_format = Qt;
+ B_ (&buffer_defaults, abbrev_table) = Qnil;
+ B_ (&buffer_defaults, display_table) = Qnil;
+ B_ (&buffer_defaults, undo_list) = Qnil;
+ B_ (&buffer_defaults, mark_active) = Qnil;
+ B_ (&buffer_defaults, file_format) = Qnil;
+ B_ (&buffer_defaults, auto_save_file_format) = Qt;
buffer_defaults.overlays_before = NULL;
buffer_defaults.overlays_after = NULL;
buffer_defaults.overlay_center = BEG;
- XSETFASTINT (buffer_defaults.tab_width, 8);
- buffer_defaults.truncate_lines = Qnil;
- buffer_defaults.word_wrap = Qnil;
- buffer_defaults.ctl_arrow = Qt;
- buffer_defaults.bidi_display_reordering = Qnil;
- buffer_defaults.bidi_paragraph_direction = Qnil;
- buffer_defaults.cursor_type = Qt;
- buffer_defaults.extra_line_spacing = Qnil;
- buffer_defaults.cursor_in_non_selected_windows = Qt;
+ XSETFASTINT (B_ (&buffer_defaults, tab_width), 8);
+ B_ (&buffer_defaults, truncate_lines) = Qnil;
+ B_ (&buffer_defaults, word_wrap) = Qnil;
+ B_ (&buffer_defaults, ctl_arrow) = Qt;
+ B_ (&buffer_defaults, bidi_display_reordering) = Qnil;
+ B_ (&buffer_defaults, bidi_paragraph_direction) = Qnil;
+ B_ (&buffer_defaults, cursor_type) = Qt;
+ B_ (&buffer_defaults, extra_line_spacing) = Qnil;
+ B_ (&buffer_defaults, cursor_in_non_selected_windows) = Qt;
#ifdef DOS_NT
buffer_defaults.buffer_file_type = Qnil; /* TEXT */
#endif
- buffer_defaults.enable_multibyte_characters = Qt;
- buffer_defaults.buffer_file_coding_system = Qnil;
- XSETFASTINT (buffer_defaults.fill_column, 70);
- XSETFASTINT (buffer_defaults.left_margin, 0);
- buffer_defaults.cache_long_line_scans = Qnil;
- buffer_defaults.file_truename = Qnil;
- XSETFASTINT (buffer_defaults.display_count, 0);
- XSETFASTINT (buffer_defaults.left_margin_cols, 0);
- XSETFASTINT (buffer_defaults.right_margin_cols, 0);
- buffer_defaults.left_fringe_width = Qnil;
- buffer_defaults.right_fringe_width = Qnil;
- buffer_defaults.fringes_outside_margins = Qnil;
- buffer_defaults.scroll_bar_width = Qnil;
- buffer_defaults.vertical_scroll_bar_type = Qt;
- buffer_defaults.indicate_empty_lines = Qnil;
- buffer_defaults.indicate_buffer_boundaries = Qnil;
- buffer_defaults.fringe_indicator_alist = Qnil;
- buffer_defaults.fringe_cursor_alist = Qnil;
- buffer_defaults.scroll_up_aggressively = Qnil;
- buffer_defaults.scroll_down_aggressively = Qnil;
- buffer_defaults.display_time = Qnil;
+ B_ (&buffer_defaults, enable_multibyte_characters) = Qt;
+ B_ (&buffer_defaults, buffer_file_coding_system) = Qnil;
+ XSETFASTINT (B_ (&buffer_defaults, fill_column), 70);
+ XSETFASTINT (B_ (&buffer_defaults, left_margin), 0);
+ B_ (&buffer_defaults, cache_long_line_scans) = Qnil;
+ B_ (&buffer_defaults, file_truename) = Qnil;
+ XSETFASTINT (B_ (&buffer_defaults, display_count), 0);
+ XSETFASTINT (B_ (&buffer_defaults, left_margin_cols), 0);
+ XSETFASTINT (B_ (&buffer_defaults, right_margin_cols), 0);
+ B_ (&buffer_defaults, left_fringe_width) = Qnil;
+ B_ (&buffer_defaults, right_fringe_width) = Qnil;
+ B_ (&buffer_defaults, fringes_outside_margins) = Qnil;
+ B_ (&buffer_defaults, scroll_bar_width) = Qnil;
+ B_ (&buffer_defaults, vertical_scroll_bar_type) = Qt;
+ B_ (&buffer_defaults, indicate_empty_lines) = Qnil;
+ B_ (&buffer_defaults, indicate_buffer_boundaries) = Qnil;
+ B_ (&buffer_defaults, fringe_indicator_alist) = Qnil;
+ B_ (&buffer_defaults, fringe_cursor_alist) = Qnil;
+ B_ (&buffer_defaults, scroll_up_aggressively) = Qnil;
+ B_ (&buffer_defaults, scroll_down_aggressively) = Qnil;
+ B_ (&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
/* 0 means not a lisp var, -1 means always local, else mask */
memset (&buffer_local_flags, 0, sizeof buffer_local_flags);
- XSETINT (buffer_local_flags.filename, -1);
- XSETINT (buffer_local_flags.directory, -1);
- XSETINT (buffer_local_flags.backed_up, -1);
- XSETINT (buffer_local_flags.save_length, -1);
- XSETINT (buffer_local_flags.auto_save_file_name, -1);
- XSETINT (buffer_local_flags.read_only, -1);
- XSETINT (buffer_local_flags.major_mode, -1);
- XSETINT (buffer_local_flags.mode_name, -1);
- XSETINT (buffer_local_flags.undo_list, -1);
- XSETINT (buffer_local_flags.mark_active, -1);
- XSETINT (buffer_local_flags.point_before_scroll, -1);
- XSETINT (buffer_local_flags.file_truename, -1);
- XSETINT (buffer_local_flags.invisibility_spec, -1);
- XSETINT (buffer_local_flags.file_format, -1);
- XSETINT (buffer_local_flags.auto_save_file_format, -1);
- XSETINT (buffer_local_flags.display_count, -1);
- XSETINT (buffer_local_flags.display_time, -1);
- XSETINT (buffer_local_flags.enable_multibyte_characters, -1);
+ XSETINT (B_ (&buffer_local_flags, filename), -1);
+ XSETINT (B_ (&buffer_local_flags, directory), -1);
+ XSETINT (B_ (&buffer_local_flags, backed_up), -1);
+ XSETINT (B_ (&buffer_local_flags, save_length), -1);
+ XSETINT (B_ (&buffer_local_flags, auto_save_file_name), -1);
+ XSETINT (B_ (&buffer_local_flags, read_only), -1);
+ XSETINT (B_ (&buffer_local_flags, major_mode), -1);
+ XSETINT (B_ (&buffer_local_flags, mode_name), -1);
+ XSETINT (B_ (&buffer_local_flags, undo_list), -1);
+ XSETINT (B_ (&buffer_local_flags, mark_active), -1);
+ XSETINT (B_ (&buffer_local_flags, point_before_scroll), -1);
+ XSETINT (B_ (&buffer_local_flags, file_truename), -1);
+ XSETINT (B_ (&buffer_local_flags, invisibility_spec), -1);
+ XSETINT (B_ (&buffer_local_flags, file_format), -1);
+ XSETINT (B_ (&buffer_local_flags, auto_save_file_format), -1);
+ XSETINT (B_ (&buffer_local_flags, display_count), -1);
+ XSETINT (B_ (&buffer_local_flags, display_time), -1);
+ XSETINT (B_ (&buffer_local_flags, enable_multibyte_characters), -1);
idx = 1;
- XSETFASTINT (buffer_local_flags.mode_line_format, idx); ++idx;
- XSETFASTINT (buffer_local_flags.abbrev_mode, idx); ++idx;
- XSETFASTINT (buffer_local_flags.overwrite_mode, idx); ++idx;
- XSETFASTINT (buffer_local_flags.case_fold_search, idx); ++idx;
- XSETFASTINT (buffer_local_flags.auto_fill_function, idx); ++idx;
- XSETFASTINT (buffer_local_flags.selective_display, idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, mode_line_format), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, abbrev_mode), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, overwrite_mode), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, case_fold_search), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, auto_fill_function), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, selective_display), idx); ++idx;
#ifndef old
- XSETFASTINT (buffer_local_flags.selective_display_ellipses, idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, selective_display_ellipses), idx); ++idx;
#endif
- XSETFASTINT (buffer_local_flags.tab_width, idx); ++idx;
- XSETFASTINT (buffer_local_flags.truncate_lines, idx); ++idx;
- XSETFASTINT (buffer_local_flags.word_wrap, idx); ++idx;
- XSETFASTINT (buffer_local_flags.ctl_arrow, idx); ++idx;
- XSETFASTINT (buffer_local_flags.fill_column, idx); ++idx;
- XSETFASTINT (buffer_local_flags.left_margin, idx); ++idx;
- XSETFASTINT (buffer_local_flags.abbrev_table, idx); ++idx;
- XSETFASTINT (buffer_local_flags.display_table, idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, tab_width), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, truncate_lines), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, word_wrap), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, ctl_arrow), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, fill_column), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, left_margin), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, abbrev_table), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, display_table), idx); ++idx;
#ifdef DOS_NT
XSETFASTINT (buffer_local_flags.buffer_file_type, idx);
/* Make this one a permanent local. */
buffer_permanent_local_flags[idx++] = 1;
#endif
- XSETFASTINT (buffer_local_flags.syntax_table, idx); ++idx;
- XSETFASTINT (buffer_local_flags.cache_long_line_scans, idx); ++idx;
- XSETFASTINT (buffer_local_flags.category_table, idx); ++idx;
- XSETFASTINT (buffer_local_flags.bidi_display_reordering, idx); ++idx;
- XSETFASTINT (buffer_local_flags.bidi_paragraph_direction, idx); ++idx;
- XSETFASTINT (buffer_local_flags.buffer_file_coding_system, idx);
+ XSETFASTINT (B_ (&buffer_local_flags, syntax_table), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, cache_long_line_scans), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, category_table), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, bidi_display_reordering), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, bidi_paragraph_direction), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, buffer_file_coding_system), idx);
/* Make this one a permanent local. */
buffer_permanent_local_flags[idx++] = 1;
- XSETFASTINT (buffer_local_flags.left_margin_cols, idx); ++idx;
- XSETFASTINT (buffer_local_flags.right_margin_cols, idx); ++idx;
- XSETFASTINT (buffer_local_flags.left_fringe_width, idx); ++idx;
- XSETFASTINT (buffer_local_flags.right_fringe_width, idx); ++idx;
- XSETFASTINT (buffer_local_flags.fringes_outside_margins, idx); ++idx;
- XSETFASTINT (buffer_local_flags.scroll_bar_width, idx); ++idx;
- XSETFASTINT (buffer_local_flags.vertical_scroll_bar_type, idx); ++idx;
- XSETFASTINT (buffer_local_flags.indicate_empty_lines, idx); ++idx;
- XSETFASTINT (buffer_local_flags.indicate_buffer_boundaries, idx); ++idx;
- XSETFASTINT (buffer_local_flags.fringe_indicator_alist, idx); ++idx;
- XSETFASTINT (buffer_local_flags.fringe_cursor_alist, idx); ++idx;
- XSETFASTINT (buffer_local_flags.scroll_up_aggressively, idx); ++idx;
- XSETFASTINT (buffer_local_flags.scroll_down_aggressively, idx); ++idx;
- XSETFASTINT (buffer_local_flags.header_line_format, idx); ++idx;
- XSETFASTINT (buffer_local_flags.cursor_type, idx); ++idx;
- XSETFASTINT (buffer_local_flags.extra_line_spacing, idx); ++idx;
- XSETFASTINT (buffer_local_flags.cursor_in_non_selected_windows, idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, left_margin_cols), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, right_margin_cols), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, left_fringe_width), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, right_fringe_width), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, fringes_outside_margins), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, scroll_bar_width), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, vertical_scroll_bar_type), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, indicate_empty_lines), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, indicate_buffer_boundaries), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, fringe_indicator_alist), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, fringe_cursor_alist), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, scroll_up_aggressively), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, scroll_down_aggressively), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, header_line_format), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, cursor_type), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, extra_line_spacing), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, cursor_in_non_selected_windows), idx); ++idx;
/* Need more room? */
if (idx >= MAX_PER_BUFFER_VARS)
QSFundamental = make_pure_c_string ("Fundamental");
Qfundamental_mode = intern_c_string ("fundamental-mode");
- buffer_defaults.major_mode = Qfundamental_mode;
+ B_ (&buffer_defaults, major_mode) = Qfundamental_mode;
Qmode_class = intern_c_string ("mode-class");
#endif /* USE_MMAP_FOR_BUFFERS */
Fset_buffer (Fget_buffer_create (build_string ("*scratch*")));
- if (NILP (buffer_defaults.enable_multibyte_characters))
+ if (NILP (B_ (&buffer_defaults, enable_multibyte_characters)))
Fset_buffer_multibyte (Qnil);
pwd = get_current_dir_name ();
pwd[len + 1] = '\0';
}
- current_buffer->directory = make_unibyte_string (pwd, strlen (pwd));
- if (! NILP (buffer_defaults.enable_multibyte_characters))
+ B_ (current_buffer, directory) = make_unibyte_string (pwd, strlen (pwd));
+ if (! NILP (B_ (&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. */
- current_buffer->directory
- = string_to_multibyte (current_buffer->directory);
+ B_ (current_buffer, directory)
+ = string_to_multibyte (B_ (current_buffer, directory));
/* Add /: to the front of the name
if it would otherwise be treated as magic. */
- temp = Ffind_file_name_handler (current_buffer->directory, Qt);
+ temp = Ffind_file_name_handler (B_ (current_buffer, directory), Qt);
if (! NILP (temp)
/* If the default dir is just /, TEMP is non-nil
because of the ange-ftp completion handler.
However, it is not necessary to turn / into /:/.
So avoid doing that. */
- && strcmp ("/", SSDATA (current_buffer->directory)))
- current_buffer->directory
- = concat2 (build_string ("/:"), current_buffer->directory);
+ && strcmp ("/", SSDATA (B_ (current_buffer, directory))))
+ B_ (current_buffer, directory)
+ = concat2 (build_string ("/:"), B_ (current_buffer, directory));
temp = get_minibuffer (0);
- XBUFFER (temp)->directory = current_buffer->directory;
+ B_ (XBUFFER (temp), directory) = B_ (current_buffer, directory);
free (pwd);
}
This is the same as (default-value 'scroll-down-aggressively). */);
DEFVAR_PER_BUFFER ("header-line-format",
- ¤t_buffer->header_line_format,
+ &B_ (current_buffer, header_line_format),
Qnil,
doc: /* Analogous to `mode-line-format', but controls the header line.
The header line appears, optionally, at the top of a window;
the mode line appears at the bottom. */);
- DEFVAR_PER_BUFFER ("mode-line-format", ¤t_buffer->mode_line_format,
+ DEFVAR_PER_BUFFER ("mode-line-format", &B_ (current_buffer, mode_line_format),
Qnil,
doc: /* Template for displaying mode line for current buffer.
Each buffer has its own value of this variable.
DEFVAR_BUFFER_DEFAULTS ("default-major-mode", major_mode,
doc: /* *Value of `major-mode' for new buffers. */);
- DEFVAR_PER_BUFFER ("major-mode", ¤t_buffer->major_mode,
+ DEFVAR_PER_BUFFER ("major-mode", &B_ (current_buffer, major_mode),
make_number (Lisp_Symbol),
doc: /* Symbol for current buffer's major mode.
The default value (normally `fundamental-mode') affects new buffers.
variables such as `buffer-read-only' and `buffer-file-coding-system'
to be set up. */);
- DEFVAR_PER_BUFFER ("mode-name", ¤t_buffer->mode_name,
+ DEFVAR_PER_BUFFER ("mode-name", &B_ (current_buffer, mode_name),
Qnil,
doc: /* Pretty name of current buffer's major mode.
Usually a string, but can use any of the constructs for `mode-line-format',
which see.
Format with `format-mode-line' to produce a string value. */);
- DEFVAR_PER_BUFFER ("local-abbrev-table", ¤t_buffer->abbrev_table, Qnil,
+ DEFVAR_PER_BUFFER ("local-abbrev-table", &B_ (current_buffer, abbrev_table), Qnil,
doc: /* Local (mode-specific) abbrev table of current buffer. */);
- DEFVAR_PER_BUFFER ("abbrev-mode", ¤t_buffer->abbrev_mode, Qnil,
+ DEFVAR_PER_BUFFER ("abbrev-mode", &B_ (current_buffer, abbrev_mode), Qnil,
doc: /* Non-nil if Abbrev mode is enabled.
Use the command `abbrev-mode' to change this variable. */);
- DEFVAR_PER_BUFFER ("case-fold-search", ¤t_buffer->case_fold_search,
+ DEFVAR_PER_BUFFER ("case-fold-search", &B_ (current_buffer, case_fold_search),
Qnil,
doc: /* *Non-nil if searches and matches should ignore case. */);
- DEFVAR_PER_BUFFER ("fill-column", ¤t_buffer->fill_column,
+ DEFVAR_PER_BUFFER ("fill-column", &B_ (current_buffer, fill_column),
make_number (LISP_INT_TAG),
doc: /* *Column beyond which automatic line-wrapping should happen.
Interactively, you can set the buffer local value using \\[set-fill-column]. */);
- DEFVAR_PER_BUFFER ("left-margin", ¤t_buffer->left_margin,
+ DEFVAR_PER_BUFFER ("left-margin", &B_ (current_buffer, left_margin),
make_number (LISP_INT_TAG),
doc: /* *Column for the default `indent-line-function' to indent to.
Linefeed indents to this column in Fundamental mode. */);
- DEFVAR_PER_BUFFER ("tab-width", ¤t_buffer->tab_width,
+ DEFVAR_PER_BUFFER ("tab-width", &B_ (current_buffer, tab_width),
make_number (LISP_INT_TAG),
doc: /* *Distance between tab stops (for display of tab characters), in columns. */);
- DEFVAR_PER_BUFFER ("ctl-arrow", ¤t_buffer->ctl_arrow, Qnil,
+ DEFVAR_PER_BUFFER ("ctl-arrow", &B_ (current_buffer, ctl_arrow), Qnil,
doc: /* *Non-nil means display control chars with uparrow.
A value of nil means use backslash and octal digits.
This variable does not apply to characters whose display is specified
in the current display table (if there is one). */);
DEFVAR_PER_BUFFER ("enable-multibyte-characters",
- ¤t_buffer->enable_multibyte_characters,
+ &B_ (current_buffer, enable_multibyte_characters),
Qnil,
doc: /* Non-nil means the buffer contents are regarded as multi-byte characters.
Otherwise they are regarded as unibyte. This affects the display,
XSYMBOL (intern_c_string ("enable-multibyte-characters"))->constant = 1;
DEFVAR_PER_BUFFER ("buffer-file-coding-system",
- ¤t_buffer->buffer_file_coding_system, Qnil,
+ &B_ (current_buffer, buffer_file_coding_system), Qnil,
doc: /* Coding system to be used for encoding the buffer contents on saving.
This variable applies to saving the buffer, and also to `write-region'
and other functions that use `write-region'.
This variable is never applied to a way of decoding a file while reading it. */);
DEFVAR_PER_BUFFER ("bidi-display-reordering",
- ¤t_buffer->bidi_display_reordering, Qnil,
+ &B_ (current_buffer, bidi_display_reordering), Qnil,
doc: /* Non-nil means reorder bidirectional text for display in the visual order. */);
DEFVAR_PER_BUFFER ("bidi-paragraph-direction",
- ¤t_buffer->bidi_paragraph_direction, Qnil,
+ &B_ (current_buffer, bidi_paragraph_direction), Qnil,
doc: /* *If non-nil, forces directionality of text paragraphs in the buffer.
If this is nil (the default), the direction of each paragraph is
This variable has no effect unless the buffer's value of
\`bidi-display-reordering' is non-nil. */);
- DEFVAR_PER_BUFFER ("truncate-lines", ¤t_buffer->truncate_lines, Qnil,
+ DEFVAR_PER_BUFFER ("truncate-lines", &B_ (current_buffer, truncate_lines), Qnil,
doc: /* *Non-nil means do not display continuation lines.
Instead, give each line of text just one screen line.
`truncate-partial-width-windows' if that variable is non-nil
and this buffer is not full-frame width. */);
- DEFVAR_PER_BUFFER ("word-wrap", ¤t_buffer->word_wrap, Qnil,
+ DEFVAR_PER_BUFFER ("word-wrap", &B_ (current_buffer, word_wrap), Qnil,
doc: /* *Non-nil means to use word-wrapping for continuation lines.
When word-wrapping is on, continuation lines are wrapped at the space
or tab character nearest to the right window edge.
On other systems, this variable is normally always nil. */);
#endif
- DEFVAR_PER_BUFFER ("default-directory", ¤t_buffer->directory,
+ DEFVAR_PER_BUFFER ("default-directory", &B_ (current_buffer, directory),
make_number (Lisp_String),
doc: /* Name of default directory of current buffer. Should end with slash.
To interactively change the default directory, use command `cd'. */);
- DEFVAR_PER_BUFFER ("auto-fill-function", ¤t_buffer->auto_fill_function,
+ DEFVAR_PER_BUFFER ("auto-fill-function", &B_ (current_buffer, auto_fill_function),
Qnil,
doc: /* Function called (if non-nil) to perform auto-fill.
It is called after self-inserting any character specified in
NOTE: This variable is not a hook;
its value may not be a list of functions. */);
- DEFVAR_PER_BUFFER ("buffer-file-name", ¤t_buffer->filename,
+ DEFVAR_PER_BUFFER ("buffer-file-name", &B_ (current_buffer, filename),
make_number (Lisp_String),
doc: /* Name of file visited in current buffer, or nil if not visiting a file. */);
- DEFVAR_PER_BUFFER ("buffer-file-truename", ¤t_buffer->file_truename,
+ DEFVAR_PER_BUFFER ("buffer-file-truename", &B_ (current_buffer, file_truename),
make_number (Lisp_String),
doc: /* Abbreviated truename of file visited in current buffer, or nil if none.
The truename of a file is calculated by `file-truename'
and then abbreviated with `abbreviate-file-name'. */);
DEFVAR_PER_BUFFER ("buffer-auto-save-file-name",
- ¤t_buffer->auto_save_file_name,
+ &B_ (current_buffer, auto_save_file_name),
make_number (Lisp_String),
doc: /* Name of file for auto-saving current buffer.
If it is nil, that means don't auto-save this buffer. */);
- DEFVAR_PER_BUFFER ("buffer-read-only", ¤t_buffer->read_only, Qnil,
+ DEFVAR_PER_BUFFER ("buffer-read-only", &B_ (current_buffer, read_only), Qnil,
doc: /* Non-nil if this buffer is read-only. */);
- DEFVAR_PER_BUFFER ("buffer-backed-up", ¤t_buffer->backed_up, Qnil,
+ DEFVAR_PER_BUFFER ("buffer-backed-up", &B_ (current_buffer, backed_up), Qnil,
doc: /* Non-nil if this buffer's file has been backed up.
Backing up is done before the first time the file is saved. */);
- DEFVAR_PER_BUFFER ("buffer-saved-size", ¤t_buffer->save_length,
+ DEFVAR_PER_BUFFER ("buffer-saved-size", &B_ (current_buffer, save_length),
make_number (LISP_INT_TAG),
doc: /* Length of current buffer when last read in, saved or auto-saved.
0 initially.
if its text size shrinks. If you use `buffer-swap-text' on a buffer,
you probably should set this to -2 in that buffer. */);
- DEFVAR_PER_BUFFER ("selective-display", ¤t_buffer->selective_display,
+ DEFVAR_PER_BUFFER ("selective-display", &B_ (current_buffer, selective_display),
Qnil,
doc: /* Non-nil enables selective display.
An integer N as value means display only lines
#ifndef old
DEFVAR_PER_BUFFER ("selective-display-ellipses",
- ¤t_buffer->selective_display_ellipses,
+ &B_ (current_buffer, selective_display_ellipses),
Qnil,
doc: /* Non-nil means display ... on previous line when a line is invisible. */);
#endif
- DEFVAR_PER_BUFFER ("overwrite-mode", ¤t_buffer->overwrite_mode, Qnil,
+ DEFVAR_PER_BUFFER ("overwrite-mode", &B_ (current_buffer, overwrite_mode), Qnil,
doc: /* Non-nil if self-insertion should replace existing text.
The value should be one of `overwrite-mode-textual',
`overwrite-mode-binary', or nil.
until the tab is filled in.
If `overwrite-mode-binary', self-insertion replaces newlines and tabs too. */);
- DEFVAR_PER_BUFFER ("buffer-display-table", ¤t_buffer->display_table,
+ DEFVAR_PER_BUFFER ("buffer-display-table", &B_ (current_buffer, display_table),
Qnil,
doc: /* Display table that controls display of the contents of current buffer.
See also the functions `display-table-slot' and `set-display-table-slot'. */);
- DEFVAR_PER_BUFFER ("left-margin-width", ¤t_buffer->left_margin_cols,
+ DEFVAR_PER_BUFFER ("left-margin-width", &B_ (current_buffer, left_margin_cols),
Qnil,
doc: /* *Width of left marginal area for display of a buffer.
A value of nil means no marginal area. */);
- DEFVAR_PER_BUFFER ("right-margin-width", ¤t_buffer->right_margin_cols,
+ DEFVAR_PER_BUFFER ("right-margin-width", &B_ (current_buffer, right_margin_cols),
Qnil,
doc: /* *Width of right marginal area for display of a buffer.
A value of nil means no marginal area. */);
- DEFVAR_PER_BUFFER ("left-fringe-width", ¤t_buffer->left_fringe_width,
+ DEFVAR_PER_BUFFER ("left-fringe-width", &B_ (current_buffer, left_fringe_width),
Qnil,
doc: /* *Width of this buffer's left fringe (in pixels).
A value of 0 means no left fringe is shown in this buffer's window.
A value of nil means to use the left fringe width from the window's frame. */);
- DEFVAR_PER_BUFFER ("right-fringe-width", ¤t_buffer->right_fringe_width,
+ DEFVAR_PER_BUFFER ("right-fringe-width", &B_ (current_buffer, right_fringe_width),
Qnil,
doc: /* *Width of this buffer's right fringe (in pixels).
A value of 0 means no right fringe is shown in this buffer's window.
A value of nil means to use the right fringe width from the window's frame. */);
- DEFVAR_PER_BUFFER ("fringes-outside-margins", ¤t_buffer->fringes_outside_margins,
+ DEFVAR_PER_BUFFER ("fringes-outside-margins", &B_ (current_buffer, fringes_outside_margins),
Qnil,
doc: /* *Non-nil means to display fringes outside display margins.
A value of nil means to display fringes between margins and buffer text. */);
- DEFVAR_PER_BUFFER ("scroll-bar-width", ¤t_buffer->scroll_bar_width,
+ DEFVAR_PER_BUFFER ("scroll-bar-width", &B_ (current_buffer, scroll_bar_width),
Qnil,
doc: /* *Width of this buffer's scroll bars in pixels.
A value of nil means to use the scroll bar width from the window's frame. */);
- DEFVAR_PER_BUFFER ("vertical-scroll-bar", ¤t_buffer->vertical_scroll_bar_type,
+ DEFVAR_PER_BUFFER ("vertical-scroll-bar", &B_ (current_buffer, vertical_scroll_bar_type),
Qnil,
doc: /* *Position of this buffer's vertical scroll bar.
The value takes effect whenever you tell a window to display this buffer;
A value of t (the default) means do whatever the window's frame specifies. */);
DEFVAR_PER_BUFFER ("indicate-empty-lines",
- ¤t_buffer->indicate_empty_lines, Qnil,
+ &B_ (current_buffer, indicate_empty_lines), Qnil,
doc: /* *Visually indicate empty lines after the buffer end.
If non-nil, a bitmap is displayed in the left fringe of a window on
window-systems. */);
DEFVAR_PER_BUFFER ("indicate-buffer-boundaries",
- ¤t_buffer->indicate_buffer_boundaries, Qnil,
+ &B_ (current_buffer, indicate_buffer_boundaries), Qnil,
doc: /* *Visually indicate buffer boundaries and scrolling.
If non-nil, the first and last line of the buffer are marked in the fringe
of a window on window-systems with angle bitmaps, or if the window can be
fringe, but no arrow bitmaps, use ((top . left) (bottom . left)). */);
DEFVAR_PER_BUFFER ("fringe-indicator-alist",
- ¤t_buffer->fringe_indicator_alist, Qnil,
+ &B_ (current_buffer, fringe_indicator_alist), Qnil,
doc: /* *Mapping from logical to physical fringe indicator bitmaps.
The value is an alist where each element (INDICATOR . BITMAPS)
specifies the fringe bitmaps used to display a specific logical
symbol which is used in both left and right fringes. */);
DEFVAR_PER_BUFFER ("fringe-cursor-alist",
- ¤t_buffer->fringe_cursor_alist, Qnil,
+ &B_ (current_buffer, fringe_cursor_alist), Qnil,
doc: /* *Mapping from logical to physical fringe cursor bitmaps.
The value is an alist where each element (CURSOR . BITMAP)
specifies the fringe bitmaps used to display a specific logical
cursor type. */);
DEFVAR_PER_BUFFER ("scroll-up-aggressively",
- ¤t_buffer->scroll_up_aggressively, Qnil,
+ &B_ (current_buffer, scroll_up_aggressively), Qnil,
doc: /* How far to scroll windows upward.
If you move point off the bottom, the window scrolls automatically.
This variable controls how far it scrolls. The value nil, the default,
between 0.0 and 1.0, inclusive. */);
DEFVAR_PER_BUFFER ("scroll-down-aggressively",
- ¤t_buffer->scroll_down_aggressively, Qnil,
+ &B_ (current_buffer, scroll_down_aggressively), Qnil,
doc: /* How far to scroll windows downward.
If you move point off the top, the window scrolls automatically.
This variable controls how far it scrolls. The value nil, the default,
The functions are run using the `run-hooks' function. */);
Vfirst_change_hook = Qnil;
- DEFVAR_PER_BUFFER ("buffer-undo-list", ¤t_buffer->undo_list, Qnil,
+ DEFVAR_PER_BUFFER ("buffer-undo-list", &B_ (current_buffer, undo_list), Qnil,
doc: /* List of undo entries in current buffer.
Recent changes come first; older changes follow newer.
If the value of the variable is t, undo information is not recorded. */);
- DEFVAR_PER_BUFFER ("mark-active", ¤t_buffer->mark_active, Qnil,
+ DEFVAR_PER_BUFFER ("mark-active", &B_ (current_buffer, mark_active), Qnil,
doc: /* Non-nil means the mark and region are currently active in this buffer. */);
- DEFVAR_PER_BUFFER ("cache-long-line-scans", ¤t_buffer->cache_long_line_scans, Qnil,
+ DEFVAR_PER_BUFFER ("cache-long-line-scans", &B_ (current_buffer, cache_long_line_scans), Qnil,
doc: /* Non-nil means that Emacs should use caches to handle long lines more quickly.
Normally, the line-motion functions work by scanning the buffer for
the cache should not affect the behavior of any of the motion
functions; it should only affect their performance. */);
- DEFVAR_PER_BUFFER ("point-before-scroll", ¤t_buffer->point_before_scroll, Qnil,
+ DEFVAR_PER_BUFFER ("point-before-scroll", &B_ (current_buffer, point_before_scroll), Qnil,
doc: /* Value of point before the last series of scroll operations, or nil. */);
- DEFVAR_PER_BUFFER ("buffer-file-format", ¤t_buffer->file_format, Qnil,
+ DEFVAR_PER_BUFFER ("buffer-file-format", &B_ (current_buffer, file_format), Qnil,
doc: /* List of formats to use when saving this buffer.
Formats are defined by `format-alist'. This variable is
set when a file is visited. */);
DEFVAR_PER_BUFFER ("buffer-auto-save-file-format",
- ¤t_buffer->auto_save_file_format, Qnil,
+ &B_ (current_buffer, auto_save_file_format), Qnil,
doc: /* *Format in which to write auto-save files.
Should be a list of symbols naming formats that are defined in `format-alist'.
If it is t, which is the default, auto-save files are written in the
same format as a regular save would use. */);
DEFVAR_PER_BUFFER ("buffer-invisibility-spec",
- ¤t_buffer->invisibility_spec, Qnil,
+ &B_ (current_buffer, invisibility_spec), Qnil,
doc: /* Invisibility spec of this buffer.
The default is t, which means that text is invisible
if it has a non-nil `invisible' property.
and they have an ellipsis as well if ELLIPSIS is non-nil. */);
DEFVAR_PER_BUFFER ("buffer-display-count",
- ¤t_buffer->display_count, Qnil,
+ &B_ (current_buffer, display_count), Qnil,
doc: /* A number incremented each time this buffer is displayed in a window.
The function `set-window-buffer' increments it. */);
DEFVAR_PER_BUFFER ("buffer-display-time",
- ¤t_buffer->display_time, Qnil,
+ &B_ (current_buffer, display_time), Qnil,
doc: /* Time stamp updated each time this buffer is displayed in a window.
The function `set-window-buffer' updates this variable
to the value obtained by calling `current-time'.
is a member of the list. */);
Vinhibit_read_only = Qnil;
- DEFVAR_PER_BUFFER ("cursor-type", ¤t_buffer->cursor_type, Qnil,
+ DEFVAR_PER_BUFFER ("cursor-type", &B_ (current_buffer, cursor_type), Qnil,
doc: /* Cursor to use when this buffer is in the selected window.
Values are interpreted as follows:
`cursor-in-non-selected-windows'. */);
DEFVAR_PER_BUFFER ("line-spacing",
- ¤t_buffer->extra_line_spacing, Qnil,
+ &B_ (current_buffer, extra_line_spacing), Qnil,
doc: /* Additional space to put between lines when displaying a buffer.
The space is measured in pixels, and put below lines on graphic displays,
see `display-graphic-p'.
to the default frame line height. A value of nil means add no extra space. */);
DEFVAR_PER_BUFFER ("cursor-in-non-selected-windows",
- ¤t_buffer->cursor_in_non_selected_windows, Qnil,
+ &B_ (current_buffer, cursor_in_non_selected_windows), Qnil,
doc: /* *Non-nil means show a cursor in non-selected windows.
If nil, only shows a cursor in the selected window.
If t, displays a cursor related to the usual cursor type
/* Return character at byte position POS. */
#define FETCH_CHAR(pos) \
- (!NILP (current_buffer->enable_multibyte_characters) \
+ (!NILP (B_ (current_buffer, enable_multibyte_characters)) \
? FETCH_MULTIBYTE_CHAR ((pos)) \
: FETCH_BYTE ((pos)))
multibyte. */
#define FETCH_CHAR_AS_MULTIBYTE(pos) \
- (!NILP (current_buffer->enable_multibyte_characters) \
+ (!NILP (B_ (current_buffer, enable_multibyte_characters)) \
? FETCH_MULTIBYTE_CHAR ((pos)) \
: UNIBYTE_TO_CHAR (FETCH_BYTE ((pos))))
int inhibit_shrinking;
};
+/* Lisp fields in struct buffer are hidden from most code and accessed
+ via the B_ macro, below. Only select pieces of code, like the GC,
+ are allowed to use BUFFER_INTERNAL_FIELD. */
+#define BUFFER_INTERNAL_FIELD(field) field ## _
+
+/* Most code should use this macro to access Lisp fields in struct
+ buffer. */
+#define B_(buf, field) ((buf)->BUFFER_INTERNAL_FIELD (field))
+
/* This is the structure that the buffer Lisp object points to. */
struct buffer
because local variables have to be right in the struct buffer.
So we copy it around in set_buffer_internal.
This comes before `name' because it is marked in a special way. */
- Lisp_Object undo_list;
+ Lisp_Object BUFFER_INTERNAL_FIELD (undo_list);
/* The name of this buffer. */
- Lisp_Object name;
+ Lisp_Object BUFFER_INTERNAL_FIELD (name);
/* The name of the file visited in this buffer, or nil. */
- Lisp_Object filename;
+ Lisp_Object BUFFER_INTERNAL_FIELD (filename);
/* Dir for expanding relative file names. */
- Lisp_Object directory;
+ Lisp_Object BUFFER_INTERNAL_FIELD (directory);
/* True if this buffer has been backed up (if you write to the
visited file and it hasn't been backed up, then a backup will
be made). */
/* This isn't really used by the C code, so could be deleted. */
- Lisp_Object backed_up;
+ Lisp_Object BUFFER_INTERNAL_FIELD (backed_up);
/* Length of file when last read or saved.
-1 means auto saving turned off because buffer shrank a lot.
-2 means don't turn off auto saving if buffer shrinks.
(That value is used with buffer-swap-text.)
This is not in the struct buffer_text
because it's not used in indirect buffers at all. */
- Lisp_Object save_length;
+ Lisp_Object BUFFER_INTERNAL_FIELD (save_length);
/* File name used for auto-saving this buffer.
This is not in the struct buffer_text
because it's not used in indirect buffers at all. */
- Lisp_Object auto_save_file_name;
+ Lisp_Object BUFFER_INTERNAL_FIELD (auto_save_file_name);
/* Non-nil if buffer read-only. */
- Lisp_Object read_only;
+ Lisp_Object BUFFER_INTERNAL_FIELD (read_only);
/* "The mark". This is a marker which may
point into this buffer or may point nowhere. */
- Lisp_Object mark;
+ Lisp_Object BUFFER_INTERNAL_FIELD (mark);
/* Alist of elements (SYMBOL . VALUE-IN-THIS-BUFFER) for all
per-buffer variables of this buffer. For locally unbound
symbols, just the symbol appears as the element. */
- Lisp_Object local_var_alist;
+ Lisp_Object BUFFER_INTERNAL_FIELD (local_var_alist);
/* Symbol naming major mode (eg, lisp-mode). */
- Lisp_Object major_mode;
+ Lisp_Object BUFFER_INTERNAL_FIELD (major_mode);
/* Pretty name of major mode (eg, "Lisp"). */
- Lisp_Object mode_name;
+ Lisp_Object BUFFER_INTERNAL_FIELD (mode_name);
/* Mode line element that controls format of mode line. */
- Lisp_Object mode_line_format;
+ Lisp_Object BUFFER_INTERNAL_FIELD (mode_line_format);
/* Analogous to mode_line_format for the line displayed at the top
of windows. Nil means don't display that line. */
- Lisp_Object header_line_format;
+ Lisp_Object BUFFER_INTERNAL_FIELD (header_line_format);
/* Keys that are bound local to this buffer. */
- Lisp_Object keymap;
+ Lisp_Object BUFFER_INTERNAL_FIELD (keymap);
/* This buffer's local abbrev table. */
- Lisp_Object abbrev_table;
+ Lisp_Object BUFFER_INTERNAL_FIELD (abbrev_table);
/* This buffer's syntax table. */
- Lisp_Object syntax_table;
+ Lisp_Object BUFFER_INTERNAL_FIELD (syntax_table);
/* This buffer's category table. */
- Lisp_Object category_table;
+ Lisp_Object BUFFER_INTERNAL_FIELD (category_table);
/* Values of several buffer-local variables. */
/* tab-width is buffer-local so that redisplay can find it
in buffers that are not current. */
- Lisp_Object case_fold_search;
- Lisp_Object tab_width;
- Lisp_Object fill_column;
- Lisp_Object left_margin;
+ Lisp_Object BUFFER_INTERNAL_FIELD (case_fold_search);
+ Lisp_Object BUFFER_INTERNAL_FIELD (tab_width);
+ Lisp_Object BUFFER_INTERNAL_FIELD (fill_column);
+ Lisp_Object BUFFER_INTERNAL_FIELD (left_margin);
/* Function to call when insert space past fill column. */
- Lisp_Object auto_fill_function;
+ Lisp_Object BUFFER_INTERNAL_FIELD (auto_fill_function);
/* nil: text, t: binary.
This value is meaningful only on certain operating systems. */
/* Actually, we don't need this flag any more because end-of-line
is handled correctly according to the buffer-file-coding-system
of the buffer. Just keeping it for backward compatibility. */
- Lisp_Object buffer_file_type;
+ Lisp_Object BUFFER_INTERNAL_FIELD (buffer_file_type);
/* Case table for case-conversion in this buffer.
This char-table maps each char into its lower-case version. */
- Lisp_Object downcase_table;
+ Lisp_Object BUFFER_INTERNAL_FIELD (downcase_table);
/* Char-table mapping each char to its upper-case version. */
- Lisp_Object upcase_table;
+ Lisp_Object BUFFER_INTERNAL_FIELD (upcase_table);
/* Char-table for conversion for case-folding search. */
- Lisp_Object case_canon_table;
+ Lisp_Object BUFFER_INTERNAL_FIELD (case_canon_table);
/* Char-table of equivalences for case-folding search. */
- Lisp_Object case_eqv_table;
+ Lisp_Object BUFFER_INTERNAL_FIELD (case_eqv_table);
/* Non-nil means do not display continuation lines. */
- Lisp_Object truncate_lines;
+ Lisp_Object BUFFER_INTERNAL_FIELD (truncate_lines);
/* Non-nil means to use word wrapping when displaying continuation lines. */
- Lisp_Object word_wrap;
+ Lisp_Object BUFFER_INTERNAL_FIELD (word_wrap);
/* Non-nil means display ctl chars with uparrow. */
- Lisp_Object ctl_arrow;
+ Lisp_Object BUFFER_INTERNAL_FIELD (ctl_arrow);
/* Non-nil means reorder bidirectional text for display in the
visual order. */
- Lisp_Object bidi_display_reordering;
+ Lisp_Object BUFFER_INTERNAL_FIELD (bidi_display_reordering);
/* If non-nil, specifies which direction of text to force in all the
paragraphs of the buffer. Nil means determine paragraph
direction dynamically for each paragraph. */
- Lisp_Object bidi_paragraph_direction;
+ Lisp_Object BUFFER_INTERNAL_FIELD (bidi_paragraph_direction);
/* Non-nil means do selective display;
see doc string in syms_of_buffer (buffer.c) for details. */
- Lisp_Object selective_display;
+ Lisp_Object BUFFER_INTERNAL_FIELD (selective_display);
#ifndef old
/* Non-nil means show ... at end of line followed by invisible lines. */
- Lisp_Object selective_display_ellipses;
+ Lisp_Object BUFFER_INTERNAL_FIELD (selective_display_ellipses);
#endif
/* Alist of (FUNCTION . STRING) for each minor mode enabled in buffer. */
- Lisp_Object minor_modes;
+ Lisp_Object BUFFER_INTERNAL_FIELD (minor_modes);
/* t if "self-insertion" should overwrite; `binary' if it should also
overwrite newlines and tabs - for editing executables and the like. */
- Lisp_Object overwrite_mode;
+ Lisp_Object BUFFER_INTERNAL_FIELD (overwrite_mode);
/* non-nil means abbrev mode is on. Expand abbrevs automatically. */
- Lisp_Object abbrev_mode;
+ Lisp_Object BUFFER_INTERNAL_FIELD (abbrev_mode);
/* Display table to use for text in this buffer. */
- Lisp_Object display_table;
+ Lisp_Object BUFFER_INTERNAL_FIELD (display_table);
/* t means the mark and region are currently active. */
- Lisp_Object mark_active;
+ Lisp_Object BUFFER_INTERNAL_FIELD (mark_active);
/* Non-nil means the buffer contents are regarded as multi-byte
form of characters, not a binary code. */
- Lisp_Object enable_multibyte_characters;
+ Lisp_Object BUFFER_INTERNAL_FIELD (enable_multibyte_characters);
/* Coding system to be used for encoding the buffer contents on
saving. */
- Lisp_Object buffer_file_coding_system;
+ Lisp_Object BUFFER_INTERNAL_FIELD (buffer_file_coding_system);
/* List of symbols naming the file format used for visited file. */
- Lisp_Object file_format;
+ Lisp_Object BUFFER_INTERNAL_FIELD (file_format);
/* List of symbols naming the file format used for auto-save file. */
- Lisp_Object auto_save_file_format;
+ Lisp_Object BUFFER_INTERNAL_FIELD (auto_save_file_format);
/* True if the newline position cache and width run cache are
enabled. See search.c and indent.c. */
- Lisp_Object cache_long_line_scans;
+ Lisp_Object BUFFER_INTERNAL_FIELD (cache_long_line_scans);
/* If the width run cache is enabled, this table contains the
character widths width_run_cache (see above) assumes. When we
current display table to see whether the display table has
affected the widths of any characters. If it has, we
invalidate the width run cache, and re-initialize width_table. */
- Lisp_Object width_table;
+ Lisp_Object BUFFER_INTERNAL_FIELD (width_table);
/* In an indirect buffer, or a buffer that is the base of an
indirect buffer, this holds a marker that records
PT for this buffer when the buffer is not current. */
- Lisp_Object pt_marker;
+ Lisp_Object BUFFER_INTERNAL_FIELD (pt_marker);
/* In an indirect buffer, or a buffer that is the base of an
indirect buffer, this holds a marker that records
BEGV for this buffer when the buffer is not current. */
- Lisp_Object begv_marker;
+ Lisp_Object BUFFER_INTERNAL_FIELD (begv_marker);
/* In an indirect buffer, or a buffer that is the base of an
indirect buffer, this holds a marker that records
ZV for this buffer when the buffer is not current. */
- Lisp_Object zv_marker;
+ Lisp_Object BUFFER_INTERNAL_FIELD (zv_marker);
/* This holds the point value before the last scroll operation.
Explicitly setting point sets this to nil. */
- Lisp_Object point_before_scroll;
+ Lisp_Object BUFFER_INTERNAL_FIELD (point_before_scroll);
/* Truename of the visited file, or nil. */
- Lisp_Object file_truename;
+ Lisp_Object BUFFER_INTERNAL_FIELD (file_truename);
/* Invisibility spec of this buffer.
t => any non-nil `invisible' property means invisible.
A list => `invisible' property means invisible
if it is memq in that list. */
- Lisp_Object invisibility_spec;
+ Lisp_Object BUFFER_INTERNAL_FIELD (invisibility_spec);
/* This is the last window that was selected with this buffer in it,
or nil if that window no longer displays this buffer. */
- Lisp_Object last_selected_window;
+ Lisp_Object BUFFER_INTERNAL_FIELD (last_selected_window);
/* Incremented each time the buffer is displayed in a window. */
- Lisp_Object display_count;
+ Lisp_Object BUFFER_INTERNAL_FIELD (display_count);
/* Widths of left and right marginal areas for windows displaying
this buffer. */
- Lisp_Object left_margin_cols, right_margin_cols;
+ Lisp_Object BUFFER_INTERNAL_FIELD (left_margin_cols), BUFFER_INTERNAL_FIELD (right_margin_cols);
/* Widths of left and right fringe areas for windows displaying
this buffer. */
- Lisp_Object left_fringe_width, right_fringe_width;
+ Lisp_Object BUFFER_INTERNAL_FIELD (left_fringe_width), BUFFER_INTERNAL_FIELD (right_fringe_width);
/* Non-nil means fringes are drawn outside display margins;
othersize draw them between margin areas and text. */
- Lisp_Object fringes_outside_margins;
+ Lisp_Object BUFFER_INTERNAL_FIELD (fringes_outside_margins);
/* Width and type of scroll bar areas for windows displaying
this buffer. */
- Lisp_Object scroll_bar_width, vertical_scroll_bar_type;
+ Lisp_Object BUFFER_INTERNAL_FIELD (scroll_bar_width), BUFFER_INTERNAL_FIELD (vertical_scroll_bar_type);
/* Non-nil means indicate lines not displaying text (in a style
like vi). */
- Lisp_Object indicate_empty_lines;
+ Lisp_Object BUFFER_INTERNAL_FIELD (indicate_empty_lines);
/* Non-nil means indicate buffer boundaries and scrolling. */
- Lisp_Object indicate_buffer_boundaries;
+ Lisp_Object BUFFER_INTERNAL_FIELD (indicate_buffer_boundaries);
/* Logical to physical fringe bitmap mappings. */
- Lisp_Object fringe_indicator_alist;
+ Lisp_Object BUFFER_INTERNAL_FIELD (fringe_indicator_alist);
/* Logical to physical cursor bitmap mappings. */
- Lisp_Object fringe_cursor_alist;
+ Lisp_Object BUFFER_INTERNAL_FIELD (fringe_cursor_alist);
/* Time stamp updated each time this buffer is displayed in a window. */
- Lisp_Object display_time;
+ Lisp_Object BUFFER_INTERNAL_FIELD (display_time);
/* If scrolling the display because point is below the bottom of a
window showing this buffer, try to choose a window start so
that point ends up this number of lines from the top of the
window. Nil means that scrolling method isn't used. */
- Lisp_Object scroll_up_aggressively;
+ Lisp_Object BUFFER_INTERNAL_FIELD (scroll_up_aggressively);
/* If scrolling the display because point is above the top of a
window showing this buffer, try to choose a window start so
that point ends up this number of lines from the bottom of the
window. Nil means that scrolling method isn't used. */
- Lisp_Object scroll_down_aggressively;
+ Lisp_Object BUFFER_INTERNAL_FIELD (scroll_down_aggressively);
/* Desired cursor type in this buffer. See the doc string of
per-buffer variable `cursor-type'. */
- Lisp_Object cursor_type;
+ Lisp_Object BUFFER_INTERNAL_FIELD (cursor_type);
/* An integer > 0 means put that number of pixels below text lines
in the display of this buffer. */
- Lisp_Object extra_line_spacing;
+ Lisp_Object BUFFER_INTERNAL_FIELD (extra_line_spacing);
/* *Cursor type to display in non-selected windows.
t means to use hollow box cursor.
See `cursor-type' for other values. */
- Lisp_Object cursor_in_non_selected_windows;
+ Lisp_Object BUFFER_INTERNAL_FIELD (cursor_in_non_selected_windows);
};
\f
from the start of a buffer structure. */
#define PER_BUFFER_VAR_OFFSET(VAR) \
- offsetof (struct buffer, VAR)
+ offsetof (struct buffer, BUFFER_INTERNAL_FIELD (VAR))
/* Return the index of buffer-local variable VAR. Each per-buffer
variable has an index > 0 associated with it, except when it always
CHECK_CHARACTER (TOP);
AFTER_POTENTIAL_GC ();
c = XFASTINT (TOP);
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
MAKE_CHAR_MULTIBYTE (c);
XSETFASTINT (TOP, syntax_code_spec[(int) SYNTAX (c)]);
}
check_mark (int for_region)
{
Lisp_Object tem;
- tem = Fmarker_buffer (current_buffer->mark);
+ tem = Fmarker_buffer (B_ (current_buffer, mark));
if (NILP (tem) || (XBUFFER (tem) != current_buffer))
error (for_region ? "The mark is not set now, so there is no region"
: "The mark is not set now");
if (!NILP (Vtransient_mark_mode) && NILP (Vmark_even_if_inactive)
- && NILP (current_buffer->mark_active))
+ && NILP (B_ (current_buffer, mark_active)))
xsignal0 (Qmark_inactive);
}
else if (*string == '*')
{
string++;
- if (!NILP (current_buffer->read_only))
+ if (!NILP (B_ (current_buffer, read_only)))
{
if (!NILP (record_flag))
{
case 'D': /* Directory name. */
args[i] = Fread_file_name (callint_message, Qnil,
- current_buffer->directory, Qlambda, Qnil,
+ B_ (current_buffer, directory), Qlambda, Qnil,
Qfile_directory_p);
break;
case 'm': /* Value of mark. Does not do I/O. */
check_mark (0);
/* visargs[i] = Qnil; */
- args[i] = current_buffer->mark;
+ args[i] = B_ (current_buffer, mark);
varies[i] = 2;
break;
check_mark (1);
set_marker_both (point_marker, Qnil, PT, PT_BYTE);
/* visargs[i+1] = Qnil; */
- foo = marker_position (current_buffer->mark);
+ foo = marker_position (B_ (current_buffer, mark));
/* visargs[i] = Qnil; */
- args[i] = PT < foo ? point_marker : current_buffer->mark;
+ args[i] = PT < foo ? point_marker : B_ (current_buffer, mark);
varies[i] = 3;
- args[++i] = PT > foo ? point_marker : current_buffer->mark;
+ args[++i] = PT > foo ? point_marker : B_ (current_buffer, mark);
varies[i] = 4;
break;
if (nargs >= 2 && ! NILP (args[1]))
{
- infile = Fexpand_file_name (args[1], current_buffer->directory);
+ infile = Fexpand_file_name (args[1], B_ (current_buffer, directory));
CHECK_STRING (infile);
}
else
{
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
- current_dir = current_buffer->directory;
+ current_dir = B_ (current_buffer, directory);
GCPRO4 (infile, buffer, current_dir, error_file);
if (NILP (Ffile_accessible_directory_p (current_dir)))
report_file_error ("Setting current directory",
- Fcons (current_buffer->directory, Qnil));
+ Fcons (B_ (current_buffer, directory), Qnil));
if (STRING_MULTIBYTE (infile))
infile = ENCODE_FILE (infile);
/* In unibyte mode, character code conversion should not take
place but EOL conversion should. So, setup raw-text or one
of the subsidiary according to the information just setup. */
- if (NILP (current_buffer->enable_multibyte_characters)
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))
&& !NILP (val))
val = raw_text_coding_system (val);
setup_coding_system (val, &process_coding);
if (!NILP (buffer))
{
- if (NILP (current_buffer->enable_multibyte_characters)
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))
&& ! CODING_MAY_REQUIRE_DECODING (&process_coding))
insert_1_both (buf, nread, nread, 0, 1, 0);
else
/* Decide coding-system of the contents of the temporary file. */
if (!NILP (Vcoding_system_for_write))
val = Vcoding_system_for_write;
- else if (NILP (current_buffer->enable_multibyte_characters))
+ else if (NILP (B_ (current_buffer, enable_multibyte_characters)))
val = Qraw_text;
else
{
register int inword = flag == CASE_DOWN;
/* If the case table is flagged as modified, rescan it. */
- if (NILP (XCHAR_TABLE (current_buffer->downcase_table)->extras[1]))
- Fset_case_table (current_buffer->downcase_table);
+ if (NILP (XCHAR_TABLE (B_ (current_buffer, downcase_table))->extras[1]))
+ Fset_case_table (B_ (current_buffer, downcase_table));
if (INTEGERP (obj))
{
int flagbits = (CHAR_ALT | CHAR_SUPER | CHAR_HYPER
| CHAR_SHIFT | CHAR_CTL | CHAR_META);
int flags = XINT (obj) & flagbits;
- int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters));
/* If the character has higher bits set
above the flags, return it unchanged.
{
register int c;
register int inword = flag == CASE_DOWN;
- register int multibyte = !NILP (current_buffer->enable_multibyte_characters);
+ register int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters));
EMACS_INT start, end;
EMACS_INT start_byte, end_byte;
EMACS_INT first = -1, last; /* Position of first and last changes. */
return;
/* If the case table is flagged as modified, rescan it. */
- if (NILP (XCHAR_TABLE (current_buffer->downcase_table)->extras[1]))
- Fset_case_table (current_buffer->downcase_table);
+ if (NILP (XCHAR_TABLE (B_ (current_buffer, downcase_table))->extras[1]))
+ Fset_case_table (B_ (current_buffer, downcase_table));
validate_region (&b, &e);
start = XFASTINT (b);
doc: /* Return the case table of the current buffer. */)
(void)
{
- return current_buffer->downcase_table;
+ return B_ (current_buffer, downcase_table);
}
DEFUN ("standard-case-table", Fstandard_case_table, Sstandard_case_table, 0, 0, 0,
}
else
{
- current_buffer->downcase_table = table;
- current_buffer->upcase_table = up;
- current_buffer->case_canon_table = canon;
- current_buffer->case_eqv_table = eqv;
+ B_ (current_buffer, downcase_table) = table;
+ B_ (current_buffer, upcase_table) = up;
+ B_ (current_buffer, case_canon_table) = canon;
+ B_ (current_buffer, case_eqv_table) = eqv;
}
return table;
check_category_table (Lisp_Object table)
{
if (NILP (table))
- return current_buffer->category_table;
+ return B_ (current_buffer, category_table);
CHECK_TYPE (!NILP (Fcategory_table_p (table)), Qcategory_table_p, table);
return table;
}
This is the one specified by the current buffer. */)
(void)
{
- return current_buffer->category_table;
+ return B_ (current_buffer, category_table);
}
DEFUN ("standard-category-table", Fstandard_category_table,
{
int idx;
table = check_category_table (table);
- current_buffer->category_table = table;
+ B_ (current_buffer, category_table) = table;
/* Indicate that this buffer now has a specified category table. */
idx = PER_BUFFER_VAR_IDX (category_table);
SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1);
Lisp_Object
char_category_set (int c)
{
- return CHAR_TABLE_REF (current_buffer->category_table, c);
+ return CHAR_TABLE_REF (B_ (current_buffer, category_table), c);
}
DEFUN ("char-category-set", Fchar_category_set, Schar_category_set, 1, 1, 0,
/* The standard category table is stored where it will automatically
be used in all new buffers. */
-#define Vstandard_category_table buffer_defaults.category_table
+#define Vstandard_category_table B_ (&buffer_defaults, category_table)
/* Return the category set of character C in the current category table. */
#define CATEGORY_SET(c) char_category_set (c)
{
/* current_buffer is null at early stages of Emacs initialization. */
if (current_buffer == 0
- || NILP (current_buffer->enable_multibyte_characters))
+ || NILP (B_ (current_buffer, enable_multibyte_characters)))
return nbytes;
return multibyte_chars_in_text (ptr, nbytes);
pos = XFASTINT (position);
p = CHAR_POS_ADDR (pos);
}
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
return make_number (*p);
}
else
do \
{ \
CHARIDX++; \
- if (!NILP (current_buffer->enable_multibyte_characters)) \
+ if (!NILP (B_ (current_buffer, enable_multibyte_characters))) \
{ \
unsigned char *ptr = BYTE_POS_ADDR (BYTEIDX); \
int len; \
do \
{ \
(charpos)++; \
- if (NILP (current_buffer->enable_multibyte_characters)) \
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))) \
(bytepos)++; \
else \
INC_POS ((bytepos)); \
do \
{ \
(charpos)--; \
- if (NILP (current_buffer->enable_multibyte_characters)) \
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))) \
(bytepos)--; \
else \
DEC_POS ((bytepos)); \
#define ASCII_CHAR_WIDTH(c) \
(c < 0x20 \
? (c == '\t' \
- ? XFASTINT (current_buffer->tab_width) \
- : (c == '\n' ? 0 : (NILP (current_buffer->ctl_arrow) ? 4 : 2))) \
+ ? XFASTINT (B_ (current_buffer, tab_width)) \
+ : (c == '\n' ? 0 : (NILP (B_ (current_buffer, ctl_arrow)) ? 4 : 2))) \
: (c < 0x7f \
? 1 \
- : ((NILP (current_buffer->ctl_arrow) ? 4 : 2))))
+ : ((NILP (B_ (current_buffer, ctl_arrow)) ? 4 : 2))))
/* Return the width of character C. The width is measured by how many
columns C will occupy on the screen when displayed in the current
EMACS_INT from, from_byte, to, stop, stop_byte;
int i;
Lisp_Object val;
- int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters));
validate_region (&beg, &end);
from = XFASTINT (beg);
}
if (remove_boundary
- && CONSP (current_buffer->undo_list)
- && NILP (XCAR (current_buffer->undo_list)))
+ && CONSP (B_ (current_buffer, undo_list))
+ && NILP (XCAR (B_ (current_buffer, undo_list))))
/* Remove the undo_boundary that was just pushed. */
- current_buffer->undo_list = XCDR (current_buffer->undo_list);
+ B_ (current_buffer, undo_list) = XCDR (B_ (current_buffer, undo_list));
/* Barf if the key that invoked this was not a character. */
if (!CHARACTERP (last_command_event))
EMACS_INT chars_to_delete = 0;
EMACS_INT spaces_to_insert = 0;
- overwrite = current_buffer->overwrite_mode;
+ overwrite = B_ (current_buffer, overwrite_mode);
if (!NILP (Vbefore_change_functions) || !NILP (Vafter_change_functions))
hairy = 1;
/* At first, get multi-byte form of C in STR. */
- if (!NILP (current_buffer->enable_multibyte_characters))
+ if (!NILP (B_ (current_buffer, enable_multibyte_characters)))
{
len = CHAR_STRING (c, str);
if (len == 1)
synt = SYNTAX (c);
- if (!NILP (current_buffer->abbrev_mode)
+ if (!NILP (B_ (current_buffer, abbrev_mode))
&& synt != Sword
- && NILP (current_buffer->read_only)
+ && NILP (B_ (current_buffer, read_only))
&& PT > BEGV
- && (SYNTAX (!NILP (current_buffer->enable_multibyte_characters)
+ && (SYNTAX (!NILP (B_ (current_buffer, enable_multibyte_characters))
? XFASTINT (Fprevious_char ())
: UNIBYTE_TO_CHAR (XFASTINT (Fprevious_char ())))
== Sword))
if (chars_to_delete)
{
- int mc = ((NILP (current_buffer->enable_multibyte_characters)
+ int mc = ((NILP (B_ (current_buffer, enable_multibyte_characters))
&& SINGLE_BYTE_CHAR_P (c))
? UNIBYTE_TO_CHAR (c) : c);
Lisp_Object string = Fmake_string (make_number (n), make_number (mc));
if ((CHAR_TABLE_P (Vauto_fill_chars)
? !NILP (CHAR_TABLE_REF (Vauto_fill_chars, c))
: (c == ' ' || c == '\n'))
- && !NILP (current_buffer->auto_fill_function))
+ && !NILP (B_ (current_buffer, auto_fill_function)))
{
Lisp_Object tem;
that. Must have the newline in place already so filling and
justification, if any, know where the end is going to be. */
SET_PT_BOTH (PT - 1, PT_BYTE - 1);
- tem = call0 (current_buffer->auto_fill_function);
+ tem = call0 (B_ (current_buffer, auto_fill_function));
/* Test PT < ZV in case the auto-fill-function is strange. */
if (c == '\n' && PT < ZV)
SET_PT_BOTH (PT + 1, PT_BYTE + 1);
set_buffer_internal (XBUFFER (coding->dst_object));
if (GPT != PT)
move_gap_both (PT, PT_BYTE);
- undo_list = current_buffer->undo_list;
- current_buffer->undo_list = Qt;
+ undo_list = B_ (current_buffer, undo_list);
+ B_ (current_buffer, undo_list) = Qt;
}
coding->consumed = coding->consumed_char = 0;
decode_eol (coding);
if (BUFFERP (coding->dst_object))
{
- current_buffer->undo_list = undo_list;
+ B_ (current_buffer, undo_list) = undo_list;
record_insert (coding->dst_pos, coding->produced_char);
}
return coding->result;
{
set_buffer_internal (XBUFFER (coding->dst_object));
coding->dst_multibyte
- = ! NILP (current_buffer->enable_multibyte_characters);
+ = ! NILP (B_ (current_buffer, enable_multibyte_characters));
}
coding->consumed = coding->consumed_char = 0;
doesn't compile new regexps. */
Fset (Fmake_local_variable (Qinhibit_modification_hooks), Qt);
Ferase_buffer ();
- current_buffer->undo_list = Qt;
- current_buffer->enable_multibyte_characters = multibyte ? Qt : Qnil;
+ B_ (current_buffer, undo_list) = Qt;
+ B_ (current_buffer, enable_multibyte_characters) = multibyte ? Qt : Qnil;
set_buffer_internal (current);
return workbuf;
}
coding->dst_object = coding->src_object;
coding->dst_pos = PT;
coding->dst_pos_byte = PT_BYTE;
- coding->dst_multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ coding->dst_multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters));
if (CODING_REQUIRE_DETECTION (coding))
detect_coding (coding);
coding->dst_pos = BUF_PT (XBUFFER (dst_object));
coding->dst_pos_byte = BUF_PT_BYTE (XBUFFER (dst_object));
coding->dst_multibyte
- = ! NILP (XBUFFER (dst_object)->enable_multibyte_characters);
+ = ! NILP (B_ (XBUFFER (dst_object), enable_multibyte_characters));
}
else
{
TEMP_SET_PT_BOTH (saved_pt, saved_pt_byte);
else if (saved_pt < from + chars)
TEMP_SET_PT_BOTH (from, from_byte);
- else if (! NILP (current_buffer->enable_multibyte_characters))
+ else if (! NILP (B_ (current_buffer, enable_multibyte_characters)))
TEMP_SET_PT_BOTH (saved_pt + (coding->produced_char - chars),
saved_pt_byte + (coding->produced - bytes));
else
{
tail->bytepos = from_byte + coding->produced;
tail->charpos
- = (NILP (current_buffer->enable_multibyte_characters)
+ = (NILP (B_ (current_buffer, enable_multibyte_characters))
? tail->bytepos : from + coding->produced_char);
}
}
set_buffer_temp (current);
}
coding->dst_multibyte
- = ! NILP (XBUFFER (dst_object)->enable_multibyte_characters);
+ = ! NILP (B_ (XBUFFER (dst_object), enable_multibyte_characters));
}
else if (EQ (dst_object, Qt))
{
TEMP_SET_PT_BOTH (saved_pt, saved_pt_byte);
else if (saved_pt < from + chars)
TEMP_SET_PT_BOTH (from, from_byte);
- else if (! NILP (current_buffer->enable_multibyte_characters))
+ else if (! NILP (B_ (current_buffer, enable_multibyte_characters)))
TEMP_SET_PT_BOTH (saved_pt + (coding->produced_char - chars),
saved_pt_byte + (coding->produced - bytes));
else
{
tail->bytepos = from_byte + coding->produced;
tail->charpos
- = (NILP (current_buffer->enable_multibyte_characters)
+ = (NILP (B_ (current_buffer, enable_multibyte_characters))
? tail->bytepos : from + coding->produced_char);
}
}
return detect_coding_system (BYTE_POS_ADDR (from_byte),
to - from, to_byte - from_byte,
!NILP (highest),
- !NILP (current_buffer
- ->enable_multibyte_characters),
+ !NILP (B_ (current_buffer
+ , enable_multibyte_characters)),
Qnil);
}
CHECK_NUMBER_COERCE_MARKER (end);
if (XINT (start) < BEG || XINT (end) > Z || XINT (start) > XINT (end))
args_out_of_range (start, end);
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
return Qt;
start_byte = CHAR_TO_BYTE (XINT (start));
end_byte = CHAR_TO_BYTE (XINT (end));
validate_region (&start, &end);
from = XINT (start);
to = XINT (end);
- if (NILP (current_buffer->enable_multibyte_characters)
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))
|| (ascii_compatible
&& (to - from) == (CHAR_TO_BYTE (to) - (CHAR_TO_BYTE (from)))))
return Qnil;
CHECK_NUMBER_COERCE_MARKER (end);
if (XINT (start) < BEG || XINT (end) > Z || XINT (start) > XINT (end))
args_out_of_range (start, end);
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
return Qnil;
start_byte = CHAR_TO_BYTE (XINT (start));
end_byte = CHAR_TO_BYTE (XINT (end));
if (NILP (string))
{
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
error ("Attempt to shape unibyte text");
validate_region (&start, &end);
from = XFASTINT (start);
cmp_it->stop_pos = endpos = start;
cmp_it->ch = -1;
}
- if (NILP (current_buffer->enable_multibyte_characters)
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))
|| NILP (Vauto_composition_mode))
return;
if (bytepos < 0)
return new_pt;
}
- if (NILP (current_buffer->enable_multibyte_characters)
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))
|| NILP (Vauto_composition_mode))
return new_pt;
if (!find_composition (from, to, &start, &end, &prop, string))
{
- if (!NILP (current_buffer->enable_multibyte_characters)
+ if (!NILP (B_ (current_buffer, enable_multibyte_characters))
&& ! NILP (Vauto_composition_mode)
&& find_automatic_composition (from, to, &start, &end, &gstring,
string))
}
else
{
- tem1 = assq_no_quit (var, current_buffer->local_var_alist);
+ tem1 = assq_no_quit (var, B_ (current_buffer, local_var_alist));
XSETBUFFER (blv->where, current_buffer);
}
}
tem1 = Fassq (symbol,
(blv->frame_local
? XFRAME (where)->param_alist
- : XBUFFER (where)->local_var_alist));
+ : B_ (XBUFFER (where), local_var_alist)));
blv->where = where;
blv->found = 1;
bindings, not for frame-local bindings. */
eassert (!blv->frame_local);
tem1 = Fcons (symbol, XCDR (blv->defcell));
- XBUFFER (where)->local_var_alist
- = Fcons (tem1, XBUFFER (where)->local_var_alist);
+ B_ (XBUFFER (where), local_var_alist)
+ = Fcons (tem1, B_ (XBUFFER (where), local_var_alist));
}
}
if (let_shadows_global_binding_p (symbol))
message ("Making %s local to %s while let-bound!",
SDATA (SYMBOL_NAME (variable)),
- SDATA (current_buffer->name));
+ SDATA (B_ (current_buffer, name)));
}
}
/* Make sure this buffer has its own value of symbol. */
XSETSYMBOL (variable, sym); /* Update in case of aliasing. */
- tem = Fassq (variable, current_buffer->local_var_alist);
+ tem = Fassq (variable, B_ (current_buffer, local_var_alist));
if (NILP (tem))
{
if (let_shadows_buffer_binding_p (sym))
default value. */
find_symbol_value (variable);
- current_buffer->local_var_alist
+ B_ (current_buffer, local_var_alist)
= Fcons (Fcons (variable, XCDR (blv->defcell)),
- current_buffer->local_var_alist);
+ B_ (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. */
/* Get rid of this buffer's alist element, if any. */
XSETSYMBOL (variable, sym); /* Propagate variable indirection. */
- tem = Fassq (variable, current_buffer->local_var_alist);
+ tem = Fassq (variable, B_ (current_buffer, local_var_alist));
if (!NILP (tem))
- current_buffer->local_var_alist
- = Fdelq (tem, current_buffer->local_var_alist);
+ B_ (current_buffer, local_var_alist)
+ = Fdelq (tem, B_ (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
XSETBUFFER (tmp, buf);
XSETSYMBOL (variable, sym); /* Update in case of aliasing. */
- for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
+ for (tail = B_ (buf, local_var_alist); CONSP (tail); tail = XCDR (tail))
{
elt = XCAR (tail);
if (EQ (variable, XCAR (elt)))
&& !(W)->pseudo_window_p \
&& FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \
&& BUFFERP ((W)->buffer) \
- && !NILP (XBUFFER ((W)->buffer)->mode_line_format) \
+ && !NILP (B_ (XBUFFER ((W)->buffer), mode_line_format)) \
&& WINDOW_TOTAL_LINES (W) > 1)
/* Value is non-zero if window W wants a header line. */
&& !(W)->pseudo_window_p \
&& FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \
&& BUFFERP ((W)->buffer) \
- && !NILP (XBUFFER ((W)->buffer)->header_line_format) \
- && WINDOW_TOTAL_LINES (W) > 1 + !NILP (XBUFFER ((W)->buffer)->mode_line_format))
+ && !NILP (B_ (XBUFFER ((W)->buffer), header_line_format)) \
+ && WINDOW_TOTAL_LINES (W) > 1 + !NILP (B_ (XBUFFER ((W)->buffer), mode_line_format)))
/* Return proper value to be used as baseline offset of font that has
{
buf = XCDR (XCAR (tail));
/* Ignore buffers that aren't included in buffer lists. */
- if (SREF (XBUFFER (buf)->name, 0) == ' ')
+ if (SREF (B_ (XBUFFER (buf), name), 0) == ' ')
continue;
if (vecp == end)
goto changed;
goto changed;
if (vecp == end)
goto changed;
- if (!EQ (*vecp++, XBUFFER (buf)->read_only))
+ if (!EQ (*vecp++, B_ (XBUFFER (buf), read_only)))
goto changed;
if (vecp == end)
goto changed;
{
buf = XCDR (XCAR (tail));
/* Ignore buffers that aren't included in buffer lists. */
- if (SREF (XBUFFER (buf)->name, 0) == ' ')
+ if (SREF (B_ (XBUFFER (buf), name), 0) == ' ')
continue;
*vecp++ = buf;
- *vecp++ = XBUFFER (buf)->read_only;
+ *vecp++ = B_ (XBUFFER (buf), read_only);
*vecp++ = Fbuffer_modified_p (buf);
}
/* Fill up the vector with lambdas (always at least one). */
if (!NILP (Vtransient_mark_mode)
&& NILP (Vmark_even_if_inactive)
- && NILP (current_buffer->mark_active))
+ && NILP (B_ (current_buffer, mark_active)))
xsignal0 (Qmark_inactive);
- m = Fmarker_position (current_buffer->mark);
+ m = Fmarker_position (B_ (current_buffer, mark));
if (NILP (m))
error ("The mark is not set now, so there is no region");
If you set the marker not to point anywhere, the buffer will have no mark. */)
(void)
{
- return current_buffer->mark;
+ return B_ (current_buffer, mark);
}
\f
== current_buffer);
return Fcons (Fpoint_marker (),
- Fcons (Fcopy_marker (current_buffer->mark, Qnil),
+ Fcons (Fcopy_marker (B_ (current_buffer, mark), Qnil),
Fcons (visible ? Qt : Qnil,
- Fcons (current_buffer->mark_active,
+ Fcons (B_ (current_buffer, mark_active),
selected_window))));
}
/* Mark marker. */
info = XCDR (info);
tem = XCAR (info);
- omark = Fmarker_position (current_buffer->mark);
- Fset_marker (current_buffer->mark, tem, Fcurrent_buffer ());
+ omark = Fmarker_position (B_ (current_buffer, mark));
+ Fset_marker (B_ (current_buffer, mark), tem, Fcurrent_buffer ());
nmark = Fmarker_position (tem);
unchain_marker (XMARKER (tem));
/* Mark active */
info = XCDR (info);
tem = XCAR (info);
- tem1 = current_buffer->mark_active;
- current_buffer->mark_active = tem;
+ tem1 = B_ (current_buffer, mark_active);
+ B_ (current_buffer, mark_active) = tem;
if (!NILP (Vrun_hooks))
{
/* If mark is active now, and either was not active
or was at a different place, run the activate hook. */
- if (! NILP (current_buffer->mark_active))
+ if (! NILP (B_ (current_buffer, mark_active)))
{
if (! EQ (omark, nmark))
call1 (Vrun_hooks, intern ("activate-mark-hook"));
Lisp_Object temp;
if (PT <= BEGV)
XSETFASTINT (temp, 0);
- else if (!NILP (current_buffer->enable_multibyte_characters))
+ else if (!NILP (B_ (current_buffer, enable_multibyte_characters)))
{
EMACS_INT pos = PT_BYTE;
DEC_POS (pos);
pos_byte = CHAR_TO_BYTE (XINT (pos));
}
- if (!NILP (current_buffer->enable_multibyte_characters))
+ if (!NILP (B_ (current_buffer, enable_multibyte_characters)))
{
DEC_POS (pos_byte);
XSETFASTINT (val, FETCH_CHAR (pos_byte));
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 (XFASTINT (val), str);
else
{
CHECK_NUMBER (character);
CHECK_NUMBER (count);
- if (!NILP (current_buffer->enable_multibyte_characters))
+ if (!NILP (B_ (current_buffer, enable_multibyte_characters)))
len = CHAR_STRING (XFASTINT (character), str);
else
str[0] = XFASTINT (character), len = 1;
if (XINT (byte) < 0 || XINT (byte) > 255)
args_out_of_range_3 (byte, make_number (0), make_number (255));
if (XINT (byte) >= 128
- && ! NILP (current_buffer->enable_multibyte_characters))
+ && ! NILP (B_ (current_buffer, enable_multibyte_characters)))
XSETFASTINT (byte, BYTE8_TO_CHAR (XINT (byte)));
return Finsert_char (byte, count, inherit);
}
if (start < GPT && GPT < end)
move_gap (start);
- if (! NILP (current_buffer->enable_multibyte_characters))
+ if (! NILP (B_ (current_buffer, enable_multibyte_characters)))
result = make_uninit_multibyte_string (end - start, end_byte - start_byte);
else
result = make_uninit_string (end - start);
if (NILP (buf))
nsberror (buffer);
bp = XBUFFER (buf);
- if (NILP (bp->name))
+ if (NILP (B_ (bp, name)))
error ("Selecting deleted buffer");
if (NILP (start))
register EMACS_INT begp1, endp1, begp2, endp2, temp;
register struct buffer *bp1, *bp2;
register Lisp_Object trt
- = (!NILP (current_buffer->case_fold_search)
- ? current_buffer->case_canon_table : Qnil);
+ = (!NILP (B_ (current_buffer, case_fold_search))
+ ? B_ (current_buffer, case_canon_table) : Qnil);
EMACS_INT chars = 0;
EMACS_INT i1, i2, i1_byte, i2_byte;
if (NILP (buf1))
nsberror (buffer1);
bp1 = XBUFFER (buf1);
- if (NILP (bp1->name))
+ if (NILP (B_ (bp1, name)))
error ("Selecting deleted buffer");
}
if (NILP (buf2))
nsberror (buffer2);
bp2 = XBUFFER (buf2);
- if (NILP (bp2->name))
+ if (NILP (B_ (bp2, name)))
error ("Selecting deleted buffer");
}
QUIT;
- if (! NILP (bp1->enable_multibyte_characters))
+ if (! NILP (B_ (bp1, enable_multibyte_characters)))
{
c1 = BUF_FETCH_MULTIBYTE_CHAR (bp1, i1_byte);
BUF_INC_POS (bp1, i1_byte);
i1++;
}
- if (! NILP (bp2->enable_multibyte_characters))
+ if (! NILP (B_ (bp2, enable_multibyte_characters)))
{
c2 = BUF_FETCH_MULTIBYTE_CHAR (bp2, i2_byte);
BUF_INC_POS (bp2, i2_byte);
static Lisp_Object
subst_char_in_region_unwind (Lisp_Object arg)
{
- return current_buffer->undo_list = arg;
+ return B_ (current_buffer, undo_list) = arg;
}
static Lisp_Object
subst_char_in_region_unwind_1 (Lisp_Object arg)
{
- return current_buffer->filename = arg;
+ return B_ (current_buffer, filename) = arg;
}
DEFUN ("subst-char-in-region", Fsubst_char_in_region,
#define COMBINING_BOTH (COMBINING_BEFORE | COMBINING_AFTER)
int maybe_byte_combining = COMBINING_NO;
EMACS_INT last_changed = 0;
- int multibyte_p = !NILP (current_buffer->enable_multibyte_characters);
+ int multibyte_p = !NILP (B_ (current_buffer, enable_multibyte_characters));
restart:
if (!changed && !NILP (noundo))
{
record_unwind_protect (subst_char_in_region_unwind,
- current_buffer->undo_list);
- current_buffer->undo_list = Qt;
+ B_ (current_buffer, undo_list));
+ B_ (current_buffer, undo_list) = Qt;
/* Don't do file-locking. */
record_unwind_protect (subst_char_in_region_unwind_1,
- current_buffer->filename);
- current_buffer->filename = Qnil;
+ B_ (current_buffer, filename));
+ B_ (current_buffer, filename) = Qnil;
}
if (pos_byte < GPT_BYTE)
struct gcpro gcpro1;
- tem = current_buffer->undo_list;
+ tem = B_ (current_buffer, undo_list);
GCPRO1 (tem);
/* Make a multibyte string containing this single character. */
INC_POS (pos_byte_next);
if (! NILP (noundo))
- current_buffer->undo_list = tem;
+ B_ (current_buffer, undo_list) = tem;
UNGCPRO;
}
int cnt; /* Number of changes made. */
EMACS_INT size; /* Size of translate table. */
EMACS_INT pos, pos_byte, end_pos;
- int multibyte = !NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters));
int string_multibyte;
Lisp_Object val;
? XMARKER (XCAR (data))->buffer
: XBUFFER (data));
- if (buf && buf != current_buffer && !NILP (buf->pt_marker))
+ if (buf && buf != current_buffer && !NILP (B_ (buf, pt_marker)))
{ /* If `buf' uses markers to keep track of PT, BEGV, and ZV (as
is the case if it is or has an indirect buffer), then make
sure it is current before we update BEGV, so
if (XINT (c1) == XINT (c2))
return Qt;
- if (NILP (current_buffer->case_fold_search))
+ if (NILP (B_ (current_buffer, case_fold_search)))
return Qnil;
/* Do these in separate statements,
then compare the variables.
because of the way DOWNCASE uses temp variables. */
i1 = XFASTINT (c1);
- if (NILP (current_buffer->enable_multibyte_characters)
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))
&& ! ASCII_CHAR_P (i1))
{
MAKE_CHAR_MULTIBYTE (i1);
}
i2 = XFASTINT (c2);
- if (NILP (current_buffer->enable_multibyte_characters)
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))
&& ! ASCII_CHAR_P (i2))
{
MAKE_CHAR_MULTIBYTE (i2);
/* Use the buffer's default-directory if DEFAULT_DIRECTORY is omitted. */
if (NILP (default_directory))
- default_directory = current_buffer->directory;
+ default_directory = B_ (current_buffer, directory);
if (! STRINGP (default_directory))
{
#ifdef DOS_NT
struct stat st;
Lisp_Object handler;
- absname = expand_and_dir_to_file (filename, current_buffer->directory);
+ absname = expand_and_dir_to_file (filename, B_ (current_buffer, directory));
/* If the file name has special constructs in it,
call the corresponding file handler. */
struct stat st;
Lisp_Object handler;
- absname = expand_and_dir_to_file (filename, current_buffer->directory);
+ absname = expand_and_dir_to_file (filename, B_ (current_buffer, directory));
/* If the file name has special constructs in it,
call the corresponding file handler. */
context_t context;
#endif
- absname = expand_and_dir_to_file (filename, current_buffer->directory);
+ absname = expand_and_dir_to_file (filename, B_ (current_buffer, directory));
/* If the file name has special constructs in it,
call the corresponding file handler. */
context_t parsed_con;
#endif
- absname = Fexpand_file_name (filename, current_buffer->directory);
+ absname = Fexpand_file_name (filename, B_ (current_buffer, directory));
/* If the file name has special constructs in it,
call the corresponding file handler. */
struct stat st;
Lisp_Object handler;
- absname = expand_and_dir_to_file (filename, current_buffer->directory);
+ absname = expand_and_dir_to_file (filename, B_ (current_buffer, directory));
/* If the file name has special constructs in it,
call the corresponding file handler. */
Lisp_Object absname, encoded_absname;
Lisp_Object handler;
- absname = Fexpand_file_name (filename, current_buffer->directory);
+ absname = Fexpand_file_name (filename, B_ (current_buffer, directory));
CHECK_NUMBER (mode);
/* If the file name has special constructs in it,
if (! lisp_time_argument (time, &sec, &usec))
error ("Invalid time specification");
- absname = Fexpand_file_name (filename, current_buffer->directory);
+ absname = Fexpand_file_name (filename, B_ (current_buffer, directory));
/* If the file name has special constructs in it,
call the corresponding file handler. */
absname1 = Qnil;
GCPRO2 (absname1, file2);
- absname1 = expand_and_dir_to_file (file1, current_buffer->directory);
- absname2 = expand_and_dir_to_file (file2, current_buffer->directory);
+ absname1 = expand_and_dir_to_file (file1, B_ (current_buffer, directory));
+ absname2 = expand_and_dir_to_file (file2, B_ (current_buffer, directory));
UNGCPRO;
/* If the file name has special constructs in it,
TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
/* Now we are safe to change the buffer's multibyteness directly. */
- current_buffer->enable_multibyte_characters = multibyte;
- current_buffer->undo_list = undo_list;
+ B_ (current_buffer, enable_multibyte_characters) = multibyte;
+ B_ (current_buffer, undo_list) = undo_list;
return Qnil;
}
if (current_buffer->base_buffer && ! NILP (visit))
error ("Cannot do file visiting in an indirect buffer");
- if (!NILP (current_buffer->read_only))
+ if (!NILP (B_ (current_buffer, read_only)))
Fbarf_if_buffer_read_only ();
val = Qnil;
buf = XBUFFER (buffer);
delete_all_overlays (buf);
- buf->directory = current_buffer->directory;
- buf->read_only = Qnil;
- buf->filename = Qnil;
- buf->undo_list = Qt;
+ B_ (buf, directory) = B_ (current_buffer, directory);
+ B_ (buf, read_only) = Qnil;
+ B_ (buf, filename) = Qnil;
+ B_ (buf, undo_list) = Qt;
eassert (buf->overlays_before == NULL);
eassert (buf->overlays_after == NULL);
set_buffer_internal (buf);
Ferase_buffer ();
- buf->enable_multibyte_characters = Qnil;
+ B_ (buf, enable_multibyte_characters) = Qnil;
insert_1_both ((char *) read_buf, nread, nread, 0, 0, 0);
TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
else
CHECK_CODING_SYSTEM (coding_system);
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
/* We must suppress all character code conversion except for
end-of-line conversion. */
coding_system = raw_text_coding_system (coding_system);
we cannot use this method; giveup and try the other. */
if (same_at_end > same_at_start
&& FETCH_BYTE (same_at_end - 1) >= 0200
- && ! NILP (current_buffer->enable_multibyte_characters)
+ && ! NILP (B_ (current_buffer, enable_multibyte_characters))
&& (CODING_MAY_REQUIRE_DECODING (&coding)))
giveup_match_end = 1;
break;
/* Extend the start of non-matching text area to multibyte
character boundary. */
- if (! NILP (current_buffer->enable_multibyte_characters))
+ if (! NILP (B_ (current_buffer, enable_multibyte_characters)))
while (same_at_start > BEGV_BYTE
&& ! CHAR_HEAD_P (FETCH_BYTE (same_at_start)))
same_at_start--;
/* Extend the end of non-matching text area to multibyte
character boundary. */
- if (! NILP (current_buffer->enable_multibyte_characters))
+ if (! NILP (B_ (current_buffer, enable_multibyte_characters)))
while (same_at_end < ZV_BYTE
&& ! CHAR_HEAD_P (FETCH_BYTE (same_at_end)))
same_at_end++;
unsigned char *decoded;
EMACS_INT temp;
int this_count = SPECPDL_INDEX ();
- int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters));
Lisp_Object conversion_buffer;
conversion_buffer = code_conversion_save (1, multibyte);
/* Extend the start of non-matching text area to the previous
multibyte character boundary. */
- if (! NILP (current_buffer->enable_multibyte_characters))
+ if (! NILP (B_ (current_buffer, enable_multibyte_characters)))
while (same_at_start > BEGV_BYTE
&& ! CHAR_HEAD_P (FETCH_BYTE (same_at_start)))
same_at_start--;
/* Extend the end of non-matching text area to the next
multibyte character boundary. */
- if (! NILP (current_buffer->enable_multibyte_characters))
+ if (! NILP (B_ (current_buffer, enable_multibyte_characters)))
while (same_at_end < ZV_BYTE
&& ! CHAR_HEAD_P (FETCH_BYTE (same_at_end)))
same_at_end++;
if (NILP (visit) && inserted > 0)
{
#ifdef CLASH_DETECTION
- if (!NILP (current_buffer->file_truename)
+ if (!NILP (B_ (current_buffer, file_truename))
/* Make binding buffer-file-name to nil effective. */
- && !NILP (current_buffer->filename)
+ && !NILP (B_ (current_buffer, filename))
&& SAVE_MODIFF >= MODIFF)
we_locked_file = 1;
#endif /* CLASH_DETECTION */
{
#ifdef CLASH_DETECTION
if (we_locked_file)
- unlock_file (current_buffer->file_truename);
+ unlock_file (B_ (current_buffer, file_truename));
#endif
Vdeactivate_mark = old_Vdeactivate_mark;
}
Lisp_Object unwind_data;
int count = SPECPDL_INDEX ();
- unwind_data = Fcons (current_buffer->enable_multibyte_characters,
- Fcons (current_buffer->undo_list,
+ unwind_data = Fcons (B_ (current_buffer, enable_multibyte_characters),
+ Fcons (B_ (current_buffer, undo_list),
Fcurrent_buffer ()));
- current_buffer->enable_multibyte_characters = Qnil;
- current_buffer->undo_list = Qt;
+ B_ (current_buffer, enable_multibyte_characters) = Qnil;
+ B_ (current_buffer, undo_list) = Qt;
record_unwind_protect (decide_coding_unwind, unwind_data);
if (inserted > 0 && ! NILP (Vset_auto_coding_function))
else
CHECK_CODING_SYSTEM (coding_system);
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
/* We must suppress all character code conversion except for
end-of-line conversion. */
coding_system = raw_text_coding_system (coding_system);
&& NILP (replace))
/* Visiting a file with these coding system makes the buffer
unibyte. */
- current_buffer->enable_multibyte_characters = Qnil;
+ B_ (current_buffer, enable_multibyte_characters) = Qnil;
}
- coding.dst_multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ coding.dst_multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters));
if (CODING_MAY_REQUIRE_DECODING (&coding)
&& (inserted > 0 || CODING_REQUIRE_FLUSHING (&coding)))
{
if (!NILP (visit))
{
- if (!EQ (current_buffer->undo_list, Qt) && !nochange)
- current_buffer->undo_list = Qnil;
+ if (!EQ (B_ (current_buffer, undo_list), Qt) && !nochange)
+ B_ (current_buffer, undo_list) = Qnil;
if (NILP (handler))
{
current_buffer->modtime = st.st_mtime;
current_buffer->modtime_size = st.st_size;
- current_buffer->filename = orig_filename;
+ B_ (current_buffer, filename) = orig_filename;
}
SAVE_MODIFF = MODIFF;
BUF_AUTOSAVE_MODIFF (current_buffer) = MODIFF;
- XSETFASTINT (current_buffer->save_length, Z - BEG);
+ XSETFASTINT (B_ (current_buffer, save_length), Z - BEG);
#ifdef CLASH_DETECTION
if (NILP (handler))
{
- if (!NILP (current_buffer->file_truename))
- unlock_file (current_buffer->file_truename);
+ if (!NILP (B_ (current_buffer, file_truename)))
+ unlock_file (B_ (current_buffer, file_truename));
unlock_file (filename);
}
#endif /* CLASH_DETECTION */
specbind (Qinhibit_modification_hooks, Qt);
/* Save old undo list and don't record undo for decoding. */
- old_undo = current_buffer->undo_list;
- current_buffer->undo_list = Qt;
+ old_undo = B_ (current_buffer, undo_list);
+ B_ (current_buffer, undo_list) = Qt;
if (NILP (replace))
{
if (NILP (visit))
{
- current_buffer->undo_list = old_undo;
+ B_ (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. */
- current_buffer->undo_list = EQ (old_undo, Qt) ? Qt : Qnil;
+ B_ (current_buffer, undo_list) = EQ (old_undo, Qt) ? Qt : Qnil;
unbind_to (count, Qnil);
}
Lisp_Object eol_parent = Qnil;
if (auto_saving
- && NILP (Fstring_equal (current_buffer->filename,
- current_buffer->auto_save_file_name)))
+ && NILP (Fstring_equal (B_ (current_buffer, filename),
+ B_ (current_buffer, auto_save_file_name))))
{
val = Qutf_8_emacs;
eol_parent = Qunix;
int using_default_coding = 0;
int force_raw_text = 0;
- val = current_buffer->buffer_file_coding_system;
+ val = B_ (current_buffer, buffer_file_coding_system);
if (NILP (val)
|| NILP (Flocal_variable_p (Qbuffer_file_coding_system, Qnil)))
{
val = Qnil;
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
force_raw_text = 1;
}
{
/* If we still have not decided a coding system, use the
default value of buffer-file-coding-system. */
- val = current_buffer->buffer_file_coding_system;
+ val = B_ (current_buffer, buffer_file_coding_system);
using_default_coding = 1;
}
format, we use that of
`default-buffer-file-coding-system'. */
if (! using_default_coding
- && ! NILP (buffer_defaults.buffer_file_coding_system))
+ && ! NILP (B_ (&buffer_defaults, buffer_file_coding_system)))
val = (coding_inherit_eol_type
- (val, buffer_defaults.buffer_file_coding_system));
+ (val, B_ (&buffer_defaults, buffer_file_coding_system)));
/* If we decide not to encode text, use `raw-text' or one of its
subsidiaries. */
val = coding_inherit_eol_type (val, eol_parent);
setup_coding_system (val, coding);
- if (!STRINGP (start) && !NILP (current_buffer->selective_display))
+ if (!STRINGP (start) && !NILP (B_ (current_buffer, selective_display)))
coding->mode |= CODING_MODE_SELECTIVE_DISPLAY;
return val;
}
if (visiting)
{
SAVE_MODIFF = MODIFF;
- XSETFASTINT (current_buffer->save_length, Z - BEG);
- current_buffer->filename = visit_file;
+ XSETFASTINT (B_ (current_buffer, save_length), Z - BEG);
+ B_ (current_buffer, filename) = visit_file;
}
UNGCPRO;
return val;
if (visiting)
{
SAVE_MODIFF = MODIFF;
- XSETFASTINT (current_buffer->save_length, Z - BEG);
- current_buffer->filename = visit_file;
+ XSETFASTINT (B_ (current_buffer, save_length), Z - BEG);
+ B_ (current_buffer, filename) = visit_file;
update_mode_lines++;
}
else if (quietly)
{
if (auto_saving
- && ! NILP (Fstring_equal (current_buffer->filename,
- current_buffer->auto_save_file_name)))
+ && ! NILP (Fstring_equal (B_ (current_buffer, filename),
+ B_ (current_buffer, auto_save_file_name))))
SAVE_MODIFF = MODIFF;
return Qnil;
}
/* Now do the same for annotation functions implied by the file-format */
- if (auto_saving && (!EQ (current_buffer->auto_save_file_format, Qt)))
- p = current_buffer->auto_save_file_format;
+ if (auto_saving && (!EQ (B_ (current_buffer, auto_save_file_format), Qt)))
+ p = B_ (current_buffer, auto_save_file_format);
else
- p = current_buffer->file_format;
+ p = B_ (current_buffer, file_format);
for (i = 0; CONSP (p); p = XCDR (p), ++i)
{
struct buffer *given_buffer = current_buffer;
b = XBUFFER (buf);
}
- if (!STRINGP (b->filename)) return Qt;
+ if (!STRINGP (B_ (b, filename))) return Qt;
if (b->modtime == 0) return Qt;
/* If the file name has special constructs in it,
call the corresponding file handler. */
- handler = Ffind_file_name_handler (b->filename,
+ handler = Ffind_file_name_handler (B_ (b, filename),
Qverify_visited_file_modtime);
if (!NILP (handler))
return call2 (handler, Qverify_visited_file_modtime, buf);
- filename = ENCODE_FILE (b->filename);
+ filename = ENCODE_FILE (B_ (b, filename));
if (stat (SSDATA (filename), &st) < 0)
{
struct stat st;
Lisp_Object handler;
- filename = Fexpand_file_name (current_buffer->filename, Qnil);
+ filename = Fexpand_file_name (B_ (current_buffer, filename), Qnil);
/* If the file name has special constructs in it,
call the corresponding file handler. */
ring_bell (XFRAME (selected_frame));
args[0] = build_string ("Auto-saving %s: %s");
- args[1] = current_buffer->name;
+ args[1] = B_ (current_buffer, name);
args[2] = Ferror_message_string (error);
msg = Fformat (3, args);
GCPRO1 (msg);
auto_save_mode_bits = 0666;
/* Get visited file's mode to become the auto save file's mode. */
- if (! NILP (current_buffer->filename))
+ if (! NILP (B_ (current_buffer, filename)))
{
- if (stat (SSDATA (current_buffer->filename), &st) >= 0)
+ if (stat (SSDATA (B_ (current_buffer, filename)), &st) >= 0)
/* But make sure we can overwrite it later! */
auto_save_mode_bits = st.st_mode | 0600;
- else if ((modes = Ffile_modes (current_buffer->filename),
+ else if ((modes = Ffile_modes (B_ (current_buffer, filename)),
INTEGERP (modes)))
/* Remote files don't cooperate with stat. */
auto_save_mode_bits = XINT (modes) | 0600;
}
return
- Fwrite_region (Qnil, Qnil, current_buffer->auto_save_file_name, Qnil,
+ Fwrite_region (Qnil, Qnil, B_ (current_buffer, auto_save_file_name), Qnil,
NILP (Vauto_save_visited_file_name) ? Qlambda : Qt,
Qnil, Qnil);
}
/* Record all the buffers that have auto save mode
in the special file that lists them. For each of these buffers,
Record visited name (if any) and auto save name. */
- if (STRINGP (b->auto_save_file_name)
+ if (STRINGP (B_ (b, auto_save_file_name))
&& stream != NULL && do_handled_files == 0)
{
BLOCK_INPUT;
- if (!NILP (b->filename))
+ if (!NILP (B_ (b, filename)))
{
- fwrite (SDATA (b->filename), 1,
- SBYTES (b->filename), stream);
+ fwrite (SDATA (B_ (b, filename)), 1,
+ SBYTES (B_ (b, filename)), stream);
}
putc ('\n', stream);
- fwrite (SDATA (b->auto_save_file_name), 1,
- SBYTES (b->auto_save_file_name), stream);
+ fwrite (SDATA (B_ (b, auto_save_file_name)), 1,
+ SBYTES (B_ (b, auto_save_file_name)), stream);
putc ('\n', stream);
UNBLOCK_INPUT;
}
/* Check for auto save enabled
and file changed since last auto save
and file changed since last real save. */
- if (STRINGP (b->auto_save_file_name)
+ if (STRINGP (B_ (b, auto_save_file_name))
&& BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)
&& BUF_AUTOSAVE_MODIFF (b) < BUF_MODIFF (b)
/* -1 means we've turned off autosaving for a while--see below. */
- && XINT (b->save_length) >= 0
+ && XINT (B_ (b, save_length)) >= 0
&& (do_handled_files
- || NILP (Ffind_file_name_handler (b->auto_save_file_name,
+ || NILP (Ffind_file_name_handler (B_ (b, auto_save_file_name),
Qwrite_region))))
{
EMACS_TIME before_time, after_time;
set_buffer_internal (b);
if (NILP (Vauto_save_include_big_deletions)
- && (XFASTINT (b->save_length) * 10
+ && (XFASTINT (B_ (b, save_length)) * 10
> (BUF_Z (b) - BUF_BEG (b)) * 13)
/* A short file is likely to change a large fraction;
spare the user annoying messages. */
- && XFASTINT (b->save_length) > 5000
+ && XFASTINT (B_ (b, save_length)) > 5000
/* These messages are frequent and annoying for `*mail*'. */
- && !EQ (b->filename, Qnil)
+ && !EQ (B_ (b, filename), Qnil)
&& NILP (no_message))
{
/* It has shrunk too much; turn off auto-saving here. */
minibuffer_auto_raise = orig_minibuffer_auto_raise;
message_with_string ("Buffer %s has shrunk a lot; auto save disabled in that buffer until next real save",
- b->name, 1);
+ B_ (b, name), 1);
minibuffer_auto_raise = 0;
/* Turn off auto-saving until there's a real save,
and prevent any more warnings. */
- XSETINT (b->save_length, -1);
+ XSETINT (B_ (b, save_length), -1);
Fsleep_for (make_number (1), Qnil);
continue;
}
internal_condition_case (auto_save_1, Qt, auto_save_error);
auto_saved++;
BUF_AUTOSAVE_MODIFF (b) = BUF_MODIFF (b);
- XSETFASTINT (current_buffer->save_length, Z - BEG);
+ XSETFASTINT (B_ (current_buffer, save_length), Z - BEG);
set_buffer_internal (old);
EMACS_GET_TIME (after_time);
/* FIXME: This should not be called in indirect buffers, since
they're not autosaved. */
BUF_AUTOSAVE_MODIFF (current_buffer) = MODIFF;
- XSETFASTINT (current_buffer->save_length, Z - BEG);
+ XSETFASTINT (B_ (current_buffer, save_length), Z - BEG);
current_buffer->auto_save_failure_time = -1;
return Qnil;
}
for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
{
b = XBUFFER (XCDR (XCAR (tail)));
- if (STRINGP (b->file_truename) && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b))
+ if (STRINGP (B_ (b, file_truename)) && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b))
{
- unlock_file(b->file_truename);
+ unlock_file(B_ (b, file_truename));
}
}
}
(Lisp_Object file)
{
if (NILP (file))
- file = current_buffer->file_truename;
+ file = B_ (current_buffer, file_truename);
else
CHECK_STRING (file);
if (SAVE_MODIFF < MODIFF
(void)
{
if (SAVE_MODIFF < MODIFF
- && STRINGP (current_buffer->file_truename))
- unlock_file (current_buffer->file_truename);
+ && STRINGP (B_ (current_buffer, file_truename)))
+ unlock_file (B_ (current_buffer, file_truename));
return Qnil;
}
unlock_buffer (struct buffer *buffer)
{
if (BUF_SAVE_MODIFF (buffer) < BUF_MODIFF (buffer)
- && STRINGP (buffer->file_truename))
- unlock_file (buffer->file_truename);
+ && STRINGP (B_ (buffer, file_truename)))
+ unlock_file (B_ (buffer, file_truename));
}
DEFUN ("file-locked-p", Ffile_locked_p, Sfile_locked_p, 1, 1, 0,
SAFE_ALLOCA (encoded, char *, allength);
encoded_length = base64_encode_1 ((char *) BYTE_POS_ADDR (ibeg),
encoded, length, NILP (no_line_break),
- !NILP (current_buffer->enable_multibyte_characters));
+ !NILP (B_ (current_buffer, enable_multibyte_characters)));
if (encoded_length > allength)
abort ();
EMACS_INT old_pos = PT;
EMACS_INT decoded_length;
EMACS_INT inserted_chars;
- int multibyte = !NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters));
USE_SAFE_ALLOCA;
validate_region (&beg, &end);
{
int force_raw_text = 0;
- coding_system = XBUFFER (object)->buffer_file_coding_system;
+ coding_system = B_ (XBUFFER (object), buffer_file_coding_system);
if (NILP (coding_system)
|| NILP (Flocal_variable_p (Qbuffer_file_coding_system, Qnil)))
{
coding_system = Qnil;
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
force_raw_text = 1;
}
}
if (NILP (coding_system)
- && !NILP (XBUFFER (object)->buffer_file_coding_system))
+ && !NILP (B_ (XBUFFER (object), buffer_file_coding_system)))
{
/* If we still have not decided a coding system, use the
default value of buffer-file-coding-system. */
- coding_system = XBUFFER (object)->buffer_file_coding_system;
+ coding_system = B_ (XBUFFER (object), buffer_file_coding_system);
}
if (!force_raw_text
Lisp_Object font_object;
multibyte = (NILP (string)
- ? ! NILP (current_buffer->enable_multibyte_characters)
+ ? ! NILP (B_ (current_buffer, enable_multibyte_characters))
: STRING_MULTIBYTE (string));
if (c < 0)
{
w = XWINDOW (window);
if (!NILP (w->buffer))
- XBUFFER (w->buffer)->display_time = Fcurrent_time ();
+ B_ (XBUFFER (w->buffer), display_time) = Fcurrent_time ();
if (!NILP (w->vchild))
make_frame_visible_1 (w->vchild);
{
Lisp_Object cmap, bm = Qnil;
- if ((cmap = XBUFFER (w->buffer)->fringe_cursor_alist), !NILP (cmap))
+ if ((cmap = B_ (XBUFFER (w->buffer), fringe_cursor_alist)), !NILP (cmap))
{
bm = Fassq (cursor, cmap);
if (CONSP (bm))
return lookup_fringe_bitmap (bm);
}
}
- if (EQ (cmap, buffer_defaults.fringe_cursor_alist))
+ if (EQ (cmap, B_ (&buffer_defaults, fringe_cursor_alist)))
return NO_FRINGE_BITMAP;
- bm = Fassq (cursor, buffer_defaults.fringe_cursor_alist);
+ bm = Fassq (cursor, B_ (&buffer_defaults, fringe_cursor_alist));
if (!CONSP (bm) || ((bm = XCDR (bm)), NILP (bm)))
return NO_FRINGE_BITMAP;
return lookup_fringe_bitmap (bm);
If partial, lookup partial bitmap in default value if not found here.
If not partial, or no partial spec is present, use non-partial bitmap. */
- if ((cmap = XBUFFER (w->buffer)->fringe_indicator_alist), !NILP (cmap))
+ if ((cmap = B_ (XBUFFER (w->buffer), fringe_indicator_alist)), !NILP (cmap))
{
bm1 = Fassq (bitmap, cmap);
if (CONSP (bm1))
}
}
- if (!EQ (cmap, buffer_defaults.fringe_indicator_alist)
- && !NILP (buffer_defaults.fringe_indicator_alist))
+ if (!EQ (cmap, B_ (&buffer_defaults, fringe_indicator_alist))
+ && !NILP (B_ (&buffer_defaults, fringe_indicator_alist)))
{
- bm2 = Fassq (bitmap, buffer_defaults.fringe_indicator_alist);
+ bm2 = Fassq (bitmap, B_ (&buffer_defaults, fringe_indicator_alist));
if (CONSP (bm2))
{
if ((bm2 = XCDR (bm2)), !NILP (bm2))
return 0;
if (!MINI_WINDOW_P (w)
- && (ind = XBUFFER (w->buffer)->indicate_buffer_boundaries, !NILP (ind)))
+ && (ind = B_ (XBUFFER (w->buffer), indicate_buffer_boundaries), !NILP (ind)))
{
if (EQ (ind, Qleft) || EQ (ind, Qright))
boundary_top = boundary_bot = arrow_top = arrow_bot = ind;
}
}
- empty_pos = XBUFFER (w->buffer)->indicate_empty_lines;
+ empty_pos = B_ (XBUFFER (w->buffer), indicate_empty_lines);
if (!NILP (empty_pos) && !EQ (empty_pos, Qright))
empty_pos = WINDOW_LEFT_FRINGE_WIDTH (w) == 0 ? Qright : Qleft;
{
Lisp_Object thisbuf;
- thisbuf = current_buffer->display_table;
+ thisbuf = B_ (current_buffer, display_table);
if (DISP_TABLE_P (thisbuf))
return XCHAR_TABLE (thisbuf);
if (DISP_TABLE_P (Vstandard_display_table))
int i;
struct Lisp_Vector *widthtab;
- if (!VECTORP (buf->width_table))
- buf->width_table = Fmake_vector (make_number (256), make_number (0));
- widthtab = XVECTOR (buf->width_table);
+ if (!VECTORP (B_ (buf, width_table)))
+ B_ (buf, width_table) = Fmake_vector (make_number (256), make_number (0));
+ widthtab = XVECTOR (B_ (buf, width_table));
if (widthtab->size != 256)
abort ();
static void
width_run_cache_on_off (void)
{
- if (NILP (current_buffer->cache_long_line_scans)
+ if (NILP (B_ (current_buffer, cache_long_line_scans))
/* And, for the moment, this feature doesn't work on multibyte
characters. */
- || !NILP (current_buffer->enable_multibyte_characters))
+ || !NILP (B_ (current_buffer, enable_multibyte_characters)))
{
/* It should be off. */
if (current_buffer->width_run_cache)
{
free_region_cache (current_buffer->width_run_cache);
current_buffer->width_run_cache = 0;
- current_buffer->width_table = Qnil;
+ B_ (current_buffer, width_table) = Qnil;
}
}
else
register int tab_seen;
int post_tab;
register int c;
- register int tab_width = XINT (current_buffer->tab_width);
- int ctl_arrow = !NILP (current_buffer->ctl_arrow);
+ register int tab_width = XINT (B_ (current_buffer, tab_width));
+ int ctl_arrow = !NILP (B_ (current_buffer, ctl_arrow));
register struct Lisp_Char_Table *dp = buffer_display_table ();
if (PT == last_known_column_point
col++;
else if (c == '\n'
|| (c == '\r'
- && EQ (current_buffer->selective_display, Qt)))
+ && EQ (B_ (current_buffer, selective_display), Qt)))
{
ptr++;
goto start_of_line_found;
static void
scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
{
- register EMACS_INT tab_width = XINT (current_buffer->tab_width);
- register int ctl_arrow = !NILP (current_buffer->ctl_arrow);
+ register EMACS_INT tab_width = XINT (B_ (current_buffer, tab_width));
+ register int ctl_arrow = !NILP (B_ (current_buffer, ctl_arrow));
register struct Lisp_Char_Table *dp = buffer_display_table ();
- int multibyte = !NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters));
struct composition_it cmp_it;
Lisp_Object window;
struct window *w;
if (c == '\n')
goto endloop;
- if (c == '\r' && EQ (current_buffer->selective_display, Qt))
+ if (c == '\r' && EQ (B_ (current_buffer, selective_display), Qt))
goto endloop;
if (c == '\t')
{
if (c == '\n')
goto endloop;
- if (c == '\r' && EQ (current_buffer->selective_display, Qt))
+ if (c == '\r' && EQ (B_ (current_buffer, selective_display), Qt))
goto endloop;
if (c == '\t')
{
{
int mincol;
register int fromcol;
- register int tab_width = XINT (current_buffer->tab_width);
+ register int tab_width = XINT (B_ (current_buffer, tab_width));
CHECK_NUMBER (column);
if (NILP (minimum))
position_indentation (register int pos_byte)
{
register EMACS_INT column = 0;
- register EMACS_INT tab_width = XINT (current_buffer->tab_width);
+ register EMACS_INT tab_width = XINT (B_ (current_buffer, tab_width));
register unsigned char *p;
register unsigned char *stop;
unsigned char *start;
switch (*p++)
{
case 0240:
- if (! NILP (current_buffer->enable_multibyte_characters))
+ if (! NILP (B_ (current_buffer, enable_multibyte_characters)))
return column;
case ' ':
column++;
break;
default:
if (ASCII_BYTE_P (p[-1])
- || NILP (current_buffer->enable_multibyte_characters))
+ || NILP (B_ (current_buffer, enable_multibyte_characters)))
return column;
{
int c;
register EMACS_INT pos;
EMACS_INT pos_byte;
register int c = 0;
- register EMACS_INT tab_width = XFASTINT (current_buffer->tab_width);
- register int ctl_arrow = !NILP (current_buffer->ctl_arrow);
+ register EMACS_INT tab_width = XFASTINT (B_ (current_buffer, tab_width));
+ register int ctl_arrow = !NILP (B_ (current_buffer, ctl_arrow));
register struct Lisp_Char_Table *dp = window_display_table (win);
int selective
- = (INTEGERP (current_buffer->selective_display)
- ? XINT (current_buffer->selective_display)
- : !NILP (current_buffer->selective_display) ? -1 : 0);
+ = (INTEGERP (B_ (current_buffer, selective_display))
+ ? XINT (B_ (current_buffer, selective_display))
+ : !NILP (B_ (current_buffer, selective_display)) ? -1 : 0);
int selective_rlen
= (selective && dp && VECTORP (DISP_INVIS_VECTOR (dp))
? XVECTOR (DISP_INVIS_VECTOR (dp))->size : 0);
EMACS_INT next_width_run = from;
Lisp_Object window;
- int multibyte = !NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters));
/* If previous char scanned was a wide character,
this is the column where it ended. Otherwise, this is 0. */
EMACS_INT wide_column_end_hpos = 0;
width_run_cache_on_off ();
if (dp == buffer_display_table ())
- width_table = (VECTORP (current_buffer->width_table)
- ? XVECTOR (current_buffer->width_table)->contents
+ width_table = (VECTORP (B_ (current_buffer, width_table))
+ ? XVECTOR (B_ (current_buffer, width_table))->contents
: 0);
else
/* If the window has its own display table, we can't use the width
}
if (hscroll || truncate
- || !NILP (current_buffer->truncate_lines))
+ || !NILP (B_ (current_buffer, truncate_lines)))
{
/* Truncating: skip to newline, unless we are already past
TO (we need to go back below). */
EMACS_INT from_byte;
EMACS_INT lmargin = hscroll > 0 ? 1 - hscroll : 0;
int selective
- = (INTEGERP (current_buffer->selective_display)
- ? XINT (current_buffer->selective_display)
- : !NILP (current_buffer->selective_display) ? -1 : 0);
+ = (INTEGERP (B_ (current_buffer, selective_display))
+ ? XINT (B_ (current_buffer, selective_display))
+ : !NILP (B_ (current_buffer, selective_display)) ? -1 : 0);
Lisp_Object window;
EMACS_INT start_hpos = 0;
int did_motion;
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;
int have_overlays;
EMACS_INT original_position;
- current_buffer->point_before_scroll = Qnil;
+ B_ (current_buffer, point_before_scroll) = Qnil;
if (charpos == PT)
return;
if (EQ (type, Qkeymap))
return Qnil;
else
- return buffer->keymap;
+ return B_ (buffer, keymap);
}
\f
/* Produce an interval tree reflecting the intervals in
and 2 if it is invisible but with an ellipsis. */
#define TEXT_PROP_MEANS_INVISIBLE(prop) \
- (EQ (current_buffer->invisibility_spec, Qt) \
+ (EQ (B_ (current_buffer, invisibility_spec), Qt) \
? !NILP (prop) \
- : invisible_p (prop, current_buffer->invisibility_spec))
+ : invisible_p (prop, B_ (current_buffer, invisibility_spec)))
/* Declared in alloc.c */
this_single_command_key_start = 0;
}
- if (!NILP (current_buffer->mark_active)
+ if (!NILP (B_ (current_buffer, mark_active))
&& !NILP (Vrun_hooks))
{
/* In Emacs 22, setting transient-mark-mode to `only' was a
if (!NILP (Fwindow_system (Qnil))
/* Even if mark_active is non-nil, the actual buffer
marker may not have been set yet (Bug#7044). */
- && XMARKER (current_buffer->mark)->buffer
+ && XMARKER (B_ (current_buffer, mark))->buffer
&& (EQ (Vselect_active_regions, Qonly)
? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
: (!NILP (Vselect_active_regions)
&& !EQ (Vthis_command, Qhandle_switch_frame))
{
EMACS_INT beg =
- XINT (Fmarker_position (current_buffer->mark));
+ XINT (Fmarker_position (B_ (current_buffer, mark)));
EMACS_INT end = PT;
if (beg < end)
call2 (Qx_set_selection, QPRIMARY,
/* Prompt with that and read response. */
message2_nolog (menu, strlen (menu),
- ! NILP (current_buffer->enable_multibyte_characters));
+ ! NILP (B_ (current_buffer, enable_multibyte_characters)));
/* Make believe its not a keyboard macro in case the help char
is pressed. Help characters are not recorded because menu prompting
/* Treat uppercase keys as shifted. */
|| (INTEGERP (key)
&& (KEY_TO_CHAR (key)
- < XCHAR_TABLE (current_buffer->downcase_table)->size)
+ < XCHAR_TABLE (B_ (current_buffer, downcase_table))->size)
&& UPPERCASEP (KEY_TO_CHAR (key))))
{
Lisp_Object new_key
(Lisp_Object keys, Lisp_Object accept_default)
{
register Lisp_Object map;
- map = current_buffer->keymap;
+ map = B_ (current_buffer, keymap);
if (NILP (map))
return Qnil;
return Flookup_key (map, keys, accept_default);
if (!NILP (keymap))
keymap = get_keymap (keymap, 1, 1);
- current_buffer->keymap = keymap;
+ B_ (current_buffer, keymap) = keymap;
return Qnil;
}
Normally the local keymap is set by the major mode with `use-local-map'. */)
(void)
{
- return current_buffer->keymap;
+ return B_ (current_buffer, keymap);
}
DEFUN ("current-global-map", Fcurrent_global_map, Scurrent_global_map, 0, 0, 0,
*p++ = 'C';
}
else if (c < 128
- || (NILP (current_buffer->enable_multibyte_characters)
+ || (NILP (B_ (current_buffer, enable_multibyte_characters))
&& SINGLE_BYTE_CHAR_P (c)
&& !force_multibyte))
{
else
{
/* Now we are sure that C is a valid character code. */
- if (NILP (current_buffer->enable_multibyte_characters)
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))
&& ! force_multibyte)
*p++ = multibyte_char_to_unibyte (c, Qnil);
else
XBUFFER (buffer), Qlocal_map);
if (!NILP (start1))
{
- if (EQ (start1, XBUFFER (buffer)->keymap))
+ if (EQ (start1, B_ (XBUFFER (buffer), keymap)))
describe_map_tree (start1, 1, shadow, prefix,
"\f\nMajor Mode Bindings", nomenu, 0, 0, 0);
else
#define DEFVAR_BUFFER_DEFAULTS(lname, vname, doc) \
do { \
static struct Lisp_Objfwd o_fwd; \
- defvar_lisp_nopro (&o_fwd, lname, &buffer_defaults.vname); \
+ defvar_lisp_nopro (&o_fwd, lname, &buffer_defaults.vname ## _); \
} while (0)
#define DEFVAR_KBOARD(lname, vname, doc) \
/* Current buffer's map from characters to lower-case characters. */
-#define DOWNCASE_TABLE current_buffer->downcase_table
+#define DOWNCASE_TABLE B_ (current_buffer, downcase_table)
/* Current buffer's map from characters to upper-case characters. */
-#define UPCASE_TABLE current_buffer->upcase_table
+#define UPCASE_TABLE B_ (current_buffer, upcase_table)
/* Downcase a character, or make no change if that cannot be done. */
if (pt_byte >= BUF_ZV_BYTE (inbuffer))
return -1;
- if (! NILP (inbuffer->enable_multibyte_characters))
+ if (! NILP (B_ (inbuffer, enable_multibyte_characters)))
{
/* Fetch the character code from the buffer. */
unsigned char *p = BUF_BYTE_ADDRESS (inbuffer, pt_byte);
if (bytepos >= BUF_ZV_BYTE (inbuffer))
return -1;
- if (! NILP (inbuffer->enable_multibyte_characters))
+ if (! NILP (B_ (inbuffer, enable_multibyte_characters)))
{
/* Fetch the character code from the buffer. */
unsigned char *p = BUF_BYTE_ADDRESS (inbuffer, bytepos);
EMACS_INT bytepos = BUF_PT_BYTE (b);
BUF_PT (b)--;
- if (! NILP (b->enable_multibyte_characters))
+ if (! NILP (B_ (b, enable_multibyte_characters)))
BUF_DEC_POS (b, bytepos);
else
bytepos--;
EMACS_INT bytepos = XMARKER (readcharfun)->bytepos;
XMARKER (readcharfun)->charpos--;
- if (! NILP (b->enable_multibyte_characters))
+ if (! NILP (B_ (b, enable_multibyte_characters)))
BUF_DEC_POS (b, bytepos);
else
bytepos--;
/* Of course, this could conceivably lose if luser sets
default-directory to be something non-absolute... */
{
- filename = Fexpand_file_name (filename, current_buffer->directory);
+ filename = Fexpand_file_name (filename, B_ (current_buffer, directory));
if (!complete_filename_p (filename))
/* Give up on this path element! */
continue;
{
int count1 = SPECPDL_INDEX ();
- if (b != 0 && NILP (b->name))
+ if (b != 0 && NILP (B_ (b, name)))
error ("Reading from killed buffer");
if (!NILP (start))
tem = printflag;
if (NILP (filename))
- filename = XBUFFER (buf)->filename;
+ filename = B_ (XBUFFER (buf), filename);
specbind (Qeval_buffer_list, Fcons (buf, Veval_buffer_list));
specbind (Qstandard_output, tem);
specbind (Qeval_buffer_list, Fcons (cbuf, Veval_buffer_list));
/* readevalloop calls functions which check the type of start and end. */
- readevalloop (cbuf, 0, XBUFFER (cbuf)->filename, Feval,
+ readevalloop (cbuf, 0, B_ (XBUFFER (cbuf), filename), Feval,
!NILP (printflag), Qnil, read_function,
start, end);
does not preserve the buffer from being GC'd (it's weak), so
markers have to be unlinked from their buffer as soon as the buffer
is killed. */
- eassert (!NILP (XBUFFER (buf)->name));
+ eassert (!NILP (B_ (XBUFFER (buf), name)));
return buf;
}
return Qnil;
CHECK_BUFFER (buffer);
b = XBUFFER (buffer);
/* If buffer is dead, set marker to point nowhere. */
- if (EQ (b->name, Qnil))
+ if (EQ (B_ (b, name), Qnil))
{
unchain_marker (m);
return marker;
CHECK_BUFFER (buffer);
b = XBUFFER (buffer);
/* If buffer is dead, set marker to point nowhere. */
- if (EQ (b->name, Qnil))
+ if (EQ (B_ (b, name), Qnil))
{
unchain_marker (m);
return marker;
CHECK_BUFFER (buffer);
b = XBUFFER (buffer);
/* If buffer is dead, set marker to point nowhere. */
- if (EQ (b->name, Qnil))
+ if (EQ (B_ (b, name), Qnil))
{
unchain_marker (m);
return marker;
CHECK_BUFFER (buffer);
b = XBUFFER (buffer);
/* If buffer is dead, set marker to point nowhere. */
- if (EQ (b->name, Qnil))
+ if (EQ (B_ (b, name), Qnil))
{
unchain_marker (m);
return marker;
if (b == 0)
return;
- if (EQ (b->name, Qnil))
+ if (EQ (B_ (b, name), Qnil))
abort ();
marker->buffer = 0;
CHECK_STRING (initial);
}
val = Qnil;
- ambient_dir = current_buffer->directory;
+ ambient_dir = B_ (current_buffer, directory);
input_method = Qnil;
enable_multibyte = Qnil;
/* `current-input-method' is buffer local. So, remember it in
INPUT_METHOD before changing the current buffer. */
input_method = Fsymbol_value (Qcurrent_input_method);
- enable_multibyte = current_buffer->enable_multibyte_characters;
+ enable_multibyte = B_ (current_buffer, enable_multibyte_characters);
}
/* Switch to the minibuffer. */
/* If appropriate, copy enable-multibyte-characters into the minibuffer. */
if (inherit_input_method)
- current_buffer->enable_multibyte_characters = enable_multibyte;
+ B_ (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
you think of something better to do? Find another buffer with a
better directory, and use that one instead. */
if (STRINGP (ambient_dir))
- current_buffer->directory = ambient_dir;
+ B_ (current_buffer, directory) = ambient_dir;
else
{
Lisp_Object buf_list;
Lisp_Object other_buf;
other_buf = XCDR (XCAR (buf_list));
- if (STRINGP (XBUFFER (other_buf)->directory))
+ if (STRINGP (B_ (XBUFFER (other_buf), directory)))
{
- current_buffer->directory = XBUFFER (other_buf)->directory;
+ B_ (current_buffer, directory) = B_ (XBUFFER (other_buf), directory);
break;
}
}
specbind (Qinhibit_modification_hooks, Qt);
Ferase_buffer ();
- if (!NILP (current_buffer->enable_multibyte_characters)
+ if (!NILP (B_ (current_buffer, enable_multibyte_characters))
&& ! STRING_MULTIBYTE (minibuf_prompt))
minibuf_prompt = Fstring_make_multibyte (minibuf_prompt);
}
clear_message (1, 1);
- current_buffer->keymap = map;
+ B_ (current_buffer, keymap) = map;
/* Turn on an input method stored in INPUT_METHOD if any. */
if (STRINGP (input_method) && !NILP (Ffboundp (Qactivate_input_method)))
call1 (Vrun_hooks, Qminibuffer_setup_hook);
/* Don't allow the user to undo past this point. */
- current_buffer->undo_list = Qnil;
+ B_ (current_buffer, undo_list) = Qnil;
recursive_edit_1 ();
Vminibuffer_list = nconc2 (Vminibuffer_list, tail);
}
buf = Fcar (tail);
- if (NILP (buf) || NILP (XBUFFER (buf)->name))
+ if (NILP (buf) || NILP (B_ (XBUFFER (buf), name)))
{
sprintf (name, " *Minibuf-%d*", depth);
buf = Fget_buffer_create (build_string (name));
int count = SPECPDL_INDEX ();
if (BUFFERP (def))
- def = XBUFFER (def)->name;
+ def = B_ (XBUFFER (def), name);
specbind (Qcompletion_ignore_case,
read_buffer_completion_ignore_case ? Qt : Qnil);
EMACS_INT old_point_byte = -1, start_point_byte = -1; \
int specpdl_count = SPECPDL_INDEX (); \
int free_print_buffer = 0; \
- int multibyte = !NILP (current_buffer->enable_multibyte_characters); \
+ int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); \
Lisp_Object original
#define PRINTPREPARE \
if (NILP (printcharfun)) \
{ \
Lisp_Object string; \
- if (NILP (current_buffer->enable_multibyte_characters) \
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)) \
&& ! print_escape_multibyte) \
specbind (Qprint_escape_multibyte, Qt); \
- if (! NILP (current_buffer->enable_multibyte_characters) \
+ if (! NILP (B_ (current_buffer, enable_multibyte_characters)) \
&& ! print_escape_nonascii) \
specbind (Qprint_escape_nonascii, Qt); \
if (print_buffer != 0) \
if (NILP (printcharfun)) \
{ \
if (print_buffer_pos != print_buffer_pos_byte \
- && NILP (current_buffer->enable_multibyte_characters)) \
+ && NILP (B_ (current_buffer, enable_multibyte_characters))) \
{ \
unsigned char *temp \
= (unsigned char *) alloca (print_buffer_pos + 1); \
else
{
int multibyte_p
- = !NILP (current_buffer->enable_multibyte_characters);
+ = !NILP (B_ (current_buffer, enable_multibyte_characters));
setup_echo_area_for_printing (multibyte_p);
insert_char (ch);
job. */
int i;
int multibyte_p
- = !NILP (current_buffer->enable_multibyte_characters);
+ = !NILP (B_ (current_buffer, enable_multibyte_characters));
setup_echo_area_for_printing (multibyte_p);
message_dolog (ptr, size_byte, 0, multibyte_p);
chars = SCHARS (string);
else if (! print_escape_nonascii
&& (EQ (printcharfun, Qt)
- ? ! NILP (buffer_defaults.enable_multibyte_characters)
- : ! NILP (current_buffer->enable_multibyte_characters)))
+ ? ! NILP (B_ (&buffer_defaults, enable_multibyte_characters))
+ : ! NILP (B_ (current_buffer, enable_multibyte_characters))))
{
/* If unibyte string STRING contains 8-bit codes, we must
convert STRING to a multibyte string containing the same
Fkill_all_local_variables ();
delete_all_overlays (current_buffer);
- current_buffer->directory = old->directory;
- current_buffer->read_only = Qnil;
- current_buffer->filename = Qnil;
- current_buffer->undo_list = Qt;
+ B_ (current_buffer, directory) = B_ (old, directory);
+ B_ (current_buffer, read_only) = Qnil;
+ B_ (current_buffer, filename) = Qnil;
+ B_ (current_buffer, undo_list) = Qt;
eassert (current_buffer->overlays_before == NULL);
eassert (current_buffer->overlays_after == NULL);
- current_buffer->enable_multibyte_characters
- = buffer_defaults.enable_multibyte_characters;
+ B_ (current_buffer, enable_multibyte_characters)
+ = B_ (&buffer_defaults, enable_multibyte_characters);
specbind (Qinhibit_read_only, Qt);
specbind (Qinhibit_modification_hooks, Qt);
Ferase_buffer ();
if (!NILP (XWINDOW (obj)->buffer))
{
strout (" on ", -1, -1, printcharfun, 0);
- print_string (XBUFFER (XWINDOW (obj)->buffer)->name, printcharfun);
+ print_string (B_ (XBUFFER (XWINDOW (obj)->buffer), name), printcharfun);
}
PRINTCHAR ('>');
}
}
else if (BUFFERP (obj))
{
- if (NILP (XBUFFER (obj)->name))
+ if (NILP (B_ (XBUFFER (obj), name)))
strout ("#<killed buffer>", -1, -1, printcharfun, 0);
else if (escapeflag)
{
strout ("#<buffer ", -1, -1, printcharfun, 0);
- print_string (XBUFFER (obj)->name, printcharfun);
+ print_string (B_ (XBUFFER (obj), name), printcharfun);
PRINTCHAR ('>');
}
else
- print_string (XBUFFER (obj)->name, printcharfun);
+ print_string (B_ (XBUFFER (obj), name), printcharfun);
}
else if (WINDOW_CONFIGURATIONP (obj))
{
sprintf (buf, "at %ld", (long)marker_position (obj));
strout (buf, -1, -1, printcharfun, 0);
strout (" in ", -1, -1, printcharfun, 0);
- print_string (XMARKER (obj)->buffer->name, printcharfun);
+ print_string (B_ (XMARKER (obj)->buffer, name), printcharfun);
}
PRINTCHAR ('>');
break;
(long)marker_position (OVERLAY_START (obj)),
(long)marker_position (OVERLAY_END (obj)));
strout (buf, -1, -1, printcharfun, 0);
- print_string (XMARKER (OVERLAY_START (obj))->buffer->name,
+ print_string (B_ (XMARKER (OVERLAY_START (obj))->buffer, name),
printcharfun);
}
PRINTCHAR ('>');
{
proc = Fget_buffer_process (obj);
if (NILP (proc))
- error ("Buffer %s has no process", SDATA (XBUFFER (obj)->name));
+ error ("Buffer %s has no process", SDATA (B_ (XBUFFER (obj), name)));
}
else
{
w_proc = i;
if (!NILP (p->buffer))
{
- if (NILP (XBUFFER (p->buffer)->name))
+ if (NILP (B_ (XBUFFER (p->buffer), name)))
{
if (w_buffer < 8)
w_buffer = 8; /* (Killed) */
}
- else if ((i = SCHARS (XBUFFER (p->buffer)->name), (i > w_buffer)))
+ else if ((i = SCHARS (B_ (XBUFFER (p->buffer), name)), (i > w_buffer)))
w_buffer = i;
}
if (STRINGP (p->tty_name)
XSETFASTINT (minspace, 1);
set_buffer_internal (XBUFFER (Vstandard_output));
- current_buffer->undo_list = Qt;
+ B_ (current_buffer, undo_list) = Qt;
- current_buffer->truncate_lines = Qt;
+ B_ (current_buffer, truncate_lines) = Qt;
write_string ("Proc", -1);
Findent_to (i_status, minspace); write_string ("Status", -1);
Findent_to (i_buffer, minspace);
if (NILP (p->buffer))
insert_string ("(none)");
- else if (NILP (XBUFFER (p->buffer)->name))
+ else if (NILP (B_ (XBUFFER (p->buffer), name)))
insert_string ("(Killed)");
else
- Finsert (1, &XBUFFER (p->buffer)->name);
+ Finsert (1, &B_ (XBUFFER (p->buffer), name));
if (!NILP (i_tty))
{
{
struct gcpro gcpro1, gcpro2;
- current_dir = current_buffer->directory;
+ current_dir = B_ (current_buffer, directory);
GCPRO2 (buffer, current_dir);
current_dir = expand_and_dir_to_file (current_dir, Qnil);
if (NILP (Ffile_accessible_directory_p (current_dir)))
report_file_error ("Setting current directory",
- Fcons (current_buffer->directory, Qnil));
+ Fcons (B_ (current_buffer, directory), Qnil));
UNGCPRO;
}
}
else if (!NILP (Vcoding_system_for_read))
val = Vcoding_system_for_read;
- else if ((!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters))
- || (NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters)))
+ else if ((!NILP (buffer) && NILP (B_ (XBUFFER (buffer), enable_multibyte_characters)))
+ || (NILP (buffer) && NILP (B_ (&buffer_defaults, enable_multibyte_characters))))
val = Qnil;
p->decode_coding_system = val;
}
else if (!NILP (Vcoding_system_for_write))
val = Vcoding_system_for_write;
- else if ((!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters))
- || (NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters)))
+ else if ((!NILP (buffer) && NILP (B_ (XBUFFER (buffer), enable_multibyte_characters)))
+ || (NILP (buffer) && NILP (B_ (&buffer_defaults, enable_multibyte_characters))))
val = Qnil;
p->encode_coding_system = val;
}
else if (!NILP (Vcoding_system_for_read))
val = Vcoding_system_for_read;
- else if ((!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters))
- || (NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters)))
+ else if ((!NILP (buffer) && NILP (B_ (XBUFFER (buffer), enable_multibyte_characters)))
+ || (NILP (buffer) && NILP (B_ (&buffer_defaults, enable_multibyte_characters))))
/* We dare not decode end-of-line format by setting VAL to
Qraw_text, because the existing Emacs Lisp libraries
assume that they receive bare code including a sequene of
}
else if (!NILP (Vcoding_system_for_write))
val = Vcoding_system_for_write;
- else if (NILP (current_buffer->enable_multibyte_characters))
+ else if (NILP (B_ (current_buffer, enable_multibyte_characters)))
val = Qnil;
else
{
/* No need to gcpro these, because all we do with them later
is test them for EQness, and none of them should be a string. */
XSETBUFFER (obuffer, current_buffer);
- okeymap = current_buffer->keymap;
+ okeymap = B_ (current_buffer, keymap);
/* We inhibit quit here instead of just catching it so that
hitting ^G when a filter happens to be running won't screw
}
/* If no filter, write into buffer if it isn't dead. */
- else if (!NILP (p->buffer) && !NILP (XBUFFER (p->buffer)->name))
+ else if (!NILP (p->buffer) && !NILP (B_ (XBUFFER (p->buffer), name)))
{
Lisp_Object old_read_only;
EMACS_INT old_begv, old_zv;
Fset_buffer (p->buffer);
opoint = PT;
opoint_byte = PT_BYTE;
- old_read_only = current_buffer->read_only;
+ old_read_only = B_ (current_buffer, read_only);
old_begv = BEGV;
old_zv = ZV;
old_begv_byte = BEGV_BYTE;
old_zv_byte = ZV_BYTE;
- current_buffer->read_only = Qnil;
+ B_ (current_buffer, read_only) = Qnil;
/* Insert new output into buffer
at the current end-of-output marker,
p->decoding_carryover = coding->carryover_bytes;
}
/* Adjust the multibyteness of TEXT to that of the buffer. */
- if (NILP (current_buffer->enable_multibyte_characters)
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))
!= ! STRING_MULTIBYTE (text))
text = (STRING_MULTIBYTE (text)
? Fstring_as_unibyte (text)
Fnarrow_to_region (make_number (old_begv), make_number (old_zv));
- current_buffer->read_only = old_read_only;
+ B_ (current_buffer, read_only) = old_read_only;
SET_PT_BOTH (opoint, opoint_byte);
}
/* Handling the process output should not deactivate the mark. */
if ((STRINGP (object) && STRING_MULTIBYTE (object))
|| (BUFFERP (object)
- && !NILP (XBUFFER (object)->enable_multibyte_characters))
+ && !NILP (B_ (XBUFFER (object), enable_multibyte_characters)))
|| EQ (object, Qt))
{
p->encode_coding_system
is test them for EQness, and none of them should be a string. */
odeactivate = Vdeactivate_mark;
XSETBUFFER (obuffer, current_buffer);
- okeymap = current_buffer->keymap;
+ okeymap = B_ (current_buffer, keymap);
/* There's no good reason to let sentinels change the current
buffer, and many callers of accept-process-output, sit-for, and
/* Avoid error if buffer is deleted
(probably that's why the process is dead, too) */
- if (NILP (XBUFFER (buffer)->name))
+ if (NILP (B_ (XBUFFER (buffer), name)))
continue;
Fset_buffer (buffer);
before = PT;
before_byte = PT_BYTE;
- tem = current_buffer->read_only;
- current_buffer->read_only = Qnil;
+ tem = B_ (current_buffer, read_only);
+ B_ (current_buffer, read_only) = Qnil;
insert_string ("\nProcess ");
Finsert (1, &p->name);
insert_string (" ");
Finsert (1, &msg);
- current_buffer->read_only = tem;
+ B_ (current_buffer, read_only) = tem;
set_marker_both (p->mark, p->buffer, PT, PT_BYTE);
if (opoint >= before)
;
else if (BUFFERP (p->buffer))
{
- if (NILP (XBUFFER (p->buffer)->enable_multibyte_characters))
+ if (NILP (B_ (XBUFFER (p->buffer), enable_multibyte_characters)))
coding_system = raw_text_coding_system (coding_system);
}
setup_coding_system (coding_system, proc_decode_coding_system[inch]);
/* If the compiled pattern hard codes some of the contents of the
syntax-table, it can only be reused with *this* syntax table. */
- cp->syntax_table = cp->buf.used_syntax ? current_buffer->syntax_table : Qt;
+ cp->syntax_table = cp->buf.used_syntax ? B_ (current_buffer, syntax_table) : Qt;
re_set_whitespace_regexp (NULL);
&& EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0)))
&& cp->posix == posix
&& (EQ (cp->syntax_table, Qt)
- || EQ (cp->syntax_table, current_buffer->syntax_table))
+ || EQ (cp->syntax_table, B_ (current_buffer, syntax_table)))
&& !NILP (Fequal (cp->whitespace_regexp, Vsearch_spaces_regexp))
&& cp->buf.charset_unibyte == charset_unibyte)
break;
save_search_regs ();
/* This is so set_image_of_range_1 in regex.c can find the EQV table. */
- XCHAR_TABLE (current_buffer->case_canon_table)->extras[2]
- = current_buffer->case_eqv_table;
+ XCHAR_TABLE (B_ (current_buffer, case_canon_table))->extras[2]
+ = B_ (current_buffer, case_eqv_table);
CHECK_STRING (string);
bufp = compile_pattern (string,
(NILP (Vinhibit_changing_match_data)
? &search_regs : NULL),
- (!NILP (current_buffer->case_fold_search)
- ? current_buffer->case_canon_table : Qnil),
+ (!NILP (B_ (current_buffer, case_fold_search))
+ ? B_ (current_buffer, case_canon_table) : Qnil),
posix,
- !NILP (current_buffer->enable_multibyte_characters));
+ !NILP (B_ (current_buffer, enable_multibyte_characters)));
immediate_quit = 1;
QUIT; /* Do a pending quit right away, to avoid paradoxical behavior */
}
/* This is so set_image_of_range_1 in regex.c can find the EQV table. */
- XCHAR_TABLE (current_buffer->case_canon_table)->extras[2]
- = current_buffer->case_eqv_table;
+ XCHAR_TABLE (B_ (current_buffer, case_canon_table))->extras[2]
+ = B_ (current_buffer, case_eqv_table);
bufp = compile_pattern (regexp,
(NILP (Vinhibit_changing_match_data)
? &search_regs : NULL),
- (!NILP (current_buffer->case_fold_search)
- ? current_buffer->case_canon_table : Qnil),
+ (!NILP (B_ (current_buffer, case_fold_search))
+ ? B_ (current_buffer, case_canon_table) : Qnil),
posix,
STRING_MULTIBYTE (string));
immediate_quit = 1;
s2 = 0;
}
re_match_object = Qnil;
- multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters));
}
buf = compile_pattern (regexp, 0, Qnil, 0, multibyte);
static void
newline_cache_on_off (struct buffer *buf)
{
- if (NILP (buf->cache_long_line_scans))
+ if (NILP (B_ (buf, cache_long_line_scans)))
{
/* It should be off. */
if (buf->newline_cache)
}
/* This is so set_image_of_range_1 in regex.c can find the EQV table. */
- XCHAR_TABLE (current_buffer->case_canon_table)->extras[2]
- = current_buffer->case_eqv_table;
+ XCHAR_TABLE (B_ (current_buffer, case_canon_table))->extras[2]
+ = B_ (current_buffer, case_eqv_table);
np = search_buffer (string, PT, PT_BYTE, lim, lim_byte, n, RE,
- (!NILP (current_buffer->case_fold_search)
- ? current_buffer->case_canon_table
+ (!NILP (B_ (current_buffer, case_fold_search))
+ ? B_ (current_buffer, case_canon_table)
: Qnil),
- (!NILP (current_buffer->case_fold_search)
- ? current_buffer->case_eqv_table
+ (!NILP (B_ (current_buffer, case_fold_search))
+ ? B_ (current_buffer, case_eqv_table)
: Qnil),
posix);
if (np <= 0)
(NILP (Vinhibit_changing_match_data)
? &search_regs : &search_regs_1),
trt, posix,
- !NILP (current_buffer->enable_multibyte_characters));
+ !NILP (B_ (current_buffer, enable_multibyte_characters)));
immediate_quit = 1; /* Quit immediately if user types ^G,
because letting this function finish
EMACS_INT raw_pattern_size;
EMACS_INT raw_pattern_size_byte;
unsigned char *patbuf;
- int multibyte = !NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters));
unsigned char *base_pat;
/* Set to positive if we find a non-ASCII char that need
translation. Otherwise set to zero later. */
EMACS_INT pos, EMACS_INT pos_byte,
EMACS_INT lim, EMACS_INT lim_byte)
{
- int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters));
int forward = n > 0;
/* Number of buffer bytes matched. Note that this may be different
from len_byte in a multibyte buffer. */
register EMACS_INT i;
register int j;
unsigned char *pat, *pat_end;
- int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters));
unsigned char simple_translate[0400];
/* These are set to the preceding bytes of a byte to be translated
EMACS_INT length = SBYTES (newtext);
unsigned char *substed;
EMACS_INT substed_alloc_size, substed_len;
- int buf_multibyte = !NILP (current_buffer->enable_multibyte_characters);
+ int buf_multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters));
int str_multibyte = STRING_MULTIBYTE (newtext);
Lisp_Object rev_tbl;
int really_changed = 0;
else
{
gl_state.use_global = 0;
- gl_state.current_syntax_table = current_buffer->syntax_table;
+ gl_state.current_syntax_table = B_ (current_buffer, syntax_table);
}
}
static INLINE EMACS_INT
dec_bytepos (EMACS_INT bytepos)
{
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
return bytepos - 1;
DEC_POS (bytepos);
This is the one specified by the current buffer. */)
(void)
{
- return current_buffer->syntax_table;
+ return B_ (current_buffer, syntax_table);
}
DEFUN ("standard-syntax-table", Fstandard_syntax_table,
{
int idx;
check_syntax_table (table);
- current_buffer->syntax_table = table;
+ B_ (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);
CHECK_CHARACTER (c);
if (NILP (syntax_table))
- syntax_table = current_buffer->syntax_table;
+ syntax_table = B_ (current_buffer, syntax_table);
else
check_syntax_table (syntax_table);
if (XINT (lim) < BEGV)
XSETFASTINT (lim, BEGV);
- multibyte = (!NILP (current_buffer->enable_multibyte_characters)
+ multibyte = (!NILP (B_ (current_buffer, enable_multibyte_characters))
&& (XINT (lim) - PT != CHAR_TO_BYTE (XINT (lim)) - PT_BYTE));
string_multibyte = SBYTES (string) > SCHARS (string);
if (forwardp ? (PT >= XFASTINT (lim)) : (PT <= XFASTINT (lim)))
return make_number (0);
- multibyte = (!NILP (current_buffer->enable_multibyte_characters)
+ multibyte = (!NILP (B_ (current_buffer, enable_multibyte_characters))
&& (XINT (lim) - PT != CHAR_TO_BYTE (XINT (lim)) - PT_BYTE));
memset (fastmap, 0, sizeof fastmap);
while (from > stop)
{
temp_pos = from_byte;
- if (! NILP (current_buffer->enable_multibyte_characters))
+ if (! NILP (B_ (current_buffer, enable_multibyte_characters)))
DEC_POS (temp_pos);
else
temp_pos--;
/* The standard syntax table is stored where it will automatically
be used in all new buffers. */
-#define Vstandard_syntax_table buffer_defaults.syntax_table
+#define Vstandard_syntax_table B_ (&buffer_defaults, syntax_table)
/* A syntax table is a chartable whose elements are cons cells
(CODE+FLAGS . MATCHING-CHAR). MATCHING-CHAR can be nil if the char
# define CURRENT_SYNTAX_TABLE gl_state.current_syntax_table
#else
# define SYNTAX_ENTRY SYNTAX_ENTRY_INT
-# define CURRENT_SYNTAX_TABLE current_buffer->syntax_table
+# define CURRENT_SYNTAX_TABLE B_ (current_buffer, syntax_table)
#endif
#define SYNTAX_ENTRY_INT(c) CHAR_TABLE_REF (CURRENT_SYNTAX_TABLE, (c))
do \
{ \
gl_state.use_global = 0; \
- gl_state.current_syntax_table = current_buffer->syntax_table; \
+ gl_state.current_syntax_table = B_ (current_buffer, syntax_table); \
} while (0)
/* This macro should be called with FROM at the start of forward
Fundo_boundary ();
last_undo_buffer = current_buffer;
- if (CONSP (current_buffer->undo_list))
+ if (CONSP (B_ (current_buffer, undo_list)))
{
/* Set AT_BOUNDARY to 1 only when we have nothing other than
marker adjustment before undo boundary. */
- Lisp_Object tail = current_buffer->undo_list, elt;
+ Lisp_Object tail = B_ (current_buffer, undo_list), elt;
while (1)
{
if (at_boundary
&& current_buffer == last_boundary_buffer
&& last_boundary_position != pt)
- current_buffer->undo_list
- = Fcons (make_number (last_boundary_position), current_buffer->undo_list);
+ B_ (current_buffer, undo_list)
+ = Fcons (make_number (last_boundary_position), B_ (current_buffer, undo_list));
}
/* Record an insertion that just happened or is about to happen,
{
Lisp_Object lbeg, lend;
- if (EQ (current_buffer->undo_list, Qt))
+ if (EQ (B_ (current_buffer, undo_list), Qt))
return;
record_point (beg);
/* If this is following another insertion and consecutive with it
in the buffer, combine the two. */
- if (CONSP (current_buffer->undo_list))
+ if (CONSP (B_ (current_buffer, undo_list)))
{
Lisp_Object elt;
- elt = XCAR (current_buffer->undo_list);
+ elt = XCAR (B_ (current_buffer, undo_list));
if (CONSP (elt)
&& INTEGERP (XCAR (elt))
&& INTEGERP (XCDR (elt))
XSETFASTINT (lbeg, beg);
XSETINT (lend, beg + length);
- current_buffer->undo_list = Fcons (Fcons (lbeg, lend),
- current_buffer->undo_list);
+ B_ (current_buffer, undo_list) = Fcons (Fcons (lbeg, lend),
+ B_ (current_buffer, undo_list));
}
/* Record that a deletion is about to take place,
{
Lisp_Object sbeg;
- if (EQ (current_buffer->undo_list, Qt))
+ if (EQ (B_ (current_buffer, undo_list), Qt))
return;
if (PT == beg + SCHARS (string))
record_point (beg);
}
- current_buffer->undo_list
- = Fcons (Fcons (string, sbeg), current_buffer->undo_list);
+ B_ (current_buffer, undo_list)
+ = Fcons (Fcons (string, sbeg), B_ (current_buffer, undo_list));
}
/* Record the fact that MARKER is about to be adjusted by ADJUSTMENT.
void
record_marker_adjustment (Lisp_Object marker, EMACS_INT adjustment)
{
- if (EQ (current_buffer->undo_list, Qt))
+ if (EQ (B_ (current_buffer, undo_list), Qt))
return;
/* Allocate a cons cell to be the undo boundary after this command. */
Fundo_boundary ();
last_undo_buffer = current_buffer;
- current_buffer->undo_list
+ B_ (current_buffer, undo_list)
= Fcons (Fcons (marker, make_number (adjustment)),
- current_buffer->undo_list);
+ B_ (current_buffer, undo_list));
}
/* Record that a replacement is about to take place,
Lisp_Object high, low;
struct buffer *base_buffer = current_buffer;
- if (EQ (current_buffer->undo_list, Qt))
+ if (EQ (B_ (current_buffer, undo_list), Qt))
return;
if (current_buffer != last_undo_buffer)
XSETFASTINT (high, (base_buffer->modtime >> 16) & 0xffff);
XSETFASTINT (low, base_buffer->modtime & 0xffff);
- current_buffer->undo_list = Fcons (Fcons (Qt, Fcons (high, low)), current_buffer->undo_list);
+ B_ (current_buffer, undo_list) = Fcons (Fcons (Qt, Fcons (high, low)), B_ (current_buffer, undo_list));
}
/* Record a change in property PROP (whose old value was VAL)
struct buffer *obuf = current_buffer, *buf = XBUFFER (buffer);
int boundary = 0;
- if (EQ (buf->undo_list, Qt))
+ if (EQ (B_ (buf, undo_list), Qt))
return;
/* Allocate a cons cell to be the undo boundary after this command. */
XSETINT (lbeg, beg);
XSETINT (lend, beg + length);
entry = Fcons (Qnil, Fcons (prop, Fcons (value, Fcons (lbeg, lend))));
- current_buffer->undo_list = Fcons (entry, current_buffer->undo_list);
+ B_ (current_buffer, undo_list) = Fcons (entry, B_ (current_buffer, undo_list));
current_buffer = obuf;
}
(void)
{
Lisp_Object tem;
- if (EQ (current_buffer->undo_list, Qt))
+ if (EQ (B_ (current_buffer, undo_list), Qt))
return Qnil;
- tem = Fcar (current_buffer->undo_list);
+ tem = Fcar (B_ (current_buffer, undo_list));
if (!NILP (tem))
{
/* One way or another, cons nil onto the front of the undo list. */
{
/* If we have preallocated the cons cell to use here,
use that one. */
- XSETCDR (pending_boundary, current_buffer->undo_list);
- current_buffer->undo_list = pending_boundary;
+ XSETCDR (pending_boundary, B_ (current_buffer, undo_list));
+ B_ (current_buffer, undo_list) = pending_boundary;
pending_boundary = Qnil;
}
else
- current_buffer->undo_list = Fcons (Qnil, current_buffer->undo_list);
+ B_ (current_buffer, undo_list) = Fcons (Qnil, B_ (current_buffer, undo_list));
}
last_boundary_position = PT;
last_boundary_buffer = current_buffer;
record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
set_buffer_internal (b);
- list = b->undo_list;
+ list = B_ (b, undo_list);
prev = Qnil;
next = list;
XSETCDR (last_boundary, Qnil);
/* There's nothing we decided to keep, so clear it out. */
else
- b->undo_list = Qnil;
+ B_ (b, undo_list) = Qnil;
unbind_to (count, Qnil);
}
/* In a writable buffer, enable undoing read-only text that is so
because of text properties. */
- if (NILP (current_buffer->read_only))
+ if (NILP (B_ (current_buffer, read_only)))
specbind (Qinhibit_read_only, Qt);
/* Don't let `intangible' properties interfere with undo. */
specbind (Qinhibit_point_motion_hooks, Qt);
- oldlist = current_buffer->undo_list;
+ oldlist = B_ (current_buffer, undo_list);
while (arg > 0)
{
so the test in `undo' for continuing an undo series
will work right. */
if (did_apply
- && EQ (oldlist, current_buffer->undo_list))
- current_buffer->undo_list
- = Fcons (list3 (Qapply, Qcdr, Qnil), current_buffer->undo_list);
+ && EQ (oldlist, B_ (current_buffer, undo_list)))
+ B_ (current_buffer, undo_list)
+ = Fcons (list3 (Qapply, Qcdr, Qnil), B_ (current_buffer, undo_list));
UNGCPRO;
return unbind_to (count, list);
{
struct buffer *b = XBUFFER (w->buffer);
- if (DISP_TABLE_P (b->display_table))
- dp = XCHAR_TABLE (b->display_table);
+ if (DISP_TABLE_P (B_ (b, display_table)))
+ dp = XCHAR_TABLE (B_ (b, display_table));
else if (DISP_TABLE_P (Vstandard_display_table))
dp = XCHAR_TABLE (Vstandard_display_table);
}
So don't clobber point in that buffer. */
if (! EQ (buf, XWINDOW (selected_window)->buffer)
/* This line helps to fix Horsley's testbug.el bug. */
- && !(WINDOWP (b->last_selected_window)
- && w != XWINDOW (b->last_selected_window)
- && EQ (buf, XWINDOW (b->last_selected_window)->buffer)))
+ && !(WINDOWP (B_ (b, last_selected_window))
+ && w != XWINDOW (B_ (b, last_selected_window))
+ && EQ (buf, XWINDOW (B_ (b, last_selected_window))->buffer)))
temp_set_point_both (b,
clip_to_bounds (BUF_BEGV (b),
XMARKER (w->pointm)->charpos,
marker_byte_position (w->pointm),
BUF_ZV_BYTE (b)));
- if (WINDOWP (b->last_selected_window)
- && w == XWINDOW (b->last_selected_window))
- b->last_selected_window = Qnil;
+ if (WINDOWP (B_ (b, last_selected_window))
+ && w == XWINDOW (B_ (b, last_selected_window)))
+ B_ (b, last_selected_window) = Qnil;
}
/* Put replacement into the window structure in place of old. */
/* Check for a window that has a killed buffer. */
case CHECK_ALL_WINDOWS:
if (! NILP (w->buffer)
- && NILP (XBUFFER (w->buffer)->name))
+ && NILP (B_ (XBUFFER (w->buffer), name)))
abort ();
break;
{
int safe_size = (MIN_SAFE_WINDOW_HEIGHT
+ ((BUFFERP (w->buffer)
- && !NILP (XBUFFER (w->buffer)->mode_line_format))
+ && !NILP (B_ (XBUFFER (w->buffer), mode_line_format)))
? 1 : 0));
return safe_p ? safe_size : max (window_min_height, safe_size);
w->buffer = buffer;
if (EQ (window, selected_window))
- b->last_selected_window = window;
+ B_ (b, last_selected_window) = window;
/* Let redisplay errors through. */
b->display_error_modiff = 0;
/* Update time stamps of buffer display. */
- if (INTEGERP (b->display_count))
- XSETINT (b->display_count, XINT (b->display_count) + 1);
- b->display_time = Fcurrent_time ();
+ if (INTEGERP (B_ (b, display_count)))
+ XSETINT (B_ (b, display_count), XINT (B_ (b, display_count)) + 1);
+ B_ (b, display_time) = Fcurrent_time ();
XSETFASTINT (w->window_end_pos, 0);
XSETFASTINT (w->window_end_vpos, 0);
w->left_margin_cols = w->right_margin_cols = Qnil;
Fset_window_fringes (window,
- b->left_fringe_width, b->right_fringe_width,
- b->fringes_outside_margins);
+ B_ (b, left_fringe_width), B_ (b, right_fringe_width),
+ B_ (b, fringes_outside_margins));
Fset_window_scroll_bars (window,
- b->scroll_bar_width,
- b->vertical_scroll_bar_type, Qnil);
+ B_ (b, scroll_bar_width),
+ B_ (b, vertical_scroll_bar_type), Qnil);
w->left_margin_cols = save_left;
w->right_margin_cols = save_right;
Fset_window_margins (window,
- b->left_margin_cols, b->right_margin_cols);
+ B_ (b, left_margin_cols), B_ (b, right_margin_cols));
}
if (run_hooks_p)
XSETWINDOW (window, w);
buffer = Fget_buffer (buffer_or_name);
CHECK_BUFFER (buffer);
- if (NILP (XBUFFER (buffer)->name))
+ if (NILP (B_ (XBUFFER (buffer), name)))
error ("Attempt to display deleted buffer");
tem = w->buffer;
if (EQ (tem, buffer))
return Qnil;
else if (EQ (w->dedicated, Qt))
- error ("Window is dedicated to `%s'", SDATA (XBUFFER (tem)->name));
+ error ("Window is dedicated to `%s'", SDATA (B_ (XBUFFER (tem), name)));
else
w->dedicated = Qnil;
Fset_buffer (w->buffer);
- XBUFFER (w->buffer)->last_selected_window = window;
+ B_ (XBUFFER (w->buffer), last_selected_window) = window;
/* Go to the point recorded in the window.
This is important when the buffer is in more
if (STRINGP (object))
object = Fget_buffer (object);
- if (BUFFERP (object) && !NILP (XBUFFER (object)->name))
+ if (BUFFERP (object) && !NILP (B_ (XBUFFER (object), name)))
{
/* Walk all windows looking for buffer, and force update
of each of those windows. */
register Lisp_Object window;
register struct window *w;
- XBUFFER (buf)->directory = current_buffer->directory;
+ B_ (XBUFFER (buf), directory) = B_ (current_buffer, directory);
Fset_buffer (buf);
BUF_SAVE_MODIFF (XBUFFER (buf)) = MODIFF;
saved_windows = XVECTOR (data->saved_windows);
new_current_buffer = data->current_buffer;
- if (NILP (XBUFFER (new_current_buffer)->name))
+ if (NILP (B_ (XBUFFER (new_current_buffer), name)))
new_current_buffer = Qnil;
else
{
w->buffer = p->buffer;
else
{
- if (!NILP (XBUFFER (p->buffer)->name))
+ if (!NILP (B_ (XBUFFER (p->buffer), name)))
/* If saved buffer is alive, install it. */
{
w->buffer = p->buffer;
w->start_at_line_beg = p->start_at_line_beg;
set_marker_restricted (w->start, p->start, w->buffer);
set_marker_restricted (w->pointm, p->pointm, w->buffer);
- Fset_marker (XBUFFER (w->buffer)->mark,
+ Fset_marker (B_ (XBUFFER (w->buffer), mark),
p->mark, w->buffer);
/* As documented in Fcurrent_window_configuration, don't
&& XBUFFER (p->buffer) == current_buffer)
Fgoto_char (w->pointm);
}
- else if (NILP (w->buffer) || NILP (XBUFFER (w->buffer)->name))
+ else if (NILP (w->buffer) || NILP (B_ (XBUFFER (w->buffer), name)))
/* Else unless window has a live buffer, get one. */
{
w->buffer = Fcdr (Fcar (Vbuffer_alist));
has been restored into it. We already swapped out that point
from that window's old buffer. */
select_window (data->current_window, Qnil, 1);
- XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window
+ B_ (XBUFFER (XWINDOW (selected_window)->buffer), last_selected_window)
= selected_window;
if (NILP (data->focus_frame)
p->start = Fcopy_marker (w->start, Qnil);
p->start_at_line_beg = w->start_at_line_beg;
- tem = XBUFFER (w->buffer)->mark;
+ tem = B_ (XBUFFER (w->buffer), mark);
p->mark = Fcopy_marker (tem, Qnil);
}
else
if (WINDOW_WANTS_MODELINE_P (w))
current_mode_line_height
= display_mode_line (w, CURRENT_MODE_LINE_FACE_ID (w),
- current_buffer->mode_line_format);
+ B_ (current_buffer, mode_line_format));
if (WINDOW_WANTS_HEADER_LINE_P (w))
current_header_line_height
= display_mode_line (w, HEADER_LINE_FACE_ID,
- current_buffer->header_line_format);
+ B_ (current_buffer, header_line_format));
start_display (&it, w, top);
move_it_to (&it, charpos, -1, it.last_visible_y-1, -1,
if (base_face_id == DEFAULT_FACE_ID
&& FRAME_WINDOW_P (it->f))
{
- if (NATNUMP (current_buffer->extra_line_spacing))
- it->extra_line_spacing = XFASTINT (current_buffer->extra_line_spacing);
- else if (FLOATP (current_buffer->extra_line_spacing))
- it->extra_line_spacing = (XFLOAT_DATA (current_buffer->extra_line_spacing)
+ if (NATNUMP (B_ (current_buffer, extra_line_spacing)))
+ it->extra_line_spacing = XFASTINT (B_ (current_buffer, extra_line_spacing));
+ else if (FLOATP (B_ (current_buffer, extra_line_spacing)))
+ it->extra_line_spacing = (XFLOAT_DATA (B_ (current_buffer, extra_line_spacing))
* FRAME_LINE_HEIGHT (it->f));
else if (it->f->extra_line_spacing > 0)
it->extra_line_spacing = it->f->extra_line_spacing;
it->override_ascent = -1;
/* Are control characters displayed as `^C'? */
- it->ctl_arrow_p = !NILP (current_buffer->ctl_arrow);
+ it->ctl_arrow_p = !NILP (B_ (current_buffer, ctl_arrow));
/* -1 means everything between a CR and the following line end
is invisible. >0 means lines indented more than this value are
invisible. */
- it->selective = (INTEGERP (current_buffer->selective_display)
- ? XFASTINT (current_buffer->selective_display)
- : (!NILP (current_buffer->selective_display)
+ it->selective = (INTEGERP (B_ (current_buffer, selective_display))
+ ? XFASTINT (B_ (current_buffer, selective_display))
+ : (!NILP (B_ (current_buffer, selective_display))
? -1 : 0));
it->selective_display_ellipsis_p
- = !NILP (current_buffer->selective_display_ellipses);
+ = !NILP (B_ (current_buffer, selective_display_ellipses));
/* Display table to use. */
it->dp = window_display_table (w);
/* Are multibyte characters enabled in current_buffer? */
- it->multibyte_p = !NILP (current_buffer->enable_multibyte_characters);
+ it->multibyte_p = !NILP (B_ (current_buffer, enable_multibyte_characters));
/* Do we need to reorder bidirectional text? Not if this is a
unibyte buffer: by definition, none of the single-byte characters
are strong R2L, so no reordering is needed. And bidi.c doesn't
support unibyte buffers anyway. */
it->bidi_p
- = !NILP (current_buffer->bidi_display_reordering) && it->multibyte_p;
+ = !NILP (B_ (current_buffer, bidi_display_reordering)) && it->multibyte_p;
/* Non-zero if we should highlight the region. */
highlight_region_p
= (!NILP (Vtransient_mark_mode)
- && !NILP (current_buffer->mark_active)
- && XMARKER (current_buffer->mark)->buffer != 0);
+ && !NILP (B_ (current_buffer, mark_active))
+ && XMARKER (B_ (current_buffer, mark))->buffer != 0);
/* Set IT->region_beg_charpos and IT->region_end_charpos to the
start and end of a visible region in window IT->w. Set both to
&& WINDOWP (minibuf_selected_window)
&& w == XWINDOW (minibuf_selected_window))))
{
- EMACS_INT charpos = marker_position (current_buffer->mark);
+ EMACS_INT charpos = marker_position (B_ (current_buffer, mark));
it->region_beg_charpos = min (PT, charpos);
it->region_end_charpos = max (PT, charpos);
}
it->redisplay_end_trigger_charpos = XINT (w->redisplay_end_trigger);
/* Correct bogus values of tab_width. */
- it->tab_width = XINT (current_buffer->tab_width);
+ it->tab_width = XINT (B_ (current_buffer, tab_width));
if (it->tab_width <= 0 || it->tab_width > 1000)
it->tab_width = 8;
&& (WINDOW_TOTAL_COLS (it->w)
< XINT (Vtruncate_partial_width_windows))))))
it->line_wrap = TRUNCATE;
- else if (NILP (current_buffer->truncate_lines))
- it->line_wrap = NILP (current_buffer->word_wrap)
+ else if (NILP (B_ (current_buffer, truncate_lines)))
+ it->line_wrap = NILP (B_ (current_buffer, word_wrap))
? WINDOW_WRAP : WORD_WRAP;
else
it->line_wrap = TRUNCATE;
{
/* Note the paragraph direction that this buffer wants to
use. */
- if (EQ (current_buffer->bidi_paragraph_direction, Qleft_to_right))
+ if (EQ (B_ (current_buffer, bidi_paragraph_direction), Qleft_to_right))
it->paragraph_embedding = L2R;
- else if (EQ (current_buffer->bidi_paragraph_direction, Qright_to_left))
+ else if (EQ (B_ (current_buffer, bidi_paragraph_direction), Qright_to_left))
it->paragraph_embedding = R2L;
else
it->paragraph_embedding = NEUTRAL_DIR;
it->method = GET_FROM_BUFFER;
it->object = it->w->buffer;
it->area = TEXT_AREA;
- it->multibyte_p = !NILP (current_buffer->enable_multibyte_characters);
+ it->multibyte_p = !NILP (B_ (current_buffer, enable_multibyte_characters));
it->sp = 0;
it->string_from_display_prop_p = 0;
it->face_before_selective_p = 0;
old_deactivate_mark = Vdeactivate_mark;
oldbuf = current_buffer;
Fset_buffer (Fget_buffer_create (Vmessages_buffer_name));
- current_buffer->undo_list = Qt;
+ B_ (current_buffer, undo_list) = Qt;
oldpoint = message_dolog_marker1;
set_marker_restricted (oldpoint, make_number (PT), Qnil);
/* Insert the string--maybe converting multibyte to single byte
or vice versa, so that all the text fits the buffer. */
if (multibyte
- && NILP (current_buffer->enable_multibyte_characters))
+ && NILP (B_ (current_buffer, enable_multibyte_characters)))
{
EMACS_INT i;
int c, char_bytes;
}
}
else if (! multibyte
- && ! NILP (current_buffer->enable_multibyte_characters))
+ && ! NILP (B_ (current_buffer, enable_multibyte_characters)))
{
EMACS_INT i;
int c, char_bytes;
Lisp_Object string;
string = Fcurrent_message ();
message3 (string, SBYTES (string),
- !NILP (current_buffer->enable_multibyte_characters));
+ !NILP (B_ (current_buffer, enable_multibyte_characters)));
}
}
for (i = 0; i < 2; ++i)
if (!BUFFERP (echo_buffer[i])
- || NILP (XBUFFER (echo_buffer[i])->name))
+ || NILP (B_ (XBUFFER (echo_buffer[i]), name)))
{
char name[30];
Lisp_Object old_buffer;
old_buffer = echo_buffer[i];
sprintf (name, " *Echo Area %d*", i);
echo_buffer[i] = Fget_buffer_create (build_string (name));
- XBUFFER (echo_buffer[i])->truncate_lines = Qnil;
+ B_ (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; */
set_marker_both (w->pointm, buffer, BEG, BEG_BYTE);
}
- current_buffer->undo_list = Qt;
- current_buffer->read_only = Qnil;
+ B_ (current_buffer, undo_list) = Qt;
+ B_ (current_buffer, read_only) = Qnil;
specbind (Qinhibit_read_only, Qt);
specbind (Qinhibit_modification_hooks, Qt);
/* Switch to that buffer and clear it. */
set_buffer_internal (XBUFFER (echo_area_buffer[0]));
- current_buffer->truncate_lines = Qnil;
+ B_ (current_buffer, truncate_lines) = Qnil;
if (Z > BEG)
{
/* Set up the buffer for the multibyteness we need. */
if (multibyte_p
- != !NILP (current_buffer->enable_multibyte_characters))
+ != !NILP (B_ (current_buffer, enable_multibyte_characters)))
Fset_buffer_multibyte (multibyte_p ? Qt : Qnil);
/* Raise the frame containing the echo area. */
{
/* Someone switched buffers between print requests. */
set_buffer_internal (XBUFFER (echo_area_buffer[0]));
- current_buffer->truncate_lines = Qnil;
+ B_ (current_buffer, truncate_lines) = Qnil;
}
}
}
/* Change multibyteness of the echo buffer appropriately. */
if (message_enable_multibyte
- != !NILP (current_buffer->enable_multibyte_characters))
+ != !NILP (B_ (current_buffer, enable_multibyte_characters)))
Fset_buffer_multibyte (message_enable_multibyte ? Qt : Qnil);
- current_buffer->truncate_lines = message_truncate_lines ? Qt : Qnil;
- if (!NILP (current_buffer->bidi_display_reordering))
- current_buffer->bidi_paragraph_direction = Qleft_to_right;
+ B_ (current_buffer, truncate_lines) = message_truncate_lines ? Qt : Qnil;
+ if (!NILP (B_ (current_buffer, bidi_display_reordering)))
+ B_ (current_buffer, bidi_paragraph_direction) = Qleft_to_right;
/* Insert new message at BEG. */
TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
if (nbytes == 0)
nbytes = strlen (s);
- if (multibyte_p && NILP (current_buffer->enable_multibyte_characters))
+ if (multibyte_p && NILP (B_ (current_buffer, enable_multibyte_characters)))
{
/* Convert from multi-byte to single-byte. */
EMACS_INT i;
}
}
else if (!multibyte_p
- && !NILP (current_buffer->enable_multibyte_characters))
+ && !NILP (B_ (current_buffer, enable_multibyte_characters)))
{
/* Convert from single-byte to multi-byte. */
EMACS_INT i;
< BUF_MODIFF (XBUFFER (w->buffer)))
!= !NILP (w->last_had_star))
|| ((!NILP (Vtransient_mark_mode)
- && !NILP (XBUFFER (w->buffer)->mark_active))
+ && !NILP (B_ (XBUFFER (w->buffer), mark_active)))
!= !NILP (w->region_showing)))
{
struct buffer *prev = current_buffer;
< BUF_MODIFF (XBUFFER (w->buffer)))
!= !NILP (w->last_had_star))
|| ((!NILP (Vtransient_mark_mode)
- && !NILP (XBUFFER (w->buffer)->mark_active))
+ && !NILP (B_ (XBUFFER (w->buffer), mark_active)))
!= !NILP (w->region_showing)))
{
struct buffer *prev = current_buffer;
/* If selective display, can't optimize if changes start at the
beginning of the line. */
if (unchanged_p
- && INTEGERP (current_buffer->selective_display)
- && XINT (current_buffer->selective_display) > 0
+ && INTEGERP (B_ (current_buffer, selective_display))
+ && XINT (B_ (current_buffer, selective_display)) > 0
&& (BEG_UNCHANGED < start || GPT <= start))
unchanged_p = 0;
require to redisplay the whole paragraph. It might be worthwhile
to find the paragraph limits and widen the range of redisplayed
lines to that, but for now just give up this optimization. */
- if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering)
- && NILP (XBUFFER (w->buffer)->bidi_paragraph_direction))
+ if (!NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering))
+ && NILP (B_ (XBUFFER (w->buffer), bidi_paragraph_direction)))
unchanged_p = 0;
}
the whole window. The assignment to this_line_start_pos prevents
the optimization directly below this if-statement. */
if (((!NILP (Vtransient_mark_mode)
- && !NILP (XBUFFER (w->buffer)->mark_active))
+ && !NILP (B_ (XBUFFER (w->buffer), mark_active)))
!= !NILP (w->region_showing))
|| (!NILP (w->region_showing)
&& !EQ (w->region_showing,
- Fmarker_position (XBUFFER (w->buffer)->mark))))
+ Fmarker_position (B_ (XBUFFER (w->buffer), mark)))))
CHARPOS (this_line_start_pos) = 0;
/* Optimize the case that only the line containing the cursor in the
/* If highlighting the region, or if the cursor is in the echo area,
then we can't just move the cursor. */
else if (! (!NILP (Vtransient_mark_mode)
- && !NILP (current_buffer->mark_active))
- && (EQ (selected_window, current_buffer->last_selected_window)
+ && !NILP (B_ (current_buffer, mark_active)))
+ && (EQ (selected_window, B_ (current_buffer, last_selected_window))
|| highlight_nonselected_windows)
&& NILP (w->region_showing)
&& NILP (Vshow_trailing_whitespace)
scroll_max = (max (scroll_step,
max (arg_scroll_conservatively, temp_scroll_step))
* FRAME_LINE_HEIGHT (f));
- else if (NUMBERP (current_buffer->scroll_down_aggressively)
- || NUMBERP (current_buffer->scroll_up_aggressively))
+ else if (NUMBERP (B_ (current_buffer, scroll_down_aggressively))
+ || NUMBERP (B_ (current_buffer, scroll_up_aggressively)))
/* We're trying to scroll because of aggressive scrolling but no
scroll_step is set. Choose an arbitrary one. */
scroll_max = 10 * FRAME_LINE_HEIGHT (f);
amount_to_scroll = scroll_max;
else
{
- aggressive = current_buffer->scroll_up_aggressively;
+ aggressive = B_ (current_buffer, scroll_up_aggressively);
height = WINDOW_BOX_TEXT_HEIGHT (w);
if (NUMBERP (aggressive))
{
amount_to_scroll = scroll_max;
else
{
- aggressive = current_buffer->scroll_down_aggressively;
+ aggressive = B_ (current_buffer, scroll_down_aggressively);
height = WINDOW_BOX_TEXT_HEIGHT (w);
if (NUMBERP (aggressive))
{
region exists, cursor movement has to do more than just
set the cursor. */
&& !(!NILP (Vtransient_mark_mode)
- && !NILP (current_buffer->mark_active))
+ && !NILP (B_ (current_buffer, mark_active)))
&& NILP (w->region_showing)
&& NILP (Vshow_trailing_whitespace)
/* Right after splitting windows, last_point may be nil. */
must_scroll = 1;
}
else if (rc != CURSOR_MOVEMENT_SUCCESS
- && !NILP (XBUFFER (w->buffer)->bidi_display_reordering))
+ && !NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering)))
{
/* If rows are bidi-reordered and point moved, back up
until we find a row that does not belong to a
else if (scroll_p)
rc = CURSOR_MOVEMENT_MUST_SCROLL;
else if (rc != CURSOR_MOVEMENT_SUCCESS
- && !NILP (XBUFFER (w->buffer)->bidi_display_reordering))
+ && !NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering)))
{
/* With bidi-reordered rows, there could be more than
one candidate row whose start and end positions
struct Lisp_Char_Table *disptab = buffer_display_table ();
if (! disptab_matches_widthtab (disptab,
- XVECTOR (current_buffer->width_table)))
+ XVECTOR (B_ (current_buffer, width_table))))
{
invalidate_region_cache (current_buffer,
current_buffer->width_run_cache,
/* If we are highlighting the region, then we just changed
the region, so redisplay to show it. */
if (!NILP (Vtransient_mark_mode)
- && !NILP (current_buffer->mark_active))
+ && !NILP (B_ (current_buffer, mark_active)))
{
clear_glyph_matrix (w->desired_matrix);
if (!try_window (window, startp, 0))
if ((scroll_conservatively
|| emacs_scroll_step
|| temp_scroll_step
- || NUMBERP (current_buffer->scroll_up_aggressively)
- || NUMBERP (current_buffer->scroll_down_aggressively))
+ || NUMBERP (B_ (current_buffer, scroll_up_aggressively))
+ || NUMBERP (B_ (current_buffer, scroll_down_aggressively)))
&& !current_buffer->clip_changed
&& CHARPOS (startp) >= BEGV
&& CHARPOS (startp) <= ZV)
/* Can't do this if region may have changed. */
if ((!NILP (Vtransient_mark_mode)
- && !NILP (current_buffer->mark_active))
+ && !NILP (B_ (current_buffer, mark_active)))
|| !NILP (w->region_showing)
|| !NILP (Vshow_trailing_whitespace))
return 0;
/* Can't use this optimization with bidi-reordered glyph
rows, unless cursor is already at point. */
- if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering))
+ if (!NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering)))
{
if (!(w->cursor.hpos >= 0
&& w->cursor.hpos < row->used[TEXT_AREA]
{
struct glyph *g;
- if (NILP (XBUFFER (w->buffer)->bidi_display_reordering)
+ if (NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering))
|| (!best_row && !row->continued_p))
return row;
/* In bidi-reordered rows, there could be several rows
/* Can't use this if highlighting a region because a cursor movement
will do more than just set the cursor. */
if (!NILP (Vtransient_mark_mode)
- && !NILP (current_buffer->mark_active))
+ && !NILP (B_ (current_buffer, mark_active)))
GIVE_UP (9);
/* Likewise if highlighting trailing whitespace. */
wrapped line can change the wrap position, altering the line
above it. It might be worthwhile to handle this more
intelligently, but for now just redisplay from scratch. */
- if (!NILP (XBUFFER (w->buffer)->word_wrap))
+ if (!NILP (B_ (XBUFFER (w->buffer), word_wrap)))
GIVE_UP (21);
/* Under bidi reordering, adding or deleting a character in the
to find the paragraph limits and widen the range of redisplayed
lines to that, but for now just give up this optimization and
redisplay from scratch. */
- if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering)
- && NILP (XBUFFER (w->buffer)->bidi_paragraph_direction))
+ if (!NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering))
+ && NILP (B_ (XBUFFER (w->buffer), bidi_paragraph_direction)))
GIVE_UP (22);
/* Make sure beg_unchanged and end_unchanged are up to date. Do it
it.glyph_row->used[TEXT_AREA] = 0;
SET_TEXT_POS (it.position, 0, 0);
- multibyte_p = !NILP (buffer->enable_multibyte_characters);
+ multibyte_p = !NILP (B_ (buffer, enable_multibyte_characters));
p = arrow_string;
while (p < arrow_end)
{
row->glyphs[TEXT_AREA]->charpos = -1;
row->displays_text_p = 0;
- if (!NILP (XBUFFER (it->w->buffer)->indicate_empty_lines)
+ if (!NILP (B_ (XBUFFER (it->w->buffer), indicate_empty_lines))
&& (!MINI_WINDOW_P (it->w)
|| (minibuf_level && EQ (it->window, minibuf_window))))
row->indicate_empty_line_p = 1;
old = current_buffer;
}
- if (NILP (buf->bidi_display_reordering))
+ if (NILP (B_ (buf, bidi_display_reordering)))
return Qleft_to_right;
- else if (!NILP (buf->bidi_paragraph_direction))
- return buf->bidi_paragraph_direction;
+ else if (!NILP (B_ (buf, bidi_paragraph_direction)))
+ return B_ (buf, bidi_paragraph_direction);
else
{
/* Determine the direction from buffer text. We could try to
/* Select mode line face based on the real selected window. */
display_mode_line (w, CURRENT_MODE_LINE_FACE_ID_3 (sel_w, sel_w, w),
- current_buffer->mode_line_format);
+ B_ (current_buffer, mode_line_format));
++n;
}
if (WINDOW_WANTS_HEADER_LINE_P (w))
{
display_mode_line (w, HEADER_LINE_FACE_ID,
- current_buffer->header_line_format);
+ B_ (current_buffer, header_line_format));
++n;
}
decode_mode_spec_coding (Lisp_Object coding_system, register char *buf, int eol_flag)
{
Lisp_Object val;
- int multibyte = !NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters));
const unsigned char *eol_str;
int eol_str_len;
/* The EOL conversion we are using. */
switch (c)
{
case '*':
- if (!NILP (b->read_only))
+ if (!NILP (B_ (b, read_only)))
return "%";
if (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
return "*";
/* This differs from %* only for a modified read-only buffer. */
if (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
return "*";
- if (!NILP (b->read_only))
+ if (!NILP (B_ (b, read_only)))
return "%";
return "-";
}
case 'b':
- obj = b->name;
+ obj = B_ (b, name);
break;
case 'c':
return "Emacs";
case 'f':
- obj = b->filename;
+ obj = B_ (b, filename);
break;
case 'i':
break;
case 'm':
- obj = b->mode_name;
+ obj = B_ (b, mode_name);
break;
case 'n':
{
int count = inhibit_garbage_collection ();
Lisp_Object val = call1 (intern ("file-remote-p"),
- current_buffer->directory);
+ B_ (current_buffer, directory));
unbind_to (count, Qnil);
if (NILP (val))
(FRAME_TERMINAL_CODING (f)->id),
p, 0);
}
- p = decode_mode_spec_coding (b->buffer_file_coding_system,
+ p = decode_mode_spec_coding (B_ (b, buffer_file_coding_system),
p, eol_flag);
#if 0 /* This proves to be annoying; I think we can do without. -- rms. */
/* If we are not in selective display mode,
check only for newlines. */
- int selective_display = (!NILP (current_buffer->selective_display)
- && !INTEGERP (current_buffer->selective_display));
+ int selective_display = (!NILP (B_ (current_buffer, selective_display))
+ && !INTEGERP (B_ (current_buffer, selective_display)));
if (count > 0)
{
{
if (w == XWINDOW (echo_area_window))
{
- if (EQ (b->cursor_type, Qt) || NILP (b->cursor_type))
+ if (EQ (B_ (b, cursor_type), Qt) || NILP (B_ (b, cursor_type)))
{
*width = FRAME_CURSOR_WIDTH (f);
return FRAME_DESIRED_CURSOR (f);
}
else
- return get_specified_cursor_type (b->cursor_type, width);
+ return get_specified_cursor_type (B_ (b, cursor_type), width);
}
*active_cursor = 0;
}
/* Never display a cursor in a window in which cursor-type is nil. */
- if (NILP (b->cursor_type))
+ if (NILP (B_ (b, cursor_type)))
return NO_CURSOR;
/* Get the normal cursor type for this window. */
- if (EQ (b->cursor_type, Qt))
+ if (EQ (B_ (b, cursor_type), Qt))
{
cursor_type = FRAME_DESIRED_CURSOR (f);
*width = FRAME_CURSOR_WIDTH (f);
}
else
- cursor_type = get_specified_cursor_type (b->cursor_type, width);
+ cursor_type = get_specified_cursor_type (B_ (b, cursor_type), width);
/* Use cursor-in-non-selected-windows instead
for non-selected window or frame. */
if (non_selected)
{
- alt_cursor = b->cursor_in_non_selected_windows;
+ alt_cursor = B_ (b, cursor_in_non_selected_windows);
if (!EQ (Qt, alt_cursor))
return get_specified_cursor_type (alt_cursor, width);
/* t means modify the normal cursor type. */
/* Cursor is blinked off, so determine how to "toggle" it. */
/* First look for an entry matching the buffer's cursor-type in blink-cursor-alist. */
- if ((alt_cursor = Fassoc (b->cursor_type, Vblink_cursor_alist), !NILP (alt_cursor)))
+ if ((alt_cursor = Fassoc (B_ (b, cursor_type), Vblink_cursor_alist), !NILP (alt_cursor)))
return get_specified_cursor_type (XCDR (alt_cursor), width);
/* Then see if frame has specified a specific blink off cursor type. */
necessarily display the character whose position
is the smallest. */
Lisp_Object lim1 =
- NILP (XBUFFER (buffer)->bidi_display_reordering)
+ NILP (B_ (XBUFFER (buffer), bidi_display_reordering))
? Fmarker_position (w->start)
: Qnil;
Lisp_Object lim2 =
- NILP (XBUFFER (buffer)->bidi_display_reordering)
+ NILP (B_ (XBUFFER (buffer), bidi_display_reordering))
? make_number (BUF_Z (XBUFFER (buffer))
- XFASTINT (w->window_end_pos))
: Qnil;
{
int face_id;
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
ch = 0;
if (NILP (prop))
Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil);
old_buffer = current_buffer;
set_buffer_internal_1 (XBUFFER (buffer));
- current_buffer->truncate_lines = Qnil;
+ B_ (current_buffer, truncate_lines) = Qnil;
specbind (Qinhibit_read_only, Qt);
specbind (Qinhibit_modification_hooks, Qt);
Ferase_buffer ();
/* Display the tooltip text in a temporary buffer. */
old_buffer = current_buffer;
set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer));
- current_buffer->truncate_lines = Qnil;
+ B_ (current_buffer, truncate_lines) = Qnil;
clear_glyph_matrix (w->desired_matrix);
clear_glyph_matrix (w->current_matrix);
SET_TEXT_POS (pos, BEGV, BEGV_BYTE);