From c990892d40ccc55d3cafa576fb8261a3521ada38 Mon Sep 17 00:00:00 2001 From: Helmut Eller Date: Sat, 22 Jun 2024 16:43:29 +0200 Subject: [PATCH] Make Lisp_Buffer_Objfwd objects const The predicate field is always a builtin symbol. That means we know the bit pattern at compile-time and they don't change at runtime. * src/buffer.c (DEFVAR_PER_BUFFER): Create a const struct. (defvar_per_buffer): Remove predicate and address arguments. (syms_of_buffer): Instead of &BVAR (current_buffer, foo) use a plain foo as argument to DEFVAR_PER_BUFFER. * src/pdumper.c (dump_field_fwd): No more relocs needed for Lisp_Fwd_Buffer_Obj and we can't apply them in the .rodata section. --- src/buffer.c | 157 +++++++++++++++++++++++++------------------------- src/pdumper.c | 21 ++----- 2 files changed, 84 insertions(+), 94 deletions(-) diff --git a/src/buffer.c b/src/buffer.c index fcfb563ed4b..d864560ec85 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5017,31 +5017,33 @@ init_buffer (void) that nil is allowed too). DOC is a dummy where you write the doc string as a comment. */ -#define DEFVAR_PER_BUFFER(lname, vname, predicate, doc) \ - do { \ - static struct Lisp_Buffer_Objfwd bo_fwd; \ - defvar_per_buffer (&bo_fwd, lname, vname, predicate); \ - } while (0) +/* FIXME: use LISPSYM_INITIALLY instead of TAG_PTR_INITIALLY */ +#define DEFVAR_PER_BUFFER(lname, vname, predicate_, doc) \ +do \ + { \ + const Lisp_Object sym = TAG_PTR_INITIALLY ( \ + Lisp_Symbol, (intptr_t)((i##predicate_) * sizeof *lispsym)); \ + static const struct Lisp_Buffer_Objfwd bo_fwd = { \ + .type = Lisp_Fwd_Buffer_Obj, \ + .offset = offsetof (struct buffer, vname##_), \ + .predicate = sym, \ + }; \ + defvar_per_buffer (&bo_fwd, lname); \ + } \ +while (0) static void -defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, const char *namestring, - Lisp_Object *address, Lisp_Object predicate) +defvar_per_buffer (const struct Lisp_Buffer_Objfwd *bo_fwd, + const char *namestring) { - struct Lisp_Symbol *sym; - int offset; - - sym = XSYMBOL (intern (namestring)); - offset = (char *)address - (char *)current_buffer; + struct Lisp_Symbol *sym = XSYMBOL (intern (namestring)); - bo_fwd->type = Lisp_Fwd_Buffer_Obj; - bo_fwd->offset = offset; - bo_fwd->predicate = predicate; sym->u.s.declared_special = true; sym->u.s.redirect = SYMBOL_FORWARDED; SET_SYMBOL_FWD (sym, bo_fwd); - XSETSYMBOL (PER_BUFFER_SYMBOL (offset), sym); + XSETSYMBOL (PER_BUFFER_SYMBOL (bo_fwd->offset), sym); - if (PER_BUFFER_IDX (offset) == 0) + if (PER_BUFFER_IDX (bo_fwd->offset) == 0) /* Did a DEFVAR_PER_BUFFER without initializing the corresponding slot of buffer_local_flags. */ emacs_abort (); @@ -5141,14 +5143,14 @@ syms_of_buffer (void) DEFSYM (Qclone_indirect_buffer_hook, "clone-indirect-buffer-hook"); DEFVAR_PER_BUFFER ("tab-line-format", - &BVAR (current_buffer, tab_line_format), + tab_line_format, Qnil, doc: /* Analogous to `mode-line-format', but controls the tab line. The tab line appears, optionally, at the top of a window; the mode line appears at the bottom. */); DEFVAR_PER_BUFFER ("header-line-format", - &BVAR (current_buffer, header_line_format), + 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 @@ -5157,7 +5159,7 @@ syms_of_buffer (void) Also see `header-line-indent-mode' if `display-line-numbers-mode' is turned on and header-line text should be aligned with buffer text. */); - DEFVAR_PER_BUFFER ("mode-line-format", &BVAR (current_buffer, mode_line_format), + DEFVAR_PER_BUFFER ("mode-line-format", mode_line_format, Qnil, doc: /* Template for displaying mode line for a window's buffer. @@ -5231,7 +5233,7 @@ syms_of_buffer (void) %% -- print %. Decimal digits after the % specify field width to which to pad. */); - DEFVAR_PER_BUFFER ("major-mode", &BVAR (current_buffer, major_mode), + DEFVAR_PER_BUFFER ("major-mode", major_mode, Qsymbolp, doc: /* Symbol for current buffer's major mode. The default value (normally `fundamental-mode') affects new buffers. @@ -5239,26 +5241,26 @@ syms_of_buffer (void) it is not marked as "special". */); DEFVAR_PER_BUFFER ("local-minor-modes", - &BVAR (current_buffer, local_minor_modes), + local_minor_modes, Qnil, doc: /* Minor modes currently active in the current buffer. This is a list of symbols, or nil if there are no minor modes active. */); - DEFVAR_PER_BUFFER ("mode-name", &BVAR (current_buffer, mode_name), + DEFVAR_PER_BUFFER ("mode-name", 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", &BVAR (current_buffer, abbrev_table), Qnil, + DEFVAR_PER_BUFFER ("local-abbrev-table", abbrev_table, Qnil, doc: /* Local (mode-specific) abbrev table of current buffer. */); - DEFVAR_PER_BUFFER ("abbrev-mode", &BVAR (current_buffer, abbrev_mode), Qnil, + DEFVAR_PER_BUFFER ("abbrev-mode", abbrev_mode, Qnil, doc: /* Non-nil if Abbrev mode is enabled. Use the command `abbrev-mode' to change this variable. */); - DEFVAR_PER_BUFFER ("fill-column", &BVAR (current_buffer, fill_column), + DEFVAR_PER_BUFFER ("fill-column", fill_column, Qintegerp, doc: /* Column beyond which automatic line-wrapping should happen. It is used by filling commands, such as `fill-region' and `fill-paragraph', @@ -5266,12 +5268,12 @@ syms_of_buffer (void) See also `current-fill-column'. Interactively, you can set the buffer local value using \\[set-fill-column]. */); - DEFVAR_PER_BUFFER ("left-margin", &BVAR (current_buffer, left_margin), + DEFVAR_PER_BUFFER ("left-margin", left_margin, Qintegerp, doc: /* Column for the default `indent-line-function' to indent to. Linefeed indents to this column in Fundamental mode. */); - DEFVAR_PER_BUFFER ("tab-width", &BVAR (current_buffer, tab_width), + DEFVAR_PER_BUFFER ("tab-width", tab_width, Qintegerp, doc: /* Distance between tab stops (for display of tab characters), in columns. This controls the width of a TAB character on display. @@ -5281,14 +5283,14 @@ syms_of_buffer (void) inserts one or more TAB characters, this variable will affect the indentation step as well, even if `indent-tabs-mode' is non-nil. */); - DEFVAR_PER_BUFFER ("ctl-arrow", &BVAR (current_buffer, ctl_arrow), Qnil, + DEFVAR_PER_BUFFER ("ctl-arrow", 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; see `standard-display-table'). */); DEFVAR_PER_BUFFER ("enable-multibyte-characters", - &BVAR (current_buffer, enable_multibyte_characters), + 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, @@ -5302,7 +5304,7 @@ syms_of_buffer (void) make_symbol_constant (intern_c_string ("enable-multibyte-characters")); DEFVAR_PER_BUFFER ("buffer-file-coding-system", - &BVAR (current_buffer, buffer_file_coding_system), Qnil, + 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'. @@ -5320,7 +5322,7 @@ syms_of_buffer (void) This variable is never applied to a way of decoding a file while reading it. */); DEFVAR_PER_BUFFER ("bidi-display-reordering", - &BVAR (current_buffer, bidi_display_reordering), Qnil, + bidi_display_reordering, Qnil, doc: /* Non-nil means reorder bidirectional text for display in the visual order. Setting this to nil is intended for use in debugging the display code. Don't set to nil in normal sessions, as that is not supported. @@ -5328,7 +5330,7 @@ syms_of_buffer (void) speed up redisplay. */); DEFVAR_PER_BUFFER ("bidi-paragraph-start-re", - &BVAR (current_buffer, bidi_paragraph_start_re), Qnil, + bidi_paragraph_start_re, Qnil, doc: /* If non-nil, a regexp matching a line that starts OR separates paragraphs. The value of nil means to use empty lines as lines that start and @@ -5350,7 +5352,7 @@ syms_of_buffer (void) See also `bidi-paragraph-direction'. */); DEFVAR_PER_BUFFER ("bidi-paragraph-separate-re", - &BVAR (current_buffer, bidi_paragraph_separate_re), Qnil, + bidi_paragraph_separate_re, Qnil, doc: /* If non-nil, a regexp matching a line that separates paragraphs. The value of nil means to use empty lines as paragraph separators. @@ -5371,7 +5373,7 @@ syms_of_buffer (void) See also `bidi-paragraph-direction'. */); DEFVAR_PER_BUFFER ("bidi-paragraph-direction", - &BVAR (current_buffer, bidi_paragraph_direction), Qnil, + 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 @@ -5382,7 +5384,7 @@ syms_of_buffer (void) This variable has no effect unless the buffer's value of `bidi-display-reordering' is non-nil. */); - DEFVAR_PER_BUFFER ("truncate-lines", &BVAR (current_buffer, truncate_lines), Qnil, + DEFVAR_PER_BUFFER ("truncate-lines", truncate_lines, Qnil, doc: /* Non-nil means do not display continuation lines. Instead, give each line of text just one screen line. @@ -5395,7 +5397,7 @@ syms_of_buffer (void) Don't set this to a non-nil value when `visual-line-mode' is turned on, as it could produce confusing results. */); - DEFVAR_PER_BUFFER ("word-wrap", &BVAR (current_buffer, word_wrap), Qnil, + DEFVAR_PER_BUFFER ("word-wrap", 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. @@ -5413,14 +5415,14 @@ syms_of_buffer (void) visual lines rather than logical lines. See the documentation of `visual-line-mode'. */); - DEFVAR_PER_BUFFER ("default-directory", &BVAR (current_buffer, directory), + DEFVAR_PER_BUFFER ("default-directory", directory, Qstringp, doc: /* Name of default directory of current buffer. It should be an absolute directory name; on GNU and Unix systems, these names start with "/" or "~" and end with "/". To interactively change the default directory, use the command `cd'. */); - DEFVAR_PER_BUFFER ("auto-fill-function", &BVAR (current_buffer, auto_fill_function), + DEFVAR_PER_BUFFER ("auto-fill-function", auto_fill_function, Qnil, doc: /* Function called (if non-nil) to perform auto-fill. It is called after self-inserting any character specified in @@ -5428,31 +5430,31 @@ syms_of_buffer (void) NOTE: This variable is not a hook; its value may not be a list of functions. */); - DEFVAR_PER_BUFFER ("buffer-file-name", &BVAR (current_buffer, filename), + DEFVAR_PER_BUFFER ("buffer-file-name", filename, Qstringp, doc: /* Name of file visited in current buffer, or nil if not visiting a file. This should be an absolute file name. */); - DEFVAR_PER_BUFFER ("buffer-file-truename", &BVAR (current_buffer, file_truename), + DEFVAR_PER_BUFFER ("buffer-file-truename", file_truename, Qstringp, 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", - &BVAR (current_buffer, auto_save_file_name), + auto_save_file_name, Qstringp, 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", &BVAR (current_buffer, read_only), Qnil, + DEFVAR_PER_BUFFER ("buffer-read-only", read_only, Qnil, doc: /* Non-nil if this buffer is read-only. */); - DEFVAR_PER_BUFFER ("buffer-backed-up", &BVAR (current_buffer, backed_up), Qnil, + DEFVAR_PER_BUFFER ("buffer-backed-up", 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", &BVAR (current_buffer, save_length), + DEFVAR_PER_BUFFER ("buffer-saved-size", save_length, Qintegerp, doc: /* Length of current buffer when last read in, saved or auto-saved. 0 initially. @@ -5462,7 +5464,7 @@ syms_of_buffer (void) 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", &BVAR (current_buffer, selective_display), + DEFVAR_PER_BUFFER ("selective-display", selective_display, Qnil, doc: /* Non-nil enables selective display. @@ -5475,11 +5477,11 @@ syms_of_buffer (void) overlays or text properties instead. */); DEFVAR_PER_BUFFER ("selective-display-ellipses", - &BVAR (current_buffer, selective_display_ellipses), + selective_display_ellipses, Qnil, doc: /* Non-nil means display ... on previous line when a line is invisible. */); - DEFVAR_PER_BUFFER ("overwrite-mode", &BVAR (current_buffer, overwrite_mode), + DEFVAR_PER_BUFFER ("overwrite-mode", overwrite_mode, Qoverwrite_mode, doc: /* Non-nil if self-insertion should replace existing text. The value should be one of `overwrite-mode-textual', @@ -5489,7 +5491,7 @@ syms_of_buffer (void) until the tab is filled in. If `overwrite-mode-binary', self-insertion replaces newlines and tabs too. */); - DEFVAR_PER_BUFFER ("buffer-display-table", &BVAR (current_buffer, display_table), + DEFVAR_PER_BUFFER ("buffer-display-table", display_table, Qnil, doc: /* Display table that controls display of the contents of current buffer. @@ -5526,7 +5528,7 @@ syms_of_buffer (void) See also the functions `display-table-slot' and `set-display-table-slot'. */); - DEFVAR_PER_BUFFER ("left-margin-width", &BVAR (current_buffer, left_margin_cols), + DEFVAR_PER_BUFFER ("left-margin-width", left_margin_cols, Qintegerp, doc: /* Width in columns of left marginal area for display of a buffer. A value of nil means no marginal area. @@ -5534,7 +5536,7 @@ syms_of_buffer (void) Setting this variable does not take effect until a new buffer is displayed in a window. To make the change take effect, call `set-window-buffer'. */); - DEFVAR_PER_BUFFER ("right-margin-width", &BVAR (current_buffer, right_margin_cols), + DEFVAR_PER_BUFFER ("right-margin-width", right_margin_cols, Qintegerp, doc: /* Width in columns of right marginal area for display of a buffer. A value of nil means no marginal area. @@ -5542,7 +5544,7 @@ syms_of_buffer (void) Setting this variable does not take effect until a new buffer is displayed in a window. To make the change take effect, call `set-window-buffer'. */); - DEFVAR_PER_BUFFER ("left-fringe-width", &BVAR (current_buffer, left_fringe_width), + DEFVAR_PER_BUFFER ("left-fringe-width", left_fringe_width, Qintegerp, 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. @@ -5551,7 +5553,7 @@ syms_of_buffer (void) Setting this variable does not take effect until a new buffer is displayed in a window. To make the change take effect, call `set-window-buffer'. */); - DEFVAR_PER_BUFFER ("right-fringe-width", &BVAR (current_buffer, right_fringe_width), + DEFVAR_PER_BUFFER ("right-fringe-width", right_fringe_width, Qintegerp, 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. @@ -5560,7 +5562,7 @@ syms_of_buffer (void) Setting this variable does not take effect until a new buffer is displayed in a window. To make the change take effect, call `set-window-buffer'. */); - DEFVAR_PER_BUFFER ("fringes-outside-margins", &BVAR (current_buffer, fringes_outside_margins), + DEFVAR_PER_BUFFER ("fringes-outside-margins", 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. @@ -5568,17 +5570,17 @@ syms_of_buffer (void) Setting this variable does not take effect until a new buffer is displayed in a window. To make the change take effect, call `set-window-buffer'. */); - DEFVAR_PER_BUFFER ("scroll-bar-width", &BVAR (current_buffer, scroll_bar_width), + DEFVAR_PER_BUFFER ("scroll-bar-width", scroll_bar_width, Qintegerp, doc: /* Width of this buffer's vertical scroll bars in pixels. A value of nil means to use the scroll bar width from the window's frame. */); - DEFVAR_PER_BUFFER ("scroll-bar-height", &BVAR (current_buffer, scroll_bar_height), + DEFVAR_PER_BUFFER ("scroll-bar-height", scroll_bar_height, Qintegerp, doc: /* Height of this buffer's horizontal scroll bars in pixels. A value of nil means to use the scroll bar height from the window's frame. */); - DEFVAR_PER_BUFFER ("vertical-scroll-bar", &BVAR (current_buffer, vertical_scroll_bar_type), + DEFVAR_PER_BUFFER ("vertical-scroll-bar", vertical_scroll_bar_type, Qvertical_scroll_bar, doc: /* Position of this buffer's vertical scroll bar. The value takes effect whenever you tell a window to display this buffer; @@ -5588,7 +5590,7 @@ syms_of_buffer (void) of the window; a value of nil means don't show any vertical scroll bars. A value of t (the default) means do whatever the window's frame specifies. */); - DEFVAR_PER_BUFFER ("horizontal-scroll-bar", &BVAR (current_buffer, horizontal_scroll_bar_type), + DEFVAR_PER_BUFFER ("horizontal-scroll-bar", horizontal_scroll_bar_type, Qnil, doc: /* Position of this buffer's horizontal scroll bar. The value takes effect whenever you tell a window to display this buffer; @@ -5600,14 +5602,14 @@ syms_of_buffer (void) specifies. */); DEFVAR_PER_BUFFER ("indicate-empty-lines", - &BVAR (current_buffer, indicate_empty_lines), Qnil, + indicate_empty_lines, Qnil, doc: /* Visually indicate unused ("empty") screen lines after the buffer end. If non-nil, a bitmap is displayed in the left fringe of a window on graphical displays for each screen line that doesn't correspond to any buffer text. */); DEFVAR_PER_BUFFER ("indicate-buffer-boundaries", - &BVAR (current_buffer, indicate_buffer_boundaries), Qnil, + 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 graphical displays with angle bitmaps, or if the window can be @@ -5632,7 +5634,7 @@ syms_of_buffer (void) fringe, but no arrow bitmaps, use ((top . left) (bottom . left)). */); DEFVAR_PER_BUFFER ("fringe-indicator-alist", - &BVAR (current_buffer, fringe_indicator_alist), Qnil, + 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 @@ -5651,7 +5653,7 @@ last (only) line has no final newline. BITMAPS may also be a single symbol which is used in both left and right fringes. */); DEFVAR_PER_BUFFER ("fringe-cursor-alist", - &BVAR (current_buffer, fringe_cursor_alist), Qnil, + 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 @@ -5666,7 +5668,7 @@ last (only) line has no final newline. BITMAPS may also be a single cursor type. */); DEFVAR_PER_BUFFER ("scroll-up-aggressively", - &BVAR (current_buffer, scroll_up_aggressively), Qfraction, + scroll_up_aggressively, Qfraction, 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, @@ -5679,7 +5681,7 @@ last (only) line has no final newline. BITMAPS may also be a single between 0.0 and 1.0, inclusive. */); DEFVAR_PER_BUFFER ("scroll-down-aggressively", - &BVAR (current_buffer, scroll_down_aggressively), Qfraction, + scroll_down_aggressively, Qfraction, 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, @@ -5730,7 +5732,7 @@ last (only) line has no final newline. BITMAPS may also be a single The functions are run using the `run-hooks' function. */); Vfirst_change_hook = Qnil; - DEFVAR_PER_BUFFER ("buffer-undo-list", &BVAR (current_buffer, undo_list), Qnil, + DEFVAR_PER_BUFFER ("buffer-undo-list", undo_list, Qnil, doc: /* List of undo entries in current buffer. Recent changes come first; older changes follow newer. @@ -5776,10 +5778,10 @@ from (abs POSITION). If POSITION is positive, point was at the front If the value of the variable is t, undo information is not recorded. */); - DEFVAR_PER_BUFFER ("mark-active", &BVAR (current_buffer, mark_active), Qnil, + DEFVAR_PER_BUFFER ("mark-active", mark_active, Qnil, doc: /* Non-nil means the mark and region are currently active in this buffer. */); - DEFVAR_PER_BUFFER ("cache-long-scans", &BVAR (current_buffer, cache_long_scans), Qnil, + DEFVAR_PER_BUFFER ("cache-long-scans", cache_long_scans, Qnil, doc: /* Non-nil means that Emacs should use caches in attempt to speedup buffer scans. There is no reason to set this to nil except for debugging purposes. @@ -5815,23 +5817,23 @@ from (abs POSITION). If POSITION is positive, point was at the front 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", &BVAR (current_buffer, point_before_scroll), Qnil, + DEFVAR_PER_BUFFER ("point-before-scroll", point_before_scroll, Qnil, doc: /* Value of point before the last series of scroll operations, or nil. */); - DEFVAR_PER_BUFFER ("buffer-file-format", &BVAR (current_buffer, file_format), Qnil, + DEFVAR_PER_BUFFER ("buffer-file-format", 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", - &BVAR (current_buffer, auto_save_file_format), Qnil, + 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", - &BVAR (current_buffer, invisibility_spec), Qnil, + 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. @@ -5845,12 +5847,12 @@ from (abs POSITION). If POSITION is positive, point was at the front the buffer looking for properties to change. */); DEFVAR_PER_BUFFER ("buffer-display-count", - &BVAR (current_buffer, display_count), Qintegerp, + display_count, Qintegerp, 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", - &BVAR (current_buffer, display_time), Qnil, + 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'. @@ -5886,7 +5888,7 @@ from (abs POSITION). If POSITION is positive, point was at the front and all `read-only' text properties. */); Vinhibit_read_only = Qnil; - DEFVAR_PER_BUFFER ("cursor-type", &BVAR (current_buffer, cursor_type), Qnil, + DEFVAR_PER_BUFFER ("cursor-type", cursor_type, Qnil, doc: /* Cursor to use when this buffer is in the selected window. Values are interpreted as follows: @@ -5910,7 +5912,7 @@ from (abs POSITION). If POSITION is positive, point was at the front `cursor-in-non-selected-windows'. */); DEFVAR_PER_BUFFER ("line-spacing", - &BVAR (current_buffer, extra_line_spacing), Qnumberp, + extra_line_spacing, Qnumberp, 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'. @@ -5918,7 +5920,7 @@ from (abs POSITION). If POSITION is positive, point was at the front to the default frame line height. A value of nil means add no extra space. */); DEFVAR_PER_BUFFER ("cursor-in-non-selected-windows", - &BVAR (current_buffer, cursor_in_non_selected_windows), Qnil, + 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 @@ -5929,8 +5931,7 @@ from (abs POSITION). If POSITION is positive, point was at the front /* While this is defined here, each *term.c module must implement the logic itself. */ - DEFVAR_PER_BUFFER ("text-conversion-style", &BVAR (current_buffer, - text_conversion_style), + DEFVAR_PER_BUFFER ("text-conversion-style", text_conversion_style, Qnil, doc: /* How the on screen keyboard's input method should insert in this buffer. diff --git a/src/pdumper.c b/src/pdumper.c index e69a2b56f0b..49357de1acb 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -2370,13 +2370,13 @@ dump_field_fwd (struct dump_context *ctx, void *out, const void *in_start, const struct Lisp_Intfwd *fwd = in_field->fwdptr; dump_emacs_reloc_immediate_intmax_t (ctx, fwd->intvar, *fwd->intvar); } - break; + return; case Lisp_Fwd_Bool: { const struct Lisp_Boolfwd *fwd = in_field->fwdptr; dump_emacs_reloc_immediate_bool (ctx, fwd->boolvar, *fwd->boolvar); } - break; + return; case Lisp_Fwd_Obj: { const struct Lisp_Objfwd *fwd = in_field->fwdptr; @@ -2384,23 +2384,12 @@ dump_field_fwd (struct dump_context *ctx, void *out, const void *in_start, ctx->staticpro_table, Qnil))) dump_emacs_reloc_to_lv (ctx, fwd->objvar, *fwd->objvar); } - break; + return; case Lisp_Fwd_Kboard_Obj: - break; case Lisp_Fwd_Buffer_Obj: - { - const struct Lisp_Buffer_Objfwd *fwd = in_field->fwdptr; - dump_emacs_reloc_immediate (ctx, &fwd->type, &fwd->type, - sizeof fwd->type); - dump_emacs_reloc_immediate (ctx, &fwd->offset, &fwd->offset, - sizeof fwd->offset); - eassert (SYMBOLP (fwd->predicate)); - /* FIXME: assumes symbols are represented as offsets from lispsym */ - dump_emacs_reloc_immediate (ctx, &fwd->predicate, &fwd->predicate, - sizeof fwd->predicate); - } - break; + return; } + emacs_abort (); } static dump_off -- 2.39.2