+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
(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."