Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

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

Closed
twmr opened this issue May 22, 2021 · 6 comments
Closed

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

twmr opened this issue May 22, 2021 · 6 comments

Comments

@twmr
Copy link

twmr commented May 22, 2021

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
Copy link
Owner

dalanicolai commented May 27, 2021

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
Copy link

vedang commented May 29, 2021

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
Copy link
Owner

dalanicolai commented May 29, 2021

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
Copy link

@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
Copy link
Owner

@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
Copy link
Owner

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

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants