* riece-options.el (riece-window-center-line): New user option.
authorueno <ueno>
Mon, 30 Aug 2004 05:40:54 +0000 (05:40 +0000)
committerueno <ueno>
Mon, 30 Aug 2004 05:40:54 +0000 (05:40 +0000)
* riece-misc.el (riece-insert): Check if the current point is not
visible in the window.

lisp/ChangeLog
lisp/riece-misc.el
lisp/riece-options.el

index cd3e1bc..d96e9f6 100644 (file)
@@ -1,5 +1,11 @@
 2004-08-30  Daiki Ueno  <ueno@unixuser.org>
 
+       * 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  <ueno@unixuser.org>
+
        * riece-misc.el (riece-insert): Don't use 2nd argument WINDOW of
        recenter since it is not supported by GNU Emacs.
 
index 2ab9f07..7a264b5 100644 (file)
        (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))))
 
index d7b4cdb..ebabff0 100644 (file)
   :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