liece-server nil))
;;;###liece-autoload
-(defun liece-close-server ()
+(defun liece-close-server (&optional quit-string)
"Close chat server."
(unwind-protect
(progn
(process-sentinel liece-server-process)))
(set-process-sentinel liece-server-process nil))
(if (liece-server-opened)
- (liece-command-quit)))
+ (if quit-string
+ (liece-send "QUIT :%s" quit-string)
+ (liece-send "QUIT"))))
(liece-close-server-internal)
;; Save settings to the `~/.liece/init.el' file.
(if liece-save-variables-are-dirty
(liece-intl-load-catalogue))
(if (liece-server-opened)
(liece-configure-windows)
- (unwind-protect
- (progn
- (switch-to-buffer
- (liece-get-buffer-create liece-command-buffer))
- (unless (eq major-mode 'liece-command-mode)
- (liece-command-mode))
- (unless (liece-server-opened)
- (liece-start-server confirm)))
- (if (not (liece-server-opened))
- (liece-command-quit)
- ;; IRC server is successfully open.
- (with-current-buffer liece-command-buffer
- (setq mode-line-process (concat " " (liece-server-host))))
- (let (buffer-read-only)
- (unless liece-keep-buffers
- (erase-buffer))
- (sit-for 0))
-
- (liece-initialize-buffers)
- (liece-configure-windows)
- (setq liece-current-channels nil)
- (cond
- (liece-current-channel
- (liece-command-join liece-current-channel))
- (liece-startup-channel
- (liece-command-join liece-startup-channel))
- (liece-startup-channel-list
- (dolist (chnl liece-startup-channel-list)
- (if (listp chnl)
- (liece-command-join (car chnl) (cadr chnl))
- (liece-command-join chnl)))))
- (unless (string-equal liece-away-message "")
- (liece-command-away liece-away-message))
- (run-hooks 'liece-startup-hook)
- (setq liece-obarray
- (or liece-obarray (make-vector liece-obarray-size nil)))
- (unless liece-timers-list-initialized-p
- (liece-initialize-timers))
- (liece-command-timestamp)
- (message (substitute-command-keys
- "Type \\[describe-mode] for help"))))))
+ (switch-to-buffer (liece-get-buffer-create liece-command-buffer))
+ (unless (eq major-mode 'liece-command-mode)
+ (liece-command-mode))
+ (liece-start-server confirm)
+ (let (buffer-read-only)
+ (unless liece-keep-buffers
+ (erase-buffer))
+ (sit-for 0))
+ (liece-initialize-buffers)
+ (liece-configure-windows)
+ (setq liece-current-channels nil)
+ (let ((startup-channels
+ (if liece-startup-channel
+ (list liece-startup-channel)
+ liece-startup-channel-list)))
+ (dolist (chnl startup-channels)
+ (if (listp chnl)
+ (liece-command-join (car chnl) (cadr chnl))
+ (liece-command-join chnl))))
+ (unless (string-equal liece-away-message "")
+ (liece-command-away liece-away-message))
+ (run-hooks 'liece-startup-hook)
+ (setq liece-obarray
+ (or liece-obarray (make-vector liece-obarray-size nil)))
+ (unless liece-timers-list-initialized-p
+ (liece-initialize-timers))
+ (liece-command-timestamp)
+ (message (substitute-command-keys "Type \\[describe-mode] for help"))))
;;;###liece-autoload
(defun liece-command-mode ()
(copy-syntax-table (syntax-table)))
(set-syntax-table liece-command-mode-syntax-table)
(mapcar
- (function (lambda (c) (modify-syntax-entry c "w")))
+ (lambda (c) (modify-syntax-entry c "w"))
"^[]{}'`"))
(run-hooks 'liece-command-mode-hook))