aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c57
1 files changed, 12 insertions, 45 deletions
diff --git a/src/data.c b/src/data.c
index 6622088b648..b33d9656d57 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1069,40 +1069,6 @@ DEFUN ("set", Fset, Sset, 2, 2, 0,
1069 return newval; 1069 return newval;
1070} 1070}
1071 1071
1072/* Return true if SYMBOL currently has a let-binding
1073 which was made in the buffer that is now current. */
1074
1075static bool
1076let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol)
1077{
1078 struct specbinding *p;
1079
1080 for (p = specpdl_ptr; p > specpdl; )
1081 if ((--p)->func == NULL
1082 && CONSP (p->symbol))
1083 {
1084 struct Lisp_Symbol *let_bound_symbol = XSYMBOL (XCAR (p->symbol));
1085 eassert (let_bound_symbol->redirect != SYMBOL_VARALIAS);
1086 if (symbol == let_bound_symbol
1087 && XBUFFER (XCDR (XCDR (p->symbol))) == current_buffer)
1088 return 1;
1089 }
1090
1091 return 0;
1092}
1093
1094static bool
1095let_shadows_global_binding_p (Lisp_Object symbol)
1096{
1097 struct specbinding *p;
1098
1099 for (p = specpdl_ptr; p > specpdl; )
1100 if ((--p)->func == NULL && EQ (p->symbol, symbol))
1101 return 1;
1102
1103 return 0;
1104}
1105
1106/* Store the value NEWVAL into SYMBOL. 1072/* Store the value NEWVAL into SYMBOL.
1107 If buffer/frame-locality is an issue, WHERE specifies which context to use. 1073 If buffer/frame-locality is an issue, WHERE specifies which context to use.
1108 (nil stands for the current buffer/frame). 1074 (nil stands for the current buffer/frame).
@@ -1841,17 +1807,18 @@ BUFFER defaults to the current buffer. */)
1841 XSETBUFFER (tmp, buf); 1807 XSETBUFFER (tmp, buf);
1842 XSETSYMBOL (variable, sym); /* Update in case of aliasing. */ 1808 XSETSYMBOL (variable, sym); /* Update in case of aliasing. */
1843 1809
1844 for (tail = BVAR (buf, local_var_alist); CONSP (tail); tail = XCDR (tail)) 1810 if (EQ (blv->where, tmp)) /* The binding is already loaded. */
1845 { 1811 return blv_found (blv) ? Qt : Qnil;
1846 elt = XCAR (tail); 1812 else
1847 if (EQ (variable, XCAR (elt))) 1813 for (tail = BVAR (buf, local_var_alist); CONSP (tail); tail = XCDR (tail))
1848 { 1814 {
1849 eassert (!blv->frame_local); 1815 elt = XCAR (tail);
1850 eassert (blv_found (blv) || !EQ (blv->where, tmp)); 1816 if (EQ (variable, XCAR (elt)))
1851 return Qt; 1817 {
1852 } 1818 eassert (!blv->frame_local);
1853 } 1819 return Qt;
1854 eassert (!blv_found (blv) || !EQ (blv->where, tmp)); 1820 }
1821 }
1855 return Qnil; 1822 return Qnil;
1856 } 1823 }
1857 case SYMBOL_FORWARDED: 1824 case SYMBOL_FORWARDED: