branch: externals/posframe commit e02cd647dab509eebdee6ff6e2e4c270aab18e2f Merge: 219ed02 2e89f6b Author: tumashu <tuma...@163.com> Commit: GitHub <nore...@github.com>
Merge pull request #32 from hexmode/fix-face Make posframe work for `emacs -nw` --- posframe.el | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/posframe.el b/posframe.el index 7ef18a2..6a23f03 100644 --- a/posframe.el +++ b/posframe.el @@ -531,15 +531,13 @@ 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 ((height (when (integerp position) - (if (= position 1) - (default-line-height) - (aref (font-info - (font-at - (if (and (= position (point-max))) - (- position 1) - position))) - 3))))) + (let* ((font (font-at (if (and (= position (point-max))) + (- position 1) + position))) + (height (when (integerp position) + (if (or (= position 1) (not (fontp font))) + (default-line-height) + (aref (font-info font) 3))))) (setq posframe--last-font-height-info (cons position height)) height)))