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

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

[elpa] master 1b309a2 24/33: posframe: Add posframe-poshandler-frame-top


From: Feng Shu
Subject: [elpa] master 1b309a2 24/33: posframe: Add posframe-poshandler-frame-top-center
Date: Fri, 14 Dec 2018 06:21:17 -0500 (EST)

branch: master
commit 1b309a2f1531865c45d70cb8cdcec6aaf5f78f3d
Author: Feng Shu <address@hidden>
Commit: Feng Shu <address@hidden>

    posframe: Add posframe-poshandler-frame-top-center
    
    * posframe.el (posframe-poshandler-frame-top-center): New poshandler
---
 posframe.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/posframe.el b/posframe.el
index affc072..2262c44 100644
--- a/posframe.el
+++ b/posframe.el
@@ -728,6 +728,18 @@ be found in docstring of `posframe-show'."
               (plist-get info :posframe-height))
            2)))
 
+
+(defun posframe-poshandler-frame-top-center (info)
+  "Posframe's position handler.
+
+Get a position which let posframe stay onto its
+parent-frame's top center.  The structure of INFO can
+be found in docstring of `posframe-show'."
+  (cons (/ (- (plist-get info :parent-frame-width)
+              (plist-get info :posframe-width))
+           2)
+        0))
+
 (defun posframe-poshandler-frame-top-left-corner (_info)
   "Posframe's position handler.
 



reply via email to

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