branch: externals/posframe
commit b29af47590e39c6662665bd863a4b2608ce3ca6c
Author: Marek L <[email protected]>
Commit: Marek L <[email protected]>

    Implement `posframe-text-scale-factor-default` instead of usign alias for 
`identity`
    
    Relates to:
    
https://github.com/tumashu/posframe/pull/148/files#diff-9a080c9b0c27364a583e07b2b6f8bf
---
 posframe.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/posframe.el b/posframe.el
index 3753eb57d7..239ff0cd54 100644
--- a/posframe.el
+++ b/posframe.el
@@ -62,13 +62,10 @@ custom function for EXWM users."
   "The function to adjust value of text-scale of posframe buffer.
 
 Accepts single argument which is the value of parent buffer 
`text-scale-mode-amount'
-or nil if the `text-scale-mode' is disabled in the parent buffer.
-`posframe-text-scale-factor-default' is an alias for `identity' function."
+or nil if the `text-scale-mode' is disabled in the parent buffer."
   :group 'posframe
   :type 'function)
 
-(defalias #'posframe-text-scale-factor-default #'identity)
-
 (defvar-local posframe--frame nil
   "Record posframe's frame.")
 
@@ -1532,6 +1529,11 @@ window manager selects it."
              (not posframe--accept-focus))
     (redirect-frame-focus posframe--frame (frame-parent))))
 
+(defun posframe-text-scale-factor-default (parent-text-scale-mode-amount)
+  "Return PARENT-TEXT-SCALE-MODE-AMOUNT or 0 if it is nil.
+This ensures text scale factor is always a number for posframe display."
+  (or parent-text-scale-mode-amount 0))
+
 (provide 'posframe)
 
 ;;; posframe.el ends here

Reply via email to