"Mapping from keywords to default values.
All keywords that can be used must be listed here."))
-(defadvice save-buffers-kill-emacs
- (before liece-save-buffers-kill-emacs activate)
- "Prompt user to quit IRC explicitly."
- (run-hooks 'liece-before-kill-emacs-hook) )
-
-(add-hook 'liece-before-kill-emacs-hook 'liece-command-quit)
+(add-hook 'kill-emacs-hook 'liece-command-quit)
(defvar liece-tmp-server-name nil "Temporaly server name.")
(defvar liece-buffer-last-check-time nil)
"/" liece-command-generic
">" end-of-buffer
"<" beginning-of-buffer
- "!" liece-command-exec
"|" liece-command-show-last-kill
"a" liece-command-away
"b" liece-command-submit-bug-report
"t" liece-command-topic
"T" liece-command-timestamp
"\C-t" liece-command-find-timestamp
- "u" liece-command-lusers
- "U" liece-command-userhost
"v" liece-command-browse-url
"w" liece-command-who)
"\r" liece-command-enter-message
[tab] liece-command-complete
[(meta control c) >] liece-command-push
- [(meta control c) <] liece-command-pop
- [(meta control c) o] liece-command-mode+o
- [(meta control c) O] liece-command-mode-o
- [(meta control c) v] liece-command-mode+v
- [(meta control c) V] liece-command-mode-v)
+ [(meta control c) <] liece-command-pop)
(liece-define-keys (liece-command-map "\C-c" liece-command-mode-map)
"\177" liece-command-scroll-down
">" liece-command-next-channel
"<" liece-command-previous-channel
"a" liece-command-away
- "c" liece-command-inline
- "\C-a" liece-command-previous-channel
"\C-f" liece-command-freeze
"\C-j" liece-command-next-channel
"\C-n" liece-command-names
"L" liece-command-load-vars
"M" liece-command-own-freeze
"\C-m" liece-command-modec
- "o" liece-command-mode+o
+ "o" liece-command-set-operators
"O" liece-command-toggle-nick-buffer-mode
"\C-o" liece-command-toggle-channel-buffer-mode
"\C-p" liece-command-part
"\C-r" mule-caesar-region
"s" liece-command-set-window-style
"S" liece-command-save-vars
- "v" liece-command-mode+v
+ "v" liece-command-set-voices
"\C-v" liece-command-browse-url
"\C-y" liece-command-yank-send)
(set-keymap-parent liece-command-map liece-dialogue-mode-map)
(liece-define-keys liece-nick-mode-map
- "o" liece-command-mode+o
- "O" liece-command-mode-o
- "v" liece-command-mode+v
- "V" liece-command-mode-v
+ "o" liece-command-set-operators
+ "v" liece-command-set-voices
"f" liece-command-finger
" " liece-command-nick-scroll-up
"\177" liece-command-nick-scroll-down
(eq 'liece-sentinel
(process-sentinel liece-server-process)))
(set-process-sentinel liece-server-process nil))
- ;; We cannot send QUIT command unless the process is running.
- (when (liece-server-opened)
- (if quit-string
- (liece-send "QUIT :%s" quit-string)
- (liece-send "QUIT"))))
- (liece-close-server-internal)))
+ (if (liece-server-opened)
+ (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-command-save-vars))
+ ;; Reset everything.
+ (liece-clear-system)
+ (liece-window-configuration-pop)
+ ;; Allow the user to do things after cleaning up.
+ (run-hooks 'liece-exit-hook)))
(defmacro liece-server-keyword-bind (plist &rest body)
"Return a `let' form that binds all variables in PLIST.
(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))
(select-window window)
(goto-char (point-max))
(if (null liece-scroll-step)
- (recenter (- (liece-window-height window) 1))
+ (progn
+ ;; skip last empty lines
+ (while (memq (char-before) '(?\n ?\t ?\ ))
+ (backward-char))
+ (recenter -1))
(vertical-motion
(- (or liece-scroll-step
(1+ (/ (liece-window-height window) 2)))