}
DEFUN ("window-truncated-p", Fwindow_truncated_p, 0, 1, 0, /*
-Returns Non-Nil iff the window is truncated.
+Returns non-nil if text in the window is truncated.
*/
(window))
{
}
}
+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);
+}
+
DEFUN ("set-window-point", Fset_window_point, 2, 2, 0, /*
Make point value in WINDOW be at position POS in WINDOW's buffer.
*/
}
static size_t
-sizeof_window_config (CONST void *h)
+sizeof_window_config (const void *h)
{
- CONST struct window_config *c = (CONST struct window_config *) h;
+ const struct window_config *c = (const struct window_config *) h;
return sizeof_window_config_for_n_windows (c->saved_windows_count);
}
void
syms_of_window (void)
{
+ INIT_LRECORD_IMPLEMENTATION (window);
+ INIT_LRECORD_IMPLEMENTATION (window_configuration);
+
defsymbol (&Qwindowp, "windowp");
defsymbol (&Qwindow_live_p, "window-live-p");
defsymbol (&Qwindow_configurationp, "window-configuration-p");
DEFSUBR (Fwindow_point);
DEFSUBR (Fwindow_start);
DEFSUBR (Fwindow_end);
+ DEFSUBR (Fwindow_last_line_visible_height);
DEFSUBR (Fset_window_point);
DEFSUBR (Fset_window_start);
DEFSUBR (Fwindow_dedicated_p);