From: yamaoka Date: Mon, 20 Sep 1999 09:38:41 +0000 (+0000) Subject: Sync up with semi-1_13. X-Git-Tag: semi-pgpgpg_20~7 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c61a6ed5ba2708ebe2ac1ae085e3dbb4962d7a8e;p=elisp%2Fsemi.git Sync up with semi-1_13. --- diff --git a/ChangeLog b/ChangeLog index e4bbbfe..0e52440 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 MORIOKA Tomohiko * SEMI: Version 1.13.6 (Komatsu) released. diff --git a/mime-view.el b/mime-view.el index 964c687..04efc7d 100644 --- a/mime-view.el +++ b/mime-view.el @@ -1346,22 +1346,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) @@ -1369,34 +1370,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 ;;;