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

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

[elpa] externals/dtache e3a12a9dc8 073/158: Add connection local variabl


From: ELPA Syncer
Subject: [elpa] externals/dtache e3a12a9dc8 073/158: Add connection local variable to timer
Date: Wed, 19 Jan 2022 18:57:59 -0500 (EST)

branch: externals/dtache
commit e3a12a9dc86c2f636370694a183e4bfb39088739
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>

    Add connection local variable to timer
    
    This allows users to have different timer settings for different
    remote hosts. This is useful for those that work on a remote host a
    lot and want to have the timer run more often on that host.
---
 dtache.el | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/dtache.el b/dtache.el
index cd67544df4..b533022bd6 100644
--- a/dtache.el
+++ b/dtache.el
@@ -793,17 +793,18 @@ Optionally CONCAT the command return command into a 
string."
 (defun dtache--session-timer-monitor (session)
   "Configure a timer to monitor SESSION activity.
  The timer object is configured according to `dtache-timer-configuration'."
-  (let* ((timer)
-         (callback
-          (lambda ()
-            (when (dtache--session-deactivated-p session)
-              (dtache--session-final-update session)
-              (cancel-timer timer)))))
-    (setq timer
-          (funcall (plist-get dtache-timer-configuration :function)
-                   (plist-get dtache-timer-configuration :seconds)
-                   (plist-get dtache-timer-configuration :repeat)
-                   callback))))
+  (with-connection-local-variables
+   (let* ((timer)
+          (callback
+           (lambda ()
+             (when (dtache--session-deactivated-p session)
+               (dtache--session-final-update session)
+               (cancel-timer timer)))))
+     (setq timer
+           (funcall (plist-get dtache-timer-configuration :function)
+                    (plist-get dtache-timer-configuration :seconds)
+                    (plist-get dtache-timer-configuration :repeat)
+                    callback)))))
 
 (defun dtache--session-filenotify-monitor (session)
   "Configure `filenotify' to monitor SESSION activity."



reply via email to

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