aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.h
diff options
context:
space:
mode:
authorTom Tromey2011-02-14 08:39:19 -0700
committerTom Tromey2011-02-14 08:39:19 -0700
commit5d8ea1203d1e659bc77d953784a85a6e7da0ce95 (patch)
tree1da71b86f9592b2f3390f0cd4d30ce41e74fbb55 /src/buffer.h
parent42f6055717e74ea9541c5cf6fd0fc6501bd907fd (diff)
downloademacs-5d8ea1203d1e659bc77d953784a85a6e7da0ce95.tar.gz
emacs-5d8ea1203d1e659bc77d953784a85a6e7da0ce95.zip
Hide implementation of `struct buffer'
* 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_.
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h151
1 files changed, 80 insertions, 71 deletions
diff --git a/src/buffer.h b/src/buffer.h
index 31f96040b2d..36cb5fe9dda 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -321,7 +321,7 @@ while (0)
321/* Return character at byte position POS. */ 321/* Return character at byte position POS. */
322 322
323#define FETCH_CHAR(pos) \ 323#define FETCH_CHAR(pos) \
324 (!NILP (current_buffer->enable_multibyte_characters) \ 324 (!NILP (B_ (current_buffer, enable_multibyte_characters)) \
325 ? FETCH_MULTIBYTE_CHAR ((pos)) \ 325 ? FETCH_MULTIBYTE_CHAR ((pos)) \
326 : FETCH_BYTE ((pos))) 326 : FETCH_BYTE ((pos)))
327 327
@@ -346,7 +346,7 @@ extern unsigned char *_fetch_multibyte_char_p;
346 multibyte. */ 346 multibyte. */
347 347
348#define FETCH_CHAR_AS_MULTIBYTE(pos) \ 348#define FETCH_CHAR_AS_MULTIBYTE(pos) \
349 (!NILP (current_buffer->enable_multibyte_characters) \ 349 (!NILP (B_ (current_buffer, enable_multibyte_characters)) \
350 ? FETCH_MULTIBYTE_CHAR ((pos)) \ 350 ? FETCH_MULTIBYTE_CHAR ((pos)) \
351 : UNIBYTE_TO_CHAR (FETCH_BYTE ((pos)))) 351 : UNIBYTE_TO_CHAR (FETCH_BYTE ((pos))))
352 352
@@ -464,6 +464,15 @@ struct buffer_text
464 int inhibit_shrinking; 464 int inhibit_shrinking;
465 }; 465 };
466 466
467/* Lisp fields in struct buffer are hidden from most code and accessed
468 via the B_ macro, below. Only select pieces of code, like the GC,
469 are allowed to use BUFFER_INTERNAL_FIELD. */
470#define BUFFER_INTERNAL_FIELD(field) field ## _
471
472/* Most code should use this macro to access Lisp fields in struct
473 buffer. */
474#define B_(buf, field) ((buf)->BUFFER_INTERNAL_FIELD (field))
475
467/* This is the structure that the buffer Lisp object points to. */ 476/* This is the structure that the buffer Lisp object points to. */
468 477
469struct buffer 478struct buffer
@@ -587,138 +596,138 @@ struct buffer
587 because local variables have to be right in the struct buffer. 596 because local variables have to be right in the struct buffer.
588 So we copy it around in set_buffer_internal. 597 So we copy it around in set_buffer_internal.
589 This comes before `name' because it is marked in a special way. */ 598 This comes before `name' because it is marked in a special way. */
590 Lisp_Object undo_list; 599 Lisp_Object BUFFER_INTERNAL_FIELD (undo_list);
591 600
592 /* The name of this buffer. */ 601 /* The name of this buffer. */
593 Lisp_Object name; 602 Lisp_Object BUFFER_INTERNAL_FIELD (name);
594 603
595 /* The name of the file visited in this buffer, or nil. */ 604 /* The name of the file visited in this buffer, or nil. */
596 Lisp_Object filename; 605 Lisp_Object BUFFER_INTERNAL_FIELD (filename);
597 /* Dir for expanding relative file names. */ 606 /* Dir for expanding relative file names. */
598 Lisp_Object directory; 607 Lisp_Object BUFFER_INTERNAL_FIELD (directory);
599 /* True if this buffer has been backed up (if you write to the 608 /* True if this buffer has been backed up (if you write to the
600 visited file and it hasn't been backed up, then a backup will 609 visited file and it hasn't been backed up, then a backup will
601 be made). */ 610 be made). */
602 /* This isn't really used by the C code, so could be deleted. */ 611 /* This isn't really used by the C code, so could be deleted. */
603 Lisp_Object backed_up; 612 Lisp_Object BUFFER_INTERNAL_FIELD (backed_up);
604 /* Length of file when last read or saved. 613 /* Length of file when last read or saved.
605 -1 means auto saving turned off because buffer shrank a lot. 614 -1 means auto saving turned off because buffer shrank a lot.
606 -2 means don't turn off auto saving if buffer shrinks. 615 -2 means don't turn off auto saving if buffer shrinks.
607 (That value is used with buffer-swap-text.) 616 (That value is used with buffer-swap-text.)
608 This is not in the struct buffer_text 617 This is not in the struct buffer_text
609 because it's not used in indirect buffers at all. */ 618 because it's not used in indirect buffers at all. */
610 Lisp_Object save_length; 619 Lisp_Object BUFFER_INTERNAL_FIELD (save_length);
611 /* File name used for auto-saving this buffer. 620 /* File name used for auto-saving this buffer.
612 This is not in the struct buffer_text 621 This is not in the struct buffer_text
613 because it's not used in indirect buffers at all. */ 622 because it's not used in indirect buffers at all. */
614 Lisp_Object auto_save_file_name; 623 Lisp_Object BUFFER_INTERNAL_FIELD (auto_save_file_name);
615 624
616 /* Non-nil if buffer read-only. */ 625 /* Non-nil if buffer read-only. */
617 Lisp_Object read_only; 626 Lisp_Object BUFFER_INTERNAL_FIELD (read_only);
618 /* "The mark". This is a marker which may 627 /* "The mark". This is a marker which may
619 point into this buffer or may point nowhere. */ 628 point into this buffer or may point nowhere. */
620 Lisp_Object mark; 629 Lisp_Object BUFFER_INTERNAL_FIELD (mark);
621 630
622 /* Alist of elements (SYMBOL . VALUE-IN-THIS-BUFFER) for all 631 /* Alist of elements (SYMBOL . VALUE-IN-THIS-BUFFER) for all
623 per-buffer variables of this buffer. For locally unbound 632 per-buffer variables of this buffer. For locally unbound
624 symbols, just the symbol appears as the element. */ 633 symbols, just the symbol appears as the element. */
625 Lisp_Object local_var_alist; 634 Lisp_Object BUFFER_INTERNAL_FIELD (local_var_alist);
626 635
627 /* Symbol naming major mode (eg, lisp-mode). */ 636 /* Symbol naming major mode (eg, lisp-mode). */
628 Lisp_Object major_mode; 637 Lisp_Object BUFFER_INTERNAL_FIELD (major_mode);
629 /* Pretty name of major mode (eg, "Lisp"). */ 638 /* Pretty name of major mode (eg, "Lisp"). */
630 Lisp_Object mode_name; 639 Lisp_Object BUFFER_INTERNAL_FIELD (mode_name);
631 /* Mode line element that controls format of mode line. */ 640 /* Mode line element that controls format of mode line. */
632 Lisp_Object mode_line_format; 641 Lisp_Object BUFFER_INTERNAL_FIELD (mode_line_format);
633 642
634 /* Analogous to mode_line_format for the line displayed at the top 643 /* Analogous to mode_line_format for the line displayed at the top
635 of windows. Nil means don't display that line. */ 644 of windows. Nil means don't display that line. */
636 Lisp_Object header_line_format; 645 Lisp_Object BUFFER_INTERNAL_FIELD (header_line_format);
637 646
638 /* Keys that are bound local to this buffer. */ 647 /* Keys that are bound local to this buffer. */
639 Lisp_Object keymap; 648 Lisp_Object BUFFER_INTERNAL_FIELD (keymap);
640 /* This buffer's local abbrev table. */ 649 /* This buffer's local abbrev table. */
641 Lisp_Object abbrev_table; 650 Lisp_Object BUFFER_INTERNAL_FIELD (abbrev_table);
642 /* This buffer's syntax table. */ 651 /* This buffer's syntax table. */
643 Lisp_Object syntax_table; 652 Lisp_Object BUFFER_INTERNAL_FIELD (syntax_table);
644 /* This buffer's category table. */ 653 /* This buffer's category table. */
645 Lisp_Object category_table; 654 Lisp_Object BUFFER_INTERNAL_FIELD (category_table);
646 655
647 /* Values of several buffer-local variables. */ 656 /* Values of several buffer-local variables. */
648 /* tab-width is buffer-local so that redisplay can find it 657 /* tab-width is buffer-local so that redisplay can find it
649 in buffers that are not current. */ 658 in buffers that are not current. */
650 Lisp_Object case_fold_search; 659 Lisp_Object BUFFER_INTERNAL_FIELD (case_fold_search);
651 Lisp_Object tab_width; 660 Lisp_Object BUFFER_INTERNAL_FIELD (tab_width);
652 Lisp_Object fill_column; 661 Lisp_Object BUFFER_INTERNAL_FIELD (fill_column);
653 Lisp_Object left_margin; 662 Lisp_Object BUFFER_INTERNAL_FIELD (left_margin);
654 /* Function to call when insert space past fill column. */ 663 /* Function to call when insert space past fill column. */
655 Lisp_Object auto_fill_function; 664 Lisp_Object BUFFER_INTERNAL_FIELD (auto_fill_function);
656 /* nil: text, t: binary. 665 /* nil: text, t: binary.
657 This value is meaningful only on certain operating systems. */ 666 This value is meaningful only on certain operating systems. */
658 /* Actually, we don't need this flag any more because end-of-line 667 /* Actually, we don't need this flag any more because end-of-line
659 is handled correctly according to the buffer-file-coding-system 668 is handled correctly according to the buffer-file-coding-system
660 of the buffer. Just keeping it for backward compatibility. */ 669 of the buffer. Just keeping it for backward compatibility. */
661 Lisp_Object buffer_file_type; 670 Lisp_Object BUFFER_INTERNAL_FIELD (buffer_file_type);
662 671
663 /* Case table for case-conversion in this buffer. 672 /* Case table for case-conversion in this buffer.
664 This char-table maps each char into its lower-case version. */ 673 This char-table maps each char into its lower-case version. */
665 Lisp_Object downcase_table; 674 Lisp_Object BUFFER_INTERNAL_FIELD (downcase_table);
666 /* Char-table mapping each char to its upper-case version. */ 675 /* Char-table mapping each char to its upper-case version. */
667 Lisp_Object upcase_table; 676 Lisp_Object BUFFER_INTERNAL_FIELD (upcase_table);
668 /* Char-table for conversion for case-folding search. */ 677 /* Char-table for conversion for case-folding search. */
669 Lisp_Object case_canon_table; 678 Lisp_Object BUFFER_INTERNAL_FIELD (case_canon_table);
670 /* Char-table of equivalences for case-folding search. */ 679 /* Char-table of equivalences for case-folding search. */
671 Lisp_Object case_eqv_table; 680 Lisp_Object BUFFER_INTERNAL_FIELD (case_eqv_table);
672 681
673 /* Non-nil means do not display continuation lines. */ 682 /* Non-nil means do not display continuation lines. */
674 Lisp_Object truncate_lines; 683 Lisp_Object BUFFER_INTERNAL_FIELD (truncate_lines);
675 /* Non-nil means to use word wrapping when displaying continuation lines. */ 684 /* Non-nil means to use word wrapping when displaying continuation lines. */
676 Lisp_Object word_wrap; 685 Lisp_Object BUFFER_INTERNAL_FIELD (word_wrap);
677 /* Non-nil means display ctl chars with uparrow. */ 686 /* Non-nil means display ctl chars with uparrow. */
678 Lisp_Object ctl_arrow; 687 Lisp_Object BUFFER_INTERNAL_FIELD (ctl_arrow);
679 /* Non-nil means reorder bidirectional text for display in the 688 /* Non-nil means reorder bidirectional text for display in the
680 visual order. */ 689 visual order. */
681 Lisp_Object bidi_display_reordering; 690 Lisp_Object BUFFER_INTERNAL_FIELD (bidi_display_reordering);
682 /* If non-nil, specifies which direction of text to force in all the 691 /* If non-nil, specifies which direction of text to force in all the
683 paragraphs of the buffer. Nil means determine paragraph 692 paragraphs of the buffer. Nil means determine paragraph
684 direction dynamically for each paragraph. */ 693 direction dynamically for each paragraph. */
685 Lisp_Object bidi_paragraph_direction; 694 Lisp_Object BUFFER_INTERNAL_FIELD (bidi_paragraph_direction);
686 /* Non-nil means do selective display; 695 /* Non-nil means do selective display;
687 see doc string in syms_of_buffer (buffer.c) for details. */ 696 see doc string in syms_of_buffer (buffer.c) for details. */
688 Lisp_Object selective_display; 697 Lisp_Object BUFFER_INTERNAL_FIELD (selective_display);
689#ifndef old 698#ifndef old
690 /* Non-nil means show ... at end of line followed by invisible lines. */ 699 /* Non-nil means show ... at end of line followed by invisible lines. */
691 Lisp_Object selective_display_ellipses; 700 Lisp_Object BUFFER_INTERNAL_FIELD (selective_display_ellipses);
692#endif 701#endif
693 /* Alist of (FUNCTION . STRING) for each minor mode enabled in buffer. */ 702 /* Alist of (FUNCTION . STRING) for each minor mode enabled in buffer. */
694 Lisp_Object minor_modes; 703 Lisp_Object BUFFER_INTERNAL_FIELD (minor_modes);
695 /* t if "self-insertion" should overwrite; `binary' if it should also 704 /* t if "self-insertion" should overwrite; `binary' if it should also
696 overwrite newlines and tabs - for editing executables and the like. */ 705 overwrite newlines and tabs - for editing executables and the like. */
697 Lisp_Object overwrite_mode; 706 Lisp_Object BUFFER_INTERNAL_FIELD (overwrite_mode);
698 /* non-nil means abbrev mode is on. Expand abbrevs automatically. */ 707 /* non-nil means abbrev mode is on. Expand abbrevs automatically. */
699 Lisp_Object abbrev_mode; 708 Lisp_Object BUFFER_INTERNAL_FIELD (abbrev_mode);
700 /* Display table to use for text in this buffer. */ 709 /* Display table to use for text in this buffer. */
701 Lisp_Object display_table; 710 Lisp_Object BUFFER_INTERNAL_FIELD (display_table);
702 /* t means the mark and region are currently active. */ 711 /* t means the mark and region are currently active. */
703 Lisp_Object mark_active; 712 Lisp_Object BUFFER_INTERNAL_FIELD (mark_active);
704 713
705 /* Non-nil means the buffer contents are regarded as multi-byte 714 /* Non-nil means the buffer contents are regarded as multi-byte
706 form of characters, not a binary code. */ 715 form of characters, not a binary code. */
707 Lisp_Object enable_multibyte_characters; 716 Lisp_Object BUFFER_INTERNAL_FIELD (enable_multibyte_characters);
708 717
709 /* Coding system to be used for encoding the buffer contents on 718 /* Coding system to be used for encoding the buffer contents on
710 saving. */ 719 saving. */
711 Lisp_Object buffer_file_coding_system; 720 Lisp_Object BUFFER_INTERNAL_FIELD (buffer_file_coding_system);
712 721
713 /* List of symbols naming the file format used for visited file. */ 722 /* List of symbols naming the file format used for visited file. */
714 Lisp_Object file_format; 723 Lisp_Object BUFFER_INTERNAL_FIELD (file_format);
715 724
716 /* List of symbols naming the file format used for auto-save file. */ 725 /* List of symbols naming the file format used for auto-save file. */
717 Lisp_Object auto_save_file_format; 726 Lisp_Object BUFFER_INTERNAL_FIELD (auto_save_file_format);
718 727
719 /* True if the newline position cache and width run cache are 728 /* True if the newline position cache and width run cache are
720 enabled. See search.c and indent.c. */ 729 enabled. See search.c and indent.c. */
721 Lisp_Object cache_long_line_scans; 730 Lisp_Object BUFFER_INTERNAL_FIELD (cache_long_line_scans);
722 731
723 /* If the width run cache is enabled, this table contains the 732 /* If the width run cache is enabled, this table contains the
724 character widths width_run_cache (see above) assumes. When we 733 character widths width_run_cache (see above) assumes. When we
@@ -726,99 +735,99 @@ struct buffer
726 current display table to see whether the display table has 735 current display table to see whether the display table has
727 affected the widths of any characters. If it has, we 736 affected the widths of any characters. If it has, we
728 invalidate the width run cache, and re-initialize width_table. */ 737 invalidate the width run cache, and re-initialize width_table. */
729 Lisp_Object width_table; 738 Lisp_Object BUFFER_INTERNAL_FIELD (width_table);
730 739
731 /* In an indirect buffer, or a buffer that is the base of an 740 /* In an indirect buffer, or a buffer that is the base of an
732 indirect buffer, this holds a marker that records 741 indirect buffer, this holds a marker that records
733 PT for this buffer when the buffer is not current. */ 742 PT for this buffer when the buffer is not current. */
734 Lisp_Object pt_marker; 743 Lisp_Object BUFFER_INTERNAL_FIELD (pt_marker);
735 744
736 /* In an indirect buffer, or a buffer that is the base of an 745 /* In an indirect buffer, or a buffer that is the base of an
737 indirect buffer, this holds a marker that records 746 indirect buffer, this holds a marker that records
738 BEGV for this buffer when the buffer is not current. */ 747 BEGV for this buffer when the buffer is not current. */
739 Lisp_Object begv_marker; 748 Lisp_Object BUFFER_INTERNAL_FIELD (begv_marker);
740 749
741 /* In an indirect buffer, or a buffer that is the base of an 750 /* In an indirect buffer, or a buffer that is the base of an
742 indirect buffer, this holds a marker that records 751 indirect buffer, this holds a marker that records
743 ZV for this buffer when the buffer is not current. */ 752 ZV for this buffer when the buffer is not current. */
744 Lisp_Object zv_marker; 753 Lisp_Object BUFFER_INTERNAL_FIELD (zv_marker);
745 754
746 /* This holds the point value before the last scroll operation. 755 /* This holds the point value before the last scroll operation.
747 Explicitly setting point sets this to nil. */ 756 Explicitly setting point sets this to nil. */
748 Lisp_Object point_before_scroll; 757 Lisp_Object BUFFER_INTERNAL_FIELD (point_before_scroll);
749 758
750 /* Truename of the visited file, or nil. */ 759 /* Truename of the visited file, or nil. */
751 Lisp_Object file_truename; 760 Lisp_Object BUFFER_INTERNAL_FIELD (file_truename);
752 761
753 /* Invisibility spec of this buffer. 762 /* Invisibility spec of this buffer.
754 t => any non-nil `invisible' property means invisible. 763 t => any non-nil `invisible' property means invisible.
755 A list => `invisible' property means invisible 764 A list => `invisible' property means invisible
756 if it is memq in that list. */ 765 if it is memq in that list. */
757 Lisp_Object invisibility_spec; 766 Lisp_Object BUFFER_INTERNAL_FIELD (invisibility_spec);
758 767
759 /* This is the last window that was selected with this buffer in it, 768 /* This is the last window that was selected with this buffer in it,
760 or nil if that window no longer displays this buffer. */ 769 or nil if that window no longer displays this buffer. */
761 Lisp_Object last_selected_window; 770 Lisp_Object BUFFER_INTERNAL_FIELD (last_selected_window);
762 771
763 /* Incremented each time the buffer is displayed in a window. */ 772 /* Incremented each time the buffer is displayed in a window. */
764 Lisp_Object display_count; 773 Lisp_Object BUFFER_INTERNAL_FIELD (display_count);
765 774
766 /* Widths of left and right marginal areas for windows displaying 775 /* Widths of left and right marginal areas for windows displaying
767 this buffer. */ 776 this buffer. */
768 Lisp_Object left_margin_cols, right_margin_cols; 777 Lisp_Object BUFFER_INTERNAL_FIELD (left_margin_cols), BUFFER_INTERNAL_FIELD (right_margin_cols);
769 778
770 /* Widths of left and right fringe areas for windows displaying 779 /* Widths of left and right fringe areas for windows displaying
771 this buffer. */ 780 this buffer. */
772 Lisp_Object left_fringe_width, right_fringe_width; 781 Lisp_Object BUFFER_INTERNAL_FIELD (left_fringe_width), BUFFER_INTERNAL_FIELD (right_fringe_width);
773 782
774 /* Non-nil means fringes are drawn outside display margins; 783 /* Non-nil means fringes are drawn outside display margins;
775 othersize draw them between margin areas and text. */ 784 othersize draw them between margin areas and text. */
776 Lisp_Object fringes_outside_margins; 785 Lisp_Object BUFFER_INTERNAL_FIELD (fringes_outside_margins);
777 786
778 /* Width and type of scroll bar areas for windows displaying 787 /* Width and type of scroll bar areas for windows displaying
779 this buffer. */ 788 this buffer. */
780 Lisp_Object scroll_bar_width, vertical_scroll_bar_type; 789 Lisp_Object BUFFER_INTERNAL_FIELD (scroll_bar_width), BUFFER_INTERNAL_FIELD (vertical_scroll_bar_type);
781 790
782 /* Non-nil means indicate lines not displaying text (in a style 791 /* Non-nil means indicate lines not displaying text (in a style
783 like vi). */ 792 like vi). */
784 Lisp_Object indicate_empty_lines; 793 Lisp_Object BUFFER_INTERNAL_FIELD (indicate_empty_lines);
785 794
786 /* Non-nil means indicate buffer boundaries and scrolling. */ 795 /* Non-nil means indicate buffer boundaries and scrolling. */
787 Lisp_Object indicate_buffer_boundaries; 796 Lisp_Object BUFFER_INTERNAL_FIELD (indicate_buffer_boundaries);
788 797
789 /* Logical to physical fringe bitmap mappings. */ 798 /* Logical to physical fringe bitmap mappings. */
790 Lisp_Object fringe_indicator_alist; 799 Lisp_Object BUFFER_INTERNAL_FIELD (fringe_indicator_alist);
791 800
792 /* Logical to physical cursor bitmap mappings. */ 801 /* Logical to physical cursor bitmap mappings. */
793 Lisp_Object fringe_cursor_alist; 802 Lisp_Object BUFFER_INTERNAL_FIELD (fringe_cursor_alist);
794 803
795 /* Time stamp updated each time this buffer is displayed in a window. */ 804 /* Time stamp updated each time this buffer is displayed in a window. */
796 Lisp_Object display_time; 805 Lisp_Object BUFFER_INTERNAL_FIELD (display_time);
797 806
798 /* If scrolling the display because point is below the bottom of a 807 /* If scrolling the display because point is below the bottom of a
799 window showing this buffer, try to choose a window start so 808 window showing this buffer, try to choose a window start so
800 that point ends up this number of lines from the top of the 809 that point ends up this number of lines from the top of the
801 window. Nil means that scrolling method isn't used. */ 810 window. Nil means that scrolling method isn't used. */
802 Lisp_Object scroll_up_aggressively; 811 Lisp_Object BUFFER_INTERNAL_FIELD (scroll_up_aggressively);
803 812
804 /* If scrolling the display because point is above the top of a 813 /* If scrolling the display because point is above the top of a
805 window showing this buffer, try to choose a window start so 814 window showing this buffer, try to choose a window start so
806 that point ends up this number of lines from the bottom of the 815 that point ends up this number of lines from the bottom of the
807 window. Nil means that scrolling method isn't used. */ 816 window. Nil means that scrolling method isn't used. */
808 Lisp_Object scroll_down_aggressively; 817 Lisp_Object BUFFER_INTERNAL_FIELD (scroll_down_aggressively);
809 818
810 /* Desired cursor type in this buffer. See the doc string of 819 /* Desired cursor type in this buffer. See the doc string of
811 per-buffer variable `cursor-type'. */ 820 per-buffer variable `cursor-type'. */
812 Lisp_Object cursor_type; 821 Lisp_Object BUFFER_INTERNAL_FIELD (cursor_type);
813 822
814 /* An integer > 0 means put that number of pixels below text lines 823 /* An integer > 0 means put that number of pixels below text lines
815 in the display of this buffer. */ 824 in the display of this buffer. */
816 Lisp_Object extra_line_spacing; 825 Lisp_Object BUFFER_INTERNAL_FIELD (extra_line_spacing);
817 826
818 /* *Cursor type to display in non-selected windows. 827 /* *Cursor type to display in non-selected windows.
819 t means to use hollow box cursor. 828 t means to use hollow box cursor.
820 See `cursor-type' for other values. */ 829 See `cursor-type' for other values. */
821 Lisp_Object cursor_in_non_selected_windows; 830 Lisp_Object BUFFER_INTERNAL_FIELD (cursor_in_non_selected_windows);
822}; 831};
823 832
824 833
@@ -942,7 +951,7 @@ extern int last_per_buffer_idx;
942 from the start of a buffer structure. */ 951 from the start of a buffer structure. */
943 952
944#define PER_BUFFER_VAR_OFFSET(VAR) \ 953#define PER_BUFFER_VAR_OFFSET(VAR) \
945 offsetof (struct buffer, VAR) 954 offsetof (struct buffer, BUFFER_INTERNAL_FIELD (VAR))
946 955
947/* Return the index of buffer-local variable VAR. Each per-buffer 956/* Return the index of buffer-local variable VAR. Each per-buffer
948 variable has an index > 0 associated with it, except when it always 957 variable has an index > 0 associated with it, except when it always