Gnus development mailing list
 help / color / mirror / Atom feed
From: Mark Borges <mdb@cdc.noaa.gov>
Cc: ding@ifi.uio.no
Subject: Re: Recentering bug in gnus-xmas - FIX
Date: 13 May 1996 11:26:44 -0600	[thread overview]
Message-ID: <vkspd4pjqj.fsf@cdc.noaa.gov> (raw)
In-Reply-To: sperber@informatik.uni-tuebingen.de's message of 11 May 1996 19:08:51 +0200

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


      reply	other threads:[~1996-05-13 17:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-05-11 17:08 Michael Sperber [Mr. Preprocessor]
1996-05-13 17:26 ` Mark Borges [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vkspd4pjqj.fsf@cdc.noaa.gov \
    --to=mdb@cdc.noaa.gov \
    --cc=ding@ifi.uio.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).