* riece-layout.el (riece-set-window-points): Restore window-point
authorueno <ueno>
Thu, 10 Jun 2004 08:18:05 +0000 (08:18 +0000)
committerueno <ueno>
Thu, 10 Jun 2004 08:18:05 +0000 (08:18 +0000)
of the channel buffer from riece-channel-buffer-window-point.

* riece-display.el (riece-switch-to-channel): Set
riece-channel-buffer-window-point.

* riece.el (riece-channel-mode): Make
riece-channel-buffer-window-point buffer local.

* riece-globals.el (riece-channel-buffer-window-point): New variable.

lisp/ChangeLog
lisp/riece-display.el
lisp/riece-globals.el
lisp/riece-layout.el
lisp/riece.el

index 3d8681f..488e300 100644 (file)
@@ -1,3 +1,16 @@
+2004-06-10  Daiki Ueno  <ueno@unixuser.org>
+
+       * riece-layout.el (riece-set-window-points): Restore window-point
+       of the channel buffer from riece-channel-buffer-window-point.
+
+       * riece-display.el (riece-switch-to-channel): Set
+       riece-channel-buffer-window-point.
+
+       * riece.el (riece-channel-mode): Make
+       riece-channel-buffer-window-point buffer local.
+
+       * riece-globals.el (riece-channel-buffer-window-point): New variable.
+
 2004-06-06  Daiki Ueno  <ueno@unixuser.org>
 
        * riece-rdcc.el (riece-command-dcc-send): Replace whitespace with
index 25ac9d3..304b4bd 100644 (file)
@@ -395,7 +395,12 @@ Local to the buffer in `riece-buffer-list'.")
   (cdr (riece-identity-assoc identity riece-channel-buffer-alist)))
 
 (defun riece-switch-to-channel (identity)
-  (let ((last riece-current-channel))
+  (let ((last riece-current-channel)
+       window)
+    (if (and riece-channel-buffer
+            (setq window (get-buffer-window riece-channel-buffer)))
+       (with-current-buffer riece-channel-buffer
+         (setq riece-channel-buffer-window-point (window-point window))))
     (setq riece-current-channel identity
          riece-channel-buffer (riece-channel-buffer riece-current-channel))
     (run-hook-with-args 'riece-after-switch-to-channel-functions last)
index c49590d..ecf6b92 100644 (file)
@@ -126,6 +126,10 @@ Local to the channel buffers.")
 channel buffer is locked.
 Local to the channel buffers.")
 
+(defvar riece-channel-buffer-window-point nil
+  "Last value of point in window which displayed the channel buffer.
+Local to the channel buffers.")
+
 ;;; Modeline indicators:
 (defvar riece-channel-indicator "None"
   "String displayed on the modeline to indicate the current channel.")
index 523e6f2..ca463dc 100644 (file)
@@ -87,7 +87,10 @@ happen unconditionally."
   (if (and riece-channel-buffer
           (get-buffer-window riece-channel-buffer))
       (with-current-buffer riece-channel-buffer
-       (unless (riece-frozen riece-channel-buffer)
+       (if (riece-frozen riece-channel-buffer)
+           (if riece-channel-buffer-window-point
+               (set-window-point (get-buffer-window riece-channel-buffer)
+                                 riece-channel-buffer-window-point))
          (set-window-point (get-buffer-window riece-channel-buffer)
                            (point-max)))))
   (if (get-buffer-window riece-others-buffer)
index da4adab..cbafff5 100644 (file)
@@ -426,6 +426,7 @@ Instead, these commands are available:
 All normal editing commands are turned off.
 Instead, these commands are available:
 \\{riece-channel-mode-map}"
+  (make-local-variable 'riece-channel-buffer-window-point)
   (setq mode-line-buffer-identification
        (riece-mode-line-buffer-identification
         '("Riece: "