* liece.el (liece-refresh-buffer-window): Simplified.
authorakr <akr>
Sat, 9 Dec 2000 07:41:15 +0000 (07:41 +0000)
committerakr <akr>
Sat, 9 Dec 2000 07:41:15 +0000 (07:41 +0000)
lisp/ChangeLog
lisp/liece.el

index 6f7e1bc..c283e97 100644 (file)
@@ -1,3 +1,7 @@
+2000-12-09   Tanaka Akira  <akr@m17n.org>
+
+       * liece.el (liece-refresh-buffer-window): Simplified.
+
 2000-11-30   Tanaka Akira  <akr@m17n.org>
 
        * liece.el (liece-refresh-buffer-window): Force to display a last
index e0711ef..65fedf8 100644 (file)
@@ -882,23 +882,16 @@ Only used from `liece-before-insert-functions'."
 
 (defun liece-refresh-buffer-window (buffer)
   "Center point in window of BUFFER and redisplay frame."
-  (let ((window (liece-get-buffer-window buffer)))
-    (when (and window (not (pos-visible-in-window-p (point-max) window)))
+  (let ((window (liece-get-buffer-window buffer))
+       (last-point (point-max)))
+    ;; skip last white spaces
+    (while (memq (char-before last-point) '(?\n ?\t ?\ ))
+      (setq last-point (1- last-point)))
+    (when (and window (not (pos-visible-in-window-p last-point window)))
       (save-selected-window
        (select-window window)
-       (goto-char (point-max))
-       (if (null liece-scroll-step)
-           (progn
-             ;; skip last empty lines
-             (while (memq (char-before) '(?\n ?\t ?\ ))
-               (backward-char))
-             (recenter -1))
-         (vertical-motion
-          (- (or liece-scroll-step
-                 (1+ (/ (liece-window-height window) 2)))
-             (liece-window-height window)))
-         (set-window-start window (point))
-         (goto-char (point-max)))))))
+       (goto-char last-point)
+       (recenter (- (or liece-scroll-step 1)))))))
 
 (defmacro liece-save-point (&rest body)
   "Execute BODY, then goto the point that was around before BODY."