diff options
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c index 53cc25e2c8f..1973a93a57d 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -145,7 +145,8 @@ Lisp_Object Qmodification_hooks; | |||
| 145 | Lisp_Object Qinsert_in_front_hooks; | 145 | Lisp_Object Qinsert_in_front_hooks; |
| 146 | Lisp_Object Qinsert_behind_hooks; | 146 | Lisp_Object Qinsert_behind_hooks; |
| 147 | 147 | ||
| 148 | Lisp_Object Qchoice, Qrange, Qleft, Qright, Qvertical_scroll_bar; | 148 | Lisp_Object Qchoice, Qrange, Qleft, Qright; |
| 149 | Lisp_Object Qvertical_scroll_bar, Qhorizontal_scroll_bar; | ||
| 149 | static Lisp_Object Qoverwrite_mode, Qfraction; | 150 | static Lisp_Object Qoverwrite_mode, Qfraction; |
| 150 | 151 | ||
| 151 | static void alloc_buffer_text (struct buffer *, ptrdiff_t); | 152 | static void alloc_buffer_text (struct buffer *, ptrdiff_t); |
| @@ -343,6 +344,11 @@ bset_scroll_bar_width (struct buffer *b, Lisp_Object val) | |||
| 343 | b->INTERNAL_FIELD (scroll_bar_width) = val; | 344 | b->INTERNAL_FIELD (scroll_bar_width) = val; |
| 344 | } | 345 | } |
| 345 | static void | 346 | static void |
| 347 | bset_scroll_bar_height (struct buffer *b, Lisp_Object val) | ||
| 348 | { | ||
| 349 | b->INTERNAL_FIELD (scroll_bar_height) = val; | ||
| 350 | } | ||
| 351 | static void | ||
| 346 | bset_scroll_down_aggressively (struct buffer *b, Lisp_Object val) | 352 | bset_scroll_down_aggressively (struct buffer *b, Lisp_Object val) |
| 347 | { | 353 | { |
| 348 | b->INTERNAL_FIELD (scroll_down_aggressively) = val; | 354 | b->INTERNAL_FIELD (scroll_down_aggressively) = val; |
| @@ -368,6 +374,11 @@ bset_vertical_scroll_bar_type (struct buffer *b, Lisp_Object val) | |||
| 368 | b->INTERNAL_FIELD (vertical_scroll_bar_type) = val; | 374 | b->INTERNAL_FIELD (vertical_scroll_bar_type) = val; |
| 369 | } | 375 | } |
| 370 | static void | 376 | static void |
| 377 | bset_horizontal_scroll_bar_type (struct buffer *b, Lisp_Object val) | ||
| 378 | { | ||
| 379 | b->INTERNAL_FIELD (horizontal_scroll_bar_type) = val; | ||
| 380 | } | ||
| 381 | static void | ||
| 371 | bset_word_wrap (struct buffer *b, Lisp_Object val) | 382 | bset_word_wrap (struct buffer *b, Lisp_Object val) |
| 372 | { | 383 | { |
| 373 | b->INTERNAL_FIELD (word_wrap) = val; | 384 | b->INTERNAL_FIELD (word_wrap) = val; |
| @@ -2429,6 +2440,14 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text, | |||
| 2429 | make_number | 2440 | make_number |
| 2430 | (BUF_BEGV (XBUFFER (XWINDOW (w)->contents))), | 2441 | (BUF_BEGV (XBUFFER (XWINDOW (w)->contents))), |
| 2431 | XWINDOW (w)->contents); | 2442 | XWINDOW (w)->contents); |
| 2443 | /* Blindly copied from pointm part. */ | ||
| 2444 | if (MARKERP (XWINDOW (w)->old_pointm) | ||
| 2445 | && (EQ (XWINDOW (w)->contents, buf1) | ||
| 2446 | || EQ (XWINDOW (w)->contents, buf2))) | ||
| 2447 | Fset_marker (XWINDOW (w)->old_pointm, | ||
| 2448 | make_number | ||
| 2449 | (BUF_BEGV (XBUFFER (XWINDOW (w)->contents))), | ||
| 2450 | XWINDOW (w)->contents); | ||
| 2432 | if (MARKERP (XWINDOW (w)->start) | 2451 | if (MARKERP (XWINDOW (w)->start) |
| 2433 | && (EQ (XWINDOW (w)->contents, buf1) | 2452 | && (EQ (XWINDOW (w)->contents, buf1) |
| 2434 | || EQ (XWINDOW (w)->contents, buf2))) | 2453 | || EQ (XWINDOW (w)->contents, buf2))) |
| @@ -5157,7 +5176,9 @@ init_buffer_once (void) | |||
| 5157 | bset_right_fringe_width (&buffer_defaults, Qnil); | 5176 | bset_right_fringe_width (&buffer_defaults, Qnil); |
| 5158 | bset_fringes_outside_margins (&buffer_defaults, Qnil); | 5177 | bset_fringes_outside_margins (&buffer_defaults, Qnil); |
| 5159 | bset_scroll_bar_width (&buffer_defaults, Qnil); | 5178 | bset_scroll_bar_width (&buffer_defaults, Qnil); |
| 5179 | bset_scroll_bar_height (&buffer_defaults, Qnil); | ||
| 5160 | bset_vertical_scroll_bar_type (&buffer_defaults, Qt); | 5180 | bset_vertical_scroll_bar_type (&buffer_defaults, Qt); |
| 5181 | bset_horizontal_scroll_bar_type (&buffer_defaults, Qt); | ||
| 5161 | bset_indicate_empty_lines (&buffer_defaults, Qnil); | 5182 | bset_indicate_empty_lines (&buffer_defaults, Qnil); |
| 5162 | bset_indicate_buffer_boundaries (&buffer_defaults, Qnil); | 5183 | bset_indicate_buffer_boundaries (&buffer_defaults, Qnil); |
| 5163 | bset_fringe_indicator_alist (&buffer_defaults, Qnil); | 5184 | bset_fringe_indicator_alist (&buffer_defaults, Qnil); |
| @@ -5225,7 +5246,9 @@ init_buffer_once (void) | |||
| 5225 | XSETFASTINT (BVAR (&buffer_local_flags, right_fringe_width), idx); ++idx; | 5246 | XSETFASTINT (BVAR (&buffer_local_flags, right_fringe_width), idx); ++idx; |
| 5226 | XSETFASTINT (BVAR (&buffer_local_flags, fringes_outside_margins), idx); ++idx; | 5247 | XSETFASTINT (BVAR (&buffer_local_flags, fringes_outside_margins), idx); ++idx; |
| 5227 | XSETFASTINT (BVAR (&buffer_local_flags, scroll_bar_width), idx); ++idx; | 5248 | XSETFASTINT (BVAR (&buffer_local_flags, scroll_bar_width), idx); ++idx; |
| 5249 | XSETFASTINT (BVAR (&buffer_local_flags, scroll_bar_height), idx); ++idx; | ||
| 5228 | XSETFASTINT (BVAR (&buffer_local_flags, vertical_scroll_bar_type), idx); ++idx; | 5250 | XSETFASTINT (BVAR (&buffer_local_flags, vertical_scroll_bar_type), idx); ++idx; |
| 5251 | XSETFASTINT (BVAR (&buffer_local_flags, horizontal_scroll_bar_type), idx); ++idx; | ||
| 5229 | XSETFASTINT (BVAR (&buffer_local_flags, indicate_empty_lines), idx); ++idx; | 5252 | XSETFASTINT (BVAR (&buffer_local_flags, indicate_empty_lines), idx); ++idx; |
| 5230 | XSETFASTINT (BVAR (&buffer_local_flags, indicate_buffer_boundaries), idx); ++idx; | 5253 | XSETFASTINT (BVAR (&buffer_local_flags, indicate_buffer_boundaries), idx); ++idx; |
| 5231 | XSETFASTINT (BVAR (&buffer_local_flags, fringe_indicator_alist), idx); ++idx; | 5254 | XSETFASTINT (BVAR (&buffer_local_flags, fringe_indicator_alist), idx); ++idx; |
| @@ -5446,6 +5469,7 @@ syms_of_buffer (void) | |||
| 5446 | 5469 | ||
| 5447 | DEFSYM (Qvertical_scroll_bar, "vertical-scroll-bar"); | 5470 | DEFSYM (Qvertical_scroll_bar, "vertical-scroll-bar"); |
| 5448 | Fput (Qvertical_scroll_bar, Qchoice, list4 (Qnil, Qt, Qleft, Qright)); | 5471 | Fput (Qvertical_scroll_bar, Qchoice, list4 (Qnil, Qt, Qleft, Qright)); |
| 5472 | DEFSYM (Qhorizontal_scroll_bar, "horizontal-scroll-bar"); | ||
| 5449 | 5473 | ||
| 5450 | DEFSYM (Qfraction, "fraction"); | 5474 | DEFSYM (Qfraction, "fraction"); |
| 5451 | Fput (Qfraction, Qrange, Fcons (make_float (0.0), make_float (1.0))); | 5475 | Fput (Qfraction, Qrange, Fcons (make_float (0.0), make_float (1.0))); |
| @@ -5954,6 +5978,11 @@ in a window. To make the change take effect, call `set-window-buffer'. */); | |||
| 5954 | doc: /* Width of this buffer's scroll bars in pixels. | 5978 | doc: /* Width of this buffer's scroll bars in pixels. |
| 5955 | A value of nil means to use the scroll bar width from the window's frame. */); | 5979 | A value of nil means to use the scroll bar width from the window's frame. */); |
| 5956 | 5980 | ||
| 5981 | DEFVAR_PER_BUFFER ("scroll-bar-height", &BVAR (current_buffer, scroll_bar_height), | ||
| 5982 | Qintegerp, | ||
| 5983 | doc: /* Height of this buffer's scroll bars in pixels. | ||
| 5984 | A value of nil means to use the scroll bar heiht from the window's frame. */); | ||
| 5985 | |||
| 5957 | DEFVAR_PER_BUFFER ("vertical-scroll-bar", &BVAR (current_buffer, vertical_scroll_bar_type), | 5986 | DEFVAR_PER_BUFFER ("vertical-scroll-bar", &BVAR (current_buffer, vertical_scroll_bar_type), |
| 5958 | Qvertical_scroll_bar, | 5987 | Qvertical_scroll_bar, |
| 5959 | doc: /* Position of this buffer's vertical scroll bar. | 5988 | doc: /* Position of this buffer's vertical scroll bar. |
| @@ -5964,6 +5993,17 @@ A value of `left' or `right' means put the vertical scroll bar at that side | |||
| 5964 | of the window; a value of nil means don't show any vertical scroll bars. | 5993 | of the window; a value of nil means don't show any vertical scroll bars. |
| 5965 | A value of t (the default) means do whatever the window's frame specifies. */); | 5994 | A value of t (the default) means do whatever the window's frame specifies. */); |
| 5966 | 5995 | ||
| 5996 | DEFVAR_PER_BUFFER ("horizontal-scroll-bar", &BVAR (current_buffer, horizontal_scroll_bar_type), | ||
| 5997 | Qnil, | ||
| 5998 | doc: /* Position of this buffer's horizontal scroll bar. | ||
| 5999 | The value takes effect whenever you tell a window to display this buffer; | ||
| 6000 | for instance, with `set-window-buffer' or when `display-buffer' displays it. | ||
| 6001 | |||
| 6002 | A value of `bottom' means put the horizontal scroll bar at the bottom of | ||
| 6003 | the window; a value of nil means don't show any horizonal scroll bars. | ||
| 6004 | A value of t (the default) means do whatever the window's frame | ||
| 6005 | specifies. */); | ||
| 6006 | |||
| 5967 | DEFVAR_PER_BUFFER ("indicate-empty-lines", | 6007 | DEFVAR_PER_BUFFER ("indicate-empty-lines", |
| 5968 | &BVAR (current_buffer, indicate_empty_lines), Qnil, | 6008 | &BVAR (current_buffer, indicate_empty_lines), Qnil, |
| 5969 | doc: /* Visually indicate empty lines after the buffer end. | 6009 | doc: /* Visually indicate empty lines after the buffer end. |