diff options
| author | Stefan Monnier | 2007-10-16 15:42:58 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-10-16 15:42:58 +0000 |
| commit | 67ee9f6e9121a43a5bad61145b55d785d88bfabf (patch) | |
| tree | a776c1c5a82747dd188a8e34d9499f2f0d6a0928 /src/buffer.c | |
| parent | 4144e15e96e7d67ff0ebbed15ecc14154ba68da2 (diff) | |
| download | emacs-67ee9f6e9121a43a5bad61145b55d785d88bfabf.tar.gz emacs-67ee9f6e9121a43a5bad61145b55d785d88bfabf.zip | |
* lisp.h (enum Lisp_Misc_Type): Del Lisp_Misc_Some_Buffer_Local_Value.
(XMISCANY): New macro.
(XMISCTYPE): Use it.
(struct Lisp_Misc_Any): New type.
(union Lisp_Misc): Use it.
(struct Lisp_Buffer_Local_Value): Add `local_if_set' bit.
* data.c (Fboundp, store_symval_forwarding, swap_in_global_binding)
(find_symbol_value, set_internal, default_value, Fset_default)
(Fmake_variable_buffer_local, Fmake_local_variable)
(Fkill_local_variable, Fmake_variable_frame_local, Flocal_variable_p)
(Flocal_variable_if_set_p, Fvariable_binding_locus):
The SOME_BUFFER_LOCAL_VALUEP distinction is replaced by local_if_set.
* alloc.c (allocate_buffer): Set the size and tag.
(allocate_misc, mark_maybe_object, mark_object, survives_gc_p):
Use XMISCANY.
(die): Follow the GNU convention for error messages.
* print.c (print_object): SOME_BUFFER_LOCAL_VALUEP -> local_if_set.
* buffer.c (Fget_buffer_create, Fmake_indirect_buffer): Don't set the
tag any more.
(set_buffer_internal_1):
* frame.c (store_frame_param):
* eval.c (specbind):
* xdisp.c (select_frame_for_redisplay): Drop SOME_BUFFER_LOCAL_VALUEP.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/src/buffer.c b/src/buffer.c index 740f9fe53d6..c53d427499a 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -361,8 +361,6 @@ The value is never nil. */) | |||
| 361 | 361 | ||
| 362 | b = (struct buffer *) allocate_buffer (); | 362 | b = (struct buffer *) allocate_buffer (); |
| 363 | 363 | ||
| 364 | b->size = sizeof (struct buffer) / sizeof (EMACS_INT); | ||
| 365 | |||
| 366 | /* An ordinary buffer uses its own struct buffer_text. */ | 364 | /* An ordinary buffer uses its own struct buffer_text. */ |
| 367 | b->text = &b->own_text; | 365 | b->text = &b->own_text; |
| 368 | b->base_buffer = 0; | 366 | b->base_buffer = 0; |
| @@ -416,10 +414,7 @@ The value is never nil. */) | |||
| 416 | STRING_SET_INTERVALS (name, NULL_INTERVAL); | 414 | STRING_SET_INTERVALS (name, NULL_INTERVAL); |
| 417 | b->name = name; | 415 | b->name = name; |
| 418 | 416 | ||
| 419 | if (SREF (name, 0) != ' ') | 417 | b->undo_list = (SREF (name, 0) != ' ') ? Qnil : Qt; |
| 420 | b->undo_list = Qnil; | ||
| 421 | else | ||
| 422 | b->undo_list = Qt; | ||
| 423 | 418 | ||
| 424 | reset_buffer (b); | 419 | reset_buffer (b); |
| 425 | reset_buffer_local_variables (b, 1); | 420 | reset_buffer_local_variables (b, 1); |
| @@ -429,7 +424,6 @@ The value is never nil. */) | |||
| 429 | b->name = name; | 424 | b->name = name; |
| 430 | 425 | ||
| 431 | /* Put this in the alist of all live buffers. */ | 426 | /* Put this in the alist of all live buffers. */ |
| 432 | XSETPVECTYPE (b, PVEC_BUFFER); | ||
| 433 | XSETBUFFER (buf, b); | 427 | XSETBUFFER (buf, b); |
| 434 | Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil)); | 428 | Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil)); |
| 435 | 429 | ||
| @@ -567,13 +561,10 @@ CLONE nil means the indirect buffer's state is reset to default values. */) | |||
| 567 | error ("Empty string for buffer name is not allowed"); | 561 | error ("Empty string for buffer name is not allowed"); |
| 568 | 562 | ||
| 569 | b = (struct buffer *) allocate_buffer (); | 563 | b = (struct buffer *) allocate_buffer (); |
| 570 | b->size = sizeof (struct buffer) / sizeof (EMACS_INT); | ||
| 571 | XSETPVECTYPE (b, PVEC_BUFFER); | ||
| 572 | 564 | ||
| 573 | if (XBUFFER (base_buffer)->base_buffer) | 565 | b->base_buffer = (XBUFFER (base_buffer)->base_buffer |
| 574 | b->base_buffer = XBUFFER (base_buffer)->base_buffer; | 566 | ? XBUFFER (base_buffer)->base_buffer |
| 575 | else | 567 | : XBUFFER (base_buffer)); |
| 576 | b->base_buffer = XBUFFER (base_buffer); | ||
| 577 | 568 | ||
| 578 | /* Use the base buffer's text object. */ | 569 | /* Use the base buffer's text object. */ |
| 579 | b->text = b->base_buffer->text; | 570 | b->text = b->base_buffer->text; |
| @@ -1918,8 +1909,7 @@ set_buffer_internal_1 (b) | |||
| 1918 | for (tail = b->local_var_alist; CONSP (tail); tail = XCDR (tail)) | 1909 | for (tail = b->local_var_alist; CONSP (tail); tail = XCDR (tail)) |
| 1919 | { | 1910 | { |
| 1920 | valcontents = SYMBOL_VALUE (XCAR (XCAR (tail))); | 1911 | valcontents = SYMBOL_VALUE (XCAR (XCAR (tail))); |
| 1921 | if ((BUFFER_LOCAL_VALUEP (valcontents) | 1912 | if ((BUFFER_LOCAL_VALUEP (valcontents)) |
| 1922 | || SOME_BUFFER_LOCAL_VALUEP (valcontents)) | ||
| 1923 | && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue, | 1913 | && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue, |
| 1924 | (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem)))) | 1914 | (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem)))) |
| 1925 | /* Just reference the variable | 1915 | /* Just reference the variable |
| @@ -1933,8 +1923,7 @@ set_buffer_internal_1 (b) | |||
| 1933 | for (tail = old_buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) | 1923 | for (tail = old_buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) |
| 1934 | { | 1924 | { |
| 1935 | valcontents = SYMBOL_VALUE (XCAR (XCAR (tail))); | 1925 | valcontents = SYMBOL_VALUE (XCAR (XCAR (tail))); |
| 1936 | if ((BUFFER_LOCAL_VALUEP (valcontents) | 1926 | if ((BUFFER_LOCAL_VALUEP (valcontents)) |
| 1937 | || SOME_BUFFER_LOCAL_VALUEP (valcontents)) | ||
| 1938 | && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue, | 1927 | && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue, |
| 1939 | (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem)))) | 1928 | (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem)))) |
| 1940 | /* Just reference the variable | 1929 | /* Just reference the variable |
| @@ -2493,7 +2482,7 @@ the normal hook `change-major-mode-hook'. */) | |||
| 2493 | /* Any which are supposed to be permanent, | 2482 | /* Any which are supposed to be permanent, |
| 2494 | make local again, with the same values they had. */ | 2483 | make local again, with the same values they had. */ |
| 2495 | 2484 | ||
| 2496 | for (alist = oalist; !NILP (alist); alist = XCDR (alist)) | 2485 | for (alist = oalist; CONSP (alist); alist = XCDR (alist)) |
| 2497 | { | 2486 | { |
| 2498 | sym = XCAR (XCAR (alist)); | 2487 | sym = XCAR (XCAR (alist)); |
| 2499 | tem = Fget (sym, Qpermanent_local); | 2488 | tem = Fget (sym, Qpermanent_local); |
| @@ -2523,7 +2512,7 @@ swap_out_buffer_local_variables (b) | |||
| 2523 | XSETBUFFER (buffer, b); | 2512 | XSETBUFFER (buffer, b); |
| 2524 | oalist = b->local_var_alist; | 2513 | oalist = b->local_var_alist; |
| 2525 | 2514 | ||
| 2526 | for (alist = oalist; !NILP (alist); alist = XCDR (alist)) | 2515 | for (alist = oalist; CONSP (alist); alist = XCDR (alist)) |
| 2527 | { | 2516 | { |
| 2528 | sym = XCAR (XCAR (alist)); | 2517 | sym = XCAR (XCAR (alist)); |
| 2529 | 2518 | ||