Gnus development mailing list
 help / color / mirror / Atom feed
* Recentering bug in gnus-xmas - FIX
@ 1996-05-11 17:08 Michael Sperber [Mr. Preprocessor]
  1996-05-13 17:26 ` Mark Borges
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Sperber [Mr. Preprocessor] @ 1996-05-11 17:08 UTC (permalink / raw)



Steve L Baur noticed this awhile ago.  He wrote:

>1.  Setting gnus-auto-center-summary to t (the default) produces bogus
>    behavior on XEmacs 19.14 -- it warps the cursor off of the last
>    article in the *Summary* buffer all too often.

This is due to the fact that window-height doesn't really report what
you want.

The patch is relative to 0.80.  Our ftp gateway is shut down, so I'm
not sure the bug's still there in the current sgnus

Cheers =8-} Mike

*** lisp/gnus-xmas.el~	Mon Apr 29 04:32:20 1996
--- lisp/gnus-xmas.el	Sat May 11 19:03:36 1996
***************
*** 110,119 ****
  			 gnus-summary-selected-face))))
  
  (defun gnus-xmas-summary-recenter ()
!   (let* ((top (cond ((< (window-height) 4) 0)
! 		    ((< (window-height) 7) 1)
  		    (t 2)))
! 	 (height (- (window-height) 2))
  	 (bottom (save-excursion (goto-char (point-max))
  				 (forward-line (- height))
  				 (point)))
--- 110,119 ----
  			 gnus-summary-selected-face))))
  
  (defun gnus-xmas-summary-recenter ()
!   (let* ((top (cond ((< (window-displayed-height) 4) 0)
! 		    ((< (window-displayed-height) 7) 1)
  		    (t 2)))
! 	 (height (- (window-displayed-height) 2))
  	 (bottom (save-excursion (goto-char (point-max))
  				 (forward-line (- height))
  				 (point)))


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Recentering bug in gnus-xmas - FIX
  1996-05-11 17:08 Recentering bug in gnus-xmas - FIX Michael Sperber [Mr. Preprocessor]
@ 1996-05-13 17:26 ` Mark Borges
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Borges @ 1996-05-13 17:26 UTC (permalink / raw)
  Cc: ding

>> On 11 May 1996 19:08:51 +0200,
>> Michael Sperber [Mr Preprocessor](ms) wrote:
ms> Steve L Baur noticed this awhile ago.  He wrote:
>> 1.  Setting gnus-auto-center-summary to t (the default) produces bogus
>> behavior on XEmacs 19.14 -- it warps the cursor off of the last
>> article in the *Summary* buffer all too often.

ms> This is due to the fact that window-height doesn't really report what
ms> you want.
ms> The patch is relative to 0.80.  Our ftp gateway is shut down, so I'm
ms> not sure the bug's still there in the current sgnus

I think this patch was applied to sgnus-0.84 (the new defun is
appended) but it doesn't work. I still see the lossage. Was the patch
applied correctly?

(defun gnus-xmas-summary-recenter ()
  "\"Center\" point in the summary window.
If `gnus-auto-center-summary' is nil, or the article buffer isn't
displayed, no centering will be performed."
  ;; Suggested by earle@mahendo.JPL.NASA.GOV (Greg Earle).
  ;; Recenter only when requested.  Suggested by popovich@park.cs.columbia.edu.
  (when gnus-auto-center-summary
    (let* ((height (if (fboundp 'window-displayed-height)
		       (window-displayed-height)
		     (- (window-height) 2)))
	   (top (cond ((< height 4) 0)
		      ((< height 7) 1)
		      (t 2)))
	   (bottom (save-excursion (goto-char (point-max))
				   (forward-line (- height))
				   (point)))
	   (window (get-buffer-window (current-buffer))))
      (when (get-buffer-window gnus-article-buffer)
	;; Only do recentering when the article buffer is displayed,
	;; Set the window start to either `bottom', which is the biggest
	;; possible valid number, or the second line from the top,
	;; whichever is the least.
	(set-window-start
	 window (min bottom (save-excursion 
			      (forward-line (- top)) (point)))))
      ;; Do horizontal recentering while we're at it.
      (when (and (get-buffer-window (current-buffer) t)
		 (not (eq gnus-auto-center-summary 'vertical)))
	(let ((selected (selected-window)))
	  (select-window (get-buffer-window (current-buffer) t))
	  (gnus-summary-position-point)
	  (gnus-horizontal-recenter)
	  (select-window selected))))))

-- 
  -mb-


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-05-13 17:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-05-11 17:08 Recentering bug in gnus-xmas - FIX Michael Sperber [Mr. Preprocessor]
1996-05-13 17:26 ` Mark Borges

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).