galdor / rfc-mode

An Emacs major mode to read and browse RFC documents.
ISC License
105 stars 10 forks source link

Unify redisplay after jumps, scrolling point to or near window top #19

Closed stepnem closed 1 year ago

stepnem commented 1 year ago

Jumping to a section and leaving point near page bottom makes for strange user experience.

rfc-mode-{backward,forward}-page did scroll the new position to window top already; unify the behavior using new rfc-mode-recenter function, reusing the recenter-top-bottom machinery to respect scroll-margin et al.

Edited to fix Markdown formatting

galdor commented 1 year ago

What do you mean by "strange" ? I am not sure I understand what the problem is.

stepnem commented 1 year ago

When I jump to a section I expect the section heading to end up at the top of the screen, so that as much of its contents as possible is immediately visible without further ado.

That's not what was happening in rfc-mode when I used it (the section heading would end up near the bottom, so I'd have to continue scrolling to see its contents). It does happen with the changes in this PR.

I'd expect most people have a similar expectation, hence "strange" as an attribute of the original behaviour.

galdor commented 1 year ago

Ok I tested your patch, and I understand your point, it is merged. Thank you!