comparison src/buffer.c @ 400:a86b2b5e0111 r21-2-30

Import from CVS: tag r21-2-30
author cvs
date Mon, 13 Aug 2007 11:14:34 +0200
parents 74fd4e045ea6
children 2f8bb876ab1d
comparison
equal deleted inserted replaced
399:376370fb5946 400:a86b2b5e0111
565 /* #### This really does not need to be called. We already 565 /* #### This really does not need to be called. We already
566 initialized the buffer-local variables in allocate_buffer(). 566 initialized the buffer-local variables in allocate_buffer().
567 local_var_alist is set to Qnil at the same point, in 567 local_var_alist is set to Qnil at the same point, in
568 nuke_all_buffer_slots(). */ 568 nuke_all_buffer_slots(). */
569 reset_buffer_local_variables (b, 1); 569 reset_buffer_local_variables (b, 1);
570 b->directory = ((current_buffer) ? current_buffer->directory : Qnil); 570 b->directory = current_buffer ? current_buffer->directory : Qnil;
571 571
572 b->last_window_start = 1; 572 b->last_window_start = 1;
573 573
574 b->name = name; 574 b->name = name;
575 if (string_byte (XSTRING (name), 0) != ' ') 575 if (string_byte (XSTRING (name), 0) != ' ')
1302 int speccount = specpdl_depth (); 1302 int speccount = specpdl_depth ();
1303 specbind (Qinhibit_quit, Qt); 1303 specbind (Qinhibit_quit, Qt);
1304 1304
1305 kill_buffer_processes (buf); 1305 kill_buffer_processes (buf);
1306 1306
1307 delete_from_buffer_alist (buf);
1308
1307 /* #### This is a problem if this buffer is in a dedicated window. 1309 /* #### This is a problem if this buffer is in a dedicated window.
1308 Need to undedicate any windows of this buffer first (and delete them?) 1310 Need to undedicate any windows of this buffer first (and delete them?)
1309 */ 1311 */
1310 Freplace_buffer_in_windows (buf); 1312 Freplace_buffer_in_windows (buf);
1311
1312 delete_from_buffer_alist (buf);
1313 1313
1314 font_lock_buffer_was_killed (b); 1314 font_lock_buffer_was_killed (b);
1315 1315
1316 /* Delete any auto-save file, if we saved it in this session. */ 1316 /* Delete any auto-save file, if we saved it in this session. */
1317 if (STRINGP (b->auto_save_file_name) 1317 if (STRINGP (b->auto_save_file_name)
2146 2146
2147 2147
2148 void 2148 void
2149 syms_of_buffer (void) 2149 syms_of_buffer (void)
2150 { 2150 {
2151 INIT_LRECORD_IMPLEMENTATION (buffer);
2152
2151 defsymbol (&Qbuffer_live_p, "buffer-live-p"); 2153 defsymbol (&Qbuffer_live_p, "buffer-live-p");
2152 defsymbol (&Qbuffer_or_string_p, "buffer-or-string-p"); 2154 defsymbol (&Qbuffer_or_string_p, "buffer-or-string-p");
2153 defsymbol (&Qmode_class, "mode-class"); 2155 defsymbol (&Qmode_class, "mode-class");
2154 defsymbol (&Qrename_auto_save_file, "rename-auto-save-file"); 2156 defsymbol (&Qrename_auto_save_file, "rename-auto-save-file");
2155 defsymbol (&Qkill_buffer_hook, "kill-buffer-hook"); 2157 defsymbol (&Qkill_buffer_hook, "kill-buffer-hook");
2371 2373
2372 /* The docstrings for DEFVAR_* are recorded externally by make-docfile. */ 2374 /* The docstrings for DEFVAR_* are recorded externally by make-docfile. */
2373 2375
2374 /* Renamed from DEFVAR_PER_BUFFER because FSFmacs D_P_B takes 2376 /* Renamed from DEFVAR_PER_BUFFER because FSFmacs D_P_B takes
2375 a bogus extra arg, which confuses an otherwise identical make-docfile.c */ 2377 a bogus extra arg, which confuses an otherwise identical make-docfile.c */
2376
2377 /* Declaring this stuff as const produces 'Cannot reinitialize' messages
2378 from SunPro C's fix-and-continue feature (a way neato feature that
2379 makes debugging unbelievably more bearable) */
2380 #define DEFVAR_BUFFER_LOCAL_1(lname, field_name, forward_type, magicfun) do { \ 2378 #define DEFVAR_BUFFER_LOCAL_1(lname, field_name, forward_type, magicfun) do { \
2381 static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C = \ 2379 static const struct symbol_value_forward I_hate_C = \
2382 { /* struct symbol_value_forward */ \ 2380 { /* struct symbol_value_forward */ \
2383 { /* struct symbol_value_magic */ \ 2381 { /* struct symbol_value_magic */ \
2384 { /* struct lcrecord_header */ \ 2382 { /* struct lcrecord_header */ \
2385 { /* struct lrecord_header */ \ 2383 { /* struct lrecord_header */ \
2386 1, /* type - index into lrecord_implementations_table */ \ 2384 lrecord_type_symbol_value_forward, /* lrecord_type_index */ \
2387 0, /* mark bit */ \ 2385 1, /* mark bit */ \
2388 0, /* c_readonly bit */ \ 2386 1, /* c_readonly bit */ \
2389 0 /* lisp_readonly bit */ \ 2387 1 /* lisp_readonly bit */ \
2390 }, \ 2388 }, \
2391 0, /* next */ \ 2389 0, /* next */ \
2392 0, /* uid */ \ 2390 0, /* uid */ \
2393 0 /* free */ \ 2391 0 /* free */ \
2394 }, \ 2392 }, \