Gnus development mailing list
 help / color / mirror / Atom feed
* Recentering during article scrolling with scroll-margin
@ 2008-08-10  9:27 Ralf Angeli
  2008-08-11  2:51 ` Katsumi Yamaoka
  0 siblings, 1 reply; 6+ messages in thread
From: Ralf Angeli @ 2008-08-10  9:27 UTC (permalink / raw)
  To: ding

Hi,

the handling of `scroll-margin' has recently changed a bit in Emacs CVS
and recentering seems to happen more agressively now.  This becomes a
problem if `scroll-margin' is greater than 0 and one is scrolling an
article with <RET>.  When the bottom of the article is reached the last
line will not stay at the bottom of the window but jump to the middle of
it.

The recentering is triggered by the statement
(move-to-window-line -1)
in `gnus-article-next-page'.  It is usually countered by
`gnus-article-next-page-1', but not at the end of an article where the
latter function will not be called.

The problem can be circumvented by changing the above statement to
(move-to-window-line (- -1 scroll-margin))

If necessary I can provide a change log entry for such a change.

-- 
Ralf



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

* Re: Recentering during article scrolling with scroll-margin
  2008-08-10  9:27 Recentering during article scrolling with scroll-margin Ralf Angeli
@ 2008-08-11  2:51 ` Katsumi Yamaoka
  2008-08-11 16:35   ` Ralf Angeli
  0 siblings, 1 reply; 6+ messages in thread
From: Katsumi Yamaoka @ 2008-08-11  2:51 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 1070 bytes --]

>>>>> Ralf Angeli wrote:
> the handling of `scroll-margin' has recently changed a bit in Emacs CVS
> and recentering seems to happen more agressively now.  This becomes a
> problem if `scroll-margin' is greater than 0 and one is scrolling an
> article with <RET>.  When the bottom of the article is reached the last
> line will not stay at the bottom of the window but jump to the middle of
> it.

> The recentering is triggered by the statement
> (move-to-window-line -1)
> in `gnus-article-next-page'.  It is usually countered by
> `gnus-article-next-page-1', but not at the end of an article where the
> latter function will not be called.

> The problem can be circumvented by changing the above statement to
> (move-to-window-line (- -1 scroll-margin))

I tried (setq scroll-margin 3) on the latest Emacs 22.0.50 and
23.0.60 and confirmed this fix is necessary for the case where
`gnus-article-over-scroll' is nil (the default).

> If necessary I can provide a change log entry for such a change.

Please provide it and I'll commit the slightly modified one like:


[-- Attachment #2: Type: application/emacs-lisp, Size: 70 bytes --]

[-- Attachment #3: Type: text/plain, Size: 607 bytes --]


(Note that there is no `scroll-margin' control in XEmacs.)

BTW, another problem related to `scroll-margin' seems to have
been solved in the latest Emacs 22.0.50 and 23.0.60:

>>>>> In <b4m4pbs7c2e.fsf@jpl.org> Katsumi Yamaoka wrote:
> The problem is, in short, that the cursor in the Gnus summary
> buffer jumps to a subject line that is not for the article being
> displayed just after selecting the article by the `g' command, if
> `scroll-margin' is a non-zero value (actually it is 3).  You may
> need to have many articles in threads and to expand the summary
> window to a certain height.

Regards,

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

* Re: Recentering during article scrolling with scroll-margin
  2008-08-11  2:51 ` Katsumi Yamaoka
@ 2008-08-11 16:35   ` Ralf Angeli
  2008-08-11 22:54     ` Katsumi Yamaoka
  2008-08-13 19:01     ` Reiner Steib
  0 siblings, 2 replies; 6+ messages in thread
From: Ralf Angeli @ 2008-08-11 16:35 UTC (permalink / raw)
  To: Katsumi Yamaoka; +Cc: ding

* Katsumi Yamaoka (2008-08-11) writes:

> I tried (setq scroll-margin 3) on the latest Emacs 22.0.50 and
> 23.0.60 and confirmed this fix is necessary for the case where
> `gnus-article-over-scroll' is nil (the default).

Thanks for confirming.

>> If necessary I can provide a change log entry for such a change.
>
> Please provide it and I'll commit the slightly modified one like:
>
> (move-to-window-line (if (featurep 'xemacs) -1 (- -1 scroll-margin)))
>
> (Note that there is no `scroll-margin' control in XEmacs.)

Okay, here is a change log entry and a patch:

2008-08-11  Ralf Angeli  <angeli@caeruleus.net>

	* gnus-art.el (gnus-article-next-page): Respect `scroll-margin' when
	moving point to the bottom of the window in order to avoid recentering.


--- gnus-art.el.~7.279.~	2008-08-03 12:03:34.000000000 +0200
+++ gnus-art.el	2008-08-11 18:30:35.000000000 +0200
@@ -6113,7 +6113,7 @@
 If end of article, return non-nil.  Otherwise return nil.
 Argument LINES specifies lines to be scrolled up."
   (interactive "p")
-  (move-to-window-line -1)
+  (move-to-window-line (if (featurep 'xemacs) -1 (- -1 scroll-margin)))
   (if (and (not (and gnus-article-over-scroll
 		     (> (count-lines (window-start) (point-max))
 			(+ (or lines (1- (window-height)))


-- 
Ralf



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

* Re: Recentering during article scrolling with scroll-margin
  2008-08-11 16:35   ` Ralf Angeli
@ 2008-08-11 22:54     ` Katsumi Yamaoka
  2008-08-13 19:01     ` Reiner Steib
  1 sibling, 0 replies; 6+ messages in thread
From: Katsumi Yamaoka @ 2008-08-11 22:54 UTC (permalink / raw)
  To: ding

>>>>> Ralf Angeli wrote:
> 2008-08-11  Ralf Angeli  <angeli@caeruleus.net>

>         * gnus-art.el (gnus-article-next-page): Respect `scroll-margin' when
>         moving point to the bottom of the window in order to avoid recentering.

Thanks.  I've committed it.



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

* Re: Recentering during article scrolling with scroll-margin
  2008-08-11 16:35   ` Ralf Angeli
  2008-08-11 22:54     ` Katsumi Yamaoka
@ 2008-08-13 19:01     ` Reiner Steib
  2008-08-14  0:48       ` Katsumi Yamaoka
  1 sibling, 1 reply; 6+ messages in thread
From: Reiner Steib @ 2008-08-13 19:01 UTC (permalink / raw)
  To: Ralf Angeli; +Cc: ding

On Mon, Aug 11 2008, Ralf Angeli wrote:

> 	* gnus-art.el (gnus-article-next-page): Respect `scroll-margin' when
> 	moving point to the bottom of the window in order to avoid recentering.
[...]
> +  (move-to-window-line (if (featurep 'xemacs) -1 (- -1 scroll-margin)))

Should we test for `scroll-margin' instead of (featurep 'xemacs)?
E.g. (and (boundp 'scroll-margin) (numberp scroll-margin))?

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/



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

* Re: Recentering during article scrolling with scroll-margin
  2008-08-13 19:01     ` Reiner Steib
@ 2008-08-14  0:48       ` Katsumi Yamaoka
  0 siblings, 0 replies; 6+ messages in thread
From: Katsumi Yamaoka @ 2008-08-14  0:48 UTC (permalink / raw)
  To: ding

>>>>> In <87vdy4buyf.fsf@marauder.physik.uni-ulm.de>
>>>>>	Reiner Steib <reinersteib+gmane@imap.cc> wrote:

>> +  (move-to-window-line (if (featurep 'xemacs) -1 (- -1 scroll-margin)))

> Should we test for `scroll-margin' instead of (featurep 'xemacs)?
> E.g. (and (boundp 'scroll-margin) (numberp scroll-margin))?

That's right if XEmacs team plan to introduce the scroll-margin
control in the future.  But the reason I arbitrarily decided to
use (featurep 'xemacs) is that I don't think so.  It also makes
the source code be clean and makes the byte code be a little bit
fast.  Is it a wrong approach?  In other words, does XEmacs plan
to have the scroll-margin control in the future?

Regards,



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

end of thread, other threads:[~2008-08-14  0:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-10  9:27 Recentering during article scrolling with scroll-margin Ralf Angeli
2008-08-11  2:51 ` Katsumi Yamaoka
2008-08-11 16:35   ` Ralf Angeli
2008-08-11 22:54     ` Katsumi Yamaoka
2008-08-13 19:01     ` Reiner Steib
2008-08-14  0:48       ` Katsumi Yamaoka

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