unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* papyrus.el, improved/simplified/"final" implementation of continuous scroll
@ 2022-04-16 16:37 dalanicolai
  2022-04-16 16:46 ` Eli Zaretskii
  2022-04-16 16:49 ` Redisplay issues with 'space' display properties on overlays Eli Zaretskii
  0 siblings, 2 replies; 21+ messages in thread
From: dalanicolai @ 2022-04-16 16:37 UTC (permalink / raw)
  To: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 3715 bytes --]

This mail contains two question, one about Emacs redisplay behavior, and
another
one about minimum heights of specified spaces. However, another purpose of
this
mail is to 'announce' the 'library' papyrus.el
<https://github.com/dalanicolai/papyrus.el>.

I have extracted the (continuous) scroll feature into a separate file. In
the
process I have greatly simplified and improved earlier implementations.

So this file implements a 'scroll/bookroll' for displaying documents. For
now, I
have named it 'papyrus.el' because 'scroll' and 'book(roll)' where
'clashing'
too much with already existing function names/namespaces.

The final file is only 358 lines long (including spaces and comments, and
the code
is fairly straightforward and I guess very easy to understand for most/all
of you.

The papyrus.el code only implements a scroll and some logic for scrolling
and
(un)displaying pages/images. I have created a separate
 pdf-scroll.el in the papyrus-version branch of my pdf-tools fork
<https://github.com/dalanicolai/pdf-tools/blob/papyrus-version/lisp/pdf-scroll.el>
to make pdf-tools
 use papyrus.el.

I am not intending (at least for now) to also create 'doc-view extensions'
to
make it use papyrus.el as that is a little more involved than creating the
support for pdf-tools. This is mostly because for creating the scroll, the
page-sizes have to be retrieved before displaying the document, which is
easy to
do in pdf-tools but requires some extra work in doc-view.

Now here follow my two questions:

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
<https://github.com/dalanicolai/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
<https://github.com/dalanicolai/pdf-tools/blob/papyrus-version/lisp/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.

Thanks for your help. B.t.w. also comments/ideas about how to add this to
Emacs (elpa/core/pdf-tools?) are very welcome.

[-- Attachment #2: Type: text/html, Size: 4244 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: papyrus.el, improved/simplified/"final" implementation of continuous scroll
  2022-04-16 16:37 papyrus.el, improved/simplified/"final" implementation of continuous scroll dalanicolai
@ 2022-04-16 16:46 ` Eli Zaretskii
  2022-04-16 19:00   ` dalanicolai
  2022-04-16 16:49 ` Redisplay issues with 'space' display properties on overlays Eli Zaretskii
  1 sibling, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2022-04-16 16:46 UTC (permalink / raw)
  To: dalanicolai; +Cc: emacs-devel

> From: dalanicolai <dalanicolai@gmail.com>
> Date: Sat, 16 Apr 2022 18:37:24 +0200
> 
> This mail contains two question, one about Emacs redisplay behavior, and another
> one about minimum heights of specified spaces. However, another purpose of this
> mail is to 'announce' the 'library' papyrus.el.

I've started a separate thread about those questions.  IME, it is
better not to conflate two such different subjects in the same thread.



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Redisplay issues with 'space' display properties on overlays
  2022-04-16 16:37 papyrus.el, improved/simplified/"final" implementation of continuous scroll dalanicolai
  2022-04-16 16:46 ` Eli Zaretskii
@ 2022-04-16 16:49 ` Eli Zaretskii
  2022-04-16 18:17   ` dalanicolai
  1 sibling, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2022-04-16 16:49 UTC (permalink / raw)
  To: dalanicolai; +Cc: emacs-devel

> 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 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.



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Redisplay issues with 'space' display properties on overlays
  2022-04-16 16:49 ` Redisplay issues with 'space' display properties on overlays Eli Zaretskii
@ 2022-04-16 18:17   ` dalanicolai
  2022-04-16 18:32     ` Eli Zaretskii
  2022-04-16 18:32     ` dalanicolai
  0 siblings, 2 replies; 21+ messages in thread
From: dalanicolai @ 2022-04-16 18:17 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 3206 bytes --]

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 <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 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.
>

[-- Attachment #2: Type: text/html, Size: 4067 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Redisplay issues with 'space' display properties on overlays
  2022-04-16 18:17   ` dalanicolai
@ 2022-04-16 18:32     ` Eli Zaretskii
  2022-04-16 18:40       ` dalanicolai
  2022-04-16 18:47       ` dalanicolai
  2022-04-16 18:32     ` dalanicolai
  1 sibling, 2 replies; 21+ messages in thread
From: Eli Zaretskii @ 2022-04-16 18:32 UTC (permalink / raw)
  To: dalanicolai; +Cc: emacs-devel

> From: dalanicolai <dalanicolai@gmail.com>
> Date: Sat, 16 Apr 2022 20:17:11 +0200
> Cc: Emacs Devel <emacs-devel@gnu.org>
> 
> Well, for the second question, just do emacs -q,
>  then load papyrus.el and do `M-x papyrus-demo`.

And then do what? look where? for what issues?

> 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).

I don't understand.  It is your code that inserts the overlays which
AFAIU give you the problems, right?  So I think it should be possible
to construct a simple test case using some image file instead of what
pdf-tools produce.

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

I don't think I understand the situation well enough to answer, sorry.



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Redisplay issues with 'space' display properties on overlays
  2022-04-16 18:17   ` dalanicolai
  2022-04-16 18:32     ` Eli Zaretskii
@ 2022-04-16 18:32     ` dalanicolai
  2022-04-16 18:36       ` Eli Zaretskii
  1 sibling, 1 reply; 21+ messages in thread
From: dalanicolai @ 2022-04-16 18:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 4037 bytes --]

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 <dalanicolai@gmail.com> 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 <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 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.
>>
>

[-- Attachment #2: Type: text/html, Size: 5253 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Redisplay issues with 'space' display properties on overlays
  2022-04-16 18:32     ` dalanicolai
@ 2022-04-16 18:36       ` Eli Zaretskii
  2022-04-16 18:38         ` Eli Zaretskii
  0 siblings, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2022-04-16 18:36 UTC (permalink / raw)
  To: dalanicolai; +Cc: emacs-devel

> From: dalanicolai <dalanicolai@gmail.com>
> Date: Sat, 16 Apr 2022 20:32:52 +0200
> Cc: Emacs Devel <emacs-devel@gnu.org>
> 
> 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

In general, when you enter the echo area, Emacs performs a more
thorough redisplay than when you don't.  Maybe that is what you are
experiencing.  But that's a guess.



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Redisplay issues with 'space' display properties on overlays
  2022-04-16 18:36       ` Eli Zaretskii
@ 2022-04-16 18:38         ` Eli Zaretskii
  2022-04-16 18:49           ` dalanicolai
  0 siblings, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2022-04-16 18:38 UTC (permalink / raw)
  To: dalanicolai; +Cc: emacs-devel

> Date: Sat, 16 Apr 2022 21:36:23 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: emacs-devel@gnu.org
> 
> In general, when you enter the echo area, Emacs performs a more
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sorry, I meant "the minibuffer" there, not the echo area.



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Redisplay issues with 'space' display properties on overlays
  2022-04-16 18:32     ` Eli Zaretskii
@ 2022-04-16 18:40       ` dalanicolai
  2022-04-16 19:02         ` Eli Zaretskii
  2022-04-16 18:47       ` dalanicolai
  1 sibling, 1 reply; 21+ messages in thread
From: dalanicolai @ 2022-04-16 18:40 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 1903 bytes --]

>
> 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'


Here is again my 'second question'. So after when you do `M-x papyrus-demo`
(and scroll using the arrows) the 'gaps', which are the gray 'gaps' between
the pages,
have the height of the default `pixel-line-height`. Setting
`papyrus-gap-height` larger
will increase the gap size. However, setting `papyrus-gap-height` smaller
will not
decrease the gap size because it seems that the `line-pixel-height` is the
minimum.
I would expect the size could be smaller, so my question is why the minimum
size is
limited to be `line-pixel-height`...

On Sat, 16 Apr 2022 at 20:32, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: dalanicolai <dalanicolai@gmail.com>
> > Date: Sat, 16 Apr 2022 20:17:11 +0200
> > Cc: Emacs Devel <emacs-devel@gnu.org>
> >
> > Well, for the second question, just do emacs -q,
> >  then load papyrus.el and do `M-x papyrus-demo`.
>
> And then do what? look where? for what issues?
>
> > 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).
>
> I don't understand.  It is your code that inserts the overlays which
> AFAIU give you the problems, right?  So I think it should be possible
> to construct a simple test case using some image file instead of what
> pdf-tools produce.
>
> > So maybe you could answer/comment on the second question.
>
> I don't think I understand the situation well enough to answer, sorry.
>

[-- Attachment #2: Type: text/html, Size: 2690 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Redisplay issues with 'space' display properties on overlays
  2022-04-16 18:32     ` Eli Zaretskii
  2022-04-16 18:40       ` dalanicolai
@ 2022-04-16 18:47       ` dalanicolai
  2022-04-16 18:57         ` dalanicolai
  2022-04-16 19:06         ` Eli Zaretskii
  1 sibling, 2 replies; 21+ messages in thread
From: dalanicolai @ 2022-04-16 18:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 1432 bytes --]

Ah yes... you are totally right of course.

So for the first question, (pdf-scroll.el is not required indeed),
do `M-x papyrus-demo`, maximize the demo window,
then scroll down a few pages, and split the buffer horizontally.
Now, the page in the other window does not get diplayed.

Then do `M-: (print "test")` and hide the echo-area by pressing
`esc`. Now the page does get displayed.

So my question is how can I achieve this without printing
something first.

On Sat, 16 Apr 2022 at 20:32, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: dalanicolai <dalanicolai@gmail.com>
> > Date: Sat, 16 Apr 2022 20:17:11 +0200
> > Cc: Emacs Devel <emacs-devel@gnu.org>
> >
> > Well, for the second question, just do emacs -q,
> >  then load papyrus.el and do `M-x papyrus-demo`.
>
> And then do what? look where? for what issues?
>
> > 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).
>
> I don't understand.  It is your code that inserts the overlays which
> AFAIU give you the problems, right?  So I think it should be possible
> to construct a simple test case using some image file instead of what
> pdf-tools produce.
>
> > So maybe you could answer/comment on the second question.
>
> I don't think I understand the situation well enough to answer, sorry.
>

[-- Attachment #2: Type: text/html, Size: 2097 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Redisplay issues with 'space' display properties on overlays
  2022-04-16 18:38         ` Eli Zaretskii
@ 2022-04-16 18:49           ` dalanicolai
  0 siblings, 0 replies; 21+ messages in thread
From: dalanicolai @ 2022-04-16 18:49 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 625 bytes --]

Well I can do the print from the code (so without opening the minibuffer),
so I guess the echo-area also triggers the more thorough redisplay.
So my question is, how can I get that redisplay without printing as
it seemd that `redisplay/force-window-update` don't work.

On Sat, 16 Apr 2022 at 20:38, Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Sat, 16 Apr 2022 21:36:23 +0300
> > From: Eli Zaretskii <eliz@gnu.org>
> > Cc: emacs-devel@gnu.org
> >
> > In general, when you enter the echo area, Emacs performs a more
>               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Sorry, I meant "the minibuffer" there, not the echo area.
>

[-- Attachment #2: Type: text/html, Size: 1107 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Redisplay issues with 'space' display properties on overlays
  2022-04-16 18:47       ` dalanicolai
@ 2022-04-16 18:57         ` dalanicolai
  2022-04-16 19:06         ` Eli Zaretskii
  1 sibling, 0 replies; 21+ messages in thread
From: dalanicolai @ 2022-04-16 18:57 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 1770 bytes --]

>
> So my question is how can I achieve this without printing
> something first.
>

This works without the printing in Spacemacs/Doom Emacs, but
I don't know which thing is responsible for the different behavior.

On Sat, 16 Apr 2022 at 20:47, dalanicolai <dalanicolai@gmail.com> wrote:

> Ah yes... you are totally right of course.
>
> So for the first question, (pdf-scroll.el is not required indeed),
> do `M-x papyrus-demo`, maximize the demo window,
> then scroll down a few pages, and split the buffer horizontally.
> Now, the page in the other window does not get diplayed.
>
> Then do `M-: (print "test")` and hide the echo-area by pressing
> `esc`. Now the page does get displayed.
>
> So my question is how can I achieve this without printing
> something first.
>
> On Sat, 16 Apr 2022 at 20:32, Eli Zaretskii <eliz@gnu.org> wrote:
>
>> > From: dalanicolai <dalanicolai@gmail.com>
>> > Date: Sat, 16 Apr 2022 20:17:11 +0200
>> > Cc: Emacs Devel <emacs-devel@gnu.org>
>> >
>> > Well, for the second question, just do emacs -q,
>> >  then load papyrus.el and do `M-x papyrus-demo`.
>>
>> And then do what? look where? for what issues?
>>
>> > 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).
>>
>> I don't understand.  It is your code that inserts the overlays which
>> AFAIU give you the problems, right?  So I think it should be possible
>> to construct a simple test case using some image file instead of what
>> pdf-tools produce.
>>
>> > So maybe you could answer/comment on the second question.
>>
>> I don't think I understand the situation well enough to answer, sorry.
>>
>

[-- Attachment #2: Type: text/html, Size: 2872 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: papyrus.el, improved/simplified/"final" implementation of continuous scroll
  2022-04-16 16:46 ` Eli Zaretskii
@ 2022-04-16 19:00   ` dalanicolai
  0 siblings, 0 replies; 21+ messages in thread
From: dalanicolai @ 2022-04-16 19:00 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 570 bytes --]

Ah okay, sorry I see/read this only now

On Sat, 16 Apr 2022 at 18:46, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: dalanicolai <dalanicolai@gmail.com>
> > Date: Sat, 16 Apr 2022 18:37:24 +0200
> >
> > This mail contains two question, one about Emacs redisplay behavior, and
> another
> > one about minimum heights of specified spaces. However, another purpose
> of this
> > mail is to 'announce' the 'library' papyrus.el.
>
> I've started a separate thread about those questions.  IME, it is
> better not to conflate two such different subjects in the same thread.
>

[-- Attachment #2: Type: text/html, Size: 973 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Redisplay issues with 'space' display properties on overlays
  2022-04-16 18:40       ` dalanicolai
@ 2022-04-16 19:02         ` Eli Zaretskii
  0 siblings, 0 replies; 21+ messages in thread
From: Eli Zaretskii @ 2022-04-16 19:02 UTC (permalink / raw)
  To: dalanicolai; +Cc: emacs-devel

> From: dalanicolai <dalanicolai@gmail.com>
> Date: Sat, 16 Apr 2022 20:40:47 +0200
> Cc: Emacs Devel <emacs-devel@gnu.org>
> 
>  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'
> 
> Here is again my 'second question'. So after when you do `M-x papyrus-demo`
> (and scroll using the arrows) the 'gaps', which are the gray 'gaps' between the pages,
> have the height of the default `pixel-line-height`. Setting `papyrus-gap-height` larger
> will increase the gap size. However, setting `papyrus-gap-height` smaller will not
> decrease the gap size because it seems that the `line-pixel-height` is the minimum.
> I would expect the size could be smaller, so my question is why the minimum size is
> limited to be `line-pixel-height`...

I think this is because you have a newline after the overlay, and the
newline has the default height.  Did you try to put a face with
smaller :height on the newline?



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Redisplay issues with 'space' display properties on overlays
  2022-04-16 18:47       ` dalanicolai
  2022-04-16 18:57         ` dalanicolai
@ 2022-04-16 19:06         ` Eli Zaretskii
  2022-04-16 19:16           ` dalanicolai
  2022-04-16 19:36           ` dalanicolai
  1 sibling, 2 replies; 21+ messages in thread
From: Eli Zaretskii @ 2022-04-16 19:06 UTC (permalink / raw)
  To: dalanicolai; +Cc: emacs-devel

> From: dalanicolai <dalanicolai@gmail.com>
> Date: Sat, 16 Apr 2022 20:47:13 +0200
> Cc: Emacs Devel <emacs-devel@gnu.org>
> 
> So for the first question, (pdf-scroll.el is not required indeed),
> do `M-x papyrus-demo`, maximize the demo window,
> then scroll down a few pages, and split the buffer horizontally.
> Now, the page in the other window does not get diplayed.
> 
> Then do `M-: (print "test")` and hide the echo-area by pressing
> `esc`. Now the page does get displayed.
> 
> So my question is how can I achieve this without printing
> something first.

I guess I don't understand what you mean by "window does not get
redisplayed".  because I see no difference on display before and after
I do 'M-: (print "test")'.  Maybe I didn't follow the recipe to the
letter?



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Redisplay issues with 'space' display properties on overlays
  2022-04-16 19:06         ` Eli Zaretskii
@ 2022-04-16 19:16           ` dalanicolai
  2022-04-16 19:18             ` Eli Zaretskii
  2022-04-16 19:36           ` dalanicolai
  1 sibling, 1 reply; 21+ messages in thread
From: dalanicolai @ 2022-04-16 19:16 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 1171 bytes --]

>
> I guess I don't understand what you mean by "window does not get
> redisplayed".  because I see no difference on display before and after
> I do 'M-: (print "test")'.  Maybe I didn't follow the recipe to the
> letter?


Did you scroll forward a few pages before splitting the window?

On Sat, 16 Apr 2022 at 21:06, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: dalanicolai <dalanicolai@gmail.com>
> > Date: Sat, 16 Apr 2022 20:47:13 +0200
> > Cc: Emacs Devel <emacs-devel@gnu.org>
> >
> > So for the first question, (pdf-scroll.el is not required indeed),
> > do `M-x papyrus-demo`, maximize the demo window,
> > then scroll down a few pages, and split the buffer horizontally.
> > Now, the page in the other window does not get diplayed.
> >
> > Then do `M-: (print "test")` and hide the echo-area by pressing
> > `esc`. Now the page does get displayed.
> >
> > So my question is how can I achieve this without printing
> > something first.
>
> I guess I don't understand what you mean by "window does not get
> redisplayed".  because I see no difference on display before and after
> I do 'M-: (print "test")'.  Maybe I didn't follow the recipe to the
> letter?
>

[-- Attachment #2: Type: text/html, Size: 1925 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Redisplay issues with 'space' display properties on overlays
  2022-04-16 19:16           ` dalanicolai
@ 2022-04-16 19:18             ` Eli Zaretskii
  2022-04-16 19:33               ` dalanicolai
  0 siblings, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2022-04-16 19:18 UTC (permalink / raw)
  To: dalanicolai; +Cc: emacs-devel

> From: dalanicolai <dalanicolai@gmail.com>
> Date: Sat, 16 Apr 2022 21:16:18 +0200
> Cc: Emacs Devel <emacs-devel@gnu.org>
> 
>  I guess I don't understand what you mean by "window does not get
>  redisplayed".  because I see no difference on display before and after
>  I do 'M-: (print "test")'.  Maybe I didn't follow the recipe to the
>  letter?
> 
> Did you scroll forward a few pages before splitting the window? 

Yes.



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Redisplay issues with 'space' display properties on overlays
  2022-04-16 19:18             ` Eli Zaretskii
@ 2022-04-16 19:33               ` dalanicolai
  2022-04-16 19:52                 ` dalanicolai
  0 siblings, 1 reply; 21+ messages in thread
From: dalanicolai @ 2022-04-16 19:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

Ah okay, so does the page in the new window display correctly or not?
Here it does not, and after the `print` then it gets displayed...

On Sat, 16 Apr 2022 at 21:18, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: dalanicolai <dalanicolai@gmail.com>
> > Date: Sat, 16 Apr 2022 21:16:18 +0200
> > Cc: Emacs Devel <emacs-devel@gnu.org>
> >
> >  I guess I don't understand what you mean by "window does not get
> >  redisplayed".  because I see no difference on display before and after
> >  I do 'M-: (print "test")'.  Maybe I didn't follow the recipe to the
> >  letter?
> >
> > Did you scroll forward a few pages before splitting the window?
>
> Yes.
>

[-- Attachment #2: Type: text/html, Size: 1188 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Redisplay issues with 'space' display properties on overlays
  2022-04-16 19:06         ` Eli Zaretskii
  2022-04-16 19:16           ` dalanicolai
@ 2022-04-16 19:36           ` dalanicolai
  1 sibling, 0 replies; 21+ messages in thread
From: dalanicolai @ 2022-04-16 19:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 1123 bytes --]

>
> I think this is because you have a newline after the overlay, and the
> newline has the default height.  Did you try to put a face with
> smaller :height on the newline?


Thanks, this is indeed what 'caused' the issue (and solved it)!

On Sat, 16 Apr 2022 at 21:06, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: dalanicolai <dalanicolai@gmail.com>
> > Date: Sat, 16 Apr 2022 20:47:13 +0200
> > Cc: Emacs Devel <emacs-devel@gnu.org>
> >
> > So for the first question, (pdf-scroll.el is not required indeed),
> > do `M-x papyrus-demo`, maximize the demo window,
> > then scroll down a few pages, and split the buffer horizontally.
> > Now, the page in the other window does not get diplayed.
> >
> > Then do `M-: (print "test")` and hide the echo-area by pressing
> > `esc`. Now the page does get displayed.
> >
> > So my question is how can I achieve this without printing
> > something first.
>
> I guess I don't understand what you mean by "window does not get
> redisplayed".  because I see no difference on display before and after
> I do 'M-: (print "test")'.  Maybe I didn't follow the recipe to the
> letter?
>

[-- Attachment #2: Type: text/html, Size: 1844 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Redisplay issues with 'space' display properties on overlays
  2022-04-16 19:33               ` dalanicolai
@ 2022-04-16 19:52                 ` dalanicolai
  2022-04-16 21:39                   ` dalanicolai
  0 siblings, 1 reply; 21+ messages in thread
From: dalanicolai @ 2022-04-16 19:52 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 1119 bytes --]

>
> Ah okay, so does the page in the new window display correctly or not?
> Here it does not, and after the `print` then it gets displayed...
>

I have tried with Emacs 27.2 now, and indeed there this problem does not
occur.
So it occurs in my build of Emacs 29. I will rebuild it using the latest
version and
see how it works there.

Eli, thanks a lot for your help!

On Sat, 16 Apr 2022 at 21:33, dalanicolai <dalanicolai@gmail.com> wrote:

> Ah okay, so does the page in the new window display correctly or not?
> Here it does not, and after the `print` then it gets displayed...
>
> On Sat, 16 Apr 2022 at 21:18, Eli Zaretskii <eliz@gnu.org> wrote:
>
>> > From: dalanicolai <dalanicolai@gmail.com>
>> > Date: Sat, 16 Apr 2022 21:16:18 +0200
>> > Cc: Emacs Devel <emacs-devel@gnu.org>
>> >
>> >  I guess I don't understand what you mean by "window does not get
>> >  redisplayed".  because I see no difference on display before and after
>> >  I do 'M-: (print "test")'.  Maybe I didn't follow the recipe to the
>> >  letter?
>> >
>> > Did you scroll forward a few pages before splitting the window?
>>
>> Yes.
>>
>

[-- Attachment #2: Type: text/html, Size: 2149 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Redisplay issues with 'space' display properties on overlays
  2022-04-16 19:52                 ` dalanicolai
@ 2022-04-16 21:39                   ` dalanicolai
  0 siblings, 0 replies; 21+ messages in thread
From: dalanicolai @ 2022-04-16 21:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 1639 bytes --]

>
> I have tried with Emacs 27.2 now, and indeed there this problem does not
> occur.
> So it occurs in my build of Emacs 29. I will rebuild it using the latest
> version and
> see how it works there.
>

Although it works fine in Spacemacs/Doom also with that Emacs 29 build, so
I still
don't understand what causes the different behavior. But it is not crucial
anymore to
know what causes the difference...

On Sat, 16 Apr 2022 at 21:52, dalanicolai <dalanicolai@gmail.com> wrote:

> Ah okay, so does the page in the new window display correctly or not?
>> Here it does not, and after the `print` then it gets displayed...
>>
>
> I have tried with Emacs 27.2 now, and indeed there this problem does not
> occur.
> So it occurs in my build of Emacs 29. I will rebuild it using the latest
> version and
> see how it works there.
>
> Eli, thanks a lot for your help!
>
> On Sat, 16 Apr 2022 at 21:33, dalanicolai <dalanicolai@gmail.com> wrote:
>
>> Ah okay, so does the page in the new window display correctly or not?
>> Here it does not, and after the `print` then it gets displayed...
>>
>> On Sat, 16 Apr 2022 at 21:18, Eli Zaretskii <eliz@gnu.org> wrote:
>>
>>> > From: dalanicolai <dalanicolai@gmail.com>
>>> > Date: Sat, 16 Apr 2022 21:16:18 +0200
>>> > Cc: Emacs Devel <emacs-devel@gnu.org>
>>> >
>>> >  I guess I don't understand what you mean by "window does not get
>>> >  redisplayed".  because I see no difference on display before and after
>>> >  I do 'M-: (print "test")'.  Maybe I didn't follow the recipe to the
>>> >  letter?
>>> >
>>> > Did you scroll forward a few pages before splitting the window?
>>>
>>> Yes.
>>>
>>

[-- Attachment #2: Type: text/html, Size: 3133 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2022-04-16 21:39 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-16 16:37 papyrus.el, improved/simplified/"final" implementation of continuous scroll dalanicolai
2022-04-16 16:46 ` Eli Zaretskii
2022-04-16 19:00   ` dalanicolai
2022-04-16 16:49 ` Redisplay issues with 'space' display properties on overlays Eli Zaretskii
2022-04-16 18:17   ` dalanicolai
2022-04-16 18:32     ` Eli Zaretskii
2022-04-16 18:40       ` dalanicolai
2022-04-16 19:02         ` Eli Zaretskii
2022-04-16 18:47       ` dalanicolai
2022-04-16 18:57         ` dalanicolai
2022-04-16 19:06         ` Eli Zaretskii
2022-04-16 19:16           ` dalanicolai
2022-04-16 19:18             ` Eli Zaretskii
2022-04-16 19:33               ` dalanicolai
2022-04-16 19:52                 ` dalanicolai
2022-04-16 21:39                   ` dalanicolai
2022-04-16 19:36           ` dalanicolai
2022-04-16 18:32     ` dalanicolai
2022-04-16 18:36       ` Eli Zaretskii
2022-04-16 18:38         ` Eli Zaretskii
2022-04-16 18:49           ` dalanicolai

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).