From 57eb2ca1bbb67e7313ab3f9a9dcd93cae617179a Mon Sep 17 00:00:00 2001 From: ueno Date: Mon, 30 Aug 2004 05:40:54 +0000 Subject: [PATCH] * riece-options.el (riece-window-center-line): New user option. * riece-misc.el (riece-insert): Check if the current point is not visible in the window. --- lisp/ChangeLog | 6 ++++++ lisp/riece-misc.el | 5 +++-- lisp/riece-options.el | 8 ++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cd3e1bc..d96e9f6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 2004-08-30 Daiki Ueno + * riece-options.el (riece-window-center-line): New user option. + * riece-misc.el (riece-insert): Check if the current point is not + visible in the window. + +2004-08-30 Daiki Ueno + * riece-misc.el (riece-insert): Don't use 2nd argument WINDOW of recenter since it is not supported by GNU Emacs. diff --git a/lisp/riece-misc.el b/lisp/riece-misc.el index 2ab9f07..7a264b5 100644 --- a/lisp/riece-misc.el +++ b/lisp/riece-misc.el @@ -76,13 +76,14 @@ (insert (format-time-string "%H:%M") " " string) (setq point (point)) (if (and (not (riece-frozen (current-buffer))) - (setq window (get-buffer-window (current-buffer)))) + (setq window (get-buffer-window (current-buffer))) + (not (pos-visible-in-window-p point window))) (save-excursion ;save-selected-window changes ;current buffer (save-selected-window (select-window window) (goto-char point) ;select-window changes current point - (recenter -2)))) + (recenter riece-window-center-line)))) (run-hook-with-args 'riece-after-insert-functions start (point)))) (setq buffers (cdr buffers)))) diff --git a/lisp/riece-options.el b/lisp/riece-options.el index d7b4cdb..ebabff0 100644 --- a/lisp/riece-options.el +++ b/lisp/riece-options.el @@ -70,6 +70,14 @@ :type 'boolean :group 'riece-looks) +(defcustom riece-window-center-line -2 + "Line number of center point in window when scrolling. +If nil, erases the entire frame and then redraws with point in the +center of the window. Negative means relative to bottom of window. +See the document of the function `recenter'." + :type 'integer + :group 'riece-looks) + (defcustom riece-directory (expand-file-name "~/.riece") "Where to look for data files." :type 'directory -- 1.7.10.4