[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master f88138f 03/33: posframe: Add posframe--last-poshandler-inf
From: |
Feng Shu |
Subject: |
[elpa] master f88138f 03/33: posframe: Add posframe--last-poshandler-info |
Date: |
Fri, 14 Dec 2018 06:21:13 -0500 (EST) |
branch: master
commit f88138f4763136da3e8122c9720cfaf252c7337a
Author: Feng Shu <address@hidden>
Commit: Feng Shu <address@hidden>
posframe: Add posframe--last-poshandler-info
* posframe.el (posframe--last-poshandler-info): New variable
(posframe-run-poshandler): Use posframe--last-poshandler-info to cache
---
posframe.el | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/posframe.el b/posframe.el
index 628aa9a..4b76901 100644
--- a/posframe.el
+++ b/posframe.el
@@ -120,6 +120,9 @@
(defvar-local posframe--last-parent-frame-size nil
"Record the last size of posframe's parent-frame.")
+(defvar-local posframe--last-poshandler-info nil
+ "Record the last poshandler info.")
+
(defvar-local posframe--last-args nil
"Record the last arguments of `posframe--create-posframe'.
@@ -552,17 +555,20 @@ This function is used by `kill-buffer-hook'."
the structure of INFO can be found in docstring
of `posframe-show'."
- (funcall
- (or (plist-get info :poshandler)
- (let ((position (plist-get info :position)))
- (cond ((integerp position)
- #'posframe-poshandler-point-bottom-left-corner)
- ((and (consp position)
- (integerp (car position))
- (integerp (cdr position)))
- #'posframe-poshandler-absolute-x-y)
- (t (error "Posframe: have no valid poshandler")))))
- info))
+ (if (equal info posframe--last-poshandler-info)
+ posframe--last-posframe-pixel-position
+ (setq posframe--last-poshandler-info info)
+ (funcall
+ (or (plist-get info :poshandler)
+ (let ((position (plist-get info :position)))
+ (cond ((integerp position)
+ #'posframe-poshandler-point-bottom-left-corner)
+ ((and (consp position)
+ (integerp (car position))
+ (integerp (cdr position)))
+ #'posframe-poshandler-absolute-x-y)
+ (t (error "Posframe: have no valid poshandler")))))
+ info)))
(defun posframe-poshandler-absolute-x-y (info)
"Posframe's position hanlder.
- [elpa] master updated (d461e05 -> 769adaa), Feng Shu, 2018/12/14
- [elpa] master 0e031b3 02/33: posframe: posframe--last-position -> posframe--last-posframe-pixel-position, Feng Shu, 2018/12/14
- [elpa] master c29228e 01/33: posframe: update README.md, Feng Shu, 2018/12/14
- [elpa] master 3a8c29e 05/33: posframe: version 0.4.0, Feng Shu, 2018/12/14
- [elpa] master 2e8003e 04/33: posframe: Add posframe--last-font-height-info., Feng Shu, 2018/12/14
- [elpa] master f88138f 03/33: posframe: Add posframe--last-poshandler-info,
Feng Shu <=
- [elpa] master 0ac1e46 06/33: Disable posframe-mouse-banish on macOS, Feng Shu, 2018/12/14
- [elpa] master 26d36c7 07/33: Account for frame height and width when repositioning, Feng Shu, 2018/12/14
- [elpa] master d8ec23d 13/33: posframe-hide-frame -> posframe--make-frame-invisible, Feng Shu, 2018/12/14
- [elpa] master fe30ee8 09/33: Merge pull request #7 from raxod502/feat/mouse-banish-on-macos, Feng Shu, 2018/12/14
- [elpa] master c94bf8a 08/33: Merge pull request #9 from aaronjensen/account-for-frame-height-and-width-when-positioning, Feng Shu, 2018/12/14
- [elpa] master 4c31de2 11/33: Merge pull request #10 from manateelazycat/patch-1, Feng Shu, 2018/12/14
- [elpa] master b79f1ce 17/33: posframe: Add fullscreen parameter, Feng Shu, 2018/12/14
- [elpa] master 713a4ef 12/33: Fix indent, Feng Shu, 2018/12/14
- [elpa] master c048016 14/33: Add posframe-poshandler-frame-top-left/right-corner, Feng Shu, 2018/12/14
- [elpa] master c156667 15/33: Add more information to README, Feng Shu, 2018/12/14