From: ueno Date: Sun, 26 Oct 2003 01:52:31 +0000 (+0000) Subject: (riece-command-quit): Clean up if no server process is available. X-Git-Tag: riece-0_1_6~15 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b06144da74ab9b917ca062625916543da2ec93ce;p=elisp%2Friece.git (riece-command-quit): Clean up if no server process is available. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f164562..828554f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -6,6 +6,7 @@ riece-command-nick-scroll-up. (riece-command-scroll-down): Check if riece-current-channel is bound. (riece-command-scroll-up): Ditto. + (riece-command-quit): Clean up if no server process is available. 2003-10-25 Daiki Ueno diff --git a/lisp/riece-commands.el b/lisp/riece-commands.el index 9a52c04..4994a8f 100644 --- a/lisp/riece-commands.el +++ b/lisp/riece-commands.el @@ -577,19 +577,24 @@ If prefix argument ARG is non-nil, toggle frozen status." (riece-update-status-indicators) (force-mode-line-update t)) +(eval-when-compile + (autoload 'riece-exit "riece")) (defun riece-command-quit (&optional arg) "Quit IRC." (interactive "P") (if (y-or-n-p "Really quit IRC? ") - (let ((message - (if arg - (read-string "Message: ") - (or riece-quit-message - (riece-extended-version)))) - (alist riece-server-process-alist)) - (while alist - (riece-quit-server-process (cdr (car alist)) message) - (setq alist (cdr alist)))))) + (if riece-server-process-alist + (let ((message + (if arg + (read-string "Message: ") + (or riece-quit-message + (riece-extended-version)))) + (alist riece-server-process-alist)) + (while alist + (riece-quit-server-process (cdr (car alist)) message) + (setq alist (cdr alist)))) + ;; If no server process is available, exit immediately. + (riece-exit)))) (defun riece-command-raw (command) "Enter raw IRC command, which is sent to the server."