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: Thu, 13 Jan 2022 11:58:14 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000ca27bd05d574908a" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26826"; mail-complaints-to="usenet@ciao.gmane.io" To: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 13 12:01:43 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 1n7xrS-0006lw-Jj for ged-emacs-devel@m.gmane-mx.org; Thu, 13 Jan 2022 12:01:42 +0100 Original-Received: from localhost ([::1]:39130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7xrQ-0002iV-MD for ged-emacs-devel@m.gmane-mx.org; Thu, 13 Jan 2022 06:01:40 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52264) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7xoM-0000KP-2W for emacs-devel@gnu.org; Thu, 13 Jan 2022 05:58:30 -0500 Original-Received: from [2607:f8b0:4864:20::92f] (port=46858 helo=mail-ua1-x92f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n7xoJ-0004Qm-0i for emacs-devel@gnu.org; Thu, 13 Jan 2022 05:58:29 -0500 Original-Received: by mail-ua1-x92f.google.com with SMTP id c36so10148204uae.13 for ; Thu, 13 Jan 2022 02:58:26 -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; bh=EET6RO0mAHb1/tfdFqDiRaHM/YpquwPR5nFBm+zUlQQ=; b=RCnIW7xAZYk3XcU2MbRm+Ye6weh76lK7R3HNPFoOI40LauQQWRTK5mP8ZipSnLWYjB WCd39r5roJW+wsmP0cT2AAZD2TVeELURV7k4pvj4W1AGuHLkGRcouNGmm+8zRtAHBh4N Pn7jorzX87vsVp1P2z4/kNb6zVG9gLXuRZe7Xo4/XyIUwodypdaUGOLFUdYradVluJ6s tt0l9E+LYvzEcEOB4jg/HpwS5l/huy6P7b+4LoTEuSxe5U9rIIAsh+CwP3VYnAf5zcan bAHD6sKCxonYgm1F/g3qA57Z5fPuPMsqcZPCxM9IvNuWpNOSC0T84yvxbrzfUq1DNmgU y/Ow== 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; bh=EET6RO0mAHb1/tfdFqDiRaHM/YpquwPR5nFBm+zUlQQ=; b=12jFEn6SYDPffn/y98ymGLiqc7LVmlvy+luPnbwwYTgYER+duUXs2dlBUqOeBci7OH 9wFV5uLP48ALTfjqME0iv/+7bKrOCK29b+uTR+ozLFu/5SbV+lEAUY22XDSArqFBTjzp ILN7HKBK/evEbUN23NwAdBgI0I+aS/z7s18y+mKcizzHnTtckjLaEUOlP/bKRZU0R1lU h4JhMdB3MGgzCv671WlxeYwYeIFhwhhCaN0oNOmmz1hwGkFA0m8s96L5RbhA+ERVBj0n ZFRMk1FRpdAE/9ZhN7BDdm4oEPsqNjqp8gLFxnGRTl0FzKPsuYbe1wKD6Yra+AdQbpup nelA== X-Gm-Message-State: AOAM532oBUAwXg0c5rEanOtVl7dQwvCSDZWYIE578leKiGVN7/W/SEJG X2oMsDgr+OqnJr806KcBLa/SrkkT+VFCNHtgzRqHZDZ8 X-Google-Smtp-Source: ABdhPJzwrX0nzunC2hcVdLLFbb97F8sRFI6WT4Lq99LCk3zptxglzKP39vqeDZhaEus5hilh/Ql1aYZ107EF7sLILss= X-Received: by 2002:a67:ff81:: with SMTP id v1mr2015975vsq.2.1642071505642; Thu, 13 Jan 2022 02:58:25 -0800 (PST) In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::92f (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::92f; envelope-from=dalanicolai@gmail.com; helo=mail-ua1-x92f.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, 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:284701 Archived-At: --000000000000ca27bd05d574908a Content-Type: text/plain; charset="UTF-8" I have more or less no experiences with patches, so I hope you don't mind that I am just quickly ask here; so are (or can be) these kind of 'subcommits' and their commit messages part of some final patch. Or is there some other way to handle it? On Thu, 13 Jan 2022 at 11:53, dalanicolai wrote: > I am not sure how to best handle this, but I figured I'll better keep you > involved (get feedback better sooner than later). > > So I have got the code for a first 'working' example for the continuous > scroll. > > Let me comment a little first: > So I've started from the Proof of Concept here > , on which I commented > on more already in the thread here > > (original thread is here > ). > > > A very short, but 'noteworthy' digression ... > > 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. > > > Back to the main subject... > > 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 ;). > For, now it only works on PDF documents (I hope all of them), because I > have to find good 'splitting points' for the various overlays (this was > the original approach > that I'd used in pdf-view, I prefer to keep the document it's contents in > the buffer and drawing > the overlays over it). For other types of documents I've tried to > 'determine' split points using `forward-line`, but that did not give > satisfactory results. > > 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. > > So now some comments on the files/approach: > > 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. > > In the single page doc-view there is a single overlay, that informs via > its properties many doc-view functions about which step to take next (it > controls the doc-view 'process'). In the bookroll > doc-view version, This overlay is kept as a 'control' overlay, which is > not used for containing images. The overlays for 'holding' the images are > in the `overlay-list`. (Although this solution > for the control overlay looks simple, it took me quite some investigation > and error and trial to > come up with it, which is also to say that I think it is a nice solution). > > For now, the scrolling is too continuous (i.e. now separation indicator > between the pages), but I > am planning to embed the files in svg images (as I have done in djvu3.el > ), so that it will be easy > to draw a line between the pages > > So, anyone who is interested can have a look at the code, and of course > any feedback and suggestions are welcome I am no experienced programmer, > and I am also fairly new to Emacs > (actually Spacemacs which I think is (also) a really great project). I am > only able to do this because of your great (documentation) work :) If you > find things that looks like 'bad developing > process practice', then I am very happy with good/better suggestions. > > As I have to take care of 'fixing' the 'resizing/scaling/zoom' > functionality now, any comments > ideas on that part would be welcome in particular... > > Quite obviously, to test it, load the bookmark.el file, then load the > doc-view.el file, open some PDF document and start scrolling using `j`/`k`. > --000000000000ca27bd05d574908a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I have more or less no experiences with patches, so I= hope you don't mind that I am just quickly ask here;
so are = (or can be) these kind of 'subcommits' and their commit messages pa= rt of some final patch. Or is
there some other way to handle it?<= br>

On Thu, 13 Jan 2022 at 11:53, dalanicolai <dalanicolai@gmail.com> wrote:
I am not su= re how to best handle this, but I figured I'll better keep you
involved (get feedback better sooner than later).

So I have got the code for a first 'working' example for the cont= inuous scroll.

Let me comment a little first:
So I've started from the Proof of Concept here, on which I comm= ented
on more already in the thread h= ere (original thread is here).


A very short, but 'noteworthy' digr= ession ...

I'd really like to mention that I g= et no hits when searchi= ng for that thread (actually searching
for 'the original= thread') when searching on `multi image PDF` in the Emacs devel archiv= e.
(This time) it is not due to too many results. Would be great = if you could inform me why that
does not work.


Back to the main subject...

So I will attach two files here, the first is an 'adapted' bookrol= l.el file, and the second is a
a modified doc-view file that impl= ements 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 yo= u must be capable of diffing it with
the latest doc-view.el file = yourself ;).
For, now it only works on PDF documents (I hope= all of them), because I
have to find good 'splitting p= oints' for the various overlays (this was the original approach
that I'd used in pdf-view, I prefer to keep the document it's co= ntents in the buffer and drawing
the overlays over it). For other= types of documents I've tried to 'determine' split points usin= g `forward-line`, but that did not give satisfactory results.
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-vie= w. But it is as it is for the development process.

So now some comments on the files/approach:

To un= derstand 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-di= splayed-images' list, and refreshes pages when necessary by comparing w= ith that list. The current page is the page that takes more than half of th= e window height.

In the single page doc-view there= is a single overlay, that informs via its properties many doc-view functio= ns about which step to take next (it controls the doc-view 'process'= ;). In the bookroll
doc-view version, This overlay is kept as a &= #39;control' overlay, which is not used for containing images. The over= lays for 'holding' the images are in the `overlay-list`. (Although = this solution
for the control overlay looks simple, it took me qu= ite some investigation and error and trial to
come up with it, wh= ich is also to say that I think it is a nice solution).

For now, the scrolling is too continuous (i.e. now separation indicat= or between the pages), but I
am planning to embed the files in sv= g images (as I have done in djvu3.el), so that it will be easy
to dr= aw a line between the pages

So, anyone who is = interested can have a look at the code, and of course any feedback and sugg= estions are welcome I am no experienced programmer, and I am also fairly ne= w to Emacs
(actually Spacemacs which I think is (also) a really g= reat project). I am only able to do this because of your great (documentati= on) work :) If you find things that looks like 'bad developing
process practice', then I am very happy with good/better suggestions= .

As I have to take care of 'fixing' t= he 'resizing/scaling/zoom' functionality now, any comments
ideas on that part would be welcome in particular...

=
Quite obviously, to test it, load the bookmark.el file, then load the = doc-view.el file, open some PDF document and start scrolling using `j`/`k`.=
--000000000000ca27bd05d574908a--