]> git.eshelyaron.com Git - emacs.git/commitdiff
(IT_update_begin): Don't dereference members of struct
authorEli Zaretskii <eliz@gnu.org>
Thu, 30 Dec 1999 14:14:38 +0000 (14:14 +0000)
committerEli Zaretskii <eliz@gnu.org>
Thu, 30 Dec 1999 14:14:38 +0000 (14:14 +0000)
window for deleted windows.

src/ChangeLog
src/msdos.c

index 413db7655c14abf6aca0b5d68666f986e9da24ed..9c4ce9ec50be70ced155d3b6b946d423e6158057 100644 (file)
@@ -1,3 +1,8 @@
+1999-12-30  Eli Zaretskii  <eliz@is.elta.co.il>
+
+       * msdos.c (IT_update_begin): Don't dereference members of struct
+       window for deleted windows.
+
 1999-12-30  Gerd Moellmann  <gerd@gnu.org>
 
        * abbrev.c (Fexpand_abbrev): If expanding an abbrev which has only
index cd969127fe1a30b51bae66c2809d2f141a25b26b..3cd0d7e5a4ea9050a219808b874ff34f4fa07139 100644 (file)
@@ -1711,16 +1711,25 @@ IT_update_begin (struct frame *f)
         Likewise, don't do anything if the frame is garbaged;
         in that case, the frame's current matrix that we would use
         is all wrong, and we will redisplay that line anyway.  */
-      if (!NILP (display_info->mouse_face_window))
+      if (!NILP (display_info->mouse_face_window)
+         && WINDOWP (display_info->mouse_face_window))
        {
          struct window *w = XWINDOW (display_info->mouse_face_window);
          int i;
 
-         for (i = 0; i < w->desired_matrix->nrows; ++i)
-           if (MATRIX_ROW_ENABLED_P (w->desired_matrix, i))
-             break;
+         /* If the mouse highlight is in the window that was deleted
+            (e.g., if it was popped by completion), clear highlight
+            unconditionally.  */
+         if (NILP (w->buffer))
+           display_info->mouse_face_window = Qnil;
+         else
+           {
+             for (i = 0; i < w->desired_matrix->nrows; ++i)
+               if (MATRIX_ROW_ENABLED_P (w->desired_matrix, i))
+                 break;
+           }
 
-         if (i < w->desired_matrix->nrows)
+         if (NILP (w->buffer) || i < w->desired_matrix->nrows)
            clear_mouse_face (display_info);
        }
     }