diff 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
line wrap: on
line diff
--- a/src/window.c	Tue Jun 10 14:17:32 2008 +0000
+++ b/src/window.c	Tue Jun 10 16:08:48 2008 +0000
@@ -167,6 +167,10 @@
 
 Lisp_Object Vscroll_preserve_screen_position;
 
+/* Non-nil means that text is inserted before window's markers.  */
+
+Lisp_Object Vwindow_point_insertion_type;
+
 /* Incremented by 1 whenever a window is deleted.  */
 
 int window_deletion_count;
@@ -3420,6 +3424,8 @@
       Fset_buffer (buffer);
     }
 
+  XMARKER (w->pointm)->insertion_type = !NILP (Vwindow_point_insertion_type);
+
   if (!keep_margins_p)
     {
       /* Set left and right marginal area width etc. from buffer.  */
@@ -3486,9 +3492,11 @@
   else if (! EQ (tem, Qt))	/* w->buffer is t when the window
 				   is first being set up.  */
     {
-      if (!NILP (w->dedicated) && !EQ (tem, buffer))
-	error ("Window is dedicated to `%s'",
-	       SDATA (XBUFFER (tem)->name));
+      if (!EQ (tem, buffer))
+	if (EQ (w->dedicated, Qt))
+	  error ("Window is dedicated to `%s'", SDATA (XBUFFER (tem)->name));
+	else
+	  w->dedicated = Qnil;
 
       unshow_buffer (w);
     }
@@ -7151,6 +7159,10 @@
 Any other value means point always keeps its screen position.  */);
   Vscroll_preserve_screen_position = Qnil;
 
+  DEFVAR_LISP ("window-point-insertion-type", &Vwindow_point_insertion_type,
+	       doc: /* Type of marker to use for `window-point'.  */);
+  Vwindow_point_insertion_type = Qnil;
+
   DEFVAR_LISP ("window-configuration-change-hook",
 	       &Vwindow_configuration_change_hook,
 	       doc: /* Functions to call when window configuration changes.