changeset 1872:ad692b76edf4

* dispnew.c (remake_frame_glyphs): When re-allocating the frame's message buffer when echo_area_glyphs is pointing at it, relocate echo_area_glyphs too. Same for previous_echo_glyphs. * window.h (previous_echo_glyphs): Add extern declaration for this.
author Jim Blandy <jimb@redhat.com>
date Sun, 14 Feb 1993 14:39:09 +0000
parents 00bee181f7ed
children c5038f47c602
files src/dispnew.c src/window.h
diffstat 2 files changed, 20 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/dispnew.c	Sun Feb 14 14:38:43 1993 +0000
+++ b/src/dispnew.c	Sun Feb 14 14:39:09 1993 +0000
@@ -317,9 +317,20 @@
     free_frame_glyphs (frame, FRAME_TEMP_GLYPHS (frame));
 
   if (FRAME_MESSAGE_BUF (frame))
-    FRAME_MESSAGE_BUF (frame)
-      = (char *) xrealloc (FRAME_MESSAGE_BUF (frame),
-			   FRAME_WIDTH (frame) + 1);
+    {
+      /* Reallocate the frame's message buffer; remember that
+	 echo_area_glyphs may be pointing here.  */
+      char *old_message_buf = FRAME_MESSAGE_BUF (frame);
+
+      FRAME_MESSAGE_BUF (frame)
+	= (char *) xrealloc (FRAME_MESSAGE_BUF (frame),
+			     FRAME_WIDTH (frame) + 1);
+
+      if (echo_area_glyphs == old_message_buf)
+	echo_area_glyphs = FRAME_MESSAGE_BUF (frame);
+      if (previous_echo_glyphs == old_message_buf)
+	previous_echo_glyphs = FRAME_MESSAGE_BUF (frame);
+    }
   else
     FRAME_MESSAGE_BUF (frame)
       = (char *) xmalloc (FRAME_WIDTH (frame) + 1);
--- a/src/window.h	Sun Feb 14 14:38:43 1993 +0000
+++ b/src/window.h	Sun Feb 14 14:39:09 1993 +0000
@@ -225,6 +225,12 @@
    minibuf_prompt as well as the buffer.  */
 extern char *echo_area_glyphs;
 
+/* Value of echo_area_glyphs when it was last acted on.
+  If this is nonzero, there is a message on the frame
+  in the minibuffer and it should be erased as soon
+  as it is no longer requested to appear. */
+extern char *previous_echo_glyphs;
+
 /* Depth in recursive edits.  */
 extern int command_loop_level;