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.bugs Subject: bug#59902: 30.0.50; Image overlay is not updated until the cursor moves to the overlay Date: Mon, 12 Dec 2022 15:15:43 +0200 Message-ID: <83h6y0sqyo.fsf@gnu.org> References: <87zgby87rm.fsf@localhost> <83h6y62kjp.fsf@gnu.org> <87ilim863y.fsf@localhost> <83lenh20fy.fsf@gnu.org> <87a63x7l1w.fsf@localhost> <83h6y51w66.fsf@gnu.org> <87wn6zr376.fsf@localhost> <83bkoby0zq.fsf@gnu.org> <87ilijfrac.fsf@localhost> <83o7sbwddn.fsf@gnu.org> <87zgbul2ln.fsf@localhost> <83bkoautll.fsf@gnu.org> <87pmcpc940.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17406"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59902@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 12 14:18:18 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1p4ihG-0004Fo-7p for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Dec 2022 14:18:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4if8-00061Y-H0; Mon, 12 Dec 2022 08:16:06 -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 1p4if4-0005zT-OR for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2022 08:16:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p4if4-0008Go-F4 for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2022 08:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p4if4-0006is-9l for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2022 08:16:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Dec 2022 13:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59902 X-GNU-PR-Package: emacs Original-Received: via spool by 59902-submit@debbugs.gnu.org id=B59902.167085095025821 (code B ref 59902); Mon, 12 Dec 2022 13:16:02 +0000 Original-Received: (at 59902) by debbugs.gnu.org; 12 Dec 2022 13:15:50 +0000 Original-Received: from localhost ([127.0.0.1]:52908 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4ier-0006iP-HN for submit@debbugs.gnu.org; Mon, 12 Dec 2022 08:15:49 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4iep-0006iD-DL for 59902@debbugs.gnu.org; Mon, 12 Dec 2022 08:15:48 -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 1p4iek-0006B2-1g; Mon, 12 Dec 2022 08:15:42 -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=KuJZEW/BXUIKSIygsrSYSo+sQEgIkJMv/N8Fk709DRs=; b=qUpmHI3/drwE p5ZyTGzZc8A5uyt+145zNrgSi4IPM4fifR2VK9HH8+m9UoN9pIsRjEAERTOh8PFv2CWpxQY/ACKnE fdTdOySHJg/TMToCImyojxE0Uwt2SMT9bFwBHVyR9nimtgucoPPmdLgJxNKOZmgQa2jfzqvm9V1kB 7mKG2X9+DeKJIoGNBbY6l/nQQY5V4rKxoY1F871816Ys730yWg5UQ/N5eKGS95Wf99m68we5KRGwH QEikTBInLxls8PvBmMFQ34rdN9jevTCZAzeK6eT5S6+pdU1CE/AVt5o34cgqS+vbcYxkfSvF8KZOx VYzinjTmAgjQT4+jLzLXFA==; 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 1p4iej-0001pN-FM; Mon, 12 Dec 2022 08:15:41 -0500 In-Reply-To: <87pmcpc940.fsf@localhost> (message from Ihor Radchenko on Mon, 12 Dec 2022 08:35:43 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250704 Archived-At: > From: Ihor Radchenko > Cc: 59902@debbugs.gnu.org > Date: Mon, 12 Dec 2022 08:35:43 +0000 > > Eli Zaretskii writes: > > > Then I don't think I understand what you expect Emacs to do in these > > cases. We have no idea when the image file is replaced, and cannot > > have such an idea without examining the file at high enough frequency. > > Doing this "from time to time" is going to miss some changes, or take > > note of them too late. What else is possible? > > For example, `create-image' could accept optional argument to update the > cached image if the file modification time is newer than it was when the > image was cached. Patches welcome. We currently hash only the spec itself, and don't pay attention to the file's meta-data. (I also think that if we go this way, file modification time alone could be insufficient for 100% reliability, what with today's fast filesystems.) > >> Yet, do note that flickering two different image versions when moving > >> point is unexpected even considering the information you provided. > > > > Flickering is expected when you do something that affects a large > > portion of the Emacs display. For example, the same will happen if > > you change a large overlay at high enough frequency. There's no way > > around that except not doing that. > > Sorry, I used inaccurate word here. > What I am referring to here is image overlay displayed old and new image > when you move the cursor to the overlay and back repeatedly. Yes, I understood. My response is still the same. > > Why was this implementation chosen for whatever feature that produces > > images? Emacs doesn't react instantly to changes in disk files that > > it visits, and here you expect it to do so. Isn't it possible to > > implement this in some other way, like have the program produce its > > image data in a temporary Emacs buffer, then use that buffer's > > contents for creating an image? Then I believe the updated image will > > have a different hash value, and there will be no cache-related > > collisions. > > It could be possible, but looks like unnecessary complication. > Also, creating buffers often creates overheads associated with user > hooks. > > I am not sure if something like > > (let ((revert-without-query '("."))) > (with-current-buffer (find-file-noselect file) > ;; Do not crown the buffer list. > (unless (string-prefix-p " " (buffer-name)) > (setf (buffer-name) (concat " " (buffer-name)))) > (buffer-string))) > > is not going to cause significant slowdowns. Sorry, you lost me here: how is the above snippet relevant to what I proposed as an alternative implementation?