From: Katsumi Yamaoka Date: Mon, 11 Aug 2008 22:54:18 +0000 (+0000) Subject: * lpath.el: Bind scroll-margin for XEmacs 21.4 and SXEmacs. X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=commitdiff_plain;h=90b2dfc0006fdfcbd80efb95eca6ab2ca199384b * lpath.el: Bind scroll-margin for XEmacs 21.4 and SXEmacs. * gnus-art.el (gnus-article-next-page, gnus-article-prev-page) (gnus-article-next-page-1): Use compiler directive (featurep 'xemacs). (gnus-article-beginning-of-window): Fix calculation. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bde885f7d..42f93aa05 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2008-08-11 Katsumi Yamaoka + + * lpath.el: Bind scroll-margin for XEmacs 21.4 and SXEmacs. + + * gnus-art.el (gnus-article-next-page, gnus-article-prev-page) + (gnus-article-next-page-1): Use compiler directive (featurep 'xemacs). + (gnus-article-beginning-of-window): Fix calculation. + 2008-08-08 Katsumi Yamaoka * gnus-msg.el (gnus-summary-supersede-article) diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 3d5ce9b39..a3e0285bd 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -6116,10 +6116,9 @@ Argument LINES specifies lines to be scrolled up." (move-to-window-line -1) (if (and (not (and gnus-article-over-scroll (> (count-lines (window-start) (point-max)) - (+ (or lines (1- (window-height))) - (or (and (boundp 'scroll-margin) - (symbol-value 'scroll-margin)) - 0))))) + (if (featurep 'xemacs) + (or lines (1- (window-height))) + (+ (or lines (1- (window-height))) scroll-margin))))) (save-excursion (end-of-line) (and (pos-visible-in-window-p) ;Not continuation line. @@ -6151,19 +6150,19 @@ specifies." (min (max 0 scroll-margin) (max 1 (- (window-height) (if mode-line-format 1 0) - (if header-line-format 1 0))))))) + (if header-line-format 1 0) + 2)))))) (defun gnus-article-next-page-1 (lines) - (when (and (not (featurep 'xemacs)) - (numberp lines) - (> lines 0) - (numberp (symbol-value 'scroll-margin)) - (> (symbol-value 'scroll-margin) 0)) + (unless (featurep 'xemacs) ;; Protect against the bug that Emacs 21.x hangs up when scrolling up for ;; too many number of lines if `scroll-margin' is set as two or greater. - (setq lines (min lines - (max 0 (- (count-lines (window-start) (point-max)) - (symbol-value 'scroll-margin)))))) + (when (and (numberp lines) + (> lines 0) + (> scroll-margin 0)) + (setq lines (min lines + (max 0 (- (count-lines (window-start) (point-max)) + scroll-margin)))))) (condition-case () (let ((scroll-in-place nil)) (scroll-up lines)) @@ -6185,9 +6184,9 @@ Argument LINES specifies lines to be scrolled down." (goto-char (point-max)) (recenter (if gnus-article-over-scroll (if lines - (max (+ lines (or (and (boundp 'scroll-margin) - (symbol-value 'scroll-margin)) - 0)) + (max (if (featurep 'xemacs) + lines + (+ lines scroll-margin)) 3) (- (window-height) 2)) -1))) diff --git a/lisp/lpath.el b/lisp/lpath.el index bc814ce83..f3bc848e6 100644 --- a/lisp/lpath.el +++ b/lisp/lpath.el @@ -82,7 +82,7 @@ get-display-table put-display-table select-frame-set-input-focus unicode-precedence-list w32-focus-frame x-focus-frame)) (maybe-bind - '(default-file-name-coding-system))) + '(default-file-name-coding-system scroll-margin))) (when (and (= emacs-major-version 21) (= emacs-minor-version 4)) (maybe-fbind