[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Is there a built-in way to tell how many lines are in a window in a give
Is there a built-in way to tell how many lines are in a window in a given face?
Sat, 15 Apr 2017 01:14:43 -0400
But if I want to know how tall a window is in terms of characters of a given face, I don't think there's a built-in method to do so. At least, I can't seem to find it.
So I wrote one. This would be nice to get into Emacs if I haven't missed any existing functionality. My code :
(defun zck--window-max-lines-per-window (face &optional window)
"Calculate how many lines of text with face FACE can fit in WINDOW."
(truncate (window-body-height window t)
(window-font-height window face)))
- Is there a built-in way to tell how many lines are in a window in a given face?,
Zachary Kanfer <=