From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Two questions about overlays Date: Tue, 21 Feb 2023 17:03:56 +0200 Message-ID: <834jrft603.fsf@gnu.org> References: <838rgrtar9.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17311"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: dalanicolai Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Feb 21 16:04:54 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 1pUUCM-0004M2-8y for ged-emacs-devel@m.gmane-mx.org; Tue, 21 Feb 2023 16:04:54 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUUBN-0001fz-Hp; Tue, 21 Feb 2023 10:03:53 -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 1pUUBF-0001df-PB for emacs-devel@gnu.org; Tue, 21 Feb 2023 10:03:47 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUUBF-0002va-FW; Tue, 21 Feb 2023 10:03:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=e7iK1uJVuFSewSV0CqD0WDZUp1fQbJAWlgvhs6QwYBU=; b=QuvgZbYecFBD ROl4uzqOwE80xJJI3GBqYmxI0oohFxvddqTO7B1JqNDzCNtJGjcR8uij9hh9A/5dSf9EivUXOl3QZ RCifoCR6QFO14ilsm39vjG88hRJ7REt7mPuITx3xxupyDSTxfn2r9T4sZado1+GDGrwssbzhbh1f9 9kMBu7UYXGlAt5Ppu5IJg9c5ikZ2z7yBXLAGB5xW96rkEBQDdmFFSCuxNqm0q9lnjbgvnsnxnYiiw Oe8PjUCkgXWh8F1ugBVLNzr06ugRDN4XxL164wNM6wQ7TxsBI9Mfu0T4+bzSRScAw2LoidwEiWUFd wI+JRZQ5LglOtSTV8bNfnA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUUBE-0006cZ-Ud; Tue, 21 Feb 2023 10:03:45 -0500 In-Reply-To: (message from dalanicolai on Tue, 21 Feb 2023 14:39:36 +0100) 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:303651 Archived-At: > 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.