From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 0A5sFK6b7maP4QAAqHPOHw:P1 (envelope-from ) for ; Sat, 21 Sep 2024 10:10:54 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 0A5sFK6b7maP4QAAqHPOHw (envelope-from ) for ; Sat, 21 Sep 2024 12:10:54 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=H2+O1FJp; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1726913454; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=wrs1XvegZJjBsuxycr4sFiOOo613lr3GA+q6OMOpb+E=; b=oMkkYu3h9M0Ix3ZtC7YTiQN0r5+VGxA3otDpP0eEBvy1uQektj+GT+l+Oxb2sot2KMwtkN CHStbj8uKKiVgKF1EF9Q8y9qjrmmbORw+mY0tCRJFgSC0FJq+2MreN1/auDsThuTd5ZbDy 5PcwHhSfGcjqqrVgrS2upFvzFm7ogskTlu0gnGX4Zrool3oqCoMJ1MacAOnnQkybKxX+Rf jh7aKs+SP4wt5y3QH1JTmo7ayIen/GjVSC6z36Fc1INihQA12LIbQxD2hzeiitQFgt0Pdt kw0mRNrprpski1CFFDSq7B3lgGqgnlLJzAiUFHez80ulBy1CrhfSV9KQv3Rb0w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1726913454; a=rsa-sha256; cv=none; b=PJVtEcyKNcGizCRbl7tsHP3Pb21cXXv0+/voxO0mV8+1u+cF3K4KyBODlI4qT6XaQ0uviO TSdMhI5AAuxMLyd4+m2+nee4TimTDik9hiY1c3cyuZnCZoE/onCyHepRlfkk0um3fZurMx 70sc/P+eQAtpvZF72s2+gpgjEjpWjI0WKy525bJv2XFfiy3Uj2ZhffxBRTlmlUYNDb+9LP q70la6YeRHxknjSlQoNzDWY73U4iXhjlSs/5BjXBL0742ct3S6B5WeOrQvl5uJhRhkMHkG THTHyfG1XqIR+xODJ2abf6V24mmeNXMO8Ml69qSDqOzF7oC8Uryvqa+OxLQ0Ng== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=H2+O1FJp; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DA35C15EBD for ; Sat, 21 Sep 2024 12:10:53 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1srx42-0006A2-6V; Sat, 21 Sep 2024 06:10:06 -0400 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 1srx3z-00067h-Qa for emacs-orgmode@gnu.org; Sat, 21 Sep 2024 06:10:03 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1srx3w-0002zr-NV for emacs-orgmode@gnu.org; Sat, 21 Sep 2024 06:10:03 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 1A756240101 for ; Sat, 21 Sep 2024 12:09:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1726913398; bh=e3jZbsDsyGN3t5yWleJjyNz35Ds134GnHbIw7U22JU4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=H2+O1FJpfZuM9VdpwVubdGO9g4EpW8chIzNidoNdVzbVgkaWErFf28lgX9cB9aBM5 eVA+MPgtNdK7tswK1lFTKm+6VzWyVQGwcz1NLshKcNoeactgj5t6JaQWDSQLXddcZk Y1ZrqYhSfsxfo8R1DQ9Hs7hN+7HrWOqJWGcnut4kk5ldkzCyGRTxRtKYHRHkqwvJEa r9Azp+r6fxFNLZncDcGft4CH15BMKeiBmM4yQmogDO3SaHAjGZW1+5lkKOGeIWZXZV L5Ru7VVjYbAovhj/GLb3Nf6sI8nRLL/ybgwQFdG7J6w4nrndOeAGxBseCHrGgWB6sB xaCAbOi8n319g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4X9lP03XXVz6tvb; Sat, 21 Sep 2024 12:09:56 +0200 (CEST) From: Ihor Radchenko To: Karthik Chikmagalur Cc: stardiviner , Org mode Subject: Re: [PATCH v5] Inline image display as part of a new org-link-preview system In-Reply-To: <8734lx4twk.fsf@gmail.com> References: <6461a84b.a70a0220.b6d36.5d00@mx.google.com> <87v7zyyvm3.fsf@localhost> <87frr07xz8.fsf@gmail.com> <87cym38aj8.fsf@gmail.com> <87r0ajawgj.fsf@localhost> <87a5h77zb1.fsf@gmail.com> <87msl4wv8d.fsf@localhost> <875xrqg6cb.fsf@gmail.com> <874j70n559.fsf@localhost> <87msksabld.fsf@gmail.com> <87jzfwljkq.fsf@localhost> <87h6b09v4o.fsf@gmail.com> <878qwb8qw1.fsf@localhost> <878qw9ak6a.fsf@gmail.com> <87o74ypp3b.fsf@localhost> <87r09rxpjg.fsf@gmail.com> <87h6ah72ui.fsf@localhost> <8734m060ma.fsf@gmail.com> <87o74mjgcy.fsf@localhost> <8734lx4twk.fsf@gmail.com> Date: Sat, 21 Sep 2024 10:11:33 +0000 Message-ID: <87bk0hs4dm.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -5.31 X-Spam-Score: -5.31 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Queue-Id: DA35C15EBD X-TUID: egF4j8BVOli3 Karthik Chikmagalur writes: > If you think it's a good idea, I can add pending previews to the queue > in a LIFO fashion instead, so that if you call `org-link-preview' in two > different sections before the first one is done previewing, the later > one is processed first. Yes, it would make sense. > If `org-link-preview-clear' is run in a region where there are previews > pending, these region-specific previews are removed from the queue. I tried the following 1. Requests 1000 previews in a buffer 2. Move point to section, request previews on a specific image (not yet displayed) 3. Observe "Preview removed" message, which is confusing as no preview is visible at that point. We need to do something about the logic determining whether any previews are displayed or not. The current check that preview overlays are present in requested region is no longer accurate as they may still be queued and not yet visible to the user, creating impression that there are no previews yet. > Note that this new code in `org-link-preview-clear' is not actually > necessary: > > (when (memq ov org-link-preview-overlays) > ;; Remove pending preview tasks between BEG and END > (when-let ((spec (cl-find ov org-link-preview--queue > :key #'cadr))) > (setq org-link-preview--queue > (delq spec org-link-preview--queue))) > > This is because the overlay placed over the links for which previews are > pending are removed anyway. So when the `--process-queue' function gets > to that preview-pending link, it skips it since the overlay is gone. > Also, the complexity of the above code is quadratic, so I can remove it > if you think it's not required. I included it to be thorough. What you say make sense, but see the above - we make certain (now incorrect) assumptions about `org-link-preview-overlays'. The relevant parts of the code need to be re-checked. > Also, I think the variable `org-link-preview-overlays' is actually > unnecessary. We can just use an overlay property for link-preview > overlays and use `overlays-in' and `org-find-overlays', and reduce the > amount of global state a little bit this way. Let me know if I should > remove it. That might be an option. But we cannot remove it. We can only deprecate it as of now and only remove in following releases. >> And please fix the compiler warnings. > > As of this patch, I don't see any flymake errors with the > `elisp-flymake-byte-compile' backend. Is this not sufficient? > Byte-compiling in my active Emacs session doesn't work as the state is > "polluted". I don't know of a convenient way to byte-compile code in a > sandbox. Just run make in Org git repo. > Please note: I need some help with code style, for example > `org-link--preview-queue' vs `org-link-preview--queue', etc. Let's > postpone this particular discussion until after the design is final? I like org-link-preview-- more, but the most important part is to make things consistent across the function/variable names. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at