From b8c75a7641a8e0d44649399d646325a93a564a21 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 27 Jan 2025 17:52:10 +0100 Subject: [PATCH] Delete macro DEFVAR_LISP_NOPRO * src/lisp.h (DEFVAR_LISP_NOPRO): Delete macro. * src/font.c (syms_of_font) : Don't use above deleted macro. (font_style_to_value): Revert recent change. --- src/font.c | 29 +++++------------------------ src/lisp.h | 6 ------ 2 files changed, 5 insertions(+), 30 deletions(-) diff --git a/src/font.c b/src/font.c index dfe479f9355..e6c41e41258 100644 --- a/src/font.c +++ b/src/font.c @@ -418,24 +418,8 @@ font_style_to_value (enum font_property_index prop, Lisp_Object val, eassert (len < 255); elt = make_vector (2, make_fixnum (100)); ASET (elt, 1, val); - Lisp_Object new_table = CALLN (Fvconcat, table, make_vector (1, elt)); - /* Update the corresponding variable with the new value of the - modified slot of font_style_table. */ - switch (prop) - { - case FONT_WEIGHT_INDEX: - Vfont_weight_table = new_table; - break; - case FONT_SLANT_INDEX: - Vfont_slant_table = new_table; - break; - case FONT_WIDTH_INDEX: - Vfont_width_table = new_table; - break; - default: - break; - } - ASET (font_style_table, prop - FONT_WEIGHT_INDEX, new_table); + ASET (font_style_table, prop - FONT_WEIGHT_INDEX, + CALLN (Fvconcat, table, make_vector (1, elt))); return (100 << 8) | (i << 4); } else @@ -5970,7 +5954,7 @@ syms_of_font (void) table used by the font display code. So we make them read-only, to avoid this confusing situation. */ - DEFVAR_LISP_NOPRO ("font-weight-table", Vfont_weight_table, + DEFVAR_LISP ("font-weight-table", Vfont_weight_table, doc: /* Vector of valid font weight values. Each element has the form: [NUMERIC-VALUE SYMBOLIC-NAME ALIAS-NAME ...] @@ -5979,23 +5963,20 @@ syms_of_font (void) Vfont_weight_table = BUILD_STYLE_TABLE (weight_table); make_symbol_constant (intern_c_string ("font-weight-table")); - DEFVAR_LISP_NOPRO ("font-slant-table", Vfont_slant_table, + DEFVAR_LISP ("font-slant-table", Vfont_slant_table, doc: /* Vector of font slant symbols vs the corresponding numeric values. See `font-weight-table' for the format of the vector. This variable cannot be set; trying to do so will signal an error. */); Vfont_slant_table = BUILD_STYLE_TABLE (slant_table); make_symbol_constant (intern_c_string ("font-slant-table")); - DEFVAR_LISP_NOPRO ("font-width-table", Vfont_width_table, + DEFVAR_LISP ("font-width-table", Vfont_width_table, doc: /* Alist of font width symbols vs the corresponding numeric values. See `font-weight-table' for the format of the vector. This variable cannot be set; trying to do so will signal an error. */); Vfont_width_table = BUILD_STYLE_TABLE (width_table); make_symbol_constant (intern_c_string ("font-width-table")); - /* Because the above 3 variables are slots in the vector we create - below, and because that vector is staticpro'd, we don't explicitly - staticpro the variables, to avoid wasting slots in staticvec[]. */ staticpro (&font_style_table); font_style_table = CALLN (Fvector, Vfont_weight_table, Vfont_slant_table, Vfont_width_table); diff --git a/src/lisp.h b/src/lisp.h index 2faad895133..fb1ed8c8fa7 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3550,12 +3550,6 @@ #define DEFVAR_LISP(lname, vname, doc) \ = {Lisp_Fwd_Obj, &globals.f_##vname}; \ defvar_lisp (&o_fwd, lname); \ } while (false) -#define DEFVAR_LISP_NOPRO(lname, vname, doc) \ - do { \ - static struct Lisp_Objfwd const o_fwd \ - = {Lisp_Fwd_Obj, &globals.f_##vname}; \ - defvar_lisp_nopro (&o_fwd, lname); \ - } while (false) #define DEFVAR_BOOL(lname, vname, doc) \ do { \ static struct Lisp_Boolfwd const b_fwd \ -- 2.48.1