Fix toggle-freeze behavior when the channel buffer window is selected.
authorDaiki Ueno <ueno@unixuser.org>
Tue, 14 Dec 2010 08:38:01 +0000 (17:38 +0900)
committerDaiki Ueno <ueno@unixuser.org>
Tue, 14 Dec 2010 08:38:01 +0000 (17:38 +0900)
lisp/ChangeLog
lisp/riece-misc.el

index 787c608..82b8e2c 100644 (file)
@@ -1,3 +1,8 @@
+2010-12-14  Daiki Ueno  <ueno@unixuser.org>
+
+       * riece-misc.el (riece-insert): Make sure to save current point,
+       when the currently selected buffer is frozen.
+
 2010-12-11  TAKAHASHI Kaoru  <kaoru@kaisei.org>
 
        * COMPILE (riece-update-mcat): Fix "Wrong number of arguments"
index 2aa1286..8995ccb 100644 (file)
     (with-current-buffer (car buffers)
       (let ((inhibit-read-only t)
            buffer-read-only
-           (start (goto-char (point-max)))
+           start
            window
            point)
-       (insert (format-time-string "%H:%M") " " string)
-       (setq point (point))
+       ;; Save the current for the case when (car buffers) is the
+       ;; currently selected buffer.
+       (save-excursion
+         (setq start (goto-char (point-max)))
+         (insert (format-time-string "%H:%M") " " string)
+         (setq point (point)))
        (if (and (not (riece-frozen (current-buffer)))
                 (setq window (get-buffer-window (current-buffer)))
                 (not (pos-visible-in-window-p point window)))