+DEFUN ("window-last-line-visible-height", Fwindow_last_line_visible_height, 0, 1, 0, /*
+Return pixel height of visible part of last window line if it is clipped.
+If the last line is not clipped, return nil.
+*/
+ (window))
+{
+ struct window *w = decode_window (window);
+ display_line_dynarr *dla = window_display_lines (w, CURRENT_DISP);
+ int num_lines = Dynarr_length (dla);
+ struct display_line *dl;
+
+ /* No lines - no clipped lines */
+ if (num_lines == 0 || (num_lines == 1 && Dynarr_atp (dla, 0)->modeline))
+ return Qnil;
+
+ dl = Dynarr_atp (dla, num_lines - 1);
+ if (dl->clip == 0)
+ return Qnil;
+
+ return make_int (dl->ascent + dl->descent - dl->clip);
+}
+