Commit 998cf2ff authored by David Byers's avatar David Byers
Browse files

Added kom-keep-alive and kom-stop-keep-alive commands.

Bumped version number to BETA-I.
parent 57590382
2000-03-15 David Byers <>
* option-edit.el (lyskom-create-widget): Use `-' and not `!' in
help button when documentation is visible.
(lyskom-customize-buffer-format): Added kom-keep-alive-interval.
(lyskom-custom-variables): Ditto.
* command.el (lyskom-start-of-command): Print special message if
called in something that does not look like it has ever been a
LysKOM buffer.
* commands2.el (lyskom-keep-alive-timers): New variable.
(lyskom-keep-alive-callback): New function.
(kom-keep-alive): New command.
(lyskom-keep-alive): New function.
(kom-stop-keep-alive): New command.
(lyskom-stop-keep-alive): New function.
* (kom-keep-alive-interval): New variable.
* lyskom-rest.el (lyskom-debug-insert): Fixed bug that caused
debug output to be inserted in LysKOM buffer (took five seconds to
do, has been put off for *years*).
* Release av 0.46-BETA-H
* view-text.el (lyskom-format-mx-author): Make mx-from clickable.
......@@ -36,7 +36,7 @@
# makefile too!
......@@ -236,9 +236,14 @@ This function checks if lyskom-doing-default-command and
lyskom-first-time-around are bound. The text entered in the buffer is
chosen according to this"
(if (or (not lyskom-proc)
(memq (process-status lyskom-proc) '(closed signal exited nil)))
(lyskom-error "%s" (lyskom-get-string 'dead-session)))
(cond ((or (not (boundp 'lyskom-proc))
(not (boundp 'lyskom-buffer))
(and (null lyskom-proc) (null lyskom-buffer)))
(lyskom-error "%s" (lyskom-get-string 'not-lyskom-buffer)))
((or (not lyskom-proc)
(memq (process-status lyskom-proc) '(closed signal exited nil)))
(lyskom-error "%s" (lyskom-get-string 'dead-session))))
(if (and lyskom-is-waiting
(listp lyskom-is-waiting))
......@@ -2263,3 +2263,53 @@ Return-value: 'no-session if there is no suitable session to switch to
(lyskom-format-insert "%#1t" (aux-item->data el))
(lyskom-insert "\n"))
;;; ============================================================
;;; Keep-alive
;;; Author: ceder, byers
(def-kom-var lyskom-keep-alive-timers nil
"List of all active keep alive timers"
(defun lyskom-keep-alive-callback (buffer)
(condition-case nil
(save-excursion (set-buffer buffer)
(if (eq (process-status lyskom-proc) 'open)
(initiate-get-time 'keep nil)
(error (lyskom-stop-keep-alive))))
(def-kom-command kom-keep-alive ()
"Keep the LysKOM session alive by sending a request every once in a while.
The variable kom-keep-alive-interval controls the frequency of the request."
(set-buffer lyskom-buffer)
(unless (eq (current-buffer) lyskom-buffer)
(lyskom-message 'start-keep-alive kom-keep-alive-interval))
(lyskom-format-insert 'start-keep-alive kom-keep-alive-interval)
(lyskom-insert "\n"))
(defun lyskom-keep-alive ()
(setq lyskom-keep-alive-timers
(run-with-timer kom-keep-alive-interval kom-keep-alive-interval 'lyskom-keep-alive-callback (current-buffer))
(def-kom-command kom-stop-keep-alive ()
"Stop sending periodic requests to keep the session alive."
(unless (eq (current-buffer) lyskom-buffer)
(lyskom-message "%#1s" 'stop-keep-alive))
(lyskom-insert 'stop-keep-alive)
(lyskom-insert "\n"))
(defun lyskom-stop-keep-alive ()
(mapcar 'cancel-timer lyskom-keep-alive-timers)
(setq lyskom-keep-alive-timers nil))
......@@ -1040,6 +1040,7 @@ You should set it to a better value.\n")
(process-signal . "Signal from the process.")
(dead-session . "No active LysKOM session.")
(not-lyskom-buffer . "This is not an active LysKOM session")
(closed-connection . "
......@@ -1385,6 +1386,9 @@ You must become an active member of the conference to enter it.\n")
(you-are-nonanonymous . "You are no longer anonymous.\n")
(you-are-already-anonymous . "You are already somewhat anonymous.\n")
(you-are-already-nonanonymous . "You are alreay non-anonymous.\n")
(start-keep-alive . "Sending data at %#1d second intervals to keep the connection active.")
(stop-keep-alive . "No longer keeping connection active by sending extra data.")
......@@ -1541,6 +1545,9 @@ You must become an active member of the conference to enter it.\n")
(kom-become-anonymous . "Become anonymous")
(kom-become-nonanonymous . "Become non-anonymous (come forth into the light)")
(kom-keep-alive . "Keep connection alive")
(kom-stop-keep-alive . "Stop keeping connection alive")
(lyskom-language-var lyskom-language-codes en
......@@ -2988,6 +2995,11 @@ be saved in the server. Otherwise it will be saved in your .emacs.")
number or a conference name, the client will accept it as a conference
number, if possible. When this is off, the text will be accepted as
a conference name first and number second.")
(kom-keep-alive-interval-doc . "\
The number of seconds between calls to the server used to keep the
network connection to the LysKOM server active. If your network connection
shuts down after a period of inactivity, set this to approximately half
that period and use the command `Keep connection alive'.")
;; Tags for variables
......@@ -3135,6 +3147,7 @@ be saved in the server. Otherwise it will be saved in your .emacs.")
(kom-server-priority-tag . "Session priority")
(kom-server-priority-breaks-tag . "Prompt to go to next LysKOM")
(kom-complete-numbers-before-names-tag . "Read conference numbers before names")
(kom-keep-alive-interval-tag . "Keep connection alive interval")
......@@ -3225,6 +3225,7 @@ If MEMBERSHIPs prioriy is 0, it always returns nil."
(select-window win)
(set-buffer buf)
(let ((move (eobp)))
(goto-char (point-max))
......@@ -78,6 +78,7 @@
......@@ -642,6 +643,7 @@ customize buffer but do not save them to the server."
(kom-bury-buffers (toggle (on off)))
(kom-ansaphone-replies (ansaphone))
(kom-complete-numbers-before-names (toggle (on off)))
(kom-keep-alive-interval (number))
(defvar lyskom-widget-functions
......@@ -731,7 +733,7 @@ customize buffer but do not save them to the server."
(lyskom-custom-string doc-sym)
(lyskom-custom-string 'hide-doc)
(list 'short
......@@ -1052,6 +1052,7 @@ Du b
Lyskom-sessionen onormalt stngd.
Felmeddelande: %#1s**************************************************")
(dead-session . "LysKOM-sessionen r inte aktiv.")
(not-lyskom-buffer . "Detta r inte en aktiv LysKOM-session.")
(error-not-found . "Fel nummer %#1d. Ingen klartextfrklaring finns.")
;; Useful in more place than one:
......@@ -1392,6 +1393,9 @@ Du m
(you-are-nonanonymous . "Du r inte lngre anonym.\n")
(you-are-already-anonymous . "Du r redan ngorlunda anonym.\n")
(you-are-already-nonanonymous . "Du r redan icke-anonym.\n")
(start-keep-alive . "Snder data %#1d sekunders mellanrum fr att hlla frbindelsen aktiv.")
(stop-keep-alive . "Data snds inte lngre fr att hlla frbindelsen aktiv.")
......@@ -1551,6 +1555,9 @@ Du m
(kom-review-mail-headers . "terse brevhuvud")
(kom-become-anonymous . "Bli anonym")
(kom-become-nonanonymous . "Bli icke-anonym (trd fram ur skuggorna)")
(kom-keep-alive . "Hll frbindelsen aktiv")
(kom-stop-keep-alive . "Avbryt hll frbindelsen aktiv")
(lyskom-language-var lyskom-language-codes sv
......@@ -3044,6 +3051,11 @@ i servern. Annars sparas det i din .emacs.")
ett mtesnamn eller ett mtesnummer vid inlsning av mtesnamn, s
tolkar klienten det i frsta hand som ett nummer. Nr detta r avslaget
s tolkas det i frsta hand som ett mtesnamn.")
(kom-keep-alive-interval-doc . "\
Antalet sekunder som skall g mellan de meddelanden som anvnds fr att
hlla ntverkskopplingen till LysKOM-servern aktiv. Om din frbindelse
kopplar ned efter en stunds inaktivitet s kan du stta detta till ungefr
hlften och sedan ge kommandot \"Hll frbindelsen aktiv\".")
......@@ -3192,6 +3204,7 @@ i servern. Annars sparas det i din .emacs.")
(kom-server-priority-tag . "Sessionsprioritet")
(kom-server-priority-breaks-tag . "Byt till LysKOM med olsta")
(kom-complete-numbers-before-names-tag . "Ls mtesnummer fre mtesnamn")
(kom-keep-alive-interval-tag . "Intervall fr hll frbindelsen igng")
......@@ -662,6 +662,9 @@ various LysKOM elements.")
A number means wrap articles shorter than the number (in bytes)."
(def-kom-var kom-keep-alive-interval 180
"*The number of seconds between periodic requests used to keep the session alive"
;;; lyskom-button-actions has been moved to swedish-strings.el on account
......@@ -1253,6 +1256,9 @@ Users are encouraged to use their best sense of humor."
;;; ================================================================
Supports Markdown
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