comparison src/buffer.c @ 112359:011b1eb5c384

Change buffer_defaults to new new macro; preparation for thread patch * lisp.h (DEFVAR_BUFFER_DEFAULTS): New macro. * buffer.c (syms_of_buffer): Use DEFVAR_BUFFER_DEFAULTS.
author Tom Tromey <tromey@redhat.com>
date Tue, 18 Jan 2011 10:00:04 -0700
parents 56d3e9c28eb0
children 42e22c4f06b7
comparison
equal deleted inserted replaced
112358:49f47421e4c1 112359:011b1eb5c384
5360 make_pure_c_string ("Attempt to modify a protected field")); 5360 make_pure_c_string ("Attempt to modify a protected field"));
5361 5361
5362 /* All these use DEFVAR_LISP_NOPRO because the slots in 5362 /* All these use DEFVAR_LISP_NOPRO because the slots in
5363 buffer_defaults will all be marked via Vbuffer_defaults. */ 5363 buffer_defaults will all be marked via Vbuffer_defaults. */
5364 5364
5365 DEFVAR_LISP_NOPRO ("default-mode-line-format", 5365 DEFVAR_BUFFER_DEFAULTS ("default-mode-line-format",
5366 &buffer_defaults.mode_line_format, 5366 mode_line_format,
5367 doc: /* Default value of `mode-line-format' for buffers that don't override it. 5367 doc: /* Default value of `mode-line-format' for buffers that don't override it.
5368 This is the same as (default-value 'mode-line-format). */); 5368 This is the same as (default-value 'mode-line-format). */);
5369 5369
5370 DEFVAR_LISP_NOPRO ("default-header-line-format", 5370 DEFVAR_BUFFER_DEFAULTS ("default-header-line-format",
5371 &buffer_defaults.header_line_format, 5371 header_line_format,
5372 doc: /* Default value of `header-line-format' for buffers that don't override it. 5372 doc: /* Default value of `header-line-format' for buffers that don't override it.
5373 This is the same as (default-value 'header-line-format). */); 5373 This is the same as (default-value 'header-line-format). */);
5374 5374
5375 DEFVAR_LISP_NOPRO ("default-cursor-type", &buffer_defaults.cursor_type, 5375 DEFVAR_BUFFER_DEFAULTS ("default-cursor-type", cursor_type,
5376 doc: /* Default value of `cursor-type' for buffers that don't override it. 5376 doc: /* Default value of `cursor-type' for buffers that don't override it.
5377 This is the same as (default-value 'cursor-type). */); 5377 This is the same as (default-value 'cursor-type). */);
5378 5378
5379 DEFVAR_LISP_NOPRO ("default-line-spacing", 5379 DEFVAR_BUFFER_DEFAULTS ("default-line-spacing",
5380 &buffer_defaults.extra_line_spacing, 5380 extra_line_spacing,
5381 doc: /* Default value of `line-spacing' for buffers that don't override it. 5381 doc: /* Default value of `line-spacing' for buffers that don't override it.
5382 This is the same as (default-value 'line-spacing). */); 5382 This is the same as (default-value 'line-spacing). */);
5383 5383
5384 DEFVAR_LISP_NOPRO ("default-cursor-in-non-selected-windows", 5384 DEFVAR_BUFFER_DEFAULTS ("default-cursor-in-non-selected-windows",
5385 &buffer_defaults.cursor_in_non_selected_windows, 5385 cursor_in_non_selected_windows,
5386 doc: /* Default value of `cursor-in-non-selected-windows'. 5386 doc: /* Default value of `cursor-in-non-selected-windows'.
5387 This is the same as (default-value 'cursor-in-non-selected-windows). */); 5387 This is the same as (default-value 'cursor-in-non-selected-windows). */);
5388 5388
5389 DEFVAR_LISP_NOPRO ("default-abbrev-mode", 5389 DEFVAR_BUFFER_DEFAULTS ("default-abbrev-mode",
5390 &buffer_defaults.abbrev_mode, 5390 abbrev_mode,
5391 doc: /* Default value of `abbrev-mode' for buffers that do not override it. 5391 doc: /* Default value of `abbrev-mode' for buffers that do not override it.
5392 This is the same as (default-value 'abbrev-mode). */); 5392 This is the same as (default-value 'abbrev-mode). */);
5393 5393
5394 DEFVAR_LISP_NOPRO ("default-ctl-arrow", 5394 DEFVAR_BUFFER_DEFAULTS ("default-ctl-arrow",
5395 &buffer_defaults.ctl_arrow, 5395 ctl_arrow,
5396 doc: /* Default value of `ctl-arrow' for buffers that do not override it. 5396 doc: /* Default value of `ctl-arrow' for buffers that do not override it.
5397 This is the same as (default-value 'ctl-arrow). */); 5397 This is the same as (default-value 'ctl-arrow). */);
5398 5398
5399 DEFVAR_LISP_NOPRO ("default-enable-multibyte-characters", 5399 DEFVAR_BUFFER_DEFAULTS ("default-enable-multibyte-characters",
5400 &buffer_defaults.enable_multibyte_characters, 5400 enable_multibyte_characters,
5401 doc: /* *Default value of `enable-multibyte-characters' for buffers not overriding it. 5401 doc: /* *Default value of `enable-multibyte-characters' for buffers not overriding it.
5402 This is the same as (default-value 'enable-multibyte-characters). */); 5402 This is the same as (default-value 'enable-multibyte-characters). */);
5403 5403
5404 DEFVAR_LISP_NOPRO ("default-buffer-file-coding-system", 5404 DEFVAR_BUFFER_DEFAULTS ("default-buffer-file-coding-system",
5405 &buffer_defaults.buffer_file_coding_system, 5405 buffer_file_coding_system,
5406 doc: /* Default value of `buffer-file-coding-system' for buffers not overriding it. 5406 doc: /* Default value of `buffer-file-coding-system' for buffers not overriding it.
5407 This is the same as (default-value 'buffer-file-coding-system). */); 5407 This is the same as (default-value 'buffer-file-coding-system). */);
5408 5408
5409 DEFVAR_LISP_NOPRO ("default-truncate-lines", 5409 DEFVAR_BUFFER_DEFAULTS ("default-truncate-lines",
5410 &buffer_defaults.truncate_lines, 5410 truncate_lines,
5411 doc: /* Default value of `truncate-lines' for buffers that do not override it. 5411 doc: /* Default value of `truncate-lines' for buffers that do not override it.
5412 This is the same as (default-value 'truncate-lines). */); 5412 This is the same as (default-value 'truncate-lines). */);
5413 5413
5414 DEFVAR_LISP_NOPRO ("default-fill-column", 5414 DEFVAR_BUFFER_DEFAULTS ("default-fill-column",
5415 &buffer_defaults.fill_column, 5415 fill_column,
5416 doc: /* Default value of `fill-column' for buffers that do not override it. 5416 doc: /* Default value of `fill-column' for buffers that do not override it.
5417 This is the same as (default-value 'fill-column). */); 5417 This is the same as (default-value 'fill-column). */);
5418 5418
5419 DEFVAR_LISP_NOPRO ("default-left-margin", 5419 DEFVAR_BUFFER_DEFAULTS ("default-left-margin",
5420 &buffer_defaults.left_margin, 5420 left_margin,
5421 doc: /* Default value of `left-margin' for buffers that do not override it. 5421 doc: /* Default value of `left-margin' for buffers that do not override it.
5422 This is the same as (default-value 'left-margin). */); 5422 This is the same as (default-value 'left-margin). */);
5423 5423
5424 DEFVAR_LISP_NOPRO ("default-tab-width", 5424 DEFVAR_BUFFER_DEFAULTS ("default-tab-width",
5425 &buffer_defaults.tab_width, 5425 tab_width,
5426 doc: /* Default value of `tab-width' for buffers that do not override it. 5426 doc: /* Default value of `tab-width' for buffers that do not override it.
5427 This is the same as (default-value 'tab-width). */); 5427 This is the same as (default-value 'tab-width). */);
5428 5428
5429 DEFVAR_LISP_NOPRO ("default-case-fold-search", 5429 DEFVAR_BUFFER_DEFAULTS ("default-case-fold-search",
5430 &buffer_defaults.case_fold_search, 5430 case_fold_search,
5431 doc: /* Default value of `case-fold-search' for buffers that don't override it. 5431 doc: /* Default value of `case-fold-search' for buffers that don't override it.
5432 This is the same as (default-value 'case-fold-search). */); 5432 This is the same as (default-value 'case-fold-search). */);
5433 5433
5434 #ifdef DOS_NT 5434 #ifdef DOS_NT
5435 DEFVAR_LISP_NOPRO ("default-buffer-file-type", 5435 DEFVAR_BUFFER_DEFAULTS ("default-buffer-file-type",
5436 &buffer_defaults.buffer_file_type, 5436 buffer_file_type,
5437 doc: /* Default file type for buffers that do not override it. 5437 doc: /* Default file type for buffers that do not override it.
5438 This is the same as (default-value 'buffer-file-type). 5438 This is the same as (default-value 'buffer-file-type).
5439 The file type is nil for text, t for binary. */); 5439 The file type is nil for text, t for binary. */);
5440 #endif 5440 #endif
5441 5441
5442 DEFVAR_LISP_NOPRO ("default-left-margin-width", 5442 DEFVAR_BUFFER_DEFAULTS ("default-left-margin-width",
5443 &buffer_defaults.left_margin_cols, 5443 left_margin_cols,
5444 doc: /* Default value of `left-margin-width' for buffers that don't override it. 5444 doc: /* Default value of `left-margin-width' for buffers that don't override it.
5445 This is the same as (default-value 'left-margin-width). */); 5445 This is the same as (default-value 'left-margin-width). */);
5446 5446
5447 DEFVAR_LISP_NOPRO ("default-right-margin-width", 5447 DEFVAR_BUFFER_DEFAULTS ("default-right-margin-width",
5448 &buffer_defaults.right_margin_cols, 5448 right_margin_cols,
5449 doc: /* Default value of `right-margin-width' for buffers that don't override it. 5449 doc: /* Default value of `right-margin-width' for buffers that don't override it.
5450 This is the same as (default-value 'right-margin-width). */); 5450 This is the same as (default-value 'right-margin-width). */);
5451 5451
5452 DEFVAR_LISP_NOPRO ("default-left-fringe-width", 5452 DEFVAR_BUFFER_DEFAULTS ("default-left-fringe-width",
5453 &buffer_defaults.left_fringe_width, 5453 left_fringe_width,
5454 doc: /* Default value of `left-fringe-width' for buffers that don't override it. 5454 doc: /* Default value of `left-fringe-width' for buffers that don't override it.
5455 This is the same as (default-value 'left-fringe-width). */); 5455 This is the same as (default-value 'left-fringe-width). */);
5456 5456
5457 DEFVAR_LISP_NOPRO ("default-right-fringe-width", 5457 DEFVAR_BUFFER_DEFAULTS ("default-right-fringe-width",
5458 &buffer_defaults.right_fringe_width, 5458 right_fringe_width,
5459 doc: /* Default value of `right-fringe-width' for buffers that don't override it. 5459 doc: /* Default value of `right-fringe-width' for buffers that don't override it.
5460 This is the same as (default-value 'right-fringe-width). */); 5460 This is the same as (default-value 'right-fringe-width). */);
5461 5461
5462 DEFVAR_LISP_NOPRO ("default-fringes-outside-margins", 5462 DEFVAR_BUFFER_DEFAULTS ("default-fringes-outside-margins",
5463 &buffer_defaults.fringes_outside_margins, 5463 fringes_outside_margins,
5464 doc: /* Default value of `fringes-outside-margins' for buffers that don't override it. 5464 doc: /* Default value of `fringes-outside-margins' for buffers that don't override it.
5465 This is the same as (default-value 'fringes-outside-margins). */); 5465 This is the same as (default-value 'fringes-outside-margins). */);
5466 5466
5467 DEFVAR_LISP_NOPRO ("default-scroll-bar-width", 5467 DEFVAR_BUFFER_DEFAULTS ("default-scroll-bar-width",
5468 &buffer_defaults.scroll_bar_width, 5468 scroll_bar_width,
5469 doc: /* Default value of `scroll-bar-width' for buffers that don't override it. 5469 doc: /* Default value of `scroll-bar-width' for buffers that don't override it.
5470 This is the same as (default-value 'scroll-bar-width). */); 5470 This is the same as (default-value 'scroll-bar-width). */);
5471 5471
5472 DEFVAR_LISP_NOPRO ("default-vertical-scroll-bar", 5472 DEFVAR_BUFFER_DEFAULTS ("default-vertical-scroll-bar",
5473 &buffer_defaults.vertical_scroll_bar_type, 5473 vertical_scroll_bar_type,
5474 doc: /* Default value of `vertical-scroll-bar' for buffers that don't override it. 5474 doc: /* Default value of `vertical-scroll-bar' for buffers that don't override it.
5475 This is the same as (default-value 'vertical-scroll-bar). */); 5475 This is the same as (default-value 'vertical-scroll-bar). */);
5476 5476
5477 DEFVAR_LISP_NOPRO ("default-indicate-empty-lines", 5477 DEFVAR_BUFFER_DEFAULTS ("default-indicate-empty-lines",
5478 &buffer_defaults.indicate_empty_lines, 5478 indicate_empty_lines,
5479 doc: /* Default value of `indicate-empty-lines' for buffers that don't override it. 5479 doc: /* Default value of `indicate-empty-lines' for buffers that don't override it.
5480 This is the same as (default-value 'indicate-empty-lines). */); 5480 This is the same as (default-value 'indicate-empty-lines). */);
5481 5481
5482 DEFVAR_LISP_NOPRO ("default-indicate-buffer-boundaries", 5482 DEFVAR_BUFFER_DEFAULTS ("default-indicate-buffer-boundaries",
5483 &buffer_defaults.indicate_buffer_boundaries, 5483 indicate_buffer_boundaries,
5484 doc: /* Default value of `indicate-buffer-boundaries' for buffers that don't override it. 5484 doc: /* Default value of `indicate-buffer-boundaries' for buffers that don't override it.
5485 This is the same as (default-value 'indicate-buffer-boundaries). */); 5485 This is the same as (default-value 'indicate-buffer-boundaries). */);
5486 5486
5487 DEFVAR_LISP_NOPRO ("default-fringe-indicator-alist", 5487 DEFVAR_BUFFER_DEFAULTS ("default-fringe-indicator-alist",
5488 &buffer_defaults.fringe_indicator_alist, 5488 fringe_indicator_alist,
5489 doc: /* Default value of `fringe-indicator-alist' for buffers that don't override it. 5489 doc: /* Default value of `fringe-indicator-alist' for buffers that don't override it.
5490 This is the same as (default-value 'fringe-indicator-alist'). */); 5490 This is the same as (default-value 'fringe-indicator-alist'). */);
5491 5491
5492 DEFVAR_LISP_NOPRO ("default-fringe-cursor-alist", 5492 DEFVAR_BUFFER_DEFAULTS ("default-fringe-cursor-alist",
5493 &buffer_defaults.fringe_cursor_alist, 5493 fringe_cursor_alist,
5494 doc: /* Default value of `fringe-cursor-alist' for buffers that don't override it. 5494 doc: /* Default value of `fringe-cursor-alist' for buffers that don't override it.
5495 This is the same as (default-value 'fringe-cursor-alist'). */); 5495 This is the same as (default-value 'fringe-cursor-alist'). */);
5496 5496
5497 DEFVAR_LISP_NOPRO ("default-scroll-up-aggressively", 5497 DEFVAR_BUFFER_DEFAULTS ("default-scroll-up-aggressively",
5498 &buffer_defaults.scroll_up_aggressively, 5498 scroll_up_aggressively,
5499 doc: /* Default value of `scroll-up-aggressively'. 5499 doc: /* Default value of `scroll-up-aggressively'.
5500 This value applies in buffers that don't have their own local values. 5500 This value applies in buffers that don't have their own local values.
5501 This is the same as (default-value 'scroll-up-aggressively). */); 5501 This is the same as (default-value 'scroll-up-aggressively). */);
5502 5502
5503 DEFVAR_LISP_NOPRO ("default-scroll-down-aggressively", 5503 DEFVAR_BUFFER_DEFAULTS ("default-scroll-down-aggressively",
5504 &buffer_defaults.scroll_down_aggressively, 5504 scroll_down_aggressively,
5505 doc: /* Default value of `scroll-down-aggressively'. 5505 doc: /* Default value of `scroll-down-aggressively'.
5506 This value applies in buffers that don't have their own local values. 5506 This value applies in buffers that don't have their own local values.
5507 This is the same as (default-value 'scroll-down-aggressively). */); 5507 This is the same as (default-value 'scroll-down-aggressively). */);
5508 5508
5509 DEFVAR_PER_BUFFER ("header-line-format", 5509 DEFVAR_PER_BUFFER ("header-line-format",
5510 &current_buffer->header_line_format, 5510 &current_buffer->header_line_format,
5565 remote machine. 5565 remote machine.
5566 %[ -- print one [ for each recursive editing level. %] similar. 5566 %[ -- print one [ for each recursive editing level. %] similar.
5567 %% -- print %. %- -- print infinitely many dashes. 5567 %% -- print %. %- -- print infinitely many dashes.
5568 Decimal digits after the % specify field width to which to pad. */); 5568 Decimal digits after the % specify field width to which to pad. */);
5569 5569
5570 DEFVAR_LISP_NOPRO ("default-major-mode", &buffer_defaults.major_mode, 5570 DEFVAR_BUFFER_DEFAULTS ("default-major-mode", major_mode,
5571 doc: /* *Value of `major-mode' for new buffers. */); 5571 doc: /* *Value of `major-mode' for new buffers. */);
5572 5572
5573 DEFVAR_PER_BUFFER ("major-mode", &current_buffer->major_mode, 5573 DEFVAR_PER_BUFFER ("major-mode", &current_buffer->major_mode,
5574 make_number (Lisp_Symbol), 5574 make_number (Lisp_Symbol),
5575 doc: /* Symbol for current buffer's major mode. 5575 doc: /* Symbol for current buffer's major mode.
5576 The default value (normally `fundamental-mode') affects new buffers. 5576 The default value (normally `fundamental-mode') affects new buffers.