[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 2e8003e 04/33: posframe: Add posframe--last-font-height-in
From: |
Feng Shu |
Subject: |
[elpa] master 2e8003e 04/33: posframe: Add posframe--last-font-height-info. |
Date: |
Fri, 14 Dec 2018 06:21:13 -0500 (EST) |
branch: master
commit 2e8003eb7e110ecb011b4fd9966362388c7e16ab
Author: Feng Shu <address@hidden>
Commit: Feng Shu <address@hidden>
posframe: Add posframe--last-font-height-info.
* posframe.el (posframe--last-font-height-info): New variable.
(posframe--get-font-height): Use posframe--last-font-height-info.
---
posframe.el | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/posframe.el b/posframe.el
index 4b76901..393c1c0 100644
--- a/posframe.el
+++ b/posframe.el
@@ -123,6 +123,9 @@
(defvar-local posframe--last-poshandler-info nil
"Record the last poshandler info.")
+(defvar-local posframe--last-font-height-info nil
+ "Record the last font height info.")
+
(defvar-local posframe--last-args nil
"Record the last arguments of `posframe--create-posframe'.
@@ -394,15 +397,20 @@ you can use `posframe-delete-all' to delete all
posframes."
(defun posframe--get-font-height (position)
"Get the font's height at POSITION."
- (when (integerp position)
- (if (= position 1)
- (default-line-height)
- (aref (font-info
- (font-at
- (if (and (= position (point-max)))
- (- position 1)
- position)))
- 3))))
+ (if (eq position (car posframe--last-font-height-info))
+ (cdr posframe--last-font-height-info)
+ (let ((height (when (integerp position)
+ (if (= position 1)
+ (default-line-height)
+ (aref (font-info
+ (font-at
+ (if (and (= position (point-max)))
+ (- position 1)
+ position)))
+ 3)))))
+ (setq posframe--last-font-height-info
+ (cons position height))
+ height)))
(defun posframe--mouse-banish (frame)
"Banish mouse to the (0 . 0) of FRAME.
- [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 <=
- [elpa] master f88138f 03/33: posframe: Add posframe--last-poshandler-info, Feng Shu, 2018/12/14
- [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