The optional argument @var{ignore-line-at-end} controls whether or
not to count the height of text in @var{to}'s screen line as part of
-the returned pixel-height.
+the returned pixel-height. This is useful if your Lisp program is
+only interested in the dimensions of text up to and excluding the
+visual beginning of @var{to}'s screen line.
@code{window-text-pixel-size} treats the text displayed in a window as a
whole and does not care about the size of individual lines. The
character.
+++
-** 'window-text-pixel-size' now accepts a new argument `ignore-line-at-end'.
-This controls whether or not the screen line at the end of the
-measured area will be counted during the height calculation.
+** 'window-text-pixel-size' now accepts a new argument 'ignore-line-at-end'.
+This controls whether or not the last screen line of the text being
+measured will be counted for the purpose of calculating the text
+dimensions.
** XDG support
set WINDOW's buffer to the buffer specified by its BUFFER_OR_NAME
argument. */
static Lisp_Object
-window_text_pixel_size (Lisp_Object window, Lisp_Object from, Lisp_Object to, Lisp_Object x_limit,
- Lisp_Object y_limit, Lisp_Object mode_lines, Lisp_Object ignore_line_at_end)
+window_text_pixel_size (Lisp_Object window, Lisp_Object from, Lisp_Object to,
+ Lisp_Object x_limit, Lisp_Object y_limit,
+ Lisp_Object mode_lines, Lisp_Object ignore_line_at_end)
{
struct window *w = decode_live_window (window);
struct it it;
/* DTRT if ignore_line_at_end is t. */
if (!NILP (ignore_line_at_end))
- {
- doff = (max (it.max_ascent, it.ascent)
- + max (it.max_descent, it.descent));
- }
+ doff = (max (it.max_ascent, it.ascent)
+ + max (it.max_descent, it.descent));
else
{
it.max_ascent = max (it.max_ascent, it.ascent);
only the height of that line, if present, in the return value. If t,
include the height of any of these, if present, in the return value.
-IGNORE-LINE-AT-END means to not add the height of the screen line at
-TO to the returned height. */)
+IGNORE-LINE-AT-END, if non-nil, means to not add the height of the
+screen line that includes TO to the returned height of the text. */)
(Lisp_Object window, Lisp_Object from, Lisp_Object to, Lisp_Object x_limit,
Lisp_Object y_limit, Lisp_Object mode_lines, Lisp_Object ignore_line_at_end)
{