[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 272ca09 10/33: Use posframe-hide-frame instead make-frame-
From: |
Feng Shu |
Subject: |
[elpa] master 272ca09 10/33: Use posframe-hide-frame instead make-frame-invisible |
Date: |
Fri, 14 Dec 2018 06:21:15 -0500 (EST) |
branch: master
commit 272ca0966fe850e8598f7799f0e152e39e48371d
Author: Andy Stewart <address@hidden>
Commit: GitHub <address@hidden>
Use posframe-hide-frame instead make-frame-invisible
Hi, I'm AndyStewart from EmacsWiki, your posframe.el is awesome.
I found posframe--run-timeout-timer will trigger error once developer use
posframe-delete remove frame before posframe timer.
Error running timer ‘make-frame-invisible’: (wrong-type-argument
frame-live-p #<dead frame *sdcv* 0x63e7940>)
I build a new function posframe-hide-frame instead make-frame-invisible
that use frame-live-p check frame before delete.
---
posframe.el | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/posframe.el b/posframe.el
index 5b06d0c..7a568e6 100644
--- a/posframe.el
+++ b/posframe.el
@@ -5,7 +5,7 @@
;; Author: Feng Shu <address@hidden>
;; Maintainer: Feng Shu <address@hidden>
;; URL: https://github.com/tumashu/posframe
-;; Version: 0.4.0
+;; Version: 0.4.1
;; Keywords: tooltip
;; Package-Requires: ((emacs "26"))
@@ -372,7 +372,7 @@ you can use `posframe-delete-all' to delete all posframes."
(posframe--set-frame-position
posframe
(posframe-run-poshandler
- `(;All poshandlers will get info from this plist.
+ `( ;All poshandlers will get info from this plist.
:position ,position
:poshandler ,poshandler
:font-height ,font-height
@@ -475,7 +475,12 @@ This need PARENT-FRAME-WIDTH and PARENT-FRAME-HEIGHT"
(cancel-timer posframe--timeout-timer))
(setq-local posframe--timeout-timer
(run-with-timer
- secs nil #'make-frame-invisible posframe))))
+ secs nil #'posframe-hide-frame posframe))))
+
+(defun posframe-hide-frame (frame)
+ "This function used to instead `make-frame-invisible' to make hide frame
safely."
+ (when (frame-live-p frame)
+ (make-frame-invisible frame)))
(defun posframe--run-refresh-timer (posframe repeat
height min-height
@@ -503,7 +508,7 @@ WIDTH and MIN-WIDTH."
(let ((buffer-info (frame-parameter frame 'posframe-buffer)))
(when (or (equal posframe-buffer (car buffer-info))
(equal posframe-buffer (cdr buffer-info)))
- (make-frame-invisible frame)))))
+ (posframe-hide-frame frame)))))
(defun posframe-delete (posframe-buffer)
"Delete posframe which buffer POSFRAME-BUFFER."
@@ -537,7 +542,7 @@ This posframe's buffer is POSFRAME-BUFFER."
(interactive)
(dolist (frame (frame-list))
(let ((buffer-info (frame-parameter frame 'posframe-buffer)))
- (when buffer-info (make-frame-invisible frame)))))
+ (when buffer-info (posframe-hide-frame frame)))))
;;;###autoload
(defun posframe-delete-all ()
- [elpa] master 0ac1e46 06/33: Disable posframe-mouse-banish on macOS, (continued)
- [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
- [elpa] master 272ca09 10/33: Use posframe-hide-frame instead make-frame-invisible,
Feng Shu <=
- [elpa] master 5803070 19/33: posframe: Recreate posframe when internal-border-width changed, Feng Shu, 2018/12/14
- [elpa] master d115a5a 23/33: Merge pull request #13 from yqrashawn/empty-frame-name, Feng Shu, 2018/12/14
- [elpa] master 2f4baf0 31/33: Merge pull request #17 from jingqi/master, Feng Shu, 2018/12/14
- [elpa] master 7ba9d9d 25/33: posframe: Add posframe-poshandler-frame-top-center document, Feng Shu, 2018/12/14
- [elpa] master 1ed5492 20/33: posframe: Add face-remap argument, Feng Shu, 2018/12/14
- [elpa] master baa2289 30/33: Change to looser line-end-style specification, Feng Shu, 2018/12/14
- [elpa] master a0dfcde 22/33: use empty posframe title for window manager, Feng Shu, 2018/12/14
- [elpa] master 9768b0a 18/33: posframe: support internal-border-width, Feng Shu, 2018/12/14
- [elpa] master d09e283 28/33: * posframe.el (posframe-show, posframe--initialized-p): Rename posframe--initialize-p to posframe--initialized-p, Feng Shu, 2018/12/14
- [elpa] master 02b446a 27/33: posframe: Add initialize argument to posframe-show, Feng Shu, 2018/12/14