branch: externals/posframe
commit 9a1a17b976500d00ebff588bd96b1607ea6c738a
Author: Štěpán Němec <[email protected]>
Commit: Štěpán Němec <[email protected]>
Fix incorrect current-buffer bug in 'posframe-show'
The function 'font-at' (called from 'posframe--get-font-height')
signals an error when the current buffer is different from the one
displayed in the selected window.
Make sure the correct buffer is current.
(This is not theoretical, I have actually bumped into the error
myself. It is not guaranteed that selected-window matches
current-buffer during 'posframe-show' invocation.)
---
posframe.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/posframe.el b/posframe.el
index 51bd925..6d99782 100644
--- a/posframe.el
+++ b/posframe.el
@@ -471,7 +471,8 @@ you can use `posframe-delete-all' to delete all posframes."
(parent-frame-width (frame-pixel-width parent-frame))
(parent-frame-height (frame-pixel-height parent-frame))
(font-width (default-font-width))
- (font-height (posframe--get-font-height position))
+ (font-height (with-current-buffer (window-buffer parent-window)
+ (posframe--get-font-height position)))
(mode-line-height (window-mode-line-height))
(minibuffer-height (window-pixel-height (minibuffer-window)))
(header-line-height (window-header-line-height parent-window))