unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: 23.0.60; Constant recentering with scroll-margin set
       [not found] ` <874p5vnys3.fsf@photon.caeruleus.net>
@ 2008-08-09  1:30   ` Chong Yidong
  2008-08-09  1:40     ` Lennart Borgman (gmail)
  2008-08-12 19:15     ` Stefan Monnier
  0 siblings, 2 replies; 4+ messages in thread
From: Chong Yidong @ 2008-08-09  1:30 UTC (permalink / raw)
  To: emacs-devel

Ralf Angeli <angeli@caeruleus.net> writes:

> * Ralf Angeli (2008-08-07) writes:
>
>> It could also be that this has to be fixed in Gnus.  I'm not sure, but I
>> remember that there was a similar issue back in 2005 where some changes
>> hat to be made in `gnus-article-next-page' and related functions in
>> order to deal with some changes in the handling of `scroll-margin'.
>
> Okay, the problem is the statement
> (move-to-window-line -1)
> in `gnus-article-next-page'.  If `scroll-margin' is set and greater than
> 0 it will lead to a recentering.  This is usually countered by
> `gnus-article-next-page-1', but not at the end of an article where
> `gnus-article-next-page-1' will not be called.
>
> The problem can be circumvented by changing the above statement to
> (move-to-window-line (- -1 scroll-margin))
>
> Let me know if the recentering behavior will stay like it is now, then
> I can report this to the Gnus maintainers.

What do people think?  When there is a scroll-margin, should
move-to-window-line automagically move to the scroll-margin instead of
recentering?




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

* Re: 23.0.60; Constant recentering with scroll-margin set
  2008-08-09  1:30   ` 23.0.60; Constant recentering with scroll-margin set Chong Yidong
@ 2008-08-09  1:40     ` Lennart Borgman (gmail)
  2008-08-12 19:15     ` Stefan Monnier
  1 sibling, 0 replies; 4+ messages in thread
From: Lennart Borgman (gmail) @ 2008-08-09  1:40 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel

Chong Yidong wrote:
> Ralf Angeli <angeli@caeruleus.net> writes:
> 
>> * Ralf Angeli (2008-08-07) writes:
>>
>>> It could also be that this has to be fixed in Gnus.  I'm not sure, but I
>>> remember that there was a similar issue back in 2005 where some changes
>>> hat to be made in `gnus-article-next-page' and related functions in
>>> order to deal with some changes in the handling of `scroll-margin'.
>> Okay, the problem is the statement
>> (move-to-window-line -1)
>> in `gnus-article-next-page'.  If `scroll-margin' is set and greater than
>> 0 it will lead to a recentering.  This is usually countered by
>> `gnus-article-next-page-1', but not at the end of an article where
>> `gnus-article-next-page-1' will not be called.
>>
>> The problem can be circumvented by changing the above statement to
>> (move-to-window-line (- -1 scroll-margin))
>>
>> Let me know if the recentering behavior will stay like it is now, then
>> I can report this to the Gnus maintainers.
> 
> What do people think?  When there is a scroll-margin, should
> move-to-window-line automagically move to the scroll-margin instead of
> recentering?

Yes. Automatic recentering is very disturbing IMO.




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

* Re: 23.0.60; Constant recentering with scroll-margin set
  2008-08-09  1:30   ` 23.0.60; Constant recentering with scroll-margin set Chong Yidong
  2008-08-09  1:40     ` Lennart Borgman (gmail)
@ 2008-08-12 19:15     ` Stefan Monnier
  2008-08-13  2:33       ` Miles Bader
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2008-08-12 19:15 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel

> What do people think?  When there is a scroll-margin, should
> move-to-window-line automagically move to the scroll-margin instead of
> recentering?

I never used it, neither interactively nor programmatically, so I don't
have a strong opinion on that.  Reading the docstring I get the
impression that the intention is to place the cursor at a particular
location within the window, rather than to place point at a particular
location within the buffer.  So that leads me to think that it should
never cause recentering.  Maybe if the operation cannot be performed,
the function should return the number of lines "left".


        Stefan




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

* Re: 23.0.60; Constant recentering with scroll-margin set
  2008-08-12 19:15     ` Stefan Monnier
@ 2008-08-13  2:33       ` Miles Bader
  0 siblings, 0 replies; 4+ messages in thread
From: Miles Bader @ 2008-08-13  2:33 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Chong Yidong, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> What do people think?  When there is a scroll-margin, should
>> move-to-window-line automagically move to the scroll-margin instead of
>> recentering?
>
> I never used it, neither interactively nor programmatically, so I don't
> have a strong opinion on that.  Reading the docstring I get the
> impression that the intention is to place the cursor at a particular
> location within the window, rather than to place point at a particular
> location within the buffer.  So that leads me to think that it should
> never cause recentering.  Maybe if the operation cannot be performed,
> the function should return the number of lines "left".

I use this function constantly -- I have simple wrappers bound to M-,
M-/ and M-. to move to the top, middle, and bottom of the window.

I almost never use a non-zero scroll-margin, so I don't have that much
experience with this problem, but I agree that it feels kind of weird if
move-to-window-line causes scrolling.

I kinda wish it would simply "disobey" the scroll-margin and locate the
cursor there without scrolling, but that probably isn't easy to
implement.

The suggested behavior of "stopping short", by having it move to line
(min (max N scroll-margin) (- window-height scroll-margin)) seems
reasonable interactively.

It might surprise some programmatic users, but on the other hand,
scrolling will probably surprise them too, so I guess there's really not
much you can do in that case; such code probably simply isn't prepared
to deal with a non-zero scroll-margin...

-Miles

-- 
`To alcohol!  The cause of, and solution to,
 all of life's problems' --Homer J. Simpson




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

end of thread, other threads:[~2008-08-13  2:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <874p5xk2s6.fsf@stupidchicken.com>
     [not found] ` <874p5vnys3.fsf@photon.caeruleus.net>
2008-08-09  1:30   ` 23.0.60; Constant recentering with scroll-margin set Chong Yidong
2008-08-09  1:40     ` Lennart Borgman (gmail)
2008-08-12 19:15     ` Stefan Monnier
2008-08-13  2:33       ` Miles Bader

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).