From: ueno Date: Wed, 27 Aug 2003 00:46:50 +0000 (+0000) Subject: * riece-options.el (riece-channel-history-length): New user option. X-Git-Tag: riece-0_1_1~9 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d41b61916f102a2972cc2fb71862926e0092845;p=elisp%2Friece.git * riece-options.el (riece-channel-history-length): New user option. (riece-connection-timeout): Abolish. * riece-globals.el (riece-channel-history): New variable. (riece-last-channel): Abolish. * riece-display.el: Autoload ring-insert. (riece-switch-to-channel): Update riece-channel-history. (riece-switch-to-nearest-channel): Ditto. * riece-server.el (riece-clear-system): Abolish. * riece.el (riece-exit): Merge riece-clear-system. (riece): Initialize riece-channel-history. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dd30d8d..c526057 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,19 @@ +2003-08-27 Daiki Ueno + + * riece-options.el (riece-channel-history-length): New user option. + (riece-connection-timeout): Abolish. + + * riece-globals.el (riece-channel-history): New variable. + (riece-last-channel): Abolish. + + * riece-display.el: Autoload ring-insert. + (riece-switch-to-channel): Update riece-channel-history. + (riece-switch-to-nearest-channel): Ditto. + + * riece-server.el (riece-clear-system): Abolish. + * riece.el (riece-exit): Merge riece-clear-system. + (riece): Initialize riece-channel-history. + 2003-08-26 Daiki Ueno * riece-filter.el (riece-sentinel): Suppress status message when diff --git a/lisp/riece-display.el b/lisp/riece-display.el index e72fe27..bb49009 100644 --- a/lisp/riece-display.el +++ b/lisp/riece-display.el @@ -29,6 +29,8 @@ (require 'riece-misc) (require 'riece-layout) +(autoload 'ring-insert "ring") + (defvar riece-update-buffer-functions '(riece-update-user-list-buffer riece-update-channel-list-buffer @@ -180,8 +182,8 @@ (current-buffer))) (defun riece-switch-to-channel (identity) - (setq riece-last-channel riece-current-channel - riece-current-channel identity) + (ring-insert riece-channel-history riece-current-channel) + (setq riece-current-channel identity) (run-hooks 'riece-channel-switch-hook)) (defun riece-join-channel (identity) @@ -211,8 +213,8 @@ (setq identity (car pointer))) (if identity (riece-switch-to-channel identity) - (setq riece-last-channel riece-current-channel - riece-current-channel nil)))) + (ring-insert riece-channel-history riece-current-channel) + (setq riece-current-channel nil)))) (defun riece-part-channel (identity) (let ((pointer (riece-identity-member identity riece-current-channels))) diff --git a/lisp/riece-globals.el b/lisp/riece-globals.el index 7488e7b..97f13e4 100644 --- a/lisp/riece-globals.el +++ b/lisp/riece-globals.el @@ -38,8 +38,8 @@ "The channel you currently have joined.") (defvar riece-current-channels nil "The channels you have currently joined.") -(defvar riece-last-channel nil - "The channel you had joined the last time.") +(defvar riece-channel-history nil + "List of channels user has visited.") (defvar riece-save-variables-are-dirty nil "Non nil if the variables in `riece-saved-forms' are changed.") diff --git a/lisp/riece-options.el b/lisp/riece-options.el index 897c876..ba3ca54 100644 --- a/lisp/riece-options.el +++ b/lisp/riece-options.el @@ -233,11 +233,6 @@ way is to put Riece variables on .emacs or file loaded from there." :type 'boolean :group 'riece-options) -(defcustom riece-connection-timeout 60 - "Default timeout interval." - :type 'integer - :group 'riece-server) - (defcustom riece-buffer-dispose-function #'bury-buffer "Function called after the buffer was disposed." :type 'function @@ -248,6 +243,11 @@ way is to put Riece variables on .emacs or file loaded from there." :type 'function :group 'riece-options) +(defcustom riece-channel-history-length 3 + "Length of riece-channel-history." + :type 'integer + :group 'riece-options) + (provide 'riece-options) ;;; riece-options.el ends here diff --git a/lisp/riece-server.el b/lisp/riece-server.el index 756598b..25d67a4 100644 --- a/lisp/riece-server.el +++ b/lisp/riece-server.el @@ -62,22 +62,6 @@ the `riece-server-keyword-map' variable." (put 'riece-server-keyword-bind 'lisp-indent-function 1) (put 'riece-server-keyword-bind 'edebug-form-spec '(form body)) -(defun riece-clear-system () - (while riece-buffer-list - (if (and (get-buffer (car riece-buffer-list)) - (buffer-live-p (car riece-buffer-list))) - (funcall riece-buffer-dispose-function (car riece-buffer-list))) - (setq riece-buffer-list (cdr riece-buffer-list))) - (setq riece-current-channels nil - riece-current-channel nil - riece-user-indicator nil - riece-channel-indicator "None" - riece-channel-list-indicator "No channel" - riece-away-indicator "-" - riece-operator-indicator "-" - riece-freeze-indicator "-") - (delete-other-windows)) - (defun riece-server-parse-string (string) "Convert a STRING set as `riece-server' and return a property list." (when (or (string-match "^\\[\\([^]]+\\)\\]:?\\([0-9]*\\)" string) diff --git a/lisp/riece.el b/lisp/riece.el index 4de3a8b..2c95c7c 100644 --- a/lisp/riece.el +++ b/lisp/riece.el @@ -30,6 +30,8 @@ (require 'riece-compat) (require 'riece-commands) +(autoload 'make-ring "ring") + (defvar riece-channel-list-mode-map (make-sparse-keymap)) (defvar riece-user-list-mode-map (make-sparse-keymap)) @@ -255,13 +257,28 @@ If optional argument CONFIRM is non-nil, ask which IRC server to connect." (riece-redisplay-buffers) (riece-open-server riece-server "") (run-hooks 'riece-startup-hook) + (setq riece-channel-history (make-ring riece-channel-history-length)) (message "%s" (substitute-command-keys "Type \\[describe-mode] for help"))) (defun riece-exit () - (setq riece-server nil) (if riece-save-variables-are-dirty (riece-save-variables-files)) - (riece-clear-system) + (while riece-buffer-list + (if (and (get-buffer (car riece-buffer-list)) + (buffer-live-p (car riece-buffer-list))) + (funcall riece-buffer-dispose-function (car riece-buffer-list))) + (setq riece-buffer-list (cdr riece-buffer-list))) + (setq riece-server nil + riece-current-channels nil + riece-current-channel nil + riece-user-indicator nil + riece-channel-indicator "None" + riece-channel-list-indicator "No channel" + riece-away-indicator "-" + riece-operator-indicator "-" + riece-freeze-indicator "-" + riece-channel-history nil) + (delete-other-windows) (run-hooks 'riece-exit-hook)) (defun riece-command-mode ()