emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/posframe 9a1a17b 08/40: Fix incorrect current-buffer bu


From: Feng Shu
Subject: [elpa] externals/posframe 9a1a17b 08/40: Fix incorrect current-buffer bug in 'posframe-show'
Date: Wed, 5 Feb 2020 04:27:17 -0500 (EST)

branch: externals/posframe
commit 9a1a17b976500d00ebff588bd96b1607ea6c738a
Author: Štěpán Němec <address@hidden>
Commit: Štěpán Němec <address@hidden>

    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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]