From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: dalanicolai Newsgroups: gmane.emacs.devel Subject: Re: {PATCH] continuous scroll for doc-view (FOR REVIEW)) Date: Sat, 15 Jan 2022 19:09:22 +0100 Message-ID: References: <86a6fypz3p.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000052891505d5a2d288" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24532"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs Devel To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jan 15 19:12:01 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n8nWz-0006E0-BE for ged-emacs-devel@m.gmane-mx.org; Sat, 15 Jan 2022 19:12:01 +0100 Original-Received: from localhost ([::1]:37604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8nWx-0006f6-SN for ged-emacs-devel@m.gmane-mx.org; Sat, 15 Jan 2022 13:11:59 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8nUi-0005qH-Hs for emacs-devel@gnu.org; Sat, 15 Jan 2022 13:09:40 -0500 Original-Received: from [2607:f8b0:4864:20::935] (port=41871 helo=mail-ua1-x935.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8nUg-0004hS-76 for emacs-devel@gnu.org; Sat, 15 Jan 2022 13:09:40 -0500 Original-Received: by mail-ua1-x935.google.com with SMTP id i10so857693uab.8 for ; Sat, 15 Jan 2022 10:09:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eWd2WrA2qZ4YOnYk+4CeNOvITkQZ3PE0Y5VHvtHwBZI=; b=SXBxCye4vfLW+X79hN8YB1Se8+Y96zqTxXu5laSXIO7GqUcQUGG9UdpGgvUDBZDNIC KUzwqjH0j2Dj4chr2AH6M4+4rsnl1SXyC2vrykSg9b1pE2zNK/bXty4nYyerxJ+EkKEW P2GtJs+mv6P5Vb2tQz0D3rzGcRtGjXaia7XeHaQUBWD9QSG7sbfjns/FVOMqh7y96Kby Go3J8e2VCecD9uYKURvBMqi2tzFedr6DuTlatoNF4p3ZS+ck3G4A2xmqOYPOtt35ksYD KMx9a3LAcHjS/937od8w0CIWzQ4qApdQR3U92XotChzwOS8tmz5QofTcdfPLQFgz3iHn ljpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eWd2WrA2qZ4YOnYk+4CeNOvITkQZ3PE0Y5VHvtHwBZI=; b=bpDrifSsfmSK+SxYkShtSgasLSoyvCAufe552Gj3XNB0eq7Wfg2Gs/SLUuFDeqRDua GnsY9MDaR2OOV5YK/44tIWCbOJLqdtCYEnI1y+tkzJfxnpjpJQQ+tEWqsLZBtNFG3nZn DqjWjEtwkHgNxDA1mPx82LF6Ah3l91gJUuiO7Ogh6n3KuODzFqdH84olMEX+1v6UoR7K OaZsudtGZ7FZX1aJCMtrwiCgcwRGCE0jaT5COrXc49UcoGAme+ZRiEqCCaNBYL5LXFfP V0Df/zieqUBneuaqg4DjqiCDLQcCtX1PbMAYcqGDU0hEFI07bPdTmyIGQNxda829GEM1 iWNA== X-Gm-Message-State: AOAM531nK+O4DsF/DZiQ4l5kvGj+qMxp5BflCr2M1WwAJAc5rMK9LTHE y6Gz1dEo+fmBifrJqldodeJdPhtEWW3ymEvszSyxVmi3 X-Google-Smtp-Source: ABdhPJz3FDpvtbUaub6XmFtNFinLcdl5ifaV+CdwDWEY1oaDN0BxDV6oWhzYcgEhh388zKhCdpWPSokTzojpYia5w5Y= X-Received: by 2002:ab0:74d5:: with SMTP id f21mr6218119uaq.134.1642270173595; Sat, 15 Jan 2022 10:09:33 -0800 (PST) In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::935 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::935; envelope-from=dalanicolai@gmail.com; helo=mail-ua1-x935.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:284781 Archived-At: --00000000000052891505d5a2d288 Content-Type: text/plain; charset="UTF-8" I have not checked it, but probably to make the 'scaling' work, the overlays must be drawn in a later stage. I have it successfully working in pdf-tools, in the simple-continuous-scroll branch of my pdf-tools fork . The branch requires the latest version of bookroll.el to be loaded first. So, in case anybody is interested in reviewing any code, then probably reviewing the pdf-tools code would be more useful (or both the doc-view and the pdf-tools code). On Fri, 14 Jan 2022 at 12:03, dalanicolai wrote: > About the mouse scrolling not working, I guess it is not filling the > buffer with empty svg's yet. > Although I still have to check that assumption. All seemed to work fine > with keyboard scrolling > (which I what I more or less use exclusively, e.g. jumping to page goes > faster by keyboard. > And there is a nice toc-mode package for > quickly creating outlines. But anyway mouse scroliing > should also be supported of course). > > On Fri, 14 Jan 2022 at 11:44, dalanicolai wrote: > >> Thanks, if you want you could attach whole files, because program files >>> take almost no space on mailing list archives, so this is not a problem >>> (the problem is when someone posts large screenshots, and even a video). >>> >> >> I wanted to do that already... terrible how in the end I did forget to >> attach the files... >> >> >>> If it could be used for other images such as for image galleries, >>> then it should be a separate package like image-mode. >>> >> >> Well, I think I really wouldn't want continuous scroll for images. So I >> think a separate >> library for image galleries would be better. I think the logic for only >> showing full images >> is a slightly simpler and therefore could be made more flexible. Creating >> the overlays is >> really just a few lines. But I am not sure, how exactly the code for an >> image gallery >> should look like. Maybe in the end, some code could be shared. >> >> A triplet or a doublet means that the scroll bar can't be used for >>> scrolling all pages? Have you tried to prefill with overlays for all >>> pages? >>> >> >> Yes, like in the Proof of Concept, all overlays are inserted at once, but >> they are 'triplet' >> only showing a triplet of images at the time. So the full buffer can be >> scrolled with the >> mouse/scroll-bar, but for some reason updating the images in that case >> does not seem >> to work yet (although from the code I would expect it should). >> >> Anyway, This time I'll send the message including the attachments... you >> can have a look >> (see first message for instructions, if necessary). >> >> >> On Fri, 14 Jan 2022 at 09:19, Juri Linkov wrote: >> >>> > I'd really like to mention that I get no hits when searching for that >>> > thread (actually searching >>> > for 'the original thread') when searching on `multi image PDF` in the >>> Emacs >>> > devel archive. >>> > (This time) it is not due to too many results. Would be great if you >>> could >>> > inform me why that does not work. >>> >>> Trying to search any recent subject shows that indexing on mailing lists >>> was disabled for a few last months. >>> >>> > So I will attach two files here, the first is an 'adapted' bookroll.el >>> > file, and the second is a >>> > a modified doc-view file that implements the first 'rudimentary' >>> continuous >>> > scroll for PDF >>> > documents(despite the subject title of this message, I am simply >>> attaching >>> > the file, >>> > as you can then more simply load and try it, while I guess you must be >>> > capable of diffing it with >>> > the latest doc-view.el file yourself ;). >>> >>> Thanks, if you want you could attach whole files, because program files >>> take almost no space on mailing list archives, so this is not a problem >>> (the problem is when someone posts large screenshots, and even a video). >>> >>> Or you can just make a copy of doc-view.el in your repository, >>> and send a message when you update it. >>> >>> > I am not sure if the bookroll-mode should be a separate package (like >>> image-mode), >>> > or that it could just get merged into doc-view. But it is as it is for >>> the >>> > development process. >>> >>> If it could be used for other images such as for image galleries, >>> then it should be a separate package like image-mode. >>> >>> > To understand the approach of bookmark.el, it is probably most useful >>> to >>> > look at the Proof >>> > of Concept file to which I have linked already above. It simply draws a >>> > triplet of images (pages) >>> > for each page (and a doublet for the first and last pages), and then it >>> > uses a 'currently-displayed-images' list, and refreshes pages when >>> > necessary by comparing with that list. The current page is the page >>> that >>> > takes more than half of the window height. >>> >>> A triplet or a doublet means that the scroll bar can't be used for >>> scrolling all pages? Have you tried to prefill with overlays for all >>> pages? >>> >> --00000000000052891505d5a2d288 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I have not checked it, but probably to make the '= scaling' work, the overlays must be drawn in a later stage.
I= have it successfully working in pdf-tools, in the simple-continuou= s-scroll branch of my pdf-tools fork.
The branch requires the= latest version of bookroll.el to be loaded first.
So, in case anybody is interested in reviewing any code, then probably re= viewing the pdf-tools code
would be more useful (or both the doc= -view and the pdf-tools code).


On Fri, 14 Jan 2022 at 11:44, dalanicolai <= ;dalanicolai@gma= il.com> wrote:
Thanks, if you want you could attach whole files, because program files<= br> take almost no space on mailing list archives, so this is not a problem
(the problem is when someone posts large screenshots, and even a video).

I wanted to do that already... terrible= how in the end I did forget to attach the files...
=C2=A0
If it could be used f= or other images such as for image galleries,
then it should be a separate package like image-mode.

Well, I think I really wouldn't want contin= uous scroll for images. So I think a separate
library for image g= alleries would be better. I think the logic for only showing full images
is a slightly simpler and therefore could be made more flexible. Cr= eating the overlays is
really just a few lines. But I am not sure= , how exactly the code for an image gallery
should look like. May= be in the end, some code could be shared.

A triplet or a doublet means= that the scroll bar can't be used for
scrolling all pages?=C2=A0 Have you tried to prefill with overlays for all = pages?

Yes, like in the Proof o= f Concept, all overlays are inserted at once, but they are 'triplet'= ;
only showing a triplet of images at the time. So the full buffe= r can be scrolled with the
mouse/scroll-bar, but for some reason = updating the images in that case does not seem
to work yet (altho= ugh from the code I would expect it should).

Anywa= y, This time I'll send the message including the attachments... you can= have a look
(see first message for instructions, if necessary).<= br>


On Fri, 14 Jan 2022 at 09:19, Juri Linkov <juri@linkov.net> wro= te:
> I'd= really like to mention that I get no hits when searching for that
> thread (actually searching
> for 'the original thread') when searching on `multi image PDF`= in the Emacs
> devel archive.
> (This time) it is not due to too many results. Would be great if you c= ould
> inform me why that does not work.

Trying to search any recent subject shows that indexing on mailing lists was disabled for a few last months.

> So I will attach two files here, the first is an 'adapted' boo= kroll.el
> file, and the second is a
> a modified doc-view file that implements the first 'rudimentary= 9; continuous
> scroll for PDF
> documents(despite the subject title of this message, I am simply attac= hing
> the file,
> as you can then more simply load and try it, while I guess you must be=
> capable of diffing it with
> the latest doc-view.el file yourself ;).

Thanks, if you want you could attach whole files, because program files
take almost no space on mailing list archives, so this is not a problem
(the problem is when someone posts large screenshots, and even a video).
Or you can just make a copy of doc-view.el in your repository,
and send a message when you update it.

> I am not sure if the bookroll-mode should be a separate package (like = image-mode),
> or that it could just get merged into doc-view. But it is as it is for= the
> development process.

If it could be used for other images such as for image galleries,
then it should be a separate package like image-mode.

> To understand the approach of bookmark.el, it is probably most useful = to
> look at the Proof
> of Concept file to which I have linked already above. It simply draws = a
> triplet of images (pages)
> for each page (and a doublet for the first and last pages), and then i= t
> uses a 'currently-displayed-images' list, and refreshes pages = when
> necessary by comparing with that list. The current page is the page th= at
> takes more than half of the window height.

A triplet or a doublet means that the scroll bar can't be used for
scrolling all pages?=C2=A0 Have you tried to prefill with overlays for all = pages?
--00000000000052891505d5a2d288--