diff options
| author | Tom Tromey | 2011-01-18 10:00:04 -0700 |
|---|---|---|
| committer | Tom Tromey | 2011-01-18 10:00:04 -0700 |
| commit | 422745d0bc0a7031231187ecab65812234595944 (patch) | |
| tree | 15f4813ac0f69efb3212db8ebc1fb115dc72f069 /src | |
| parent | 567611822a824fb832587db623bfb6854ff156db (diff) | |
| download | emacs-422745d0bc0a7031231187ecab65812234595944.tar.gz emacs-422745d0bc0a7031231187ecab65812234595944.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/buffer.c | 170 | ||||
| -rw-r--r-- | src/lisp.h | 6 |
3 files changed, 96 insertions, 85 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6e950569fbc..d6808bb27b7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-01-18 Tom Tromey <tromey@redhat.com> | ||
| 2 | |||
| 3 | * lisp.h (DEFVAR_BUFFER_DEFAULTS): New macro. | ||
| 4 | * buffer.c (syms_of_buffer): Use DEFVAR_BUFFER_DEFAULTS. | ||
| 5 | |||
| 1 | 2011-01-18 Paul Eggert <eggert@cs.ucla.edu> | 6 | 2011-01-18 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 7 | ||
| 3 | * lisp.h (DECL_ALIGN): Define if HAVE_ATTRIBUTE_ALIGNED, not if | 8 | * lisp.h (DECL_ALIGN): Define if HAVE_ATTRIBUTE_ALIGNED, not if |
diff --git a/src/buffer.c b/src/buffer.c index 24f653b761b..36e842e84b0 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -5362,147 +5362,147 @@ syms_of_buffer (void) | |||
| 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 | ||
| @@ -5567,8 +5567,8 @@ A string is printed verbatim in the mode line except for %-constructs: | |||
| 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", ¤t_buffer->major_mode, | 5573 | DEFVAR_PER_BUFFER ("major-mode", ¤t_buffer->major_mode, |
| 5574 | make_number (Lisp_Symbol), | 5574 | make_number (Lisp_Symbol), |
diff --git a/src/lisp.h b/src/lisp.h index 5424bf7b83d..58d8678c146 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -1866,6 +1866,12 @@ extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int); | |||
| 1866 | defvar_int (&i_fwd, lname, vname); \ | 1866 | defvar_int (&i_fwd, lname, vname); \ |
| 1867 | } while (0) | 1867 | } while (0) |
| 1868 | 1868 | ||
| 1869 | #define DEFVAR_BUFFER_DEFAULTS(lname, vname, doc) \ | ||
| 1870 | do { \ | ||
| 1871 | static struct Lisp_Objfwd o_fwd; \ | ||
| 1872 | defvar_lisp_nopro (&o_fwd, lname, &buffer_defaults.vname); \ | ||
| 1873 | } while (0) | ||
| 1874 | |||
| 1869 | #define DEFVAR_KBOARD(lname, vname, doc) \ | 1875 | #define DEFVAR_KBOARD(lname, vname, doc) \ |
| 1870 | do { \ | 1876 | do { \ |
| 1871 | static struct Lisp_Kboard_Objfwd ko_fwd; \ | 1877 | static struct Lisp_Kboard_Objfwd ko_fwd; \ |