* lpath.el: Bind scroll-margin for XEmacs 21.4 and SXEmacs.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 11 Aug 2008 22:54:18 +0000 (22:54 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 11 Aug 2008 22:54:18 +0000 (22:54 +0000)
* 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.

lisp/ChangeLog
lisp/gnus-art.el
lisp/lpath.el

index bde885f..42f93aa 100644 (file)
@@ -1,3 +1,11 @@
+2008-08-11  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * 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  <yamaoka@jpl.org>
 
        * gnus-msg.el (gnus-summary-supersede-article)
index 3d5ce9b..a3e0285 100644 (file)
@@ -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)))
index bc814ce..f3bc848 100644 (file)
@@ -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