From: dalanicolai <dalanicolai@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Two questions about overlays
Date: Tue, 21 Feb 2023 16:17:35 +0100 [thread overview]
Message-ID: <CACJP=3=sgPBuYMGt9QExz4F2DdoYfdNyQ+-V9V00ZSU0EoHFGQ@mail.gmail.com> (raw)
In-Reply-To: <834jrft603.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 1934 bytes --]
>
> You assume that window-start and window-end will reliably tell you the
> beginning and end of the window in the middle of a Lisp program?
> Their doc strings explicitly say that the values are updated by
> redisplay. window-end is specifically documented to be accurate only
> after redisplay ends. I believe this is why you need to call sit-for:
> that function triggers redisplay.
Ah okay, I had not seen/noted that (part of the) docstring. Well, this
clears things up (now for both questions).
Thanks again for your help!
On Tue, 21 Feb 2023 at 16:03, Eli Zaretskii <eliz@gnu.org> wrote:
> > From: dalanicolai <dalanicolai@gmail.com>
> > Date: Tue, 21 Feb 2023 14:39:36 +0100
> > Cc: emacs-devel@gnu.org
> >
> > In this example code, I am simply displaying all images at once,
> > because I am assuming that the images in the directory are not too
> > many and that they are small (which is not a very reasonable
> > assumption, but this is just my personal 'test' function).
> >
> > Indeed, the example does not call sit-for, because it should show that
> > the printed number of overlays, is the number of all images in the
> > directory (instead of only the number of images currently on the
> > screen, i.e. within '(overlays-in (window-start) (window-end))' ).
>
> You assume that window-start and window-end will reliably tell you the
> beginning and end of the window in the middle of a Lisp program?
> Their doc strings explicitly say that the values are updated by
> redisplay. window-end is specifically documented to be accurate only
> after redisplay ends. I believe this is why you need to call sit-for:
> that function triggers redisplay.
>
> > B.t.w. I am using Emacs 29 (and 30), and the overlay-recenter is still
> there.
> > Maybe it would be handy to remove it then?
>
> We don't want to remove it because that could break some third-party
> packages. So we made the function do nothing instead.
>
[-- Attachment #2: Type: text/html, Size: 2683 bytes --]
prev parent reply other threads:[~2023-02-21 15:17 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
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 [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CACJP=3=sgPBuYMGt9QExz4F2DdoYfdNyQ+-V9V00ZSU0EoHFGQ@mail.gmail.com' \
--to=dalanicolai@gmail.com \
--cc=eliz@gnu.org \
--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 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).