diff options
| author | Gerd Moellmann | 1999-07-21 21:43:52 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 1999-07-21 21:43:52 +0000 |
| commit | 0552666bc1f8989999967b575977b08a5f57ecb7 (patch) | |
| tree | d327de1404b9bae3c30aa93894805a27ebabd4c6 /src/buffer.c | |
| parent | 6e0adcfa04ca8d0655e645515f90f129e958a84a (diff) | |
| download | emacs-0552666bc1f8989999967b575977b08a5f57ecb7.tar.gz emacs-0552666bc1f8989999967b575977b08a5f57ecb7.zip | |
(init_buffer_once): Init top_line_format.
(default-top-line-format): New.
(top-line-format): New buffer-local variable.
(init_buffer_once): Set buffer_local_flags for
scroll_*_aggressively.
(syms_of_buffer): Add DEFVAR_PER_BUFFER for scroll-*-aggressively.
(init_buffer_once): Set defaults for these variables.
(syms_of_buffer): Add default-scroll-*-aggressively.
(indicate-empty-lines): New.
(default-indicate-zv-lines): Likewise.
(init_buffer_once): Add default for `indicate-zv-lines'.
(init_buffer_once): New variable `default-indicate-zv-lines'.
(syms_of_buffer): New buffer-local varianle `indicate-zv-lines'.
(init_buffer_once): Add left_margin_width and
right_margin_width to buffer_local_flags.
(syms_of_buffer): Add buffer-local variables
left-margin-width and right-margin-width. Add defaults
default-left-margin-width and default-right-margin-width.
(record_buffer): Return void.
(record_asynch_buffer_change): Return void.
(Fget_buffer_create): Initialize minibuffer_prompt_length.
(Fmake_indirect_buffer): Ditto.
(Fkill_buffer): Ditto.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 101 |
1 files changed, 99 insertions, 2 deletions
diff --git a/src/buffer.c b/src/buffer.c index f00edb4622c..d6989697a7d 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -369,6 +369,9 @@ The value is never nil.") | |||
| 369 | b->newline_cache = 0; | 369 | b->newline_cache = 0; |
| 370 | b->width_run_cache = 0; | 370 | b->width_run_cache = 0; |
| 371 | b->width_table = Qnil; | 371 | b->width_table = Qnil; |
| 372 | #if !NO_PROMPT_IN_BUFFER | ||
| 373 | b->minibuffer_prompt_length = Qnil; | ||
| 374 | #endif | ||
| 372 | 375 | ||
| 373 | /* Put this on the chain of all buffers including killed ones. */ | 376 | /* Put this on the chain of all buffers including killed ones. */ |
| 374 | b->next = all_buffers; | 377 | b->next = all_buffers; |
| @@ -447,6 +450,9 @@ NAME should be a string which is not the name of an existing buffer.") | |||
| 447 | b->newline_cache = 0; | 450 | b->newline_cache = 0; |
| 448 | b->width_run_cache = 0; | 451 | b->width_run_cache = 0; |
| 449 | b->width_table = Qnil; | 452 | b->width_table = Qnil; |
| 453 | #if !NO_PROMPT_IN_BUFFER | ||
| 454 | b->minibuffer_prompt_length = Qnil; | ||
| 455 | #endif | ||
| 450 | 456 | ||
| 451 | /* Put this on the chain of all buffers including killed ones. */ | 457 | /* Put this on the chain of all buffers including killed ones. */ |
| 452 | b->next = all_buffers; | 458 | b->next = all_buffers; |
| @@ -1215,6 +1221,9 @@ with SIGHUP.") | |||
| 1215 | b->width_run_cache = 0; | 1221 | b->width_run_cache = 0; |
| 1216 | } | 1222 | } |
| 1217 | b->width_table = Qnil; | 1223 | b->width_table = Qnil; |
| 1224 | #if !NO_PROMPT_IN_BUFFER | ||
| 1225 | b->minibuffer_prompt_length = Qnil; | ||
| 1226 | #endif | ||
| 1218 | UNBLOCK_INPUT; | 1227 | UNBLOCK_INPUT; |
| 1219 | b->undo_list = Qnil; | 1228 | b->undo_list = Qnil; |
| 1220 | 1229 | ||
| @@ -1410,6 +1419,7 @@ set_buffer_internal (b) | |||
| 1410 | if (current_buffer == b) | 1419 | if (current_buffer == b) |
| 1411 | return; | 1420 | return; |
| 1412 | 1421 | ||
| 1422 | /* Otherwise, force-mode-line-update doesn't work as expected. */ | ||
| 1413 | windows_or_buffers_changed = 1; | 1423 | windows_or_buffers_changed = 1; |
| 1414 | set_buffer_internal_1 (b); | 1424 | set_buffer_internal_1 (b); |
| 1415 | } | 1425 | } |
| @@ -2029,7 +2039,11 @@ overlays_at (pos, extend, vec_ptr, len_ptr, next_ptr, prev_ptr) | |||
| 2029 | Either make it bigger, or don't store any more in it. */ | 2039 | Either make it bigger, or don't store any more in it. */ |
| 2030 | if (extend) | 2040 | if (extend) |
| 2031 | { | 2041 | { |
| 2032 | *len_ptr = len *= 2; | 2042 | /* Make it work with an initial len == 0. */ |
| 2043 | len *= 2; | ||
| 2044 | if (len == 0) | ||
| 2045 | len = 4; | ||
| 2046 | *len_ptr = len; | ||
| 2033 | vec = (Lisp_Object *) xrealloc (vec, len * sizeof (Lisp_Object)); | 2047 | vec = (Lisp_Object *) xrealloc (vec, len * sizeof (Lisp_Object)); |
| 2034 | *vec_ptr = vec; | 2048 | *vec_ptr = vec; |
| 2035 | } | 2049 | } |
| @@ -2071,6 +2085,8 @@ overlays_at (pos, extend, vec_ptr, len_ptr, next_ptr, prev_ptr) | |||
| 2071 | if (extend) | 2085 | if (extend) |
| 2072 | { | 2086 | { |
| 2073 | *len_ptr = len *= 2; | 2087 | *len_ptr = len *= 2; |
| 2088 | if (len == 0) | ||
| 2089 | len = *len_ptr = 4; | ||
| 2074 | vec = (Lisp_Object *) xrealloc (vec, len * sizeof (Lisp_Object)); | 2090 | vec = (Lisp_Object *) xrealloc (vec, len * sizeof (Lisp_Object)); |
| 2075 | *vec_ptr = vec; | 2091 | *vec_ptr = vec; |
| 2076 | } | 2092 | } |
| @@ -3847,6 +3863,7 @@ init_buffer_once () | |||
| 3847 | 3863 | ||
| 3848 | /* real setup is done in loaddefs.el */ | 3864 | /* real setup is done in loaddefs.el */ |
| 3849 | buffer_defaults.mode_line_format = build_string ("%-"); | 3865 | buffer_defaults.mode_line_format = build_string ("%-"); |
| 3866 | buffer_defaults.top_line_format = Qnil; | ||
| 3850 | buffer_defaults.abbrev_mode = Qnil; | 3867 | buffer_defaults.abbrev_mode = Qnil; |
| 3851 | buffer_defaults.overwrite_mode = Qnil; | 3868 | buffer_defaults.overwrite_mode = Qnil; |
| 3852 | buffer_defaults.case_fold_search = Qt; | 3869 | buffer_defaults.case_fold_search = Qt; |
| @@ -3879,6 +3896,9 @@ init_buffer_once () | |||
| 3879 | buffer_defaults.cache_long_line_scans = Qnil; | 3896 | buffer_defaults.cache_long_line_scans = Qnil; |
| 3880 | buffer_defaults.file_truename = Qnil; | 3897 | buffer_defaults.file_truename = Qnil; |
| 3881 | XSETFASTINT (buffer_defaults.display_count, 0); | 3898 | XSETFASTINT (buffer_defaults.display_count, 0); |
| 3899 | buffer_defaults.indicate_empty_lines = Qnil; | ||
| 3900 | buffer_defaults.scroll_up_aggressively = Qnil; | ||
| 3901 | buffer_defaults.scroll_down_aggressively = Qnil; | ||
| 3882 | buffer_defaults.display_time = Qnil; | 3902 | buffer_defaults.display_time = Qnil; |
| 3883 | 3903 | ||
| 3884 | /* Assign the local-flags to the slots that have default values. | 3904 | /* Assign the local-flags to the slots that have default values. |
| @@ -3937,6 +3957,12 @@ init_buffer_once () | |||
| 3937 | XSETFASTINT (buffer_local_flags.buffer_file_coding_system, 0x80000); | 3957 | XSETFASTINT (buffer_local_flags.buffer_file_coding_system, 0x80000); |
| 3938 | /* Make this one a permanent local. */ | 3958 | /* Make this one a permanent local. */ |
| 3939 | buffer_permanent_local_flags |= 0x80000; | 3959 | buffer_permanent_local_flags |= 0x80000; |
| 3960 | XSETFASTINT (buffer_local_flags.left_margin_width, 0x100000); | ||
| 3961 | XSETFASTINT (buffer_local_flags.right_margin_width, 0x200000); | ||
| 3962 | XSETFASTINT (buffer_local_flags.indicate_empty_lines, 0x400000); | ||
| 3963 | XSETFASTINT (buffer_local_flags.scroll_up_aggressively, 0x800000); | ||
| 3964 | XSETFASTINT (buffer_local_flags.scroll_down_aggressively, 0x1000000); | ||
| 3965 | XSETFASTINT (buffer_local_flags.top_line_format, 0x2000000); | ||
| 3940 | 3966 | ||
| 3941 | Vbuffer_alist = Qnil; | 3967 | Vbuffer_alist = Qnil; |
| 3942 | current_buffer = 0; | 3968 | current_buffer = 0; |
| @@ -4084,6 +4110,11 @@ syms_of_buffer () | |||
| 4084 | "Default value of `mode-line-format' for buffers that don't override it.\n\ | 4110 | "Default value of `mode-line-format' for buffers that don't override it.\n\ |
| 4085 | This is the same as (default-value 'mode-line-format)."); | 4111 | This is the same as (default-value 'mode-line-format)."); |
| 4086 | 4112 | ||
| 4113 | DEFVAR_LISP_NOPRO ("default-top-line-format", | ||
| 4114 | &buffer_defaults.top_line_format, | ||
| 4115 | "Default value of `top-line-format' for buffers that don't override it.\n\ | ||
| 4116 | This is the same as (default-value 'top-line-format)."); | ||
| 4117 | |||
| 4087 | DEFVAR_LISP_NOPRO ("default-abbrev-mode", | 4118 | DEFVAR_LISP_NOPRO ("default-abbrev-mode", |
| 4088 | &buffer_defaults.abbrev_mode, | 4119 | &buffer_defaults.abbrev_mode, |
| 4089 | "Default value of `abbrev-mode' for buffers that do not override it.\n\ | 4120 | "Default value of `abbrev-mode' for buffers that do not override it.\n\ |
| @@ -4142,6 +4173,38 @@ This is the same as (default-value 'buffer-file-type).\n\ | |||
| 4142 | The file type is nil for text, t for binary."); | 4173 | The file type is nil for text, t for binary."); |
| 4143 | #endif | 4174 | #endif |
| 4144 | 4175 | ||
| 4176 | DEFVAR_LISP_NOPRO ("default-left-margin-width", | ||
| 4177 | &buffer_defaults.left_margin_width, | ||
| 4178 | "Default value of `left-margin-width' for buffers that don't override it.\n\ | ||
| 4179 | This is the same as (default-value 'left-margin-width)."); | ||
| 4180 | |||
| 4181 | DEFVAR_LISP_NOPRO ("default-right-margin-width", | ||
| 4182 | &buffer_defaults.right_margin_width, | ||
| 4183 | "Default value of `right_margin_width' for buffers that don't override it.\n\ | ||
| 4184 | This is the same as (default-value 'right-margin-width)."); | ||
| 4185 | |||
| 4186 | DEFVAR_LISP_NOPRO ("default-indicate-empty-lines", | ||
| 4187 | &buffer_defaults.indicate_empty_lines, | ||
| 4188 | "Default value of `indicate-empty-lines' for buffers that don't override it.\n\ | ||
| 4189 | This is the same as (default-value 'indicate-empty-lines)."); | ||
| 4190 | |||
| 4191 | DEFVAR_LISP_NOPRO ("default-scroll-up-aggressively", | ||
| 4192 | &buffer_defaults.scroll_up_aggressively, | ||
| 4193 | "Default value of `scroll-up-aggressively' for buffers that\n\ | ||
| 4194 | don't override it. This is the same as (default-value\n\ | ||
| 4195 | 'scroll-up-aggressively)."); | ||
| 4196 | |||
| 4197 | DEFVAR_LISP_NOPRO ("default-scroll-down-aggressively", | ||
| 4198 | &buffer_defaults.scroll_down_aggressively, | ||
| 4199 | "Default value of `scroll-down-aggressively' for buffers that\n\ | ||
| 4200 | don't override it. This is the same as (default-value\n\ | ||
| 4201 | 'scroll-down-aggressively)."); | ||
| 4202 | |||
| 4203 | DEFVAR_PER_BUFFER ("top-line-format", ¤t_buffer->top_line_format, | ||
| 4204 | Qnil, | ||
| 4205 | "Analogous to `mode-line-format', but for a mode line displayed\n\ | ||
| 4206 | at the top of windows."); | ||
| 4207 | |||
| 4145 | DEFVAR_PER_BUFFER ("mode-line-format", ¤t_buffer->mode_line_format, | 4208 | DEFVAR_PER_BUFFER ("mode-line-format", ¤t_buffer->mode_line_format, |
| 4146 | Qnil, 0); | 4209 | Qnil, 0); |
| 4147 | 4210 | ||
| @@ -4151,7 +4214,8 @@ The file type is nil for text, t for binary."); | |||
| 4151 | Qnil, | 4214 | Qnil, |
| 4152 | "Template for displaying mode line for current buffer.\n\ | 4215 | "Template for displaying mode line for current buffer.\n\ |
| 4153 | Each buffer has its own value of this variable.\n\ | 4216 | Each buffer has its own value of this variable.\n\ |
| 4154 | Value may be a string, a symbol or a list or cons cell.\n\ | 4217 | Value may be nil, a string, a symbol or a list or cons cell.\n\ |
| 4218 | A value of nil means don't display a mode line.\n\ | ||
| 4155 | For a symbol, its value is used (but it is ignored if t or nil).\n\ | 4219 | For a symbol, its value is used (but it is ignored if t or nil).\n\ |
| 4156 | A string appearing directly as the value of a symbol is processed verbatim\n\ | 4220 | A string appearing directly as the value of a symbol is processed verbatim\n\ |
| 4157 | in that the %-constructs below are not recognized.\n\ | 4221 | in that the %-constructs below are not recognized.\n\ |
| @@ -4382,6 +4446,39 @@ Each window can have its own, overriding display table."); | |||
| 4382 | DEFVAR_PER_BUFFER ("buffer-display-table", ¤t_buffer->display_table, | 4446 | DEFVAR_PER_BUFFER ("buffer-display-table", ¤t_buffer->display_table, |
| 4383 | Qnil, 0); | 4447 | Qnil, 0); |
| 4384 | 4448 | ||
| 4449 | DEFVAR_PER_BUFFER ("left-margin-width", ¤t_buffer->left_margin_width, | ||
| 4450 | Qnil, | ||
| 4451 | "*Width of left marginal area for display of a buffer.\n\ | ||
| 4452 | Automatically becomes buffer-local when set in any fashion.\n\ | ||
| 4453 | A value of nil means no marginal area."); | ||
| 4454 | |||
| 4455 | DEFVAR_PER_BUFFER ("right-margin-width", ¤t_buffer->right_margin_width, | ||
| 4456 | Qnil, | ||
| 4457 | "*Width of right marginal area for display of a buffer.\n\ | ||
| 4458 | Automatically becomes buffer-local when set in any fashion.\n\ | ||
| 4459 | A value of nil means no marginal area."); | ||
| 4460 | |||
| 4461 | DEFVAR_PER_BUFFER ("indicate-empty-lines", | ||
| 4462 | ¤t_buffer->indicate_empty_lines, Qnil, | ||
| 4463 | "*Non-nil means visually indicate lines not displaying text.\n\ | ||
| 4464 | Automatically becomes buffer-local when set in any fashion.\n"); | ||
| 4465 | |||
| 4466 | DEFVAR_PER_BUFFER ("scroll-up-aggressively", | ||
| 4467 | ¤t_buffer->scroll_up_aggressively, Qnil, | ||
| 4468 | "*If a number, scroll display up aggressively.\n\ | ||
| 4469 | If scrolling a window because point is above the window start, choose\n\ | ||
| 4470 | a new window start so that point ends up that fraction of the window's\n\ | ||
| 4471 | height from the bottom of the window.\n\ | ||
| 4472 | Automatically becomes buffer-local when set in any fashion."); | ||
| 4473 | |||
| 4474 | DEFVAR_PER_BUFFER ("scroll-down-aggressively", | ||
| 4475 | ¤t_buffer->scroll_down_aggressively, Qnil, | ||
| 4476 | "*If a number, scroll display down aggressively.\n\ | ||
| 4477 | If scrolling a window because point is below the window end, choose\n\ | ||
| 4478 | a new window start so that point ends up that fraction of the window's\n\ | ||
| 4479 | height from the top of the window.\n\ | ||
| 4480 | Automatically becomes buffer-local when set in any fashion."); | ||
| 4481 | |||
| 4385 | /*DEFVAR_LISP ("debug-check-symbol", &Vcheck_symbol, | 4482 | /*DEFVAR_LISP ("debug-check-symbol", &Vcheck_symbol, |
| 4386 | "Don't ask."); | 4483 | "Don't ask."); |
| 4387 | */ | 4484 | */ |