]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix last change
authorEli Zaretskii <eliz@gnu.org>
Sat, 18 Dec 2021 11:56:10 +0000 (13:56 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 18 Dec 2021 11:56:10 +0000 (13:56 +0200)
* src/xdisp.c (window_text_pixel_size): Fix whitespace and braces.

* src/xdisp.c (Fwindow_text_pixel_size):
* etc/NEWS:
* doc/lispref/display.texi (Size of Displayed Text): Improve
wording of the documentation of the new argument of
'window-text-pixel-size'.

doc/lispref/display.texi
etc/NEWS
src/xdisp.c

index 92bfd2fea196fb883e2acba41a743d30fd1c3d85..1460e070a0a1475bfa170269fb2a25ff3856a795 100644 (file)
@@ -2138,7 +2138,9 @@ height of all of these lines, if present, in the return value.
 
 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
index 20056b30c58289e3b7f60bf677c7d3ab22a39c5a..e3665b918a3ce3f5b79895a6874f5d31fa0e2cbb 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -985,9 +985,10 @@ This can be used to check whether a specific font has a glyph for a
 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
 
index 473c9f3f1436715052d50e6fb5860fb83287d747..6dcfe3573a9d6a8ef8b8b0747a01ca78e12acfdf 100644 (file)
@@ -10832,8 +10832,9 @@ in_display_vector_p (struct it *it)
    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;
@@ -10973,10 +10974,8 @@ window_text_pixel_size (Lisp_Object window, Lisp_Object from, Lisp_Object to, Li
 
          /* 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);
@@ -11105,8 +11104,8 @@ If it is the symbol `mode-line', 'tab-line' or `header-line', include
 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)
 {