Closed twmr closed 2 years ago
Haha... funny those eyes. Anyway, thanks for your message. If @vedang would be happy with this, then I would be happy to get this merged into pdf-tools.
But it still is a hacky solution, that quickly gets 'confused' e.g. when switching between buffers etc. Although it is usually easy to reset it by toggling the mode off and on...
I agree that this is a slightly hacky way to solve the problem of continuous scrolling in pdf-tools
:).
I want to map out all the work I need to do to potentially fix this in the package itself, but as politza has already explained, it requires significant rethinking of some of the functions.
I'm open to considering ways to merge this code as an optional / alpha feature in pdf-tools
. I'll think about this some more (how to provide alpha opt-in) and get back to this.
Tagging vedang/pdf-tools#18 here so that new people can find this repository in the meantime.
Haha, yes it is hacky, but it was the fastest way to achieve it.
Do you have any idea for how you would like to implement this?
I will just mention another (probably useless, but who knows;) approach:
I guess another way to achieve this would be by embedding multiple png images in a svg image. Then pixel-scroll-mode
could be used for scrolling (I've also implemented a png embedded in svg solution to add annotation rendering features to the djvu package here).
I've quickly tested this by drawing a single svg image in a buffer e.g. with:
(let ((svg (svg-create 800 1200)))
(mapcar (lambda (z) (apply
(lambda (x y)
(svg-rectangle svg 0 (+ 600 x) 800 600 :fill-color y)
(insert-image (svg-image svg))
(newline))
z))
'((0 "red") (600 "green"))))
(This code, with the two lambda's, looks a little ugly to me, maybe you know a simpler way?)
Anyway, now that image can be scrolled with pixel-scroll-mode
.
But surely, adapting all pdf-mode's (annotation) features is a lot of work for the little gain.
Of course, it would be much nicer if Emacs got some kind of canvas object (for which I have seen a proposal here).
Well, maybe this could be of any help...
@dalanicolai Am I right that the Emacs canvas proposal you link to seems to be dead? It looks cool but from what I can tell the conversation petered out over a year ago after a not-especially-warm reception from the Emacs maintainer.
@titaniumbones Yeah it looks dead, but maybe it could be revived if some pdf-tools enthusiast indicates that this would be a nice feature for Emacs document viewers too.
Closing the issue for archiving this repo. A better implementation is available at https://github.com/dalanicolai/image-roll.el
Now that pdf-tools has a new maintainer, maybe you want to consider merging the project into https://github.com/vedang/pdf-tools even though you still consider the implementation as a hack (not sure if this is still the case). pdf-contiuous-scroll-mode would IMO get more attention if it were part of the upstream pdf-tools pkg. WDYT?
cc @vedang