Mercurial > emacs
comparison src/window.c @ 95777:edc51d72cb17
* window.c (Vwindow_point_insertion_type): New var.
(set_window_buffer): Use it.
(syms_of_window): Init and export it to Lisp.
* progmodes/compile.el (compilation-mode):
Set window-point-insertion-type.
(compilation-filter): Don't use insert-before-markers any more.
* emacs-lisp/trace.el (trace-make-advice):
Set window-point-insertion-type in the trace buffer.
* startup.el (normal-top-level): Set window-point-insertion-type in
*Messages*.
* net/telnet.el (telnet-mode): Set window-point-insertion-type.
(telnet-filter): Don't use insert-before-markers any more.
* comint.el (comint-mode): Set window-point-insertion-type.
(comint-output-filter): Don't use insert-before-markers any more.
* button.el (make-text-button): Allow `start' to be a string.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 10 Jun 2008 16:08:48 +0000 |
parents | 9a4b27c8feec |
children | a99299e4d2de |
comparison
equal
deleted
inserted
replaced
95776:dc7fbbea402e | 95777:edc51d72cb17 |
---|---|
164 | 164 |
165 /* Non-nil means scroll commands try to put point | 165 /* Non-nil means scroll commands try to put point |
166 at the same screen height as previously. */ | 166 at the same screen height as previously. */ |
167 | 167 |
168 Lisp_Object Vscroll_preserve_screen_position; | 168 Lisp_Object Vscroll_preserve_screen_position; |
169 | |
170 /* Non-nil means that text is inserted before window's markers. */ | |
171 | |
172 Lisp_Object Vwindow_point_insertion_type; | |
169 | 173 |
170 /* Incremented by 1 whenever a window is deleted. */ | 174 /* Incremented by 1 whenever a window is deleted. */ |
171 | 175 |
172 int window_deletion_count; | 176 int window_deletion_count; |
173 | 177 |
3418 { | 3422 { |
3419 record_unwind_protect (Fset_window_buffer_unwind, Fcurrent_buffer ()); | 3423 record_unwind_protect (Fset_window_buffer_unwind, Fcurrent_buffer ()); |
3420 Fset_buffer (buffer); | 3424 Fset_buffer (buffer); |
3421 } | 3425 } |
3422 | 3426 |
3427 XMARKER (w->pointm)->insertion_type = !NILP (Vwindow_point_insertion_type); | |
3428 | |
3423 if (!keep_margins_p) | 3429 if (!keep_margins_p) |
3424 { | 3430 { |
3425 /* Set left and right marginal area width etc. from buffer. */ | 3431 /* Set left and right marginal area width etc. from buffer. */ |
3426 | 3432 |
3427 /* This may call adjust_window_margins three times, so | 3433 /* This may call adjust_window_margins three times, so |
3484 if (NILP (tem)) | 3490 if (NILP (tem)) |
3485 error ("Window is deleted"); | 3491 error ("Window is deleted"); |
3486 else if (! EQ (tem, Qt)) /* w->buffer is t when the window | 3492 else if (! EQ (tem, Qt)) /* w->buffer is t when the window |
3487 is first being set up. */ | 3493 is first being set up. */ |
3488 { | 3494 { |
3489 if (!NILP (w->dedicated) && !EQ (tem, buffer)) | 3495 if (!EQ (tem, buffer)) |
3490 error ("Window is dedicated to `%s'", | 3496 if (EQ (w->dedicated, Qt)) |
3491 SDATA (XBUFFER (tem)->name)); | 3497 error ("Window is dedicated to `%s'", SDATA (XBUFFER (tem)->name)); |
3498 else | |
3499 w->dedicated = Qnil; | |
3492 | 3500 |
3493 unshow_buffer (w); | 3501 unshow_buffer (w); |
3494 } | 3502 } |
3495 | 3503 |
3496 set_window_buffer (window, buffer, 1, !NILP (keep_margins)); | 3504 set_window_buffer (window, buffer, 1, !NILP (keep_margins)); |
7148 A value of t means point keeps its screen position if the scroll | 7156 A value of t means point keeps its screen position if the scroll |
7149 command moved it vertically out of the window, e.g. when scrolling | 7157 command moved it vertically out of the window, e.g. when scrolling |
7150 by full screens. | 7158 by full screens. |
7151 Any other value means point always keeps its screen position. */); | 7159 Any other value means point always keeps its screen position. */); |
7152 Vscroll_preserve_screen_position = Qnil; | 7160 Vscroll_preserve_screen_position = Qnil; |
7161 | |
7162 DEFVAR_LISP ("window-point-insertion-type", &Vwindow_point_insertion_type, | |
7163 doc: /* Type of marker to use for `window-point'. */); | |
7164 Vwindow_point_insertion_type = Qnil; | |
7153 | 7165 |
7154 DEFVAR_LISP ("window-configuration-change-hook", | 7166 DEFVAR_LISP ("window-configuration-change-hook", |
7155 &Vwindow_configuration_change_hook, | 7167 &Vwindow_configuration_change_hook, |
7156 doc: /* Functions to call when window configuration changes. | 7168 doc: /* Functions to call when window configuration changes. |
7157 The buffer-local part is run once per window, with the relevant window | 7169 The buffer-local part is run once per window, with the relevant window |