From: ueno Date: Sat, 5 Feb 2005 09:45:48 +0000 (+0000) Subject: * riece-keepalive.el: Require 'riece-options. X-Git-Tag: riece-1_0_7~6 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=027ed8dd8985d7590a1c88d36be8ad24402d9fe6;p=elisp%2Friece.git * riece-keepalive.el: Require 'riece-options. (riece-keepalive-ping-repeat): Define with defcustom. (riece-keepalive-description): New constant. * riece.el (riece-dialogue-mode-map): Bind riece-command-suspend-resume. * riece-commands.el (riece-command-suspend-resume): New command. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5a76cb6..1e832b0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,13 @@ 2005-02-05 Daiki Ueno + * riece-keepalive.el: Require 'riece-options. + (riece-keepalive-ping-repeat): Define with defcustom. + (riece-keepalive-description): New constant. + + * riece.el (riece-dialogue-mode-map): Bind + riece-command-suspend-resume. + * riece-commands.el (riece-command-suspend-resume): New command. + * riece-options.el (riece-addons): Enable riece-keyword by default. * riece-button.el (riece-identity-button-popup-menu): Changed diff --git a/lisp/riece-commands.el b/lisp/riece-commands.el index 38a2edb..e65173a 100644 --- a/lisp/riece-commands.el +++ b/lisp/riece-commands.el @@ -112,8 +112,23 @@ (defun riece-command-configure-windows () (interactive) + "Reconfigure windows with the current layout." (riece-redisplay-buffers t)) +(defun riece-command-suspend-resume () + (interactive) + "Save or restore the current window configuration." + (let ((entry (assq 'riece-window-configuration (frame-parameters)))) + (modify-frame-parameters (selected-frame) + (list (cons 'riece-window-configuration + (current-window-configuration)))) + (if entry + (set-window-configuration (cdr entry)) + (delete-other-windows)) + (message + (substitute-command-keys + "\\[riece-command-suspend-resume] to get back the last windows")))) + (defun riece-command-change-layout (name) "Select a layout-name from all current available layouts and change the layout to the selected layout-name." diff --git a/lisp/riece-keepalive.el b/lisp/riece-keepalive.el index a3148b3..6526d5c 100644 --- a/lisp/riece-keepalive.el +++ b/lisp/riece-keepalive.el @@ -29,9 +29,23 @@ ;;; Code: -(defvar riece-keepalive-ping-repeat 120) +(require 'riece-options) + +(defgroup riece-keepalive nil + "Keep an IRC connection." + :prefix "riece-" + :group 'riece) + +(defcustom riece-keepalive-ping-repeat 120 + "Interval for sending PING to server." + :type 'integer + :group 'riece-keepalive) + (defvar riece-keepalive-timer nil) +(defconst riece-keepalive-description + "Keep an IRC connection.") + (defun riece-keepalive-after-login-hook () (make-local-variable 'riece-keepalive-timer) (unless riece-keepalive-timer diff --git a/lisp/riece.el b/lisp/riece.el index 4fb555d..c736b4b 100644 --- a/lisp/riece.el +++ b/lisp/riece.el @@ -185,7 +185,8 @@ If optional argument SAFE is nil, overwrite previous definitions." "r" riece-command-configure-windows "x" riece-command-copy-region "t" riece-command-topic - "w" riece-command-who) + "w" riece-command-who + "z" riece-command-suspend-resume) (riece-define-keys riece-command-mode-map "\r" riece-command-enter-message @@ -276,6 +277,9 @@ If optional argument CONFIRM is non-nil, ask which IRC server to connect." (run-hooks 'riece-after-load-startup-hook) (if (riece-server-opened) (riece-command-configure-windows) + (modify-frame-parameters (selected-frame) + (list (cons 'riece-window-configuration + (current-window-configuration)))) (unless riece-addons-insinuated (setq riece-addons (riece-resolve-addons riece-addons)) (let ((pointer riece-addons)) @@ -371,7 +375,11 @@ If optional argument CONFIRM is non-nil, ask which IRC server to connect." riece-operator-indicator "-" riece-channel-status-indicator "-" riece-freeze-indicator "-") - (delete-other-windows) + (let ((window-configuration + (cdr (assq 'riece-window-configuration (frame-parameters))))) + (if window-configuration + (set-window-configuration window-configuration) + (delete-other-windows))) (run-hooks 'riece-exit-hook)) (defun riece-command-mode ()