From 11ffb4656d768b09e1f7dfacc091d85eef4a403a Mon Sep 17 00:00:00 2001 From: Mattias EngdegÄrd Date: Mon, 4 Mar 2024 14:14:05 +0100 Subject: Revert "Replace XSETSYMBOL with make_lisp_symbol" This reverts commit de6b1e1efb1a36c69e7a6e09297e1de5b1477121. While it did simplify code, there aren't much in the way of technical benefits the change at this time, and there were protest against the unwarranted style change. --- src/data.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'src/data.c') diff --git a/src/data.c b/src/data.c index c87b5317618..df08eaf8102 100644 --- a/src/data.c +++ b/src/data.c @@ -1256,7 +1256,7 @@ If OBJECT is not a symbol, just return it. */) struct Lisp_Symbol *sym = XSYMBOL (object); while (sym->u.s.redirect == SYMBOL_VARALIAS) sym = SYMBOL_ALIAS (sym); - object = make_lisp_symbol (sym); + XSETSYMBOL (object, sym); } return object; } @@ -1506,9 +1506,12 @@ swap_in_symval_forwarding (struct Lisp_Symbol *symbol, struct Lisp_Buffer_Local_ if (blv->fwd.fwdptr) set_blv_value (blv, do_symval_forwarding (blv->fwd)); /* Choose the new binding. */ - tem1 = assq_no_quit (make_lisp_symbol (symbol), - BVAR (current_buffer, local_var_alist)); - set_blv_where (blv, Fcurrent_buffer ()); + { + Lisp_Object var; + XSETSYMBOL (var, symbol); + tem1 = assq_no_quit (var, BVAR (current_buffer, local_var_alist)); + set_blv_where (blv, Fcurrent_buffer ()); + } if (!(blv->found = !NILP (tem1))) tem1 = blv->defcell; @@ -1652,8 +1655,7 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, set_blv_value (blv, do_symval_forwarding (blv->fwd)); /* Find the new binding. */ - /* May have changed via aliasing. */ - symbol = make_lisp_symbol (sym); + XSETSYMBOL (symbol, sym); /* May have changed via aliasing. */ Lisp_Object tem1 = assq_no_quit (symbol, BVAR (XBUFFER (where), local_var_alist)); @@ -2057,10 +2059,13 @@ make_blv (struct Lisp_Symbol *sym, bool forwarded, union Lisp_Val_Fwd valcontents) { struct Lisp_Buffer_Local_Value *blv = xmalloc (sizeof *blv); - Lisp_Object tem = Fcons (make_lisp_symbol (sym), - forwarded - ? do_symval_forwarding (valcontents.fwd) - : valcontents.value); + Lisp_Object symbol; + Lisp_Object tem; + + XSETSYMBOL (symbol, sym); + tem = Fcons (symbol, (forwarded + ? do_symval_forwarding (valcontents.fwd) + : valcontents.value)); /* Buffer_Local_Values cannot have as realval a buffer-local or keyboard-local forwarding. */ @@ -2216,7 +2221,7 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */) } /* Make sure this buffer has its own value of symbol. */ - variable = make_lisp_symbol (sym); /* Update in case of aliasing. */ + XSETSYMBOL (variable, sym); /* Update in case of aliasing. */ tem = assq_no_quit (variable, BVAR (current_buffer, local_var_alist)); if (NILP (tem)) { @@ -2296,7 +2301,7 @@ From now on the default value will apply in this buffer. Return VARIABLE. */) notify_variable_watchers (variable, Qnil, Qmakunbound, Fcurrent_buffer ()); /* Get rid of this buffer's alist element, if any. */ - variable = make_lisp_symbol (sym); /* Propagate variable indirection. */ + XSETSYMBOL (variable, sym); /* Propagate variable indirection. */ tem = assq_no_quit (variable, BVAR (current_buffer, local_var_alist)); if (!NILP (tem)) bset_local_var_alist @@ -2341,7 +2346,7 @@ Also see `buffer-local-boundp'.*/) Lisp_Object tmp; struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); XSETBUFFER (tmp, buf); - variable = make_lisp_symbol (sym); /* Update in case of aliasing. */ + XSETSYMBOL (variable, sym); /* Update in case of aliasing. */ if (EQ (blv->where, tmp)) /* The binding is already loaded. */ return blv_found (blv) ? Qt : Qnil; @@ -2391,7 +2396,7 @@ value in BUFFER, or if VARIABLE is automatically buffer-local (see struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); if (blv->local_if_set) return Qt; - variable = make_lisp_symbol (sym); /* Update in case of aliasing. */ + XSETSYMBOL (variable, sym); /* Update in case of aliasing. */ return Flocal_variable_p (variable, buffer); } case SYMBOL_FORWARDED: -- cgit v1.2.1