[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Two questions about overlays
From: |
Eli Zaretskii |
Subject: |
Re: Two questions about overlays |
Date: |
Tue, 21 Feb 2023 15:21:14 +0200 |
> From: dalanicolai <dalanicolai@gmail.com>
> Date: Tue, 21 Feb 2023 13:46:56 +0100
>
> So now here are the questions:
>
> - when displaying multiple pages in columns, I would like to use the
> overlays-in function to determine which overlays should display
> images. So I am creating a full 'book roll' by giving the overlays a
> size via the 'space' display property, after which I use overlays-in
> to determine which overlays are actually visible. However, after it
> takes some time for the 'space' display property to take effect, so I
> am manuall adding a 'sit-for' with some reasonable delay
> time. However, I would like to ask if there is someone has an idea for
> a 'better' mechanism to wait until/detect if the 'overlay expansion'
> has finished.
>
> If the explanation is not clear then please load the following file
> and do 'M-x scrap-dir-images' on a directory that contains enough
> images to not fit all on a single screen. It will print the number of
> overlays found via 'overlays-in' directly after 'displaying the
> images' (here by assigning the image as display property instead of
> space). You will find it prints all overlays in the buffer (instead of
> only the ones on screen). To find what I expect it to print now
> (again) do 'M-: (overlays-in (window-start) (window-end))'.
I did all that, and I still don't understand the question. In
particular, your code doesn't call sit-for, so I'm unsure what exactly
is the problem you are asking about here.
> My second question is about the function 'overlay-recenter' I don't
> really understand its docstring. What kind of 'overlay lookup' would
> go faster? What is 'overlay-lookup' anyway?
Looking up overlays that are relevant to a particular buffer position.
But this function is a no-op in Emacs 29 and later, since the overlays
were reimplemented in a way that makes it unnecessary to "center" the
list of overlays. So you can forget about that and ignore this
function.