* riece-keepalive.el: Require 'riece-options.
authorueno <ueno>
Sat, 5 Feb 2005 09:45:48 +0000 (09:45 +0000)
committerueno <ueno>
Sat, 5 Feb 2005 09:45:48 +0000 (09:45 +0000)
(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.

lisp/ChangeLog
lisp/riece-commands.el
lisp/riece-keepalive.el
lisp/riece.el

index 5a76cb6..1e832b0 100644 (file)
@@ -1,5 +1,13 @@
 2005-02-05  Daiki Ueno  <ueno@unixuser.org>
 
+       * 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
index 38a2edb..e65173a 100644 (file)
 
 (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."
index a3148b3..6526d5c 100644 (file)
 
 ;;; 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
index 4fb555d..c736b4b 100644 (file)
@@ -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 ()