unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Feature request for extra configuration variable.
@ 2022-05-03 11:30 dalanicolai
  2022-05-03 23:12 ` Yuan Fu
  2022-05-04  0:38 ` Po Lu
  0 siblings, 2 replies; 6+ messages in thread
From: dalanicolai @ 2022-05-03 11:30 UTC (permalink / raw)
  To: Emacs Devel

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

As I have already mentioned here before, I have written image-roll.e
<https://github.com/dalanicolai/image-roll.el>l which provides an
'improved' document 'display engine', to give a better reading scrolling
experience. The package already works quite fine for doc-view en pdf-tools.
However, there is a remaining issue, for which I have asked some question
already here
<https://lists.gnu.org/archive/html/emacs-devel/2022-04/msg01289.html>.

Now I could add extra logic to fix that issue, but I prefer to keep the
code as straightforward, clear and simple as possible.

The issue is due to the behavior, that if some line is already on screen,
then, when jumping to that line will not make the line the 'window start'.
When jumping to a line that is off-screen the problem does not occur, i.e.
Emacs makes it the `window-start` automatically.

The package is implemented so that each page is (on overlay over) a single
line (i.e. a single space). The 'current page' should always be the page
at/overlapping with the window start. So when jumping to a next page, the
new page (i.e. line) should become the new window start.
All pages that are 'calculated' to be not 'on-window' (in view) will get
'undisplayed' to save memory.

So all pages above the 'new current page' get undisplayed, but when the
'new current page' is already within view (on-window), then when we jump to
the new page, the page does not become the window start, and the
undisplayed pages above it stay visible.

When I try to use `(set-window-start ...)`, then for some reason
subsequently setting `vscroll` does not work.
Setting vscroll does work after a `(redisplay)` but then the jump becomes
very 'ugly'.

Now, as obviously, there is already some (visually) 'clean' way to jump to
some line and make it the window start (namely what happens automatically,
when the new line is off-screen before the jump), I would expect that it
should be quite easy to 'apply' the 'same mechanism' when the 'new line' is
already on screen (which does NOT apply currently).

Now, of course it could be that there already exists some 'scrolling'
configuration variable that takes care of this, but I am unable to find it,
and no one responded to my earlier question.

So finally, my request is, if such variable does not exist, would it be
possible to add some variable so that Emacs uses the 'same mechanism' for
jumping to a line that is already 'on-window' as it uses for jumping to
lines that are 'off-window' before jumping?

Then I could keep the code of the package, nice, clear and simple.

Thank you!

[-- Attachment #2: Type: text/html, Size: 3072 bytes --]

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

end of thread, other threads:[~2022-05-04 22:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-03 11:30 Feature request for extra configuration variable dalanicolai
2022-05-03 23:12 ` Yuan Fu
2022-05-03 23:14   ` Yuan Fu
2022-05-04  0:38 ` Po Lu
2022-05-04  7:16   ` dalanicolai
2022-05-04 22:53   ` Yuan Fu

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