Changes committed gnus/lisp (ChangeLog gnus-art.el lpath.el)

"Katsumi Yamaoka" <[email protected]> Tue, 12 Aug 2008 00:54:19 +0200
Newsgroups gmane.emacs.gnus.commits
Message-ID <[email protected]>
Modified: ChangeLog gnus-art.el lpath.el

* 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.


Index: ChangeLog
diff -u gnus/lisp/ChangeLog:7.1898 gnus/lisp/ChangeLog:7.1899
--- ChangeLog:7.1898	Fri Aug  8 13:10:55 2008
+++ ChangeLog	Tue Aug 12 00:54:18 2008
@@ -1,3 +1,11 @@
+2008-08-11  Katsumi Yamaoka  <[email protected]>
+
+	* 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  <[email protected]>
 
 	* gnus-msg.el (gnus-summary-supersede-article)
Index: gnus-art.el
diff -u gnus/lisp/gnus-art.el:7.279 gnus/lisp/gnus-art.el:7.280
--- gnus-art.el:7.279	Wed Jul 30 01:59:05 2008
+++ gnus-art.el	Tue Aug 12 00:54:18 2008
@@ -6116,10 +6116,9 @@
   (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 @@
       (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 @@
 	(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: lpath.el
diff -u gnus/lisp/lpath.el:7.45 gnus/lisp/lpath.el:7.46
--- lpath.el:7.45	Tue Jul 29 01:47:19 2008
+++ lpath.el	Tue Aug 12 00:54:18 2008
@@ -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