From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: Continuous image scrolling Date: Tue, 3 Apr 2018 17:57:35 -0400 Message-ID: <3d9009a5-865c-98bd-b444-c24275291e65@gmail.com> 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> <87370c83io.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1522792542 24234 195.159.176.226 (3 Apr 2018 21:55:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 3 Apr 2018 21:55:42 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 03 23:55:38 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 1f3Ttx-00067V-UP for ged-emacs-devel@m.gmane.org; Tue, 03 Apr 2018 23:55:38 +0200 Original-Received: from localhost ([::1]:39114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3Tw1-0000f7-JY for ged-emacs-devel@m.gmane.org; Tue, 03 Apr 2018 17:57:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3Tvv-0000eZ-3i for emacs-devel@gnu.org; Tue, 03 Apr 2018 17:57:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3Tvu-0005J3-6b for emacs-devel@gnu.org; Tue, 03 Apr 2018 17:57:39 -0400 Original-Received: from mail-qk0-x230.google.com ([2607:f8b0:400d:c09::230]:41174) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f3Tvu-0005Iy-3N for emacs-devel@gnu.org; Tue, 03 Apr 2018 17:57:38 -0400 Original-Received: by mail-qk0-x230.google.com with SMTP id s78so20386389qkl.8 for ; Tue, 03 Apr 2018 14:57:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=g94jYmmwDzsdNbB8exDM5UOTyHVmjMKshKVSwuWCPXQ=; b=LqlFzX+v9LPFbjdTlvjJVV8VPj2aJ1vBnBjaL2hc473KSB+erPPbS6tah6gp6NiTFr ZYP1ifpYQHZMvLz90u31DIyP02crjln3ZrVu4dItSlMnanCUZROc/SdhUnRG+NaaDOaA g9eRb766vq1UMrgRqUOFDGH8kkgNEqm1Qj5oFpLre42iMiWfQ2gWLM38MmzeF7uvU1nv YheM2rv2vITwh7cIOtYSLYTyKciL+nlEiqDL6/bgHBR7c+uVSvbGHI0Rcb+69QG6D5c1 v91FwyKonUBdbes1VJhLacawFD707Op29HYswzYbRf+sSLF6HyLuoWZaVKTQkomKlsW+ ybmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=g94jYmmwDzsdNbB8exDM5UOTyHVmjMKshKVSwuWCPXQ=; b=SX2tQZYvqsCdUNHJ/Q2DKhdcMRXvCWPblhOtETHpg1wkyFnKiZRKL8ehLu646UrEe8 tm2lCfeAnUHDIBjlfEd9PViE6++QpScQe5q4ghmU72A/Fj4Yct+P2vffcnquzCGujjgw Baww0O51zSB7btL+sVZREIKreghklqpELgiLfSntAqfzFH4Z4OVV48L0P4ndtDJLJHQH v8/+1069My7c5cZ5SIO8h4ZekPkK9KxZHC0xSXLAAPxxOvrEWn9opamPgMvMd5H1HU8w hxmmvZqAYG07r28E577Npsj169qOSYwTgQWxQWd8/JXUlRprW2F5MwSzusNj0wtFrjC+ 4s/A== X-Gm-Message-State: ALQs6tB8QbQJeMy5VIVieMiCgfRKEyFIo9+U0CNUvYQsUgTqZeQQun6o LxMgA9vNx6ZlNpnVol3PkJzpkQEL X-Google-Smtp-Source: AIpwx49izKu8CvaYPW3cCqg7uiiaTrCI6SD9ZXC0/Ki1CVjJ26pa6ueysZvkx9txXMIjbPzJGx/NUw== X-Received: by 10.55.214.210 with SMTP id p79mr7524061qkl.19.1522792657292; Tue, 03 Apr 2018 14:57:37 -0700 (PDT) Original-Received: from ?IPv6:2601:184:4180:66e7:4d40:d759:7bf9:9995? ([2601:184:4180:66e7:4d40:d759:7bf9:9995]) by smtp.gmail.com with ESMTPSA id d52sm3299263qta.25.2018.04.03.14.57.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Apr 2018 14:57:36 -0700 (PDT) In-Reply-To: <87370c83io.fsf@mail.linkov.net> Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::230 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:224287 Archived-At: On 2018-04-03 15:59, Juri Linkov wrote: >> 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: Maybe I'm misunderstanding the original request, but if not then I don't think this is the issue. AFAIU, one thing that is not too easy to implement today in ELisp is continuous ("smooth") scrolling over multiple images, as shown in e.g. evince: if I drag the scroll bars or press the up and down keys, the current page and the following one move up and down by a bit. We usually call this pixel-scroll in Emacs, and we have an implementation of it based on set-window-vscroll in lisp/pixel-scroll.el. This is also what Docview and PDFTools use to scroll images that don't fit in the selected window. But I don't think that trick works for sequences of images, at least not straight out of the box. The main issue, IIUC, is that images occupy one (tall) line, and Emacs tries to always keep the line containing the point in full view, which means that set-window-vscroll does not always work if the point is on a line containing an image. You can see what I mean concretely with the following example. Open a new buffer, and run (insert (propertize " " 'display '(image :type jpeg :file "/path/to/some/large/picture.jpg" :scale 1))). Then insert 5 lines of "A". Your buffer will look like this: |----------------| | Picture here | | | |----------------| A A A A Put the point on the third A and run (set-window-vscroll (selected-window) 8 t); note how the images moves a bit up. That's the kind of scrolling we want, which is encouraging :) But now put the point on the picture's line, and try the same experiment; notice how the picture doesn't move, because we try to keep the line in full view. (if the image is larger than the window, it does work, and that's how docview scrolls single pages. I don't know if there's a way to get that behavior when the image fits in the window). That behavior becomes an issue when you have sequences of images, because you can't leave the point on the line of the first image, but moving the point to the line of the second image scrolls it entirely into view. The two techniques to work around this that I'm aware of are (1) cutting the images into thin horizontal strips (and showing one strip per line), and (2) inserting a thin text line between each image on which to place the point while scrolling. I don't know if either of these would work for pdftools. Hopefully there's a third, simpler technique to achieve this? Clément.