diff options
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/window.c b/src/window.c index 20084a15c16..31e9782b4a8 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -4970,25 +4970,21 @@ window_wants_header_line (struct window *w) | |||
| 4970 | : 0); | 4970 | : 0); |
| 4971 | } | 4971 | } |
| 4972 | 4972 | ||
| 4973 | /* Return number of lines of text (not counting mode lines) in W. */ | 4973 | /* Return number of lines of text in window W, not counting the mode |
| 4974 | line and header line, if any. Do NOT use this for windows on GUI | ||
| 4975 | frames; use window_body_height instead. This function is only for | ||
| 4976 | windows on TTY frames, where it is much more efficient. */ | ||
| 4974 | 4977 | ||
| 4975 | int | 4978 | int |
| 4976 | window_internal_height (struct window *w) | 4979 | window_internal_height (struct window *w) |
| 4977 | { | 4980 | { |
| 4978 | int ht = w->total_lines; | 4981 | int ht = w->total_lines; |
| 4979 | 4982 | ||
| 4980 | if (!MINI_WINDOW_P (w)) | 4983 | if (window_wants_mode_line (w)) |
| 4981 | { | 4984 | --ht; |
| 4982 | if (!NILP (w->parent) | ||
| 4983 | || WINDOWP (w->contents) | ||
| 4984 | || !NILP (w->next) | ||
| 4985 | || !NILP (w->prev) | ||
| 4986 | || window_wants_mode_line (w)) | ||
| 4987 | --ht; | ||
| 4988 | 4985 | ||
| 4989 | if (window_wants_header_line (w)) | 4986 | if (window_wants_header_line (w)) |
| 4990 | --ht; | 4987 | --ht; |
| 4991 | } | ||
| 4992 | 4988 | ||
| 4993 | return ht; | 4989 | return ht; |
| 4994 | } | 4990 | } |
| @@ -5017,8 +5013,8 @@ window_scroll (Lisp_Object window, EMACS_INT n, bool whole, bool noerror) | |||
| 5017 | if (whole && Vfast_but_imprecise_scrolling) | 5013 | if (whole && Vfast_but_imprecise_scrolling) |
| 5018 | specbind (Qfontification_functions, Qnil); | 5014 | specbind (Qfontification_functions, Qnil); |
| 5019 | 5015 | ||
| 5020 | /* If we must, use the pixel-based version which is much slower than | 5016 | /* On GUI frames, use the pixel-based version which is much slower |
| 5021 | the line-based one but can handle varying line heights. */ | 5017 | than the line-based one but can handle varying line heights. */ |
| 5022 | if (FRAME_WINDOW_P (XFRAME (XWINDOW (window)->frame))) | 5018 | if (FRAME_WINDOW_P (XFRAME (XWINDOW (window)->frame))) |
| 5023 | window_scroll_pixel_based (window, n, whole, noerror); | 5019 | window_scroll_pixel_based (window, n, whole, noerror); |
| 5024 | else | 5020 | else |