From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Continuous image scrolling Date: Tue, 03 Apr 2018 22:59:43 +0300 Organization: LINKOV.NET Message-ID: <87370c83io.fsf@mail.linkov.net> References: <87inaiss6l.fsf@web.de> <6FCF6ACA-4F29-4B6B-BE9D-D7130C6E9495@gnu.org> <87fu5moe4c.fsf@web.de> <877eqyocro.fsf@web.de> <83zi3uz4nb.fsf@gnu.org> <0b1dd3fa-e0b0-ed20-a256-dd92d1c1826f@dancol.org> <8bc3c4c7-dfc7-987a-95e7-bd309e2326c6@cs.ucla.edu> <03118DC0-39DA-4AB5-980E-A33809B9A5EE@raeburn.org> <86578165-1b41-e75c-7180-84d8edefc44b@grinta.net> <87d10i9qbx.fsf@mail.linkov.net> <87tvtucch8.fsf@telefonica.net> <87efjxibor.fsf_-_@mail.linkov.net> <87muyl59tw.fsf@telefonica.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1522786341 11140 195.159.176.226 (3 Apr 2018 20:12:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 3 Apr 2018 20:12:21 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel@gnu.org To: =?iso-8859-1?Q?=D3scar?= Fuentes Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 03 22:12:17 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3SHw-0002oK-Ag for ged-emacs-devel@m.gmane.org; Tue, 03 Apr 2018 22:12:16 +0200 Original-Received: from localhost ([::1]:33161 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3SK1-0004Vw-GP for ged-emacs-devel@m.gmane.org; Tue, 03 Apr 2018 16:14:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3SJr-0004TU-LF for emacs-devel@gnu.org; Tue, 03 Apr 2018 16:14:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3SJn-0005e4-MA for emacs-devel@gnu.org; Tue, 03 Apr 2018 16:14:15 -0400 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:33126 helo=homiemail-a39.g.dreamhost.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3SJn-0005dX-CO for emacs-devel@gnu.org; Tue, 03 Apr 2018 16:14:11 -0400 Original-Received: from homiemail-a39.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a39.g.dreamhost.com (Postfix) with ESMTP id 259FC150078; Tue, 3 Apr 2018 13:14:09 -0700 (PDT) Original-Received: from localhost.linkov.net (m91-129-105-236.cust.tele2.ee [91.129.105.236]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a39.g.dreamhost.com (Postfix) with ESMTPSA id 3B18D150069; Tue, 3 Apr 2018 13:14:08 -0700 (PDT) In-Reply-To: <87muyl59tw.fsf@telefonica.net> (=?iso-8859-1?Q?=22=D3scar?= Fuentes"'s message of "Tue, 03 Apr 2018 03:59:23 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 69.163.253.7 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:224281 Archived-At: >> I just realized we already have continuous image scrolling mode: >> >> 1. visiting a PDF file generates PNG images in the temporary directory >> 2. C-x d /tmp/docview1000/... RET >> 3. M-x iimage-mode RET >> 4. enjoy continuous image scrolling mode directly in dired >> (the same logic could be later incorporated into doc-view.el) >> >> I tried this with a directory containing ca 1000 pages/images >> and there is no performance degradation while continuously scrolling >> all these 1000 images. > > PDF-Tools (which is vastly superior to the built-in PDF viewer) does not > work this way. It generates pages on demand. It is an absurd waste of > resources to visit a book and generate one png file for each page. > PDF-Tools solves this and does much more. > > So, if the solution depends on having pre-generated images, it is worse > than not having continuous scroll, IMAO. This is an optimization, but a significant one, indeed, if you are not going to read the whole PDF at once. > OTOH, I tried what you suggest on a directory with lots of images. The > result is quite crude. For example, it seems that the curso height > corresponds to the image height, It's possible to hide the cursor like we do in image-mode. > i.e. it is not possible to finely scroll the sequence of images up and > down, you go one image at the time. It's because next-line goes to the next file in Dired by default, this is why I disabled this inconvenience in my ~/.emacs by using normal cursor motion keybindings: (define-key dired-mode-map [remap next-line] nil) (define-key dired-mode-map [remap previous-line] nil) > The problems I faced while trying to implement continous document scroll > for PDF-Tools revolved around making the scroll actually continous: if > you scroll down from page P-1 to page P, remove page P-2 I see no need to remove page P-2. For optimization it's better to keep it, so that when the user returns to that page, it's already here. > and append page P+1 without producing visible jumps. Based on the simplistic approach like used by iimage-mode, it should be easy to insert placeholders for all pages, and use font-lock machinery to replace placeholders with generated images when the user navigates to other parts of the PDF buffer.