aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
authorSergey Vinokurov2022-01-14 08:49:11 +0100
committerLars Ingebrigtsen2022-01-14 08:50:06 +0100
commita5ce31a192f474bce1259b97e599258d1fde7c8c (patch)
tree60bc8a18648682c7fcb53339deed6ecd3bfd1361 /src/data.c
parent3ae74c2e478e65de2cdc78013c0d6524b97442c0 (diff)
downloademacs-a5ce31a192f474bce1259b97e599258d1fde7c8c.tar.gz
emacs-a5ce31a192f474bce1259b97e599258d1fde7c8c.zip
Use assq_no_quit on all local_var_alist accesses
* src/data.c (Fkill_local_variable): * src/buffer.c (buffer_local_value): Use assq_no_quit instead of Fassoc/Fassq on local_var_alist (bug#53242). * src/data.c (Flocal_variable_p): Use assq_no_quit instead of open-coding the search on local_var_alist.
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/data.c b/src/data.c
index 5d0790692b7..f287c38fcdf 100644
--- a/src/data.c
+++ b/src/data.c
@@ -2103,7 +2103,7 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */)
2103 2103
2104 /* Make sure this buffer has its own value of symbol. */ 2104 /* Make sure this buffer has its own value of symbol. */
2105 XSETSYMBOL (variable, sym); /* Update in case of aliasing. */ 2105 XSETSYMBOL (variable, sym); /* Update in case of aliasing. */
2106 tem = Fassq (variable, BVAR (current_buffer, local_var_alist)); 2106 tem = assq_no_quit (variable, BVAR (current_buffer, local_var_alist));
2107 if (NILP (tem)) 2107 if (NILP (tem))
2108 { 2108 {
2109 if (let_shadows_buffer_binding_p (sym)) 2109 if (let_shadows_buffer_binding_p (sym))
@@ -2183,7 +2183,7 @@ From now on the default value will apply in this buffer. Return VARIABLE. */)
2183 2183
2184 /* Get rid of this buffer's alist element, if any. */ 2184 /* Get rid of this buffer's alist element, if any. */
2185 XSETSYMBOL (variable, sym); /* Propagate variable indirection. */ 2185 XSETSYMBOL (variable, sym); /* Propagate variable indirection. */
2186 tem = Fassq (variable, BVAR (current_buffer, local_var_alist)); 2186 tem = assq_no_quit (variable, BVAR (current_buffer, local_var_alist));
2187 if (!NILP (tem)) 2187 if (!NILP (tem))
2188 bset_local_var_alist 2188 bset_local_var_alist
2189 (current_buffer, 2189 (current_buffer,
@@ -2224,7 +2224,7 @@ Also see `buffer-local-boundp'.*/)
2224 case SYMBOL_PLAINVAL: return Qnil; 2224 case SYMBOL_PLAINVAL: return Qnil;
2225 case SYMBOL_LOCALIZED: 2225 case SYMBOL_LOCALIZED:
2226 { 2226 {
2227 Lisp_Object tail, elt, tmp; 2227 Lisp_Object tmp;
2228 struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); 2228 struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
2229 XSETBUFFER (tmp, buf); 2229 XSETBUFFER (tmp, buf);
2230 XSETSYMBOL (variable, sym); /* Update in case of aliasing. */ 2230 XSETSYMBOL (variable, sym); /* Update in case of aliasing. */
@@ -2232,13 +2232,9 @@ Also see `buffer-local-boundp'.*/)
2232 if (EQ (blv->where, tmp)) /* The binding is already loaded. */ 2232 if (EQ (blv->where, tmp)) /* The binding is already loaded. */
2233 return blv_found (blv) ? Qt : Qnil; 2233 return blv_found (blv) ? Qt : Qnil;
2234 else 2234 else
2235 for (tail = BVAR (buf, local_var_alist); CONSP (tail); tail = XCDR (tail)) 2235 return NILP (assq_no_quit (variable, BVAR (buf, local_var_alist)))
2236 { 2236 ? Qnil
2237 elt = XCAR (tail); 2237 : Qt;
2238 if (EQ (variable, XCAR (elt)))
2239 return Qt;
2240 }
2241 return Qnil;
2242 } 2238 }
2243 case SYMBOL_FORWARDED: 2239 case SYMBOL_FORWARDED:
2244 { 2240 {