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

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

[elpa] externals/posframe e75f61ceec: * posframe.el (posframe--create-po


From: ELPA Syncer
Subject: [elpa] externals/posframe e75f61ceec: * posframe.el (posframe--create-posframe): Find existing posframe if possible.
Date: Fri, 7 Jan 2022 04:57:41 -0500 (EST)

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

    * posframe.el (posframe--create-posframe): Find existing posframe if 
possible.
---
 posframe.el | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/posframe.el b/posframe.el
index 3b16c1239c..94570ea637 100644
--- a/posframe.el
+++ b/posframe.el
@@ -202,13 +202,17 @@ ACCEPT-FOCUS."
 
       (add-hook 'kill-buffer-hook #'posframe-auto-delete nil t)
 
+      ;; Find existing posframe: Sometimes, the buffer of posframe
+      ;; will be recreated by other packages, so we should find
+      ;; existing posframe first if possible.
+      (unless (or posframe--frame posframe--last-args)
+        (setq-local posframe--frame
+                    (posframe--find-existing-posframe buffer-or-name))
+        (setq-local posframe--last-args args))
+
       ;; Create child-frame
-      (unless (and (frame-live-p (or posframe--frame
-                                     ;; Sometimes, the buffer of posframe will 
be
-                                     ;; recreated by other packages,
-                                     ;; so we should reuse exist
-                                     ;; posframe as far as possible.
-                                     (posframe--find-existing-posframe 
buffer-or-name)))
+      (unless (and posframe--frame
+                   (frame-live-p posframe--frame)
                    ;; For speed reason, posframe will reuse
                    ;; existing frame at possible, but when
                    ;; user change args, recreating frame



reply via email to

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