[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/posframe b3028b0 2/6: Add posframe-poshandler-point-bot
From: |
Feng Shu |
Subject: |
[elpa] externals/posframe b3028b0 2/6: Add posframe-poshandler-point-bottom-left-corner-upward |
Date: |
Mon, 3 Aug 2020 03:35:28 -0400 (EDT) |
branch: externals/posframe
commit b3028b01a96699b1dfc9b2b5f4e3ba2bc1aa8317
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>
Add posframe-poshandler-point-bottom-left-corner-upward
* posframe.el (posframe-show): Add
`posframe-poshandler-point-bottom-left-corner-upward' info to docstring.
(posframe-poshandler-point-bottom-left-corner): Add upward argument.
(posframe-poshandler-point-bottom-left-corner-upward): New function.
---
posframe.el | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/posframe.el b/posframe.el
index bb1c0bf..dd19b4d 100644
--- a/posframe.el
+++ b/posframe.el
@@ -451,6 +451,7 @@ The builtin poshandler functions are listed below:
14. `posframe-poshandler-window-bottom-right-corner'
15. `posframe-poshandler-point-top-left-corner'
16. `posframe-poshandler-point-bottom-left-corner'
+17. `posframe-poshandler-point-bottom-left-corner-upward'
This posframe's buffer is BUFFER-OR-NAME, which can be a buffer
or a name of a (possibly nonexistent) buffer.
@@ -896,7 +897,7 @@ of `posframe-show'."
(cons (+ (car position) x-pixel-offset)
(+ (cdr position) y-pixel-offset))))
-(defun posframe-poshandler-point-bottom-left-corner (info &optional
font-height)
+(defun posframe-poshandler-point-bottom-left-corner (info &optional
font-height upward)
"Posframe's position hanlder.
Get bottom-left-corner pixel position of a point,
@@ -929,10 +930,22 @@ Optional argument FONT-HEIGHT ."
(font-height (or font-height (plist-get info :font-height)))
(y-bottom (+ y-top font-height)))
(cons (max 0 (min x (- xmax (or posframe-width 0))))
- (max 0 (if (> (+ y-bottom (or posframe-height 0)) ymax)
+ (max 0 (if (if upward
+ (> (- y-bottom (or posframe-height 0)) 0)
+ (> (+ y-bottom (or posframe-height 0)) ymax))
(- y-top (or posframe-height 0))
y-bottom)))))
+(defun posframe-poshandler-point-bottom-left-corner-upward (info)
+ "Posframe's position hanlder.
+
+Get a position of a point, by which posframe can put above it,
+the structure of INFO can be found in docstring
+of `posframe-show'.
+
+Optional argument FONT-HEIGHT ."
+ (posframe-poshandler-point-bottom-left-corner info nil t))
+
(defun posframe-poshandler-point-top-left-corner (info)
"Posframe's position hanlder.
@@ -955,7 +968,6 @@ be found in docstring of `posframe-show'."
(plist-get info :posframe-height))
2)))
-
(defun posframe-poshandler-frame-top-center (info)
"Posframe's position handler.
- [elpa] externals/posframe updated (922e4d2 -> ca15414), Feng Shu, 2020/08/03
- [elpa] externals/posframe 0144261 4/6: * posframe.el (posframe--create-posframe): Re-create frame when accept-focus change., Feng Shu, 2020/08/03
- [elpa] externals/posframe 6d604a7 5/6: * posframe.el (posframe-hide): let posframe-hide can work as buffer-list-update-hook function, Feng Shu, 2020/08/03
- [elpa] externals/posframe 2d55988 3/6: Merge pull request #68 from tumashu/accept-focus, Feng Shu, 2020/08/03
- [elpa] externals/posframe b3028b0 2/6: Add posframe-poshandler-point-bottom-left-corner-upward,
Feng Shu <=
- [elpa] externals/posframe 8d5cc3b 1/6: * posframe.el (posframe--create-posframe, posframe-show): Add accept-focus argument., Feng Shu, 2020/08/03
- [elpa] externals/posframe ca15414 6/6: Provide argument which will cause posframe to hide when user switches the buffer #69, Feng Shu, 2020/08/03