From c5fbd7ee9bf4e335cef308344d918cc9979de791 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Mon, 20 Sep 1999 09:38:27 +0000 Subject: [PATCH] Sync up with semi-1_13. --- ChangeLog | 10 +++++++++ mime-view.el | 70 +++++++++++++++++++++++++++++++--------------------------- 2 files changed, 48 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index a16d753..cfd57c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +1999-09-20 Yoshiki Hayashi + + * mime-view.el (mime-preview-scroll-up-entitiy, + mime-preview-scroll-down-entity): Use scroll-up and scroll-down + instead of forward-line. + (mime-preview-next-line-entity, + mime-preview-previous-line-entity): Add optional argument LINES + and scroll LINES lines if specified. Add doc-string. + + 1999-09-13 Katsumi Yamaoka * WEMI: Version 1.13.6 (Rokug-Dr) released. diff --git a/mime-view.el b/mime-view.el index ad8c800..7e15c80 100644 --- a/mime-view.el +++ b/mime-view.el @@ -1347,22 +1347,23 @@ variable `mime-preview-over-to-next-method-alist'." If reached to (point-max), it calls function registered in variable `mime-preview-over-to-next-method-alist'." (interactive) - (or h - (setq h (1- (window-height))) - ) - (if (= (point) (point-max)) + (if (eobp) (let ((f (assq (mime-preview-original-major-mode) - mime-preview-over-to-next-method-alist))) - (if f - (funcall (cdr f)) - )) + mime-preview-over-to-next-method-alist))) + (if f + (funcall (cdr f)) + )) (let ((point (or (next-single-property-change (point) 'mime-view-entity) - (point-max)))) - (forward-line h) - (if (> (point) point) - (goto-char point) - ) + (point-max))) + (bottom (window-end (selected-window)))) + (if (and (not h) + (> bottom point)) + (goto-char point) + (condition-case nil + (scroll-up h) + (end-of-buffer + (goto-char (point-max))))) ))) (defun mime-preview-scroll-down-entity (&optional h) @@ -1370,34 +1371,39 @@ If reached to (point-max), it calls function registered in variable If reached to (point-min), it calls function registered in variable `mime-preview-over-to-previous-method-alist'." (interactive) - (or h - (setq h (1- (window-height))) - ) - (if (= (point) (point-min)) + (if (bobp) (let ((f (assq (mime-preview-original-major-mode) mime-preview-over-to-previous-method-alist))) - (if f - (funcall (cdr f)) - )) + (if f + (funcall (cdr f)) + )) (let ((point (or (previous-single-property-change (point) 'mime-view-entity) - (point-min)))) - (forward-line (- h)) - (if (< (point) point) - (goto-char point) - )))) + (point-min))) + (top (window-start (selected-window)))) + (if (and (not h) + (< top point)) + (goto-char point) + (condition-case nil + (scroll-down h) + (beginning-of-buffer + (goto-char (point-min))))) + ))) -(defun mime-preview-next-line-entity () - (interactive) - (mime-preview-scroll-up-entity 1) +(defun mime-preview-next-line-entity (&optional lines) + "Scroll up one line (or prefix LINES lines). +If LINES is negative, scroll down LINES lines." + (interactive "p") + (mime-preview-scroll-up-entity (or lines 1)) ) -(defun mime-preview-previous-line-entity () - (interactive) - (mime-preview-scroll-down-entity 1) +(defun mime-preview-previous-line-entity (&optional lines) + "Scrroll down one line (or prefix LINES lines). +If LINES is negative, scroll up LINES lines." + (interactive "p") + (mime-preview-scroll-down-entity (or lines 1)) ) - ;;; @@ quitting ;;; -- 1.7.10.4