aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/buffer.c33
2 files changed, 25 insertions, 14 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5e78a64a0ba..0e8d8f6961a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12009-08-15 Chong Yidong <cyd@stupidchicken.com>
2
3 * buffer.c (set_buffer_internal_1)
4 (swap_out_buffer_local_variables): Check for unbound local
5 variables (Bug#4138).
6
12009-08-14 Eli Zaretskii <eliz@gnu.org> 72009-08-14 Eli Zaretskii <eliz@gnu.org>
2 8
3 * process.c (create_pty): Fix last change. 9 * process.c (create_pty): Fix last change.
diff --git a/src/buffer.c b/src/buffer.c
index f811f162ef2..580d5f004cd 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1921,12 +1921,14 @@ set_buffer_internal_1 (b)
1921 1921
1922 for (tail = b->local_var_alist; CONSP (tail); tail = XCDR (tail)) 1922 for (tail = b->local_var_alist; CONSP (tail); tail = XCDR (tail))
1923 { 1923 {
1924 valcontents = SYMBOL_VALUE (XCAR (XCAR (tail))); 1924 if (CONSP (XCAR (tail))
1925 if ((BUFFER_LOCAL_VALUEP (valcontents)) 1925 && SYMBOLP (XCAR (XCAR (tail)))
1926 && (valcontents = SYMBOL_VALUE (XCAR (XCAR (tail))),
1927 (BUFFER_LOCAL_VALUEP (valcontents)))
1926 && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue, 1928 && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue,
1927 (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem)))) 1929 (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem))))
1928 /* Just reference the variable 1930 /* Just reference the variable to cause it to become set for
1929 to cause it to become set for this buffer. */ 1931 this buffer. */
1930 Fsymbol_value (XCAR (XCAR (tail))); 1932 Fsymbol_value (XCAR (XCAR (tail)));
1931 } 1933 }
1932 1934
@@ -1935,12 +1937,14 @@ set_buffer_internal_1 (b)
1935 if (old_buf) 1937 if (old_buf)
1936 for (tail = old_buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) 1938 for (tail = old_buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
1937 { 1939 {
1938 valcontents = SYMBOL_VALUE (XCAR (XCAR (tail))); 1940 if (CONSP (tail)
1939 if ((BUFFER_LOCAL_VALUEP (valcontents)) 1941 && SYMBOLP (XCAR (XCAR (tail)))
1942 && (valcontents = SYMBOL_VALUE (XCAR (XCAR (tail))),
1943 (BUFFER_LOCAL_VALUEP (valcontents)))
1940 && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue, 1944 && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue,
1941 (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem)))) 1945 (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem))))
1942 /* Just reference the variable 1946 /* Just reference the variable to cause it to become set for
1943 to cause it to become set for this buffer. */ 1947 this buffer. */
1944 Fsymbol_value (XCAR (XCAR (tail))); 1948 Fsymbol_value (XCAR (XCAR (tail)));
1945 } 1949 }
1946} 1950}
@@ -2653,18 +2657,19 @@ static void
2653swap_out_buffer_local_variables (b) 2657swap_out_buffer_local_variables (b)
2654 struct buffer *b; 2658 struct buffer *b;
2655{ 2659{
2656 Lisp_Object oalist, alist, sym, tem, buffer; 2660 Lisp_Object oalist, alist, sym, buffer;
2657 2661
2658 XSETBUFFER (buffer, b); 2662 XSETBUFFER (buffer, b);
2659 oalist = b->local_var_alist; 2663 oalist = b->local_var_alist;
2660 2664
2661 for (alist = oalist; CONSP (alist); alist = XCDR (alist)) 2665 for (alist = oalist; CONSP (alist); alist = XCDR (alist))
2662 { 2666 {
2663 sym = XCAR (XCAR (alist)); 2667 if (CONSP (XCAR (alist))
2664 2668 && (sym = XCAR (XCAR (alist)), SYMBOLP (sym))
2665 /* Need not do anything if some other buffer's binding is now encached. */ 2669 /* Need not do anything if some other buffer's binding is
2666 tem = XBUFFER_LOCAL_VALUE (SYMBOL_VALUE (sym))->buffer; 2670 now encached. */
2667 if (EQ (tem, buffer)) 2671 && EQ (XBUFFER_LOCAL_VALUE (SYMBOL_VALUE (sym))->buffer,
2672 buffer))
2668 { 2673 {
2669 /* Symbol is set up for this buffer's old local value: 2674 /* Symbol is set up for this buffer's old local value:
2670 swap it out! */ 2675 swap it out! */