Mercurial > hg > xemacs-beta
comparison src/buffer.c @ 183:e121b013d1f0 r20-3b18
Import from CVS: tag r20-3b18
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:54:23 +0200 |
parents | 2d532a89d707 |
children | 3d6bfa290dbd |
comparison
equal
deleted
inserted
replaced
182:f07455f06202 | 183:e121b013d1f0 |
---|---|
113 | 113 |
114 If a slot is -1, then there is a DEFVAR_BUFFER_LOCAL for it | 114 If a slot is -1, then there is a DEFVAR_BUFFER_LOCAL for it |
115 as well as a default value which is used to initialize newly-created | 115 as well as a default value which is used to initialize newly-created |
116 buffers and as a reset-value when local-vars are killed. | 116 buffers and as a reset-value when local-vars are killed. |
117 | 117 |
118 If a slot is -2, there is no DEFVAR_BUFFER_LOCAL for it. | 118 If a slot is -2, there is no DEFVAR_BUFFER_LOCAL for it. |
119 (The slot is always local, but there's no lisp variable for it.) | 119 (The slot is always local, but there's no lisp variable for it.) |
120 The default value is only used to initialize newly-creation buffers. | 120 The default value is only used to initialize newly-creation buffers. |
121 | 121 |
122 If a slot is -3, then there is no DEFVAR_BUFFER_LOCAL for it but | 122 If a slot is -3, then there is no DEFVAR_BUFFER_LOCAL for it but |
123 there is a default which is used to initialize newly-creation | 123 there is a default which is used to initialize newly-creation |
124 buffers and as a reset-value when local-vars are killed. | 124 buffers and as a reset-value when local-vars are killed. |
125 | 125 |
126 | 126 |
127 */ | 127 */ |
128 struct buffer buffer_local_flags; | 128 struct buffer buffer_local_flags; |
129 | 129 |
130 /* This structure holds the names of symbols whose values may be | 130 /* This structure holds the names of symbols whose values may be |
131 buffer-local. It is indexed and accessed in the same way as the above. */ | 131 buffer-local. It is indexed and accessed in the same way as the above. */ |
268 static void | 268 static void |
269 print_buffer (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) | 269 print_buffer (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) |
270 { | 270 { |
271 struct buffer *b = XBUFFER (obj); | 271 struct buffer *b = XBUFFER (obj); |
272 | 272 |
273 if (print_readably) | 273 if (print_readably) |
274 { | 274 { |
275 if (!BUFFER_LIVE_P (b)) | 275 if (!BUFFER_LIVE_P (b)) |
276 error ("printing unreadable object #<killed buffer>"); | 276 error ("printing unreadable object #<killed buffer>"); |
277 else | 277 else |
278 error ("printing unreadable object #<buffer %s>", | 278 error ("printing unreadable object #<buffer %s>", |
279 XSTRING_DATA (b->name)); | 279 XSTRING_DATA (b->name)); |
280 } | 280 } |
281 else if (!BUFFER_LIVE_P (b)) | 281 else if (!BUFFER_LIVE_P (b)) |
282 write_c_string ("#<killed buffer>", printcharfun); | 282 write_c_string ("#<killed buffer>", printcharfun); |
283 else if (escapeflag) | 283 else if (escapeflag) |
289 else | 289 else |
290 { | 290 { |
291 print_internal (b->name, printcharfun, 0); | 291 print_internal (b->name, printcharfun, 0); |
292 } | 292 } |
293 } | 293 } |
294 | 294 |
295 | 295 |
296 DEFUN ("bufferp", Fbufferp, 1, 1, 0, /* | 296 DEFUN ("bufferp", Fbufferp, 1, 1, 0, /* |
297 T if OBJECT is an editor buffer. | 297 T if OBJECT is an editor buffer. |
298 */ | 298 */ |
299 (object)) | 299 (object)) |
347 { | 347 { |
348 if (!BUFFER_LIVE_P (XBUFFER (name))) | 348 if (!BUFFER_LIVE_P (XBUFFER (name))) |
349 { | 349 { |
350 if (error_if_deleted_or_does_not_exist) | 350 if (error_if_deleted_or_does_not_exist) |
351 nsberror (name); | 351 nsberror (name); |
352 return (Qnil); | 352 return Qnil; |
353 } | 353 } |
354 return name; | 354 return name; |
355 } | 355 } |
356 else | 356 else |
357 { | 357 { |
362 GCPRO1 (name); | 362 GCPRO1 (name); |
363 buf = Fcdr (Fassoc (name, Vbuffer_alist)); | 363 buf = Fcdr (Fassoc (name, Vbuffer_alist)); |
364 UNGCPRO; | 364 UNGCPRO; |
365 if (NILP (buf) && error_if_deleted_or_does_not_exist) | 365 if (NILP (buf) && error_if_deleted_or_does_not_exist) |
366 nsberror (name); | 366 nsberror (name); |
367 return (buf); | 367 return buf; |
368 } | 368 } |
369 } | 369 } |
370 | 370 |
371 struct buffer * | 371 struct buffer * |
372 decode_buffer (Lisp_Object buffer, int allow_string) | 372 decode_buffer (Lisp_Object buffer, int allow_string) |
373 { | 373 { |
374 if (NILP (buffer)) | 374 if (NILP (buffer)) |
375 { | 375 return current_buffer; |
376 return current_buffer; | 376 |
377 } | 377 if (allow_string && STRINGP (buffer)) |
378 else if (STRINGP (buffer)) | 378 return XBUFFER (get_buffer (buffer, 1)); |
379 { | |
380 if (allow_string) | |
381 return XBUFFER (get_buffer (buffer, 1)); | |
382 else | |
383 CHECK_BUFFER (buffer); /* This will cause a wrong-type error. */ | |
384 } | |
385 | 379 |
386 CHECK_LIVE_BUFFER (buffer); | 380 CHECK_LIVE_BUFFER (buffer); |
387 return XBUFFER (buffer); | 381 return XBUFFER (buffer); |
388 } | 382 } |
389 | 383 |
419 return elt; | 413 return elt; |
420 } | 414 } |
421 return Qnil; | 415 return Qnil; |
422 } | 416 } |
423 | 417 |
424 #endif | 418 #endif /* FSFmacs */ |
425 | 419 |
426 DEFUN ("get-buffer", Fget_buffer, 1, 1, 0, /* | 420 DEFUN ("get-buffer", Fget_buffer, 1, 1, 0, /* |
427 Return the buffer named NAME (a string). | 421 Return the buffer named NAME (a string). |
428 If there is no live buffer named NAME, return nil. | 422 If there is no live buffer named NAME, return nil. |
429 NAME may also be a buffer; if so, the value is that buffer. | 423 NAME may also be a buffer; if so, the value is that buffer. |
437 | 431 |
438 /* #### This might return a dead buffer. This is gross. This is | 432 /* #### This might return a dead buffer. This is gross. This is |
439 called FSF compatibility. */ | 433 called FSF compatibility. */ |
440 if (BUFFERP (name)) | 434 if (BUFFERP (name)) |
441 return name; | 435 return name; |
442 return (get_buffer (name, 0)); | 436 return get_buffer (name, 0); |
443 /* FSFmacs 19.29 calls assoc_ignore_text_properties() here. | 437 /* FSFmacs 19.29 calls assoc_ignore_text_properties() here. |
444 Bleagh!! */ | 438 Bleagh!! */ |
445 } | 439 } |
446 | 440 |
447 | 441 |
748 translated. */ | 742 translated. */ |
749 #endif | 743 #endif |
750 | 744 |
751 tem = Fget_buffer (name); | 745 tem = Fget_buffer (name); |
752 if (NILP (tem)) | 746 if (NILP (tem)) |
753 return (name); | 747 return name; |
754 | 748 |
755 count = 1; | 749 count = 1; |
756 while (1) | 750 while (1) |
757 { | 751 { |
758 sprintf (number, "<%d>", ++count); | 752 sprintf (number, "<%d>", ++count); |
763 if (!NILP (tem)) | 757 if (!NILP (tem)) |
764 return gentemp; | 758 return gentemp; |
765 } | 759 } |
766 tem = Fget_buffer (gentemp); | 760 tem = Fget_buffer (gentemp); |
767 if (NILP (tem)) | 761 if (NILP (tem)) |
768 return (gentemp); | 762 return gentemp; |
769 } | 763 } |
770 } | 764 } |
771 | 765 |
772 | 766 |
773 DEFUN ("buffer-name", Fbuffer_name, 0, 1, 0, /* | 767 DEFUN ("buffer-name", Fbuffer_name, 0, 1, 0, /* |
906 result = Fcons (Fcons (syms->slot, buf->slot), result); \ | 900 result = Fcons (Fcons (syms->slot, buf->slot), result); \ |
907 } | 901 } |
908 #include "bufslots.h" | 902 #include "bufslots.h" |
909 #undef MARKED_SLOT | 903 #undef MARKED_SLOT |
910 } | 904 } |
911 return (result); | 905 return result; |
912 } | 906 } |
913 | 907 |
914 DEFUN ("buffer-dedicated-frame", Fbuffer_dedicated_frame, 0, 1, 0, /* | 908 DEFUN ("buffer-dedicated-frame", Fbuffer_dedicated_frame, 0, 1, 0, /* |
915 Return the frame dedicated to this BUFFER, or nil if there is none. | 909 Return the frame dedicated to this BUFFER, or nil if there is none. |
916 No argument or nil as argument means use current buffer as BUFFER. | 910 No argument or nil as argument means use current buffer as BUFFER. |
921 | 915 |
922 /* XEmacs addition: if the frame is dead, silently make it go away. */ | 916 /* XEmacs addition: if the frame is dead, silently make it go away. */ |
923 if (!NILP (buf->dedicated_frame) && | 917 if (!NILP (buf->dedicated_frame) && |
924 !FRAME_LIVE_P (XFRAME (buf->dedicated_frame))) | 918 !FRAME_LIVE_P (XFRAME (buf->dedicated_frame))) |
925 buf->dedicated_frame = Qnil; | 919 buf->dedicated_frame = Qnil; |
926 | 920 |
927 return buf->dedicated_frame; | 921 return buf->dedicated_frame; |
928 } | 922 } |
929 | 923 |
930 DEFUN ("set-buffer-dedicated-frame", Fset_buffer_dedicated_frame, 2, 2, 0, /* | 924 DEFUN ("set-buffer-dedicated-frame", Fset_buffer_dedicated_frame, 2, 2, 0, /* |
931 For this BUFFER, set the FRAME dedicated to it. | 925 For this BUFFER, set the FRAME dedicated to it. |
963 { | 957 { |
964 /* This function can GC */ | 958 /* This function can GC */ |
965 struct buffer *buf = decode_buffer (buffer, 0); | 959 struct buffer *buf = decode_buffer (buffer, 0); |
966 | 960 |
967 #ifdef ENERGIZE | 961 #ifdef ENERGIZE |
968 Lisp_Object starting_flag = | 962 Lisp_Object starting_flag = |
969 (BUF_SAVE_MODIFF (buf) < BUF_MODIFF (buf)) ? Qt : Qnil; | 963 (BUF_SAVE_MODIFF (buf) < BUF_MODIFF (buf)) ? Qt : Qnil; |
970 Lisp_Object argument_flag = (NILP (flag)) ? Qnil : Qt; | 964 Lisp_Object argument_flag = (NILP (flag)) ? Qnil : Qt; |
971 #endif | 965 #endif |
972 | 966 |
973 #ifdef CLASH_DETECTION | 967 #ifdef CLASH_DETECTION |
974 /* If buffer becoming modified, lock the file. | 968 /* If buffer becoming modified, lock the file. |
975 If buffer becoming unmodified, unlock the file. */ | 969 If buffer becoming unmodified, unlock the file. */ |
976 | 970 |
1031 No argument or nil as argument means use current buffer as BUFFER. | 1025 No argument or nil as argument means use current buffer as BUFFER. |
1032 */ | 1026 */ |
1033 (buffer)) | 1027 (buffer)) |
1034 { | 1028 { |
1035 struct buffer *buf = decode_buffer (buffer, 0); | 1029 struct buffer *buf = decode_buffer (buffer, 0); |
1036 | 1030 |
1037 return make_int (BUF_MODIFF (buf)); | 1031 return make_int (BUF_MODIFF (buf)); |
1038 } | 1032 } |
1039 | 1033 |
1040 DEFUN ("rename-buffer", Frename_buffer, 1, 2, | 1034 DEFUN ("rename-buffer", Frename_buffer, 1, 2, |
1041 "sRename buffer (to new name): \nP", /* | 1035 "sRename buffer (to new name): \nP", /* |
1140 continue; | 1134 continue; |
1141 /* If FRAME has a buffer_predicate, | 1135 /* If FRAME has a buffer_predicate, |
1142 disregard buffers that don't fit the predicate. */ | 1136 disregard buffers that don't fit the predicate. */ |
1143 if (FRAMEP (frame)) | 1137 if (FRAMEP (frame)) |
1144 { | 1138 { |
1145 tem = XFRAME (frame)->buffer_predicate; | 1139 tem = XFRAME (frame)->buffer_predicate; |
1146 if (!NILP (tem)) | 1140 if (!NILP (tem)) |
1147 { | 1141 { |
1148 tem = call1 (tem, buf); | 1142 tem = call1 (tem, buf); |
1149 if (NILP (tem)) | 1143 if (NILP (tem)) |
1150 continue; | 1144 continue; |
1296 kill-buffer-hook, but the user might mess that up. | 1290 kill-buffer-hook, but the user might mess that up. |
1297 */ | 1291 */ |
1298 if (EQ (Vwindow_system, Qx)) | 1292 if (EQ (Vwindow_system, Qx)) |
1299 call0 (intern ("xselect-kill-buffer-hook")); | 1293 call0 (intern ("xselect-kill-buffer-hook")); |
1300 /* #### generalize me! */ | 1294 /* #### generalize me! */ |
1301 #endif | 1295 #endif /* HAVE_X_WINDOWS */ |
1302 unbind_to (speccount, Qnil); | 1296 unbind_to (speccount, Qnil); |
1303 UNGCPRO; | 1297 UNGCPRO; |
1304 b = XBUFFER (buf); /* Hypothetical relocating GC. */ | 1298 b = XBUFFER (buf); /* Hypothetical relocating GC. */ |
1305 } | 1299 } |
1306 | 1300 |
1328 LIST_LOOP (rest, b->indirect_children) | 1322 LIST_LOOP (rest, b->indirect_children) |
1329 Fkill_buffer (XCAR (rest)); | 1323 Fkill_buffer (XCAR (rest)); |
1330 | 1324 |
1331 UNGCPRO; | 1325 UNGCPRO; |
1332 } | 1326 } |
1333 | 1327 |
1334 /* Make this buffer not be current. | 1328 /* Make this buffer not be current. |
1335 In the process, notice if this is the sole visible buffer | 1329 In the process, notice if this is the sole visible buffer |
1336 and give up if so. */ | 1330 and give up if so. */ |
1337 if (b == current_buffer) | 1331 if (b == current_buffer) |
1338 { | 1332 { |
1391 macro or something for it. */ | 1385 macro or something for it. */ |
1392 GCPRO1 (buf); | 1386 GCPRO1 (buf); |
1393 internal_delete_file (b->auto_save_file_name); | 1387 internal_delete_file (b->auto_save_file_name); |
1394 UNGCPRO; | 1388 UNGCPRO; |
1395 b = XBUFFER (buf); | 1389 b = XBUFFER (buf); |
1396 | 1390 |
1397 if (!BUFFER_LIVE_P (b)) | 1391 if (!BUFFER_LIVE_P (b)) |
1398 return Qnil; | 1392 return Qnil; |
1399 | 1393 |
1400 if (b == current_buffer) | 1394 if (b == current_buffer) |
1401 { | 1395 { |
1550 if (!noninteractive && initialized) | 1544 if (!noninteractive && initialized) |
1551 { | 1545 { |
1552 extern Lisp_Object Ffep_force_on (), Ffep_force_off (), Ffep_get_mode (); | 1546 extern Lisp_Object Ffep_force_on (), Ffep_force_off (), Ffep_get_mode (); |
1553 | 1547 |
1554 old_buf->fep_mode = Ffep_get_mode (); | 1548 old_buf->fep_mode = Ffep_get_mode (); |
1555 | 1549 |
1556 if (!NILP (current_buffer->fep_mode)) | 1550 if (!NILP (current_buffer->fep_mode)) |
1557 Ffep_force_on (); | 1551 Ffep_force_on (); |
1558 else | 1552 else |
1559 Ffep_force_off (); | 1553 Ffep_force_off (); |
1560 } | 1554 } |
1561 #endif | 1555 #endif /* HAVE_FEP */ |
1562 | 1556 |
1563 if (old_buf) | 1557 if (old_buf) |
1564 { | 1558 { |
1565 /* Put the undo list back in the base buffer, so that it appears | 1559 /* Put the undo list back in the base buffer, so that it appears |
1566 that an indirect buffer shares the undo list of its base. */ | 1560 that an indirect buffer shares the undo list of its base. */ |
1660 end = start; | 1654 end = start; |
1661 get_buffer_range_char (b, start, end, &s, &e, 0); | 1655 get_buffer_range_char (b, start, end, &s, &e, 0); |
1662 } | 1656 } |
1663 barf_if_buffer_read_only (b, s, e); | 1657 barf_if_buffer_read_only (b, s, e); |
1664 | 1658 |
1665 return (Qnil); | 1659 return Qnil; |
1666 } | 1660 } |
1667 | 1661 |
1668 static void | 1662 static void |
1669 bury_buffer_1 (Lisp_Object buffer, Lisp_Object before, | 1663 bury_buffer_1 (Lisp_Object buffer, Lisp_Object before, |
1670 Lisp_Object *buffer_alist) | 1664 Lisp_Object *buffer_alist) |
2052 #if 0 /* FSFmacs */ | 2046 #if 0 /* FSFmacs */ |
2053 xxDEFVAR_LISP ("transient-mark-mode", &Vtransient_mark_mode /* | 2047 xxDEFVAR_LISP ("transient-mark-mode", &Vtransient_mark_mode /* |
2054 *Non-nil means deactivate the mark when the buffer contents change. | 2048 *Non-nil means deactivate the mark when the buffer contents change. |
2055 */ ); | 2049 */ ); |
2056 Vtransient_mark_mode = Qnil; | 2050 Vtransient_mark_mode = Qnil; |
2057 #endif | 2051 #endif /* FSFmacs */ |
2058 | 2052 |
2059 DEFVAR_INT ("undo-threshold", &undo_threshold /* | 2053 DEFVAR_INT ("undo-threshold", &undo_threshold /* |
2060 Keep no more undo information once it exceeds this size. | 2054 Keep no more undo information once it exceeds this size. |
2061 This threshold is applied when garbage collection happens. | 2055 This threshold is applied when garbage collection happens. |
2062 The size is counted as the number of bytes occupied, | 2056 The size is counted as the number of bytes occupied, |
2091 *Non-nil means delete auto-save file when a buffer is saved or killed. | 2085 *Non-nil means delete auto-save file when a buffer is saved or killed. |
2092 */ ); | 2086 */ ); |
2093 delete_auto_save_files = 1; | 2087 delete_auto_save_files = 1; |
2094 } | 2088 } |
2095 | 2089 |
2096 /* DOC is ignored because it is snagged and recorded externally | 2090 /* DOC is ignored because it is snagged and recorded externally |
2097 * by make-docfile */ | 2091 * by make-docfile */ |
2098 /* Renamed from DEFVAR_PER_BUFFER because FSFmacs D_P_B takes | 2092 /* Renamed from DEFVAR_PER_BUFFER because FSFmacs D_P_B takes |
2099 * a bogus extra arg, which confuses an otherwise identical make-docfile.c */ | 2093 * a bogus extra arg, which confuses an otherwise identical make-docfile.c */ |
2100 /* Declaring this stuff as const produces 'Cannot reinitialize' messages | 2094 /* Declaring this stuff as const produces 'Cannot reinitialize' messages |
2101 from SunPro C's fix-and-continue feature (a way neato feature that | 2095 from SunPro C's fix-and-continue feature (a way neato feature that |
2131 SYMVAL_CONST_CURRENT_BUFFER_FORWARD }, magicfun }; \ | 2125 SYMVAL_CONST_CURRENT_BUFFER_FORWARD }, magicfun }; \ |
2132 defvar_buffer_local ((lname), &I_hate_C); \ | 2126 defvar_buffer_local ((lname), &I_hate_C); \ |
2133 } while (0) | 2127 } while (0) |
2134 | 2128 |
2135 static void | 2129 static void |
2136 defvar_buffer_local (CONST char *namestring, | 2130 defvar_buffer_local (CONST char *namestring, |
2137 CONST struct symbol_value_forward *m) | 2131 CONST struct symbol_value_forward *m) |
2138 { | 2132 { |
2139 int offset = ((char *)symbol_value_forward_forward (m) | 2133 int offset = ((char *)symbol_value_forward_forward (m) |
2140 - (char *)&buffer_local_flags); | 2134 - (char *)&buffer_local_flags); |
2141 | 2135 |
2142 defvar_mumble (namestring, m, sizeof (*m)); | 2136 defvar_mumble (namestring, m, sizeof (*m)); |
2143 | 2137 |
2144 *((Lisp_Object *)(offset + (char *)XBUFFER (Vbuffer_local_symbols))) | 2138 *((Lisp_Object *)(offset + (char *)XBUFFER (Vbuffer_local_symbols))) |
2145 = intern (namestring); | 2139 = intern (namestring); |
2146 } | 2140 } |
2147 | 2141 |
2148 /* DOC is ignored because it is snagged and recorded externally | 2142 /* DOC is ignored because it is snagged and recorded externally |
2149 * by make-docfile */ | 2143 * by make-docfile */ |
2150 #define DEFVAR_BUFFER_DEFAULTS(lname, field_name) \ | 2144 #define DEFVAR_BUFFER_DEFAULTS(lname, field_name) \ |
2151 do { static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ | 2145 do { static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ |
2152 = { { { { lrecord_symbol_value_forward }, \ | 2146 = { { { { lrecord_symbol_value_forward }, \ |
2153 (void *) &(buffer_local_flags.field_name), 69 }, \ | 2147 (void *) &(buffer_local_flags.field_name), 69 }, \ |
2186 | 2180 |
2187 staticpro (&Vbuffer_defaults); | 2181 staticpro (&Vbuffer_defaults); |
2188 staticpro (&Vbuffer_local_symbols); | 2182 staticpro (&Vbuffer_local_symbols); |
2189 XSETBUFFER (Vbuffer_defaults, defs); | 2183 XSETBUFFER (Vbuffer_defaults, defs); |
2190 XSETBUFFER (Vbuffer_local_symbols, syms); | 2184 XSETBUFFER (Vbuffer_local_symbols, syms); |
2191 | 2185 |
2192 nuke_all_buffer_slots (syms, Qnil); | 2186 nuke_all_buffer_slots (syms, Qnil); |
2193 nuke_all_buffer_slots (defs, Qnil); | 2187 nuke_all_buffer_slots (defs, Qnil); |
2194 defs->text = &defs->own_text; | 2188 defs->text = &defs->own_text; |
2195 syms->text = &syms->own_text; | 2189 syms->text = &syms->own_text; |
2196 | 2190 |
2197 /* Set up the non-nil default values of various buffer slots. | 2191 /* Set up the non-nil default values of various buffer slots. |
2198 Must do these before making the first buffer. | 2192 Must do these before making the first buffer. |
2199 */ | 2193 */ |
2200 defs->major_mode = Qfundamental_mode; | 2194 defs->major_mode = Qfundamental_mode; |
2201 defs->mode_name = QSFundamental; | 2195 defs->mode_name = QSFundamental; |
2207 #ifdef MULE | 2201 #ifdef MULE |
2208 defs->mirror_downcase_table = Vmirror_ascii_downcase_table; | 2202 defs->mirror_downcase_table = Vmirror_ascii_downcase_table; |
2209 defs->mirror_upcase_table = Vmirror_ascii_upcase_table; | 2203 defs->mirror_upcase_table = Vmirror_ascii_upcase_table; |
2210 defs->mirror_case_canon_table = Vmirror_ascii_canon_table; | 2204 defs->mirror_case_canon_table = Vmirror_ascii_canon_table; |
2211 defs->mirror_case_eqv_table = Vmirror_ascii_eqv_table; | 2205 defs->mirror_case_eqv_table = Vmirror_ascii_eqv_table; |
2212 #endif | 2206 #endif /* MULE */ |
2213 defs->syntax_table = Vstandard_syntax_table; | 2207 defs->syntax_table = Vstandard_syntax_table; |
2214 defs->mirror_syntax_table = | 2208 defs->mirror_syntax_table = |
2215 XCHAR_TABLE (Vstandard_syntax_table)->mirror_table; | 2209 XCHAR_TABLE (Vstandard_syntax_table)->mirror_table; |
2216 #ifdef MULE | 2210 #ifdef MULE |
2217 defs->category_table = Vstandard_category_table; | 2211 defs->category_table = Vstandard_category_table; |
2226 defs->save_length = Qzero; /* lisp code wants int-or-nil */ | 2220 defs->save_length = Qzero; /* lisp code wants int-or-nil */ |
2227 defs->modtime = 0; | 2221 defs->modtime = 0; |
2228 defs->auto_save_modified = 0; | 2222 defs->auto_save_modified = 0; |
2229 defs->auto_save_failure_time = -1; | 2223 defs->auto_save_failure_time = -1; |
2230 defs->invisibility_spec = Qt; | 2224 defs->invisibility_spec = Qt; |
2231 | 2225 |
2232 { | 2226 { |
2233 /* 0 means var is always local. Default used only at creation. | 2227 /* 0 means var is always local. Default used only at creation. |
2234 * -1 means var is always local. Default used only at reset and | 2228 * -1 means var is always local. Default used only at reset and |
2235 * creation. | 2229 * creation. |
2236 * -2 means there's no lisp variable corresponding to this slot | 2230 * -2 means there's no lisp variable corresponding to this slot |
2240 * Otherwise default is used. | 2234 * Otherwise default is used. |
2241 */ | 2235 */ |
2242 Lisp_Object always_local_no_default = make_int (0); | 2236 Lisp_Object always_local_no_default = make_int (0); |
2243 Lisp_Object always_local_resettable = make_int (-1); | 2237 Lisp_Object always_local_resettable = make_int (-1); |
2244 Lisp_Object resettable = make_int (-3); | 2238 Lisp_Object resettable = make_int (-3); |
2245 | 2239 |
2246 /* Assign the local-flags to the slots that have default values. | 2240 /* Assign the local-flags to the slots that have default values. |
2247 The local flag is a bit that is used in the buffer | 2241 The local flag is a bit that is used in the buffer |
2248 to say that it has its own local value for the slot. | 2242 to say that it has its own local value for the slot. |
2249 The local flag bits are in the local_var_flags slot of the | 2243 The local flag bits are in the local_var_flags slot of the |
2250 buffer. */ | 2244 buffer. */ |
2251 | 2245 |
2252 nuke_all_buffer_slots (&buffer_local_flags, make_int (-2)); | 2246 nuke_all_buffer_slots (&buffer_local_flags, make_int (-2)); |
2253 buffer_local_flags.filename = always_local_no_default; | 2247 buffer_local_flags.filename = always_local_no_default; |
2254 buffer_local_flags.directory = always_local_no_default; | 2248 buffer_local_flags.directory = always_local_no_default; |
2255 buffer_local_flags.backed_up = always_local_no_default; | 2249 buffer_local_flags.backed_up = always_local_no_default; |
2256 buffer_local_flags.save_length = always_local_no_default; | 2250 buffer_local_flags.save_length = always_local_no_default; |
2257 buffer_local_flags.auto_save_file_name = always_local_no_default; | 2251 buffer_local_flags.auto_save_file_name = always_local_no_default; |
2258 buffer_local_flags.read_only = always_local_no_default; | 2252 buffer_local_flags.read_only = always_local_no_default; |
2259 | 2253 |
2260 buffer_local_flags.major_mode = always_local_resettable; | 2254 buffer_local_flags.major_mode = always_local_resettable; |
2261 buffer_local_flags.mode_name = always_local_resettable; | 2255 buffer_local_flags.mode_name = always_local_resettable; |
2262 buffer_local_flags.undo_list = always_local_no_default; | 2256 buffer_local_flags.undo_list = always_local_no_default; |
2263 #if 0 /* FSFmacs */ | 2257 #if 0 /* FSFmacs */ |
2264 buffer_local_flags.mark_active = always_local_resettable; | 2258 buffer_local_flags.mark_active = always_local_resettable; |
2266 buffer_local_flags.point_before_scroll = always_local_resettable; | 2260 buffer_local_flags.point_before_scroll = always_local_resettable; |
2267 buffer_local_flags.file_truename = always_local_no_default; | 2261 buffer_local_flags.file_truename = always_local_no_default; |
2268 buffer_local_flags.invisibility_spec = always_local_resettable; | 2262 buffer_local_flags.invisibility_spec = always_local_resettable; |
2269 buffer_local_flags.file_format = always_local_resettable; | 2263 buffer_local_flags.file_format = always_local_resettable; |
2270 buffer_local_flags.generated_modeline_string = always_local_no_default; | 2264 buffer_local_flags.generated_modeline_string = always_local_no_default; |
2271 | 2265 |
2272 buffer_local_flags.keymap = resettable; | 2266 buffer_local_flags.keymap = resettable; |
2273 buffer_local_flags.downcase_table = resettable; | 2267 buffer_local_flags.downcase_table = resettable; |
2274 buffer_local_flags.upcase_table = resettable; | 2268 buffer_local_flags.upcase_table = resettable; |
2275 buffer_local_flags.case_canon_table = resettable; | 2269 buffer_local_flags.case_canon_table = resettable; |
2276 buffer_local_flags.case_eqv_table = resettable; | 2270 buffer_local_flags.case_eqv_table = resettable; |
2277 buffer_local_flags.syntax_table = resettable; | 2271 buffer_local_flags.syntax_table = resettable; |
2278 #ifdef MULE | 2272 #ifdef MULE |
2279 buffer_local_flags.category_table = resettable; | 2273 buffer_local_flags.category_table = resettable; |
2280 #endif | 2274 #endif |
2281 | 2275 |
2282 buffer_local_flags.modeline_format = make_int (1); | 2276 buffer_local_flags.modeline_format = make_int (1); |
2283 buffer_local_flags.abbrev_mode = make_int (2); | 2277 buffer_local_flags.abbrev_mode = make_int (2); |
2284 buffer_local_flags.overwrite_mode = make_int (4); | 2278 buffer_local_flags.overwrite_mode = make_int (4); |
2285 buffer_local_flags.case_fold_search = make_int (8); | 2279 buffer_local_flags.case_fold_search = make_int (8); |
2286 buffer_local_flags.auto_fill_function = make_int (0x10); | 2280 buffer_local_flags.auto_fill_function = make_int (0x10); |
2297 #endif | 2291 #endif |
2298 buffer_local_flags.buffer_file_type = make_int (0x4000); | 2292 buffer_local_flags.buffer_file_type = make_int (0x4000); |
2299 #ifdef MULE | 2293 #ifdef MULE |
2300 buffer_local_flags.buffer_file_coding_system = make_int (0x8000); | 2294 buffer_local_flags.buffer_file_coding_system = make_int (0x8000); |
2301 #endif | 2295 #endif |
2302 | 2296 |
2303 /* #### Warning, 0x4000000 (that's six zeroes) is the largest number | 2297 /* #### Warning, 0x4000000 (that's six zeroes) is the largest number |
2304 currently allowable due to the XINT() handling of this value. | 2298 currently allowable due to the XINT() handling of this value. |
2305 With some rearrangement you can get 4 more bits. */ | 2299 With some rearrangement you can get 4 more bits. */ |
2306 } | 2300 } |
2307 | 2301 |
2477 #if 0 /* #### Make this a specifier! */ | 2471 #if 0 /* #### Make this a specifier! */ |
2478 xxDEFVAR_BUFFER_LOCAL ("display-direction", display_direction /* | 2472 xxDEFVAR_BUFFER_LOCAL ("display-direction", display_direction /* |
2479 *Non-nil means lines in the buffer are displayed right to left. | 2473 *Non-nil means lines in the buffer are displayed right to left. |
2480 Nil means left to right. (Not yet implemented.) | 2474 Nil means left to right. (Not yet implemented.) |
2481 */ ); | 2475 */ ); |
2482 #endif | 2476 #endif /* Not yet implemented */ |
2483 | 2477 |
2484 DEFVAR_BUFFER_LOCAL_MAGIC ("truncate-lines", truncate_lines /* | 2478 DEFVAR_BUFFER_LOCAL_MAGIC ("truncate-lines", truncate_lines /* |
2485 *Non-nil means do not display continuation lines; | 2479 *Non-nil means do not display continuation lines; |
2486 give each line of text one frame line. | 2480 give each line of text one frame line. |
2487 Automatically becomes buffer-local when set in any fashion. | 2481 Automatically becomes buffer-local when set in any fashion. |
2577 Each buffer has its own value of this variable. | 2571 Each buffer has its own value of this variable. |
2578 */ | 2572 */ |
2579 #endif /* FSFmacs */ | 2573 #endif /* FSFmacs */ |
2580 | 2574 |
2581 DEFVAR_BUFFER_LOCAL ("buffer-file-truename", file_truename /* | 2575 DEFVAR_BUFFER_LOCAL ("buffer-file-truename", file_truename /* |
2582 The real name of the file visited in the current buffer, | 2576 The real name of the file visited in the current buffer, |
2583 or nil if not visiting a file. This is the result of passing | 2577 or nil if not visiting a file. This is the result of passing |
2584 buffer-file-name to the `file-truename' function. Every buffer has | 2578 buffer-file-name to the `file-truename' function. Every buffer has |
2585 its own value of this variable. This variable is automatically | 2579 its own value of this variable. This variable is automatically |
2586 maintained by the functions that change the file name associated | 2580 maintained by the functions that change the file name associated |
2587 with a buffer. | 2581 with a buffer. |
2588 */ ); | 2582 */ ); |
2589 | 2583 |
2590 DEFVAR_BUFFER_LOCAL ("buffer-auto-save-file-name", auto_save_file_name /* | 2584 DEFVAR_BUFFER_LOCAL ("buffer-auto-save-file-name", auto_save_file_name /* |
2591 Name of file for auto-saving current buffer, | 2585 Name of file for auto-saving current buffer, |
2648 | 2642 |
2649 An entry (nil PROPERTY VALUE BEG . END) indicates that a text property | 2643 An entry (nil PROPERTY VALUE BEG . END) indicates that a text property |
2650 was modified between BEG and END. PROPERTY is the property name, | 2644 was modified between BEG and END. PROPERTY is the property name, |
2651 and VALUE is the old value. | 2645 and VALUE is the old value. |
2652 */ | 2646 */ |
2653 #endif | 2647 #endif /* FSFmacs */ |
2654 | 2648 |
2655 DEFVAR_BUFFER_LOCAL ("buffer-undo-list", undo_list /* | 2649 DEFVAR_BUFFER_LOCAL ("buffer-undo-list", undo_list /* |
2656 List of undo entries in current buffer. | 2650 List of undo entries in current buffer. |
2657 Recent changes come first; older changes follow newer. | 2651 Recent changes come first; older changes follow newer. |
2658 | 2652 |
2689 #if 0 /* FSFmacs */ | 2683 #if 0 /* FSFmacs */ |
2690 xxDEFVAR_BUFFER_LOCAL ("mark-active", mark_active /* | 2684 xxDEFVAR_BUFFER_LOCAL ("mark-active", mark_active /* |
2691 Non-nil means the mark and region are currently active in this buffer. | 2685 Non-nil means the mark and region are currently active in this buffer. |
2692 Automatically local in all buffers. | 2686 Automatically local in all buffers. |
2693 */ ); | 2687 */ ); |
2694 #endif | 2688 #endif /* FSFmacs */ |
2695 | 2689 |
2696 #ifdef REGION_CACHE_NEEDS_WORK | 2690 #ifdef REGION_CACHE_NEEDS_WORK |
2697 xxDEFVAR_BUFFER_LOCAL ("cache-long-line-scans", cache_long_line_scans /* | 2691 xxDEFVAR_BUFFER_LOCAL ("cache-long-line-scans", cache_long_line_scans /* |
2698 Non-nil means that Emacs should use caches to handle long lines more quickly. | 2692 Non-nil means that Emacs should use caches to handle long lines more quickly. |
2699 This variable is buffer-local, in all buffers. | 2693 This variable is buffer-local, in all buffers. |
2802 /* Reset Vbuffer_alist again so that the above buf is magically | 2796 /* Reset Vbuffer_alist again so that the above buf is magically |
2803 invisible */ | 2797 invisible */ |
2804 Vbuffer_alist = Qnil; | 2798 Vbuffer_alist = Qnil; |
2805 /* Want no undo records for prin1_to_string_buffer */ | 2799 /* Want no undo records for prin1_to_string_buffer */ |
2806 Fbuffer_disable_undo (Vprin1_to_string_buffer); | 2800 Fbuffer_disable_undo (Vprin1_to_string_buffer); |
2807 | 2801 |
2808 { | 2802 { |
2809 Lisp_Object scratch = | 2803 Lisp_Object scratch = |
2810 Fset_buffer (Fget_buffer_create (QSscratch)); | 2804 Fset_buffer (Fget_buffer_create (QSscratch)); |
2811 /* Want no undo records for *scratch* until after Emacs is dumped */ | 2805 /* Want no undo records for *scratch* until after Emacs is dumped */ |
2812 Fbuffer_disable_undo (scratch); | 2806 Fbuffer_disable_undo (scratch); |
2852 | 2846 |
2853 #if 0 /* FSFmacs */ | 2847 #if 0 /* FSFmacs */ |
2854 /* #### is this correct? */ | 2848 /* #### is this correct? */ |
2855 temp = get_minibuffer (0); | 2849 temp = get_minibuffer (0); |
2856 XBUFFER (temp)->directory = current_buffer->directory; | 2850 XBUFFER (temp)->directory = current_buffer->directory; |
2857 #endif | 2851 #endif /* FSFmacs */ |
2858 } | 2852 } |