dalanicolai / pdf-continuous-scroll-mode.el

A pdf-tools extension that provides continuous scrolling functionality
GNU General Public License v3.0
144 stars 10 forks source link

Plans to merge into vedang/pdf-tools? #13

Closed twmr closed 2 years ago

twmr commented 3 years ago

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

dalanicolai commented 3 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...

vedang commented 3 years ago

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.

dalanicolai commented 3 years ago

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

titaniumbones commented 3 years ago

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

dalanicolai commented 3 years ago

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

dalanicolai commented 2 years ago

Closing the issue for archiving this repo. A better implementation is available at https://github.com/dalanicolai/image-roll.el