From 12043689792ce9d285180f422a7db6998d10b6e0 Mon Sep 17 00:00:00 2001 From: ueno Date: Thu, 10 Jun 2004 08:18:05 +0000 Subject: [PATCH] * 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. --- lisp/ChangeLog | 13 +++++++++++++ lisp/riece-display.el | 7 ++++++- lisp/riece-globals.el | 4 ++++ lisp/riece-layout.el | 5 ++++- lisp/riece.el | 1 + 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3d8681f..488e300 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,16 @@ +2004-06-10 Daiki Ueno + + * 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 * riece-rdcc.el (riece-command-dcc-send): Replace whitespace with diff --git a/lisp/riece-display.el b/lisp/riece-display.el index 25ac9d3..304b4bd 100644 --- a/lisp/riece-display.el +++ b/lisp/riece-display.el @@ -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) diff --git a/lisp/riece-globals.el b/lisp/riece-globals.el index c49590d..ecf6b92 100644 --- a/lisp/riece-globals.el +++ b/lisp/riece-globals.el @@ -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.") diff --git a/lisp/riece-layout.el b/lisp/riece-layout.el index 523e6f2..ca463dc 100644 --- a/lisp/riece-layout.el +++ b/lisp/riece-layout.el @@ -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) diff --git a/lisp/riece.el b/lisp/riece.el index da4adab..cbafff5 100644 --- a/lisp/riece.el +++ b/lisp/riece.el @@ -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: " -- 1.7.10.4