From: Eli Zaretskii <eliz@gnu.org>
To: dalanicolai <dalanicolai@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Two questions about overlays
Date: Tue, 21 Feb 2023 15:21:14 +0200 [thread overview]
Message-ID: <838rgrtar9.fsf@gnu.org> (raw)
In-Reply-To: <CACJP=3mDp-QNO_oNVLEa_d7VoAM+6UqeyYdwCDmwfF5tzTyvxg@mail.gmail.com> (message from dalanicolai on Tue, 21 Feb 2023 13:46:56 +0100)
> 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.
next prev parent reply other threads:[~2023-02-21 13:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-21 12:46 Two questions about overlays dalanicolai
2023-02-21 13:21 ` Eli Zaretskii [this message]
2023-02-21 13:39 ` dalanicolai
2023-02-21 13:50 ` dalanicolai
2023-02-21 13:57 ` dalanicolai
2023-02-21 14:16 ` dalanicolai
2023-02-21 14:52 ` dalanicolai
2023-02-21 15:03 ` Eli Zaretskii
2023-02-21 15:17 ` dalanicolai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=838rgrtar9.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=dalanicolai@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.