Commit 8366b4e0 authored by Christer Ekholm's avatar Christer Ekholm
Browse files

Merge branch 'kill-keep-alive-with-buffer' into 'master'

Terminate keep-alive in kill-buffer-hook

Since lyskom-keep-alive-timers is a buffer-local variable,
lyskom-keep-alive-callback can't stop the keep-alive timer
if the buffer has been killed.  As a result, it keeps saying ERROR! in
the mini buffer.

On an idea from Christer Ekholm, terminate the timer explicitly with a
kill-buffer-hook instead.  The error logging in
lyskom-keep-alive-callback has been improved too, to provide more
information on what went wrong if there are other error situations in
the future.

See merge request !2
parents ee45a027 c74c4bbc
2015-12-11 Peter Liljenberg <>
* commands2.el: Terminate keep-alive with kill-buffer-hook, as
lyskom-keep-alive-callback can't do it once the buffer is killed.
Also improve error logging in the callback.
2014-10-30 Christer Ekholm <>
* Makefile: Use cp -f to copy files to build-directory for target
......@@ -2373,13 +2373,14 @@ This command accepts text number prefix arguments \(see
(defun lyskom-keep-alive-callback (buffer)
(condition-case nil
(condition-case callback-error
(save-current-buffer (set-buffer buffer)
(if (eq (process-status lyskom-proc) 'open)
(initiate-get-time 'keep nil)
(message "Terminating keep-alive")))
(error (message "ERROR!") (lyskom-stop-keep-alive))))
(error (message "Error during keep-alive: %s" callback-error)
(def-kom-command kom-keep-alive ()
"Keep the LysKOM session alive by sending a request every once in a
......@@ -2423,7 +2424,12 @@ See `kom-keep-alive' for more information."
(mapc 'disable-timeout lyskom-keep-alive-timers)
(setq lyskom-keep-alive-timers nil))
(defun lyskom-buffer-kill-keep-alive-hook ()
(if lyskom-keep-alive-timers
(message "Terminating keep-alive for buffer %s" (buffer-name (current-buffer))))
(add-hook 'kill-buffer-hook 'lyskom-buffer-kill-keep-alive-hook)
;;; ========================================================================
;;; Check (if Person is a) member (of Conference)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment