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: Redisplay issues with 'space' display properties on overlays Date: Sat, 16 Apr 2022 20:32:52 +0200 Message-ID: References: <83pmlhynw9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e7fe4b05dcc9c143" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28927"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs Devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 16 20:34:44 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 1nfnFr-0007OS-Vz for ged-emacs-devel@m.gmane-mx.org; Sat, 16 Apr 2022 20:34:44 +0200 Original-Received: from localhost ([::1]:39058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nfnFq-0003pG-U0 for ged-emacs-devel@m.gmane-mx.org; Sat, 16 Apr 2022 14:34:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfnEP-0002MW-6A for emacs-devel@gnu.org; Sat, 16 Apr 2022 14:33:13 -0400 Original-Received: from mail-yb1-xb33.google.com ([2607:f8b0:4864:20::b33]:35730) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nfnEN-0004o6-68; Sat, 16 Apr 2022 14:33:12 -0400 Original-Received: by mail-yb1-xb33.google.com with SMTP id t67so19447636ybi.2; Sat, 16 Apr 2022 11:33:04 -0700 (PDT) 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=H4euEpkKiPZdhts7iI6ALRlt+B81EhMjHMs/Mmj1mg4=; b=qMXvhm9SRr3VacAxjm2sLEnK+iZJHcOIqqWtsYpQcdZOCcjla5cqD1E+6bCSwCFuLc xwMs1cWtUG2R/ZeZIuVU54bUT/Oe/hDDApM0p1J3e94M1tx3tviQ//+csGVszqmBaVKZ 0DsxftSi4Hb9CurYpSGFqCBZZFlwEj2JeOhbU5AcbAnYmnlUxr91nriKaKMa4W1VsoJ1 NOn09ONwwD9HR7lMZmCt7epzerYunHqPYI8EaYM3CPMUdeHHonVd5xbwAb7ZBP4m2+Xe fiqhW+88YgTBRYPPF7jj/lGpVcU4TK7UR74tivdikOqzsIgfv8pyWVCcVb6Obpi7Gl8q 4k8Q== 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=H4euEpkKiPZdhts7iI6ALRlt+B81EhMjHMs/Mmj1mg4=; b=kE8sX02DRFns5RYzXaeeQFua8jOPHvqvZbp7Y3Azw3J5GFhPgtnrBnXEIS1NQtOGpy 6+1bmLVD+3yAjcnvZRxcIhPLRSTqwFlqs5uNsZQHh/hOQNEhoNWZOURcje5qOXzlGJt2 haRMPI/cB1C2+HQTISQhCAdKJpes02S2IrEcaZB2N75lZvaWN90hoCXRHRU2UmOXmCHb MSda/jqYmsjFBlfriNCwLAUCd887CWxqabUUxJcpLsd8TLwMpAQG5T9rRImEW7kq1Yr2 XfOpF55rCA9HkRHK4QkC3k1++hm9Y+lmlYDt/td9/5ES6eEVkqK8YTETLxFF80HvWXG+ CY7Q== X-Gm-Message-State: AOAM532ezOTRCmwc+2bEU9ynsATY5xGx4Ik9xmMCy0hCRJmJ3ZVoA11R rcti+y/jAdihIatTD2tb4nleiZ83YSWA1H4+edx4JL0wnmw= X-Google-Smtp-Source: ABdhPJzla7M/VnuvmSj8UULy4e9twx6Y1f7gO8GY8JGUBEiyflZe+TApH2CtMsRPwu7nVDTXXXzZJz/2ImQcDaeDsk0= X-Received: by 2002:a05:6902:1083:b0:63e:5325:d6b0 with SMTP id v3-20020a056902108300b0063e5325d6b0mr3728544ybu.431.1650133983296; Sat, 16 Apr 2022 11:33:03 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::b33; envelope-from=dalanicolai@gmail.com; helo=mail-yb1-xb33.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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:288491 Archived-At: --000000000000e7fe4b05dcc9c143 Content-Type: text/plain; charset="UTF-8" Or actually simpler, for the first question, with pdf-tools installed, - first load pdf-scroll.el (after first setting the path to papyrus.el at the beginning of the file) - open some pdf and scroll down/up a few pages - now split the buffer (the page in the second window does not display) - then do `M-: (print "test"), and 'hide' the echo area by pressing `esc` Now the page will display. So my question is, which 'action' is responsible for getting that page displayed (I guess it is just the vscroll does not get set, because when splitting the window immediately after opening, without scrolling, then the page in the other window does get displayed). On Sat, 16 Apr 2022 at 20:17, dalanicolai wrote: > Well, for the second question, just do emacs -q, > then load papyrus.el and do `M-x papyrus-demo`. > > For the first question pdf-tools is required to be installed, > I am not sure how to achieve that from emacs -q > (well besides building the server manually, after installing > pdf-tools using `list-packages` I guess). > > So maybe you could answer/comment on the second question. > > And maybe someone who has pdf-tools installed can > answer/comment on the first question. > But I have commented out the 'print hack' now, so that the > instruction becomes to 'uncomment` it (and 'slurp' it as final > statements inside the `papyrus-redisplay` function`), after testing > the behavior with the lines commented out first. > > On Sat, 16 Apr 2022 at 18:49, Eli Zaretskii wrote: > >> > From: dalanicolai >> > Date: Sat, 16 Apr 2022 18:37:24 +0200 >> > >> > 1. papyrus.el uses the `papyrus-redisplay` function, which creates the >> 'scroll' >> > by adding 'space' display properties to the overlays, and page images to >> > the 'currently visible overlays'. The redisplay works fine on >> Spacemacs/Doom, >> > but for vanilla Emacs, in order to 'finalize' the process requires a >> hack which is >> > to 'print' something to the echo area, after which the 'redisplay' will >> finish >> > and show the images. >> > >> > I have tried to use `redisplay/force-window-update` for this, but those >> do not >> > seem to have the right effect. >> > >> > Obviously, my question is if you can tell me why the hack 'is required' >> and what >> > would be the better way to achieve/finalize the redisplay. >> > >> > 2. I would expect that a specified space (space display property for >> the 'gap' >> > overlays, i.e. the space between the pages) could be smaller than the >> default >> > 'line-pixel-height`. However, this does not seem possible by just >> setting a >> > smaller :height for the space display property, as the overlay will >> always have >> > a minimum height of the default 'line-pixel-height' >> > >> > To see/reproduce what I mean you can simply load `papyrus.el` and do >> > `M-x papyrus-demo`. You can experiment with the 'gap/space-height' by >> setting >> > the `papyrus-gap-height`. >> > >> > For 'reproducing' the 'issue' of the first question, you can simply load >> > pdf-scroll.el (but first set the correct path to `papyrus.el` at the >> beginning >> > of that file. Also, pdf-scroll.el requires pdf-tools to be correctly >> installed). >> > Subsequently, open some pdf file, and split the window. I hope you will >> find >> > that the continuous scroll, including the functionality of the >> > `pdf-tools-enabled-modes`, works perfectly fine in vanilla Emacs >> (scroll with arrows >> > and page-down/up). Now, to see what I mean with the display 'issue' >> comment out the >> > last two lines of the `papyrus-redisplay` function, and again try to >> split the >> > window from the pdf buffer, you will find that the extra step of >> printing is >> > required before the image will show correctly. >> >> Since using the actual code requires complex setups, would you please >> show simpler recipes for these two issues, ones that can be used >> easily from "emacs -Q"? Then I will try to answer your questions >> above. >> >> Thanks. >> > --000000000000e7fe4b05dcc9c143 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Or actually simpler, for the first question, with pdf= -tools installed,
- first load pdf-scroll.el (after first setting= the path to papyrus.el at the beginning
of the file)
-= open some pdf and scroll down/up a few pages
- now split the buf= fer (the page in the second window does not display)
- then do `M= -: (print "test"), and 'hide' the echo area by pressing `= esc`
Now the page will display.

So my qu= estion is, which 'action' is responsible for getting that page disp= layed
(I guess it is just the vscroll does not get set, because w= hen splitting the window
immediately after opening, without scrol= ling, then the page in the other window
does get displayed).
<= /div>

On Sat, 16 Apr 2022 at 20:17, dalanicolai <dalanicolai@gmail.com> wrote:
Well, for the s= econd question, just do emacs -q,
=C2=A0then load papyrus.el and = do `M-x papyrus-demo`.

For the first question pdf-= tools is required to be installed,
I am not sure how to achieve t= hat from emacs -q
(well besides building the server manually, aft= er installing
pdf-tools using `list-packages` I guess).

So maybe you could answer/comment on the second question.

And maybe someone who has pdf-tools installed can
answer/comment on the first question.
But I have comment= ed out the 'print hack' now, so that the
instruction beco= mes to 'uncomment` it (and 'slurp' it as final
statem= ents inside the `papyrus-redisplay` function`), after testing
the= behavior with the lines commented out first.

On Sat, 16 Apr 2022 = at 18:49, Eli Zaretskii <eliz@gnu.org> wrote:
> From: dalanicolai <dalanicolai@gmail.com>
> Date: Sat, 16 Apr 2022 18:37:24 +0200
>
> 1. papyrus.el uses the `papyrus-redisplay` function, which creates the= 'scroll'
> by adding 'space' display properties to the overlays, and page= images to
> the 'currently visible overlays'. The redisplay works fine on = Spacemacs/Doom,
> but for vanilla Emacs, in order to 'finalize' the process requ= ires a hack which is
> to 'print' something to the echo area, after which the 're= display' will finish
> and show the images.
>
> I have tried to use `redisplay/force-window-update` for this, but thos= e do not
> seem to have the right effect.
>
> Obviously, my question is if you can tell me why the hack 'is requ= ired' and what
> would be the better way to achieve/finalize the redisplay.
>
> 2. I would expect that a specified space (space display property for t= he 'gap'
> overlays, i.e. the space between the pages) could be smaller than the = default
> 'line-pixel-height`. However, this does not seem possible by just = setting a
> smaller :height for the space display property, as the overlay will al= ways have
> a minimum height of the default 'line-pixel-height'
>
> To see/reproduce what I mean you can simply load `papyrus.el` and do > `M-x papyrus-demo`. You can experiment with the 'gap/space-height&= #39; by setting
> the `papyrus-gap-height`.
>
> For 'reproducing' the 'issue' of the first question, y= ou can simply load
> pdf-scroll.el (but first set the correct path to `papyrus.el` at the b= eginning
> of that file. Also, pdf-scroll.el requires pdf-tools to be correctly i= nstalled).
> Subsequently, open some pdf file, and split the window. I hope you wil= l find
> that the continuous scroll, including the functionality of the
> `pdf-tools-enabled-modes`, works perfectly fine in vanilla Emacs (scro= ll with arrows
> and page-down/up). Now, to see what I mean with the display 'issue= ' comment out the
> last two lines of the `papyrus-redisplay` function, and again try to s= plit the
> window from the pdf buffer, you will find that the extra step of print= ing is
> required before the image will show correctly.

Since using the actual code requires complex setups, would you please
show simpler recipes for these two issues, ones that can be used
easily from "emacs -Q"?=C2=A0 Then I will try to answer your ques= tions
above.

Thanks.
--000000000000e7fe4b05dcc9c143--