branch: externals/dtache commit e3a12a9dc86c2f636370694a183e4bfb39088739 Author: Niklas Eklund <niklas.ekl...@posteo.net> Commit: Niklas Eklund <niklas.ekl...@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."