comparison src/buffer.c @ 37858:fd7c0dac2110

Use SYMBOL_VALUE/ SET_SYMBOL_VALUE macros instead of accessing symbols' value directly.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 21 May 2001 12:34:11 +0000
parents 1085e1cfebaf
children
comparison
equal deleted inserted replaced
37857:b3fd27aaa58d 37858:fd7c0dac2110
1680 /* Look down buffer's list of local Lisp variables 1680 /* Look down buffer's list of local Lisp variables
1681 to find and update any that forward into C variables. */ 1681 to find and update any that forward into C variables. */
1682 1682
1683 for (tail = b->local_var_alist; !NILP (tail); tail = XCDR (tail)) 1683 for (tail = b->local_var_alist; !NILP (tail); tail = XCDR (tail))
1684 { 1684 {
1685 valcontents = XSYMBOL (XCAR (XCAR (tail)))->value; 1685 valcontents = SYMBOL_VALUE (XCAR (XCAR (tail)));
1686 if ((BUFFER_LOCAL_VALUEP (valcontents) 1686 if ((BUFFER_LOCAL_VALUEP (valcontents)
1687 || SOME_BUFFER_LOCAL_VALUEP (valcontents)) 1687 || SOME_BUFFER_LOCAL_VALUEP (valcontents))
1688 && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue, 1688 && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue,
1689 (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem)))) 1689 (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem))))
1690 /* Just reference the variable 1690 /* Just reference the variable
1695 /* Do the same with any others that were local to the previous buffer */ 1695 /* Do the same with any others that were local to the previous buffer */
1696 1696
1697 if (old_buf) 1697 if (old_buf)
1698 for (tail = old_buf->local_var_alist; !NILP (tail); tail = XCDR (tail)) 1698 for (tail = old_buf->local_var_alist; !NILP (tail); tail = XCDR (tail))
1699 { 1699 {
1700 valcontents = XSYMBOL (XCAR (XCAR (tail)))->value; 1700 valcontents = SYMBOL_VALUE (XCAR (XCAR (tail)));
1701 if ((BUFFER_LOCAL_VALUEP (valcontents) 1701 if ((BUFFER_LOCAL_VALUEP (valcontents)
1702 || SOME_BUFFER_LOCAL_VALUEP (valcontents)) 1702 || SOME_BUFFER_LOCAL_VALUEP (valcontents))
1703 && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue, 1703 && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue,
1704 (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem)))) 1704 (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem))))
1705 /* Just reference the variable 1705 /* Just reference the variable
2257 for (alist = oalist; !NILP (alist); alist = XCDR (alist)) 2257 for (alist = oalist; !NILP (alist); alist = XCDR (alist))
2258 { 2258 {
2259 sym = XCAR (XCAR (alist)); 2259 sym = XCAR (XCAR (alist));
2260 2260
2261 /* Need not do anything if some other buffer's binding is now encached. */ 2261 /* Need not do anything if some other buffer's binding is now encached. */
2262 tem = XBUFFER_LOCAL_VALUE (XSYMBOL (sym)->value)->buffer; 2262 tem = XBUFFER_LOCAL_VALUE (SYMBOL_VALUE (sym))->buffer;
2263 if (BUFFERP (tem) && XBUFFER (tem) == current_buffer) 2263 if (BUFFERP (tem) && XBUFFER (tem) == current_buffer)
2264 { 2264 {
2265 /* Symbol is set up for this buffer's old local value. 2265 /* Symbol is set up for this buffer's old local value.
2266 Set it up for the current buffer with the default value. */ 2266 Set it up for the current buffer with the default value. */
2267 2267
2268 tem = XBUFFER_LOCAL_VALUE (XSYMBOL (sym)->value)->cdr; 2268 tem = XBUFFER_LOCAL_VALUE (SYMBOL_VALUE (sym))->cdr;
2269 /* Store the symbol's current value into the alist entry 2269 /* Store the symbol's current value into the alist entry
2270 it is currently set up for. This is so that, if the 2270 it is currently set up for. This is so that, if the
2271 local is marked permanent, and we make it local again 2271 local is marked permanent, and we make it local again
2272 later in Fkill_all_local_variables, we don't lose the value. */ 2272 later in Fkill_all_local_variables, we don't lose the value. */
2273 XCDR (XCAR (tem)) 2273 XCDR (XCAR (tem))
2274 = do_symval_forwarding (XBUFFER_LOCAL_VALUE (XSYMBOL (sym)->value)->realvalue); 2274 = do_symval_forwarding (XBUFFER_LOCAL_VALUE (SYMBOL_VALUE (sym))->realvalue);
2275 /* Switch to the symbol's default-value alist entry. */ 2275 /* Switch to the symbol's default-value alist entry. */
2276 XCAR (tem) = tem; 2276 XCAR (tem) = tem;
2277 /* Mark it as current for buffer B. */ 2277 /* Mark it as current for buffer B. */
2278 XBUFFER_LOCAL_VALUE (XSYMBOL (sym)->value)->buffer = buffer; 2278 XBUFFER_LOCAL_VALUE (SYMBOL_VALUE (sym))->buffer = buffer;
2279 /* Store the current value into any forwarding in the symbol. */ 2279 /* Store the current value into any forwarding in the symbol. */
2280 store_symval_forwarding (sym, 2280 store_symval_forwarding (sym,
2281 XBUFFER_LOCAL_VALUE (XSYMBOL (sym)->value)->realvalue, 2281 XBUFFER_LOCAL_VALUE (SYMBOL_VALUE (sym))->realvalue,
2282 XCDR (tem), NULL); 2282 XCDR (tem), NULL);
2283 } 2283 }
2284 } 2284 }
2285 } 2285 }
2286 2286