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

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

[elpa] externals/posframe 3eaae4b 1/3: Add posframe-hidehandler-daemon-f


From: ELPA Syncer
Subject: [elpa] externals/posframe 3eaae4b 1/3: Add posframe-hidehandler-daemon-function
Date: Fri, 4 Jun 2021 02:57:12 -0400 (EDT)

branch: externals/posframe
commit 3eaae4b7c8f8a5991cf3d2ba9fafc1458e573e17
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>

    Add posframe-hidehandler-daemon-function
    
        * posframe.el (posframe-hidehandler-daemon-function): New function.
        (posframe-hidehandler-daemon): Use posframe-hidehandler-daemon-function.
---
 posframe.el | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/posframe.el b/posframe.el
index 5ceb3a8..b1d06e3 100644
--- a/posframe.el
+++ b/posframe.el
@@ -856,24 +856,25 @@ BUFFER-OR-NAME can be a buffer or a buffer name."
 
 ;; Remove in the future.
 (defun posframe-hidehandler-daemon ()
-  "Run posframe hidehandler."
+  "Run posframe hidehandler daemon."
   (when posframe-hidehandler-timer
     (cancel-timer posframe-hidehandler-timer))
   (setq posframe-hidehandler-timer
-        (run-with-idle-timer
-         1 t
-         (lambda ()
-           (ignore-errors
-             (dolist (frame (frame-list))
-               (let ((hidehandler (frame-parameter frame 
'posframe-hidehandler))
-                     (buffer (frame-parameter frame 'posframe-buffer))
-                     (parent-buffer (frame-parameter frame 
'posframe-parent-buffer)))
-                 (when (and hidehandler
-                            (funcall hidehandler
-                                     (list
-                                      :posframe-buffer buffer
-                                      :posframe-parent-buffer parent-buffer)))
-                   (posframe--make-frame-invisible frame)))))))))
+        (run-with-idle-timer 0.5 t #'posframe-hidehandler-daemon-function)))
+
+(defun posframe-hidehandler-daemon-function ()
+  "Posframe hidehandler daemon function."
+  (ignore-errors
+    (dolist (frame (frame-list))
+      (let ((hidehandler (frame-parameter frame 'posframe-hidehandler))
+            (buffer (frame-parameter frame 'posframe-buffer))
+            (parent-buffer (frame-parameter frame 'posframe-parent-buffer)))
+        (when (and hidehandler
+                   (funcall hidehandler
+                            (list
+                             :posframe-buffer buffer
+                             :posframe-parent-buffer parent-buffer)))
+          (posframe--make-frame-invisible frame))))))
 
 (posframe-hidehandler-daemon)
 (remove-hook 'post-command-hook #'posframe-run-hidehandler)



reply via email to

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