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: Two questions about overlays Date: Tue, 21 Feb 2023 16:17:35 +0100 Message-ID: References: <838rgrtar9.fsf@gnu.org> <834jrft603.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000003b94ac05f537483f" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15741"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Feb 21 16:18:21 2023 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 1pUUPN-0003sC-GG for ged-emacs-devel@m.gmane-mx.org; Tue, 21 Feb 2023 16:18:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUUOw-0006yu-Ch; Tue, 21 Feb 2023 10:17:54 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUUOu-0006tJ-9T for emacs-devel@gnu.org; Tue, 21 Feb 2023 10:17:52 -0500 Original-Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUUOr-0005wm-Sa; Tue, 21 Feb 2023 10:17:51 -0500 Original-Received: by mail-wr1-x42c.google.com with SMTP id z8so4543169wrm.8; Tue, 21 Feb 2023 07:17:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=oYtDIjTmDDeWcRFmJGCh8oz0O5htjEkpqfs9gJYHgX8=; b=CbkueBQLQBvrp31xhxJlIxMvOjXGjUnCniormkyku0jeoi7+kEw6us0EXWz9ei6ot7 jPSzYgCrWqOyyvma86xVkexVMEHdXcX0ltj0g4EewHJylORoSsZrmcD/l97gRPfn4/Op hzxLB5Fr0KQijBPuwpQUKDJNS7qckq+kkw8BVylUQc8S9bSYA/y1Rf5esGk1MwVcIMrs Ut5v+RaNa7S4zErjZ57RTb5OFmAQg7YGUQ3NcVslx4QkqPKIDd4bkMDkku+e57NtA+FO PAYclPmtzuxKhpkWGU3rLAz83W7Pvk3msz8tJd/Jyw7PXPrAZbksGLAYhb2LU7w5eJ6Q Ow0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oYtDIjTmDDeWcRFmJGCh8oz0O5htjEkpqfs9gJYHgX8=; b=KU0ef2tl7k8qmSa1whUL4tOE4bXrDkVahDAbeqVJ3esUwzB92M3SI0oG0fCoVq5RCm suGbPf3368eaua8GZ4UPu83Q7nY5H1IhIIMMb2cNcj8e/eYFX15hWz9MS8Xet2YzPgXR XhoZUZl+0/Stvbl71QGhGW9zPj0MZLNH3/JW3PdKYofI+d/RwC4pbBumS1GF+1d0SioA aMrFDeavoOi0Sx+Y2YJBKLO+ddyqBUPo4bGMzueAsAAFCQoRVzpWK1/dmXdkOSbGwqrL 0Ss1tMn+Gi7AdmefR0AXeT0Y4LWgDPuB8oEgzAd44Lu2jhv4HAquqwpPR5v1b3N0DOlX IY3g== X-Gm-Message-State: AO0yUKVmu2p3rKXuyXlumzHywkby4Dtc+D9aweqZ8qftfEFmt6eUBBW5 fpV8ruD5Yg23CBd7MRemJw8/96EZR3S6gnZNVjHbsEIpxXgc+Q== X-Google-Smtp-Source: AK7set8qbZaPWuRZf34K8Rvsyjb8WWkuVzLU3FqbrUv+wLyYqJW2qpcICZXx0UOWl59pccFZ2Gja2wMGpblqaOOOtcM= X-Received: by 2002:adf:ec47:0:b0:2c3:e2bd:3de5 with SMTP id w7-20020adfec47000000b002c3e2bd3de5mr36673wrn.365.1676992667420; Tue, 21 Feb 2023 07:17:47 -0800 (PST) In-Reply-To: <834jrft603.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=dalanicolai@gmail.com; helo=mail-wr1-x42c.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 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:303653 Archived-At: --0000000000003b94ac05f537483f Content-Type: text/plain; charset="UTF-8" > > 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 wrote: > > From: dalanicolai > > 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. > --0000000000003b94ac05f537483f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
You assu= me 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.=C2=A0 window-end is specifically documented to be accurate only<= br> after redisplay ends.=C2=A0 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
cle= ars things up (now for both questions).

Thanks aga= in for your help!

On Tue, 21 Feb 2023 at 16:03, Eli Zaretskii <= eliz@gnu.org> wrote:
> From: dalanicolai <dalanicolai@gmail.co= m>
> Date: Tue, 21 Feb 2023 14:39:36 +0100
> Cc: emacs-dev= el@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.=C2=A0 window-end is specifically documented to be accurate only<= br> after redisplay ends.=C2=A0 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.=C2=A0 So we made the function do nothing instead.
--0000000000003b94ac05f537483f--