From b14f1c3c2c0376dd88089c57d4431e3507a32d0c Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 9 Dec 2000 07:41:15 +0000 Subject: [PATCH] * liece.el (liece-refresh-buffer-window): Simplified. --- lisp/ChangeLog | 4 ++++ lisp/liece.el | 23 ++++++++--------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6f7e1bc..c283e97 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2000-12-09 Tanaka Akira + + * liece.el (liece-refresh-buffer-window): Simplified. + 2000-11-30 Tanaka Akira * liece.el (liece-refresh-buffer-window): Force to display a last diff --git a/lisp/liece.el b/lisp/liece.el index e0711ef..65fedf8 100644 --- a/lisp/liece.el +++ b/lisp/liece.el @@ -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." -- 1.7.10.4