aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Rudalics2016-06-24 09:59:50 +0200
committerMartin Rudalics2016-06-24 09:59:50 +0200
commitdc49db725e2d1648cbf1f94cef6131d42b13237b (patch)
treee77bdc8ace666c6119b12107e1786e5450adbd36 /src
parent098347a9b4e16935fc2c9e08817896019e2f1879 (diff)
downloademacs-dc49db725e2d1648cbf1f94cef6131d42b13237b.tar.gz
emacs-dc49db725e2d1648cbf1f94cef6131d42b13237b.zip
Remove two uses of 'min' in Fwindow_text_pixel_size
* src/xdisp.c (Fwindow_text_pixel_size): Don't use 'min' since it calls move_it_to twice. Suggested by Eli Zaretskii.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 9df73f2d833..1289515d918 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -9979,18 +9979,21 @@ include the height of both, if present, in the return value. */)
9979 it.last_visible_x = max_x; 9979 it.last_visible_x = max_x;
9980 /* Actually, we never want move_it_to stop at to_x. But to make 9980 /* Actually, we never want move_it_to stop at to_x. But to make
9981 sure that move_it_in_display_line_to always moves far enough, 9981 sure that move_it_in_display_line_to always moves far enough,
9982 we set it to INT_MAX and specify MOVE_TO_X. Also bound width 9982 we set it to INT_MAX and specify MOVE_TO_X. */
9983 value by X-LIMIT. */ 9983 x = move_it_to (&it, end, INT_MAX, max_y, -1,
9984 x = min (move_it_to (&it, end, INT_MAX, max_y, -1, 9984 MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
9985 MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y), 9985 /* Don't return more than X-LIMIT. */
9986 max_x); 9986 if (x > max_x)
9987 x = max_x;
9987 } 9988 }
9988 9989
9989 /* Subtract height of header-line which was counted automatically by 9990 /* Subtract height of header-line which was counted automatically by
9990 start_display. */ 9991 start_display. */
9991 y = min (it.current_y + it.max_ascent + it.max_descent 9992 y = it.current_y + it.max_ascent + it.max_descent
9992 - WINDOW_HEADER_LINE_HEIGHT (w), 9993 - WINDOW_HEADER_LINE_HEIGHT (w);
9993 max_y); 9994 /* Don't return more than Y-LIMIT. */
9995 if (y > max_y)
9996 y = max_y;
9994 9997
9995 if (EQ (mode_and_header_line, Qheader_line) 9998 if (EQ (mode_and_header_line, Qheader_line)
9996 || EQ (mode_and_header_line, Qt)) 9999 || EQ (mode_and_header_line, Qt))