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

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

[elpa] externals/activities 4c97e42709 1/3: windows-set: avoid frame rac


From: ELPA Syncer
Subject: [elpa] externals/activities 4c97e42709 1/3: windows-set: avoid frame race condition
Date: Tue, 9 Jul 2024 21:57:41 -0400 (EDT)

branch: externals/activities
commit 4c97e427094a0362b9b467d8c1a0d3a506bc3522
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: Adam Porter <adam@alphapapa.net>

    windows-set: avoid frame race condition
    
    window-set: bind frame in top let for race-condition fix
    
    windows-set: bind window-persistent-parameters in timer callback
    
    windows-set: pass selected frame as argument, don't copy params
    
    Remove reference to non-existent set-window-persistent-parameters
    
    window-set: further simplify immediate timer call
---
 activities.el | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/activities.el b/activities.el
index a03e2809de..b204199af1 100644
--- a/activities.el
+++ b/activities.el
@@ -250,8 +250,7 @@ discarded, such a bookmark could become stale."
         (cons 'window-side 'writable)
         (cons 'window-slot 'writable))
   "Additional window parameters to persist.
-See Info node `(elisp)Window Parameters'.  See also option
-`activities-set-window-persistent-parameters'."
+See Info node `(elisp)Window Parameters'."
   :type '(alist :key-type (symbol :tag "Window parameter")
                 :value-type (choice (const :tag "Not saved" nil)
                                     (const :tag "Saved" writable))))
@@ -639,17 +638,18 @@ activity's name is NAME."
 
 (defun activities--windows-set (state)
   "Set window configuration according to STATE."
-  (setf window-persistent-parameters (copy-sequence 
activities-window-persistent-parameters))
-  (pcase-let* ((window-persistent-parameters (append 
activities-window-persistent-parameters
-                                                     
window-persistent-parameters))
-               (state
-                ;; NOTE: We copy the state so as not to mutate the one in 
storage.
-                (activities--bufferize-window-state (copy-tree state))))
-    ;; HACK: Since `bookmark--jump-via' insists on calling a buffer-display
-    ;; function after handling the bookmark, we use an immediate timer to
-    ;; set the window configuration.
-    (run-at-time nil nil (lambda ()
-                           (window-state-put state (frame-root-window) 
'safe)))))
+  ;; HACK: Since `bookmark--jump-via' insists on calling a buffer-display
+  ;; function after handling the bookmark, we use an immediate timer to
+  ;; set the window configuration.
+  (run-at-time nil nil
+              (lambda (frame state)
+                (let ((window-persistent-parameters
+                       (append activities-window-persistent-parameters
+                               window-persistent-parameters)))
+                  (window-state-put state (frame-root-window frame) 'safe)))
+              (selected-frame)
+              ;; NOTE: We copy the state so as not to mutate the one in 
storage.
+              (activities--bufferize-window-state (copy-tree state))))
 
 (defun activities--bufferize-window-state (state)
   "Return window state STATE with its buffers reincarnated."



reply via email to

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