changeset 25025:be2881684382

(prepare_to_modify_buffer): Set windows_or_buffers_changed, (del_range_1) [PROMPT_IN_BUFFER]: If start position is less than mini-buffer prompt width, use prompt width as start.
author Gerd Moellmann <gerd@gnu.org>
date Wed, 21 Jul 1999 21:43:52 +0000
parents 3bb745067f0e
children 488e6b8dc9ae
files src/insdel.c
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/insdel.c	Wed Jul 21 21:43:52 1999 +0000
+++ b/src/insdel.c	Wed Jul 21 21:43:52 1999 +0000
@@ -33,6 +33,7 @@
 #endif
 
 #define min(x, y) ((x) < (y) ? (x) : (y))
+#define max(x, y) ((x) > (y) ? (x) : (y))
 
 static void insert_from_string_1 P_ ((Lisp_Object, int, int, int, int, int, int));
 static void insert_from_buffer_1 ();
@@ -2047,6 +2048,15 @@
      int from, to, prepare;
 {
   int from_byte, to_byte;
+  
+#if !NO_PROMPT_IN_BUFFER
+  if (INTEGERP (current_buffer->minibuffer_prompt_length))
+    {
+      /* Don't delete part of a mini-buffer prompt.  */
+      int len = XFASTINT (current_buffer->minibuffer_prompt_length);
+      from = max (from, len);
+    }
+#endif /* !NO_PROMPT_IN_BUFFER */
 
   /* Make args be valid */
   if (from < BEGV)
@@ -2328,6 +2338,11 @@
   if (!NILP (current_buffer->read_only))
     Fbarf_if_buffer_read_only ();
 
+  /* Let redisplay consider other windows than selected_window
+     if modifying another buffer.  */
+  if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
+    ++windows_or_buffers_changed;
+
   /* Only defined if Emacs is compiled with USE_TEXT_PROPERTIES */
   if (BUF_INTERVALS (current_buffer) != 0)
     {