aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
authorMattias EngdegÄrd2024-03-04 14:14:05 +0100
committerMattias EngdegÄrd2024-03-04 14:14:05 +0100
commit11ffb4656d768b09e1f7dfacc091d85eef4a403a (patch)
tree4469592094317fb49925cf4408516e9349bfeb87 /src/data.c
parentb9e8474a4470f71c30a4b89651fd3c5f2ef92ba2 (diff)
downloademacs-11ffb4656d768b09e1f7dfacc091d85eef4a403a.tar.gz
emacs-11ffb4656d768b09e1f7dfacc091d85eef4a403a.zip
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.
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c33
1 files changed, 19 insertions, 14 deletions
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. */)
1256 struct Lisp_Symbol *sym = XSYMBOL (object); 1256 struct Lisp_Symbol *sym = XSYMBOL (object);
1257 while (sym->u.s.redirect == SYMBOL_VARALIAS) 1257 while (sym->u.s.redirect == SYMBOL_VARALIAS)
1258 sym = SYMBOL_ALIAS (sym); 1258 sym = SYMBOL_ALIAS (sym);
1259 object = make_lisp_symbol (sym); 1259 XSETSYMBOL (object, sym);
1260 } 1260 }
1261 return object; 1261 return object;
1262} 1262}
@@ -1506,9 +1506,12 @@ swap_in_symval_forwarding (struct Lisp_Symbol *symbol, struct Lisp_Buffer_Local_
1506 if (blv->fwd.fwdptr) 1506 if (blv->fwd.fwdptr)
1507 set_blv_value (blv, do_symval_forwarding (blv->fwd)); 1507 set_blv_value (blv, do_symval_forwarding (blv->fwd));
1508 /* Choose the new binding. */ 1508 /* Choose the new binding. */
1509 tem1 = assq_no_quit (make_lisp_symbol (symbol), 1509 {
1510 BVAR (current_buffer, local_var_alist)); 1510 Lisp_Object var;
1511 set_blv_where (blv, Fcurrent_buffer ()); 1511 XSETSYMBOL (var, symbol);
1512 tem1 = assq_no_quit (var, BVAR (current_buffer, local_var_alist));
1513 set_blv_where (blv, Fcurrent_buffer ());
1514 }
1512 if (!(blv->found = !NILP (tem1))) 1515 if (!(blv->found = !NILP (tem1)))
1513 tem1 = blv->defcell; 1516 tem1 = blv->defcell;
1514 1517
@@ -1652,8 +1655,7 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where,
1652 set_blv_value (blv, do_symval_forwarding (blv->fwd)); 1655 set_blv_value (blv, do_symval_forwarding (blv->fwd));
1653 1656
1654 /* Find the new binding. */ 1657 /* Find the new binding. */
1655 /* May have changed via aliasing. */ 1658 XSETSYMBOL (symbol, sym); /* May have changed via aliasing. */
1656 symbol = make_lisp_symbol (sym);
1657 Lisp_Object tem1 1659 Lisp_Object tem1
1658 = assq_no_quit (symbol, 1660 = assq_no_quit (symbol,
1659 BVAR (XBUFFER (where), local_var_alist)); 1661 BVAR (XBUFFER (where), local_var_alist));
@@ -2057,10 +2059,13 @@ make_blv (struct Lisp_Symbol *sym, bool forwarded,
2057 union Lisp_Val_Fwd valcontents) 2059 union Lisp_Val_Fwd valcontents)
2058{ 2060{
2059 struct Lisp_Buffer_Local_Value *blv = xmalloc (sizeof *blv); 2061 struct Lisp_Buffer_Local_Value *blv = xmalloc (sizeof *blv);
2060 Lisp_Object tem = Fcons (make_lisp_symbol (sym), 2062 Lisp_Object symbol;
2061 forwarded 2063 Lisp_Object tem;
2062 ? do_symval_forwarding (valcontents.fwd) 2064
2063 : valcontents.value); 2065 XSETSYMBOL (symbol, sym);
2066 tem = Fcons (symbol, (forwarded
2067 ? do_symval_forwarding (valcontents.fwd)
2068 : valcontents.value));
2064 2069
2065 /* Buffer_Local_Values cannot have as realval a buffer-local 2070 /* Buffer_Local_Values cannot have as realval a buffer-local
2066 or keyboard-local forwarding. */ 2071 or keyboard-local forwarding. */
@@ -2216,7 +2221,7 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */)
2216 } 2221 }
2217 2222
2218 /* Make sure this buffer has its own value of symbol. */ 2223 /* Make sure this buffer has its own value of symbol. */
2219 variable = make_lisp_symbol (sym); /* Update in case of aliasing. */ 2224 XSETSYMBOL (variable, sym); /* Update in case of aliasing. */
2220 tem = assq_no_quit (variable, BVAR (current_buffer, local_var_alist)); 2225 tem = assq_no_quit (variable, BVAR (current_buffer, local_var_alist));
2221 if (NILP (tem)) 2226 if (NILP (tem))
2222 { 2227 {
@@ -2296,7 +2301,7 @@ From now on the default value will apply in this buffer. Return VARIABLE. */)
2296 notify_variable_watchers (variable, Qnil, Qmakunbound, Fcurrent_buffer ()); 2301 notify_variable_watchers (variable, Qnil, Qmakunbound, Fcurrent_buffer ());
2297 2302
2298 /* Get rid of this buffer's alist element, if any. */ 2303 /* Get rid of this buffer's alist element, if any. */
2299 variable = make_lisp_symbol (sym); /* Propagate variable indirection. */ 2304 XSETSYMBOL (variable, sym); /* Propagate variable indirection. */
2300 tem = assq_no_quit (variable, BVAR (current_buffer, local_var_alist)); 2305 tem = assq_no_quit (variable, BVAR (current_buffer, local_var_alist));
2301 if (!NILP (tem)) 2306 if (!NILP (tem))
2302 bset_local_var_alist 2307 bset_local_var_alist
@@ -2341,7 +2346,7 @@ Also see `buffer-local-boundp'.*/)
2341 Lisp_Object tmp; 2346 Lisp_Object tmp;
2342 struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); 2347 struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
2343 XSETBUFFER (tmp, buf); 2348 XSETBUFFER (tmp, buf);
2344 variable = make_lisp_symbol (sym); /* Update in case of aliasing. */ 2349 XSETSYMBOL (variable, sym); /* Update in case of aliasing. */
2345 2350
2346 if (EQ (blv->where, tmp)) /* The binding is already loaded. */ 2351 if (EQ (blv->where, tmp)) /* The binding is already loaded. */
2347 return blv_found (blv) ? Qt : Qnil; 2352 return blv_found (blv) ? Qt : Qnil;
@@ -2391,7 +2396,7 @@ value in BUFFER, or if VARIABLE is automatically buffer-local (see
2391 struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); 2396 struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
2392 if (blv->local_if_set) 2397 if (blv->local_if_set)
2393 return Qt; 2398 return Qt;
2394 variable = make_lisp_symbol (sym); /* Update in case of aliasing. */ 2399 XSETSYMBOL (variable, sym); /* Update in case of aliasing. */
2395 return Flocal_variable_p (variable, buffer); 2400 return Flocal_variable_p (variable, buffer);
2396 } 2401 }
2397 case SYMBOL_FORWARDED: 2402 case SYMBOL_FORWARDED: