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