comparison src/buffer.c @ 51190:17af4bfeb062

(init_buffer_once): Set buffer_defaults and buffer_local_flags for new buffer-local variables left_fringe_width, right_fringe_width, fringes_outside_margins, scroll_bar_width, and vertical_scroll_bar_type. (syms_of_buffer): Defvar_per_buffer them, and defvar_lisp_nopro default-* variables for them.
author Kim F. Storm <storm@cua.dk>
date Sat, 24 May 2003 21:54:43 +0000
parents 44219a7a4ca4
children e518779f4ae1
comparison
equal deleted inserted replaced
51189:540976dbc323 51190:17af4bfeb062
1605 record_buffer (buf); 1605 record_buffer (buf);
1606 1606
1607 Fset_window_buffer (EQ (selected_window, minibuf_window) 1607 Fset_window_buffer (EQ (selected_window, minibuf_window)
1608 ? Fnext_window (minibuf_window, Qnil, Qnil) 1608 ? Fnext_window (minibuf_window, Qnil, Qnil)
1609 : selected_window, 1609 : selected_window,
1610 buf); 1610 buf, Qnil);
1611 1611
1612 return buf; 1612 return buf;
1613 } 1613 }
1614 1614
1615 DEFUN ("switch-to-buffer", Fswitch_to_buffer, Sswitch_to_buffer, 1, 2, "BSwitch to buffer: ", 1615 DEFUN ("switch-to-buffer", Fswitch_to_buffer, Sswitch_to_buffer, 1, 2, "BSwitch to buffer: ",
4925 XSETFASTINT (buffer_defaults.fill_column, 70); 4925 XSETFASTINT (buffer_defaults.fill_column, 70);
4926 XSETFASTINT (buffer_defaults.left_margin, 0); 4926 XSETFASTINT (buffer_defaults.left_margin, 0);
4927 buffer_defaults.cache_long_line_scans = Qnil; 4927 buffer_defaults.cache_long_line_scans = Qnil;
4928 buffer_defaults.file_truename = Qnil; 4928 buffer_defaults.file_truename = Qnil;
4929 XSETFASTINT (buffer_defaults.display_count, 0); 4929 XSETFASTINT (buffer_defaults.display_count, 0);
4930 XSETFASTINT (buffer_defaults.left_margin_cols, 0);
4931 XSETFASTINT (buffer_defaults.right_margin_cols, 0);
4932 buffer_defaults.left_fringe_width = Qnil;
4933 buffer_defaults.right_fringe_width = Qnil;
4934 buffer_defaults.fringes_outside_margins = Qnil;
4935 buffer_defaults.scroll_bar_width = Qnil;
4936 buffer_defaults.vertical_scroll_bar_type = Qt;
4930 buffer_defaults.indicate_empty_lines = Qnil; 4937 buffer_defaults.indicate_empty_lines = Qnil;
4931 buffer_defaults.scroll_up_aggressively = Qnil; 4938 buffer_defaults.scroll_up_aggressively = Qnil;
4932 buffer_defaults.scroll_down_aggressively = Qnil; 4939 buffer_defaults.scroll_down_aggressively = Qnil;
4933 buffer_defaults.display_time = Qnil; 4940 buffer_defaults.display_time = Qnil;
4934 4941
4987 XSETFASTINT (buffer_local_flags.category_table, idx); ++idx; 4994 XSETFASTINT (buffer_local_flags.category_table, idx); ++idx;
4988 XSETFASTINT (buffer_local_flags.direction_reversed, idx); ++idx; 4995 XSETFASTINT (buffer_local_flags.direction_reversed, idx); ++idx;
4989 XSETFASTINT (buffer_local_flags.buffer_file_coding_system, idx); 4996 XSETFASTINT (buffer_local_flags.buffer_file_coding_system, idx);
4990 /* Make this one a permanent local. */ 4997 /* Make this one a permanent local. */
4991 buffer_permanent_local_flags[idx++] = 1; 4998 buffer_permanent_local_flags[idx++] = 1;
4992 XSETFASTINT (buffer_local_flags.left_margin_width, idx); ++idx; 4999 XSETFASTINT (buffer_local_flags.left_margin_cols, idx); ++idx;
4993 XSETFASTINT (buffer_local_flags.right_margin_width, idx); ++idx; 5000 XSETFASTINT (buffer_local_flags.right_margin_cols, idx); ++idx;
5001 XSETFASTINT (buffer_local_flags.left_fringe_width, idx); ++idx;
5002 XSETFASTINT (buffer_local_flags.right_fringe_width, idx); ++idx;
5003 XSETFASTINT (buffer_local_flags.fringes_outside_margins, idx); ++idx;
5004 XSETFASTINT (buffer_local_flags.scroll_bar_width, idx); ++idx;
5005 XSETFASTINT (buffer_local_flags.vertical_scroll_bar_type, idx); ++idx;
4994 XSETFASTINT (buffer_local_flags.indicate_empty_lines, idx); ++idx; 5006 XSETFASTINT (buffer_local_flags.indicate_empty_lines, idx); ++idx;
4995 XSETFASTINT (buffer_local_flags.scroll_up_aggressively, idx); ++idx; 5007 XSETFASTINT (buffer_local_flags.scroll_up_aggressively, idx); ++idx;
4996 XSETFASTINT (buffer_local_flags.scroll_down_aggressively, idx); ++idx; 5008 XSETFASTINT (buffer_local_flags.scroll_down_aggressively, idx); ++idx;
4997 XSETFASTINT (buffer_local_flags.header_line_format, idx); ++idx; 5009 XSETFASTINT (buffer_local_flags.header_line_format, idx); ++idx;
4998 XSETFASTINT (buffer_local_flags.cursor_type, idx); ++idx; 5010 XSETFASTINT (buffer_local_flags.cursor_type, idx); ++idx;
5238 This is the same as (default-value 'buffer-file-type). 5250 This is the same as (default-value 'buffer-file-type).
5239 The file type is nil for text, t for binary. */); 5251 The file type is nil for text, t for binary. */);
5240 #endif 5252 #endif
5241 5253
5242 DEFVAR_LISP_NOPRO ("default-left-margin-width", 5254 DEFVAR_LISP_NOPRO ("default-left-margin-width",
5243 &buffer_defaults.left_margin_width, 5255 &buffer_defaults.left_margin_cols,
5244 doc: /* Default value of `left-margin-width' for buffers that don't override it. 5256 doc: /* Default value of `left-margin-width' for buffers that don't override it.
5245 This is the same as (default-value 'left-margin-width). */); 5257 This is the same as (default-value 'left-margin-width). */);
5246 5258
5247 DEFVAR_LISP_NOPRO ("default-right-margin-width", 5259 DEFVAR_LISP_NOPRO ("default-right-margin-width",
5248 &buffer_defaults.right_margin_width, 5260 &buffer_defaults.right_margin_cols,
5249 doc: /* Default value of `right_margin_width' for buffers that don't override it. 5261 doc: /* Default value of `right-margin-width' for buffers that don't override it.
5250 This is the same as (default-value 'right-margin-width). */); 5262 This is the same as (default-value 'right-margin-width). */);
5263
5264 DEFVAR_LISP_NOPRO ("default-left-fringe-width",
5265 &buffer_defaults.left_fringe_width,
5266 doc: /* Default value of `left-fringe-width' for buffers that don't override it.
5267 This is the same as (default-value 'left-fringe-width). */);
5268
5269 DEFVAR_LISP_NOPRO ("default-right-fringe-width",
5270 &buffer_defaults.right_fringe_width,
5271 doc: /* Default value of `right-fringe-width' for buffers that don't override it.
5272 This is the same as (default-value 'right-fringe-width). */);
5273
5274 DEFVAR_LISP_NOPRO ("default-fringes-outside-margins",
5275 &buffer_defaults.fringes_outside_margins,
5276 doc: /* Default value of `fringes-outside-margins' for buffers that don't override it.
5277 This is the same as (default-value 'fringes-outside-margins). */);
5278
5279 DEFVAR_LISP_NOPRO ("default-scroll-bar-width",
5280 &buffer_defaults.scroll_bar_width,
5281 doc: /* Default value of `scroll-bar-width' for buffers that don't override it.
5282 This is the same as (default-value 'scroll-bar-width). */);
5283
5284 DEFVAR_LISP_NOPRO ("default-vertical-scroll-bar",
5285 &buffer_defaults.vertical_scroll_bar_type,
5286 doc: /* Default value of `vertical-scroll-bar' for buffers that don't override it.
5287 This is the same as (default-value 'vertical-scroll-bar). */);
5251 5288
5252 DEFVAR_LISP_NOPRO ("default-indicate-empty-lines", 5289 DEFVAR_LISP_NOPRO ("default-indicate-empty-lines",
5253 &buffer_defaults.indicate_empty_lines, 5290 &buffer_defaults.indicate_empty_lines,
5254 doc: /* Default value of `indicate-empty-lines' for buffers that don't override it. 5291 doc: /* Default value of `indicate-empty-lines' for buffers that don't override it.
5255 This is the same as (default-value 'indicate-empty-lines). */); 5292 This is the same as (default-value 'indicate-empty-lines). */);
5515 the character used to draw the border between side-by-side windows 5552 the character used to draw the border between side-by-side windows
5516 (extra-slot 5, a single character). 5553 (extra-slot 5, a single character).
5517 5554
5518 See also the functions `display-table-slot' and `set-display-table-slot'. */); 5555 See also the functions `display-table-slot' and `set-display-table-slot'. */);
5519 5556
5520 DEFVAR_PER_BUFFER ("left-margin-width", &current_buffer->left_margin_width, 5557 DEFVAR_PER_BUFFER ("left-margin-width", &current_buffer->left_margin_cols,
5521 Qnil, 5558 Qnil,
5522 doc: /* *Width of left marginal area for display of a buffer. 5559 doc: /* *Width of left marginal area for display of a buffer.
5523 A value of nil means no marginal area. */); 5560 A value of nil means no marginal area. */);
5524 5561
5525 DEFVAR_PER_BUFFER ("right-margin-width", &current_buffer->right_margin_width, 5562 DEFVAR_PER_BUFFER ("right-margin-width", &current_buffer->right_margin_cols,
5526 Qnil, 5563 Qnil,
5527 doc: /* *Width of right marginal area for display of a buffer. 5564 doc: /* *Width of right marginal area for display of a buffer.
5528 A value of nil means no marginal area. */); 5565 A value of nil means no marginal area. */);
5566
5567 DEFVAR_PER_BUFFER ("left-fringe-width", &current_buffer->left_fringe_width,
5568 Qnil,
5569 doc: /* *Width of this buffer's left fringe (in pixels).
5570 A value of 0 means no left fringe is shown in this buffer's window.
5571 A value of nil means to use the left fringe width from the window's frame. */);
5572
5573 DEFVAR_PER_BUFFER ("right-fringe-width", &current_buffer->right_fringe_width,
5574 Qnil,
5575 doc: /* *Width of this buffer's right fringe (in pixels).
5576 A value of 0 means no right fringe is shown in this buffer's window.
5577 A value of nil means to use the right fringe width from the window's frame. */);
5578
5579 DEFVAR_PER_BUFFER ("fringes-outside-margins", &current_buffer->fringes_outside_margins,
5580 Qnil,
5581 doc: /* *Non-nil means to display fringes outside display margins.
5582 A value of nil means to display fringes between margins and buffer text. */);
5583
5584 DEFVAR_PER_BUFFER ("scroll-bar-width", &current_buffer->scroll_bar_width,
5585 Qnil,
5586 doc: /* *Width of this buffer's scroll bars in pixels.
5587 A value of nil means to use the scroll bar width from the window's frame. */);
5588
5589 DEFVAR_PER_BUFFER ("vertical-scroll-bar", &current_buffer->vertical_scroll_bar_type,
5590 Qnil,
5591 doc: /* *Position of this buffer's vertical scroll bar.
5592 A value of left or right means to place the vertical scroll bar at that side
5593 of the window; a value of nil means that this window has no vertical scroll bar.
5594 A value of t means to use the vertical scroll bar type from the window's frame. */);
5529 5595
5530 DEFVAR_PER_BUFFER ("indicate-empty-lines", 5596 DEFVAR_PER_BUFFER ("indicate-empty-lines",
5531 &current_buffer->indicate_empty_lines, Qnil, 5597 &current_buffer->indicate_empty_lines, Qnil,
5532 doc: /* *Visually indicate empty lines after the buffer end. 5598 doc: /* *Visually indicate empty lines after the buffer end.
5533 If non-nil, a bitmap is displayed in the left fringe of a window on 5599 If non-nil, a bitmap is displayed in the left fringe of a window on