]> code.delx.au - gnu-emacs/blobdiff - src/xdisp.c
(mark_byte_stack): Use XMARKBIT and XMARK.
[gnu-emacs] / src / xdisp.c
index 0b0d0383957fd45a789cf263143bfac1ef4032c0..484474c2ab64ad52b2b76b1734e2975b0aacb310 100644 (file)
@@ -603,7 +603,7 @@ static Lisp_Object eval_form P_ ((Lisp_Object));
 static void insert_left_trunc_glyphs P_ ((struct it *));
 static struct glyph_row *get_overlay_arrow_glyph_row P_ ((struct window *));
 static void extend_face_to_end_of_line P_ ((struct it *));
-static void append_space P_ ((struct it *, int));
+static int append_space P_ ((struct it *, int));
 static void make_cursor_line_fully_visible P_ ((struct window *));
 static int try_scrolling P_ ((Lisp_Object, int, int, int, int));
 static int trailing_whitespace_p P_ ((int));
@@ -2976,7 +2976,6 @@ back_to_previous_visible_line_start (it)
          && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it),
                                it->selective))
        visible_p = 0;
-#ifdef USE_TEXT_PROPERTIES
       else 
        {
          Lisp_Object prop;
@@ -2985,7 +2984,6 @@ back_to_previous_visible_line_start (it)
          if (TEXT_PROP_MEANS_INVISIBLE (prop))
            visible_p = 0;
        }
-#endif /* USE_TEXT_PROPERTIES  */
 
       /* Back one more newline if the current one is invisible.  */
       if (!visible_p)
@@ -4404,7 +4402,6 @@ invisible_text_between_p (it, start_charpos, end_charpos)
      struct it *it;
      int start_charpos, end_charpos;
 {
-#ifdef USE_TEXT_PROPERTIES
   Lisp_Object prop, limit;
   int invisible_found_p;
   
@@ -4424,10 +4421,6 @@ invisible_text_between_p (it, start_charpos, end_charpos)
     }
 
   return invisible_found_p;
-  
-#else /* not USE_TEXT_PROPERTIES */
-  return 0;
-#endif /* not USE_TEXT_PROPERTIES */
 }
 
 
@@ -5518,9 +5511,13 @@ resize_mini_window (w, exact_p)
       max_height = min (total_height, max_height);
       
       /* Find out the height of the text in the window.  */
+      last_height = 0;
       move_it_to (&it, ZV, -1, -1, -1, MOVE_TO_POS);
-      height = (unit - 1 + it.current_y + last_height) / unit;
-      height = max (1, height);
+      if (it.max_ascent == 0 && it.max_descent == 0)
+       height = it.current_y + last_height;
+      else
+       height = it.current_y + it.max_ascent + it.max_descent;
+      height = (height + unit - 1) / unit;
       
       /* Compute a suitable window start.  */
       if (height > max_height)
@@ -10723,7 +10720,7 @@ compute_line_metrics (it)
 /* Append one space to the glyph row of iterator IT if doing a
    window-based redisplay.  DEFAULT_FACE_P non-zero means let the
    space have the default face, otherwise let it have the same face as
-   IT->face_id.
+   IT->face_id.  Value is non-zero if a space was added.
 
    This function is called to make sure that there is always one glyph
    at the end of a glyph row that the cursor can be set on under
@@ -10733,7 +10730,7 @@ compute_line_metrics (it)
    At the same time this space let's a nicely handle clearing to the
    end of the line if the row ends in italic text.  */
 
-static void
+static int
 append_space (it, default_face_p)
      struct it *it;
      int default_face_p;
@@ -10778,8 +10775,11 @@ append_space (it, default_face_p)
          it->what = saved_what;
          it->face_id = saved_face_id;
          it->charset = saved_charset;
+         return 1;
        }
     }
+
+  return 0;
 }
 
 
@@ -11005,13 +11005,11 @@ display_line (it)
       if (!get_next_display_element (it))
        {
          /* Maybe add a space at the end of this line that is used to
-            display the cursor there under X.  */
-         append_space (it, 1);
-
-         /* The position -1 below indicates a blank line not
-            corresponding to any text, as opposed to an empty line
-            corresponding to a line end.  */
-         if (row->used[TEXT_AREA] <= 1)
+            display the cursor there under X.  Set the charpos of the
+            first glyph of blank lines not corresponding to any text
+            to -1.  */
+         if ((append_space (it, 1) && row->used[TEXT_AREA] == 1)
+             || row->used[TEXT_AREA] == 0)
            {
              row->glyphs[TEXT_AREA]->charpos = -1;
              row->displays_text_p = 0;