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

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

[elpa] externals/popper 9b1cff1b57 061/102: Popups are updated correctly


From: ELPA Syncer
Subject: [elpa] externals/popper 9b1cff1b57 061/102: Popups are updated correctly now
Date: Fri, 8 Sep 2023 15:58:54 -0400 (EDT)

branch: externals/popper
commit 9b1cff1b571e90ad92f29f1c412afa91923535a7
Author: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmagalur@gmail.com>

    Popups are updated correctly now
    
    Open popups were not being removed from the buried popup alist, now they 
should be.
---
 popper.el | 37 ++++++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 15 deletions(-)

diff --git a/popper.el b/popper.el
index 9190e1a3a9..3897c27917 100644
--- a/popper.el
+++ b/popper.el
@@ -342,20 +342,25 @@ Each element of the alist is a cons cell of the form 
(window . buffer)."
                            (memq (buffer-local-value 'popper-popup-status (cdr 
win-buf))
                                  '(popup user-popup)))
                          (cl-set-difference popper-open-popup-alist 
open-popups :key #'cdr))))
-         (setq popper-open-popup-alist (nreverse open-popups))
-         (if popper-group-function
-             (cl-loop for (win . buf) in closed-popups do
-                      (let* ((group-name (with-current-buffer buf (funcall 
popper-group-function)))
-                             (group-popups (cdr (assoc group-name 
popper-buried-popup-alist 'equal)))
-                             (newpop (cons win buf)))
-                        (setf (alist-get group-name popper-buried-popup-alist
-                                         nil nil 'equal)
-                              (append (list newpop)
-                                      (cl-remove newpop group-popups :key 
'cdr)))))
-           (let ((old-popups (alist-get nil popper-buried-popup-alist)))
-             (setf (alist-get nil popper-buried-popup-alist)
-                   (append closed-popups
-                           (cl-set-difference old-popups closed-popups :key 
#'cdr))))))
+    (setq popper-open-popup-alist (nreverse open-popups))
+    ;; First remove all open popups that have been opened
+    (cl-loop for (win . buf) in open-popups do
+            (let* ((group-name (when popper-group-function
+                                 (with-current-buffer buf (funcall 
popper-group-function))))
+                   (group-popups (cdr (assoc group-name 
popper-buried-popup-alist 'equal))))
+              (setf (alist-get group-name popper-buried-popup-alist
+                               nil nil 'equal)
+                    (cl-remove buf group-popups :key #'cdr))))
+    ;; Then add all popups that have been closed
+    (cl-loop for (win . buf) in closed-popups do
+            (let* ((group-name (when popper-group-function
+                                 (with-current-buffer buf (funcall 
popper-group-function))))
+                    (group-popups (cdr (assoc group-name 
popper-buried-popup-alist 'equal)))
+                    (newpop (cons win buf)))
+               (setf (alist-get group-name popper-buried-popup-alist
+                                nil nil 'equal)
+                     (append (list newpop)
+                             (cl-remove newpop group-popups :key 'cdr))))))
   ;; Mode line update
   (cl-loop for (_ . buf) in popper-open-popup-alist do
              (with-current-buffer buf
@@ -429,7 +434,9 @@ a popup buffer to open."
   "Delete popup window WIN in a manner appropriate to its type."
   (when (window-valid-p win)
     (cond
-     ((window-parent win) (quit-window nil win))
+     ((window-parent win) (if (window-parameter win 'window-side)
+                             (delete-window win)
+                           (quit-window nil win)))
      ((frame-parent) (delete-frame))
      (t (quit-window nil win)))))
 



reply via email to

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