From dd147f4af03b27873847a35d45996c2bbcef8e9b Mon Sep 17 00:00:00 2001 From: ueno Date: Wed, 22 Oct 2003 02:16:06 +0000 Subject: [PATCH] * riece-server.el (riece-quit-server-process): Use riece-run-at-time. * riece-xemacs.el (riece-run-at-time): New function. * riece-emacs.el (riece-run-at-time): New alias. --- lisp/ChangeLog | 4 ++++ lisp/riece-emacs.el | 2 ++ lisp/riece-server.el | 16 ++++++++-------- lisp/riece-xemacs.el | 8 ++++++++ 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b897296..c98eab0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2003-10-22 Daiki Ueno + * riece-server.el (riece-quit-server-process): Use riece-run-at-time. + * riece-xemacs.el (riece-run-at-time): New function. + * riece-emacs.el (riece-run-at-time): New alias. + * riece-misc.el (riece-get-identities-on-server): New function. (riece-get-users-on-server): Use it. diff --git a/lisp/riece-emacs.el b/lisp/riece-emacs.el index 6f5eca6..a22ecac 100644 --- a/lisp/riece-emacs.el +++ b/lisp/riece-emacs.el @@ -77,6 +77,8 @@ (defalias 'riece-overlay-start 'overlay-start) (defalias 'riece-overlay-buffer 'overlay-buffer) +(defalias 'riece-run-at-time 'run-at-time) + (provide 'riece-emacs) ;;; riece-emacs.el ends here diff --git a/lisp/riece-server.el b/lisp/riece-server.el index e5cceb3..62e26bb 100644 --- a/lisp/riece-server.el +++ b/lisp/riece-server.el @@ -225,14 +225,14 @@ the `riece-server-keyword-map' variable." (eval-when-compile (autoload 'riece-exit "riece")) (defun riece-quit-server-process (process &optional message) - (run-at-time riece-quit-timeout nil - (lambda (process) - (when (rassq process riece-server-process-alist) - (riece-close-server-process process) - ;; If no server process is available, exit. - (unless riece-server-process-alist - (riece-exit)))) - process) + (riece-run-at-time riece-quit-timeout nil + (lambda (process) + (when (rassq process riece-server-process-alist) + (riece-close-server-process process) + ;; If no server process is available, exit. + (unless riece-server-process-alist + (riece-exit)))) + process) (riece-process-send-string process (if message (format "QUIT :%s\r\n" message) diff --git a/lisp/riece-xemacs.el b/lisp/riece-xemacs.el index e180cfc..dd896dd 100644 --- a/lisp/riece-xemacs.el +++ b/lisp/riece-xemacs.el @@ -77,6 +77,14 @@ (defalias 'riece-overlay-start 'extent-start-position) (defalias 'riece-overlay-buffer 'extent-buffer) +;;; stolen (and renamed) from nnheaderxm.el. +(defun riece-run-at-time (time repeat function &rest args) + (start-itimer + "riece-run-at-time" + `(lambda () + (,function ,@args)) + time repeat)) + (provide 'riece-xemacs) ;;; riece-xemacs.el ends here -- 1.7.10.4