branch: externals/posframe commit 3f96881825fe289483a46ae870e518a3fc5c451e Author: Feng Shu <tuma...@163.com> Commit: Feng Shu <tuma...@163.com>
Fix: "doesn't work if the buffer is empty" --- posframe.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/posframe.el b/posframe.el index 6a23f03..6fc32c6 100644 --- a/posframe.el +++ b/posframe.el @@ -531,9 +531,11 @@ you can use `posframe-delete-all' to delete all posframes." "Get the font's height at POSITION." (if (eq position (car posframe--last-font-height-info)) (cdr posframe--last-font-height-info) - (let* ((font (font-at (if (and (= position (point-max))) - (- position 1) - position))) + (let* ((font (when (and (integerp position) + (not (= position 1))) + (font-at (if (and (= position (point-max))) + (- position 1) + position)))) (height (when (integerp position) (if (or (= position 1) (not (fontp font))) (default-line-height)