Mercurial > hg > xemacs-beta
comparison src/buffer.c @ 5117:3742ea8250b5 ben-lisp-object ben-lisp-object-final-ws-year-2005
Checking in final CVS version of workspace 'ben-lisp-object'
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Sat, 26 Dec 2009 00:20:27 -0600 |
parents | b7f26b2f78bd |
children | e0db3c197671 |
comparison
equal
deleted
inserted
replaced
5116:e56f73345619 | 5117:3742ea8250b5 |
---|---|
317 } | 317 } |
318 | 318 |
319 /* We do not need a finalize method to handle a buffer's children list | 319 /* We do not need a finalize method to handle a buffer's children list |
320 because all buffers have `kill-buffer' applied to them before | 320 because all buffers have `kill-buffer' applied to them before |
321 they disappear, and the children removal happens then. */ | 321 they disappear, and the children removal happens then. */ |
322 DEFINE_LRECORD_IMPLEMENTATION ("buffer", buffer, | 322 DEFINE_NONDUMPABLE_LISP_OBJECT ("buffer", buffer, mark_buffer, |
323 0, /*dumpable-flag*/ | 323 print_buffer, 0, 0, 0, |
324 mark_buffer, print_buffer, 0, 0, 0, | 324 buffer_description, |
325 buffer_description, | 325 struct buffer); |
326 struct buffer); | |
327 | 326 |
328 DEFUN ("bufferp", Fbufferp, 1, 1, 0, /* | 327 DEFUN ("bufferp", Fbufferp, 1, 1, 0, /* |
329 Return t if OBJECT is an editor buffer. | 328 Return t if OBJECT is an editor buffer. |
330 */ | 329 */ |
331 (object)) | 330 (object)) |
585 } | 584 } |
586 | 585 |
587 static struct buffer * | 586 static struct buffer * |
588 allocate_buffer (void) | 587 allocate_buffer (void) |
589 { | 588 { |
590 struct buffer *b = ALLOC_LCRECORD_TYPE (struct buffer, &lrecord_buffer); | 589 Lisp_Object obj = ALLOC_LISP_OBJECT (buffer); |
590 struct buffer *b = XBUFFER (obj); | |
591 | 591 |
592 COPY_LCRECORD (b, XBUFFER (Vbuffer_defaults)); | 592 COPY_LCRECORD (b, XBUFFER (Vbuffer_defaults)); |
593 | 593 |
594 return b; | 594 return b; |
595 } | 595 } |
1886 | 1886 |
1887 | 1887 |
1888 void | 1888 void |
1889 syms_of_buffer (void) | 1889 syms_of_buffer (void) |
1890 { | 1890 { |
1891 INIT_LRECORD_IMPLEMENTATION (buffer); | 1891 INIT_LISP_OBJECT (buffer); |
1892 | 1892 |
1893 DEFSYMBOL (Qbuffer_live_p); | 1893 DEFSYMBOL (Qbuffer_live_p); |
1894 DEFSYMBOL (Qbuffer_or_string_p); | 1894 DEFSYMBOL (Qbuffer_or_string_p); |
1895 DEFSYMBOL (Qmode_class); | 1895 DEFSYMBOL (Qmode_class); |
1896 DEFSYMBOL (Qrename_auto_save_file); | 1896 DEFSYMBOL (Qrename_auto_save_file); |
2118 do \ | 2118 do \ |
2119 { \ | 2119 { \ |
2120 struct symbol_value_forward *I_hate_C = \ | 2120 struct symbol_value_forward *I_hate_C = \ |
2121 alloc_lrecord_type (struct symbol_value_forward, \ | 2121 alloc_lrecord_type (struct symbol_value_forward, \ |
2122 &lrecord_symbol_value_forward); \ | 2122 &lrecord_symbol_value_forward); \ |
2123 /*mcpro ((Lisp_Object) I_hate_C);*/ \ | 2123 /*mcpro ((Lisp_Object) I_hate_C);*/ \ |
2124 \ | 2124 \ |
2125 I_hate_C->magic.value = &(buffer_local_flags.field_name); \ | 2125 I_hate_C->magic.value = &(buffer_local_flags.field_name); \ |
2126 I_hate_C->magic.type = forward_type; \ | 2126 I_hate_C->magic.type = forward_type; \ |
2127 I_hate_C->magicfun = magic_fun; \ | 2127 I_hate_C->magicfun = magic_fun; \ |
2128 \ | 2128 \ |
2207 static void | 2207 static void |
2208 common_init_complex_vars_of_buffer (void) | 2208 common_init_complex_vars_of_buffer (void) |
2209 { | 2209 { |
2210 /* Make sure all markable slots in buffer_defaults | 2210 /* Make sure all markable slots in buffer_defaults |
2211 are initialized reasonably, so mark_buffer won't choke. */ | 2211 are initialized reasonably, so mark_buffer won't choke. */ |
2212 struct buffer *defs = ALLOC_LCRECORD_TYPE (struct buffer, &lrecord_buffer); | 2212 Lisp_Object defobj = ALLOC_LISP_OBJECT (buffer); |
2213 struct buffer *syms = ALLOC_LCRECORD_TYPE (struct buffer, &lrecord_buffer); | 2213 struct buffer *defs = XBUFFER (defobj); |
2214 Lisp_Object symobj = ALLOC_LISP_OBJECT (buffer); | |
2215 struct buffer *syms = XBUFFER (symobj); | |
2214 | 2216 |
2215 staticpro_nodump (&Vbuffer_defaults); | 2217 staticpro_nodump (&Vbuffer_defaults); |
2216 staticpro_nodump (&Vbuffer_local_symbols); | 2218 staticpro_nodump (&Vbuffer_local_symbols); |
2217 Vbuffer_defaults = wrap_buffer (defs); | 2219 Vbuffer_defaults = defobj; |
2218 Vbuffer_local_symbols = wrap_buffer (syms); | 2220 Vbuffer_local_symbols = symobj; |
2219 | 2221 |
2220 nuke_all_buffer_slots (syms, Qnil); | 2222 nuke_all_buffer_slots (syms, Qnil); |
2221 nuke_all_buffer_slots (defs, Qnil); | 2223 nuke_all_buffer_slots (defs, Qnil); |
2222 defs->text = &defs->own_text; | 2224 defs->text = &defs->own_text; |
2223 syms->text = &syms->own_text; | 2225 syms->text = &syms->own_text; |