From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id UJ3IOlmW3mbyPgEAqHPOHw:P1 (envelope-from ) for ; Mon, 09 Sep 2024 06:31:54 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id UJ3IOlmW3mbyPgEAqHPOHw (envelope-from ) for ; Mon, 09 Sep 2024 08:31:54 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="Q/gy9Iiv"; dmarc=pass (policy=none) header.from=gmail.com; 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=1725863513; 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=CoqLW/5qu0BZ09r5pzjiODJD6PqPKb7wrm3WFgYp4sw=; b=OXnJaoLyMbnX8CMvRPSk74LrGI78gD0yRMJFwzbNw8lBAxcLaLD420+oVdbEq012ImPWWV 2fsHBm2XXJ+BzDu5v2jjhhqNpoIjVZGFF5sQaWt6GOtsaBDwcSxBkW5IZ8chQKAxVknqr0 dP8za6vuMk/mWvtxJnp+Xdm2bhe3iXyW/NoXmvzsG0g2Lf+5m3GXGVo5wksZyZSzjjcBdT /iNAmlz5dlvai95kJga1W3xiuvpEdb2IutGkMWKJyk2OWj444r3oySj0jiYPqA2KMwFNBf vVeWtTau6rvgXRlHH6rl1aGOpy27zG8sLMG20Y+ian2fbJLNUh4RT9TSFLOlRQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1725863513; a=rsa-sha256; cv=none; b=pAkqreqibACoAq8XVWLyxGroS1ZDL1Z7JAF9PszLufoGbPfJmyLXqNGbA+4sSgkh1Ebuul OMLnY66xpSCmRhXT1T66QMdz7LIoNIC3ntfYJpE2Lq1Z51EB1w8tIzTpTBGt0SBzp87rZ1 5hrR2B0MPl0fZGu0v4n0qJ8b3zstc+QSokA6j/7NPUh6q0Zril/HpEwBxzlSr3IaBnDnau j+wq/RjVkVbme+OP0d+ltWxycpK2dEQzKeKzES+m3RfGdSiZsyeqDfXFFbPLDJaBA7H+qA RhO97U8QCfU9NBCdwcgTHR5lSRFo+9sVZK55aqUlixIpUnVqqtxsB7QuIGF+4g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="Q/gy9Iiv"; dmarc=pass (policy=none) header.from=gmail.com; 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 A900B63200 for ; Mon, 9 Sep 2024 08:31:53 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1snXvT-000294-9u; Mon, 09 Sep 2024 02:31:03 -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 1snXvR-00028s-Ja for emacs-orgmode@gnu.org; Mon, 09 Sep 2024 02:31:01 -0400 Received: from mail-il1-x136.google.com ([2607:f8b0:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1snXvP-00058E-AH for emacs-orgmode@gnu.org; Mon, 09 Sep 2024 02:31:01 -0400 Received: by mail-il1-x136.google.com with SMTP id e9e14a558f8ab-39e6b1ab200so17634075ab.0 for ; Sun, 08 Sep 2024 23:30:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725863457; x=1726468257; darn=gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=CoqLW/5qu0BZ09r5pzjiODJD6PqPKb7wrm3WFgYp4sw=; b=Q/gy9Iiv6qYiN7YR2bvz/WD3WOsETAb330NnS7+HFD/H0BlvOF1BxqkR1P+UUN/VYM AJCYZ7t0fOE8Z+yRY2x1HpcTNlOHqOb8eSN9YvS/LGM0msp2Xju8mi/jTgWwNcXTahCC RRR+JBRhZq2ClHXB4uDn7LIv2TTBdwvWUyLm2Esh3t2hcVhwB0NVO1CB4w0X+R9Afk7d xxlNTWTbL6H/qcBdjAoRM0n1CS7M0PYgxtjtzWcPHuyUn5tfNahxGLx2a78nLGawEdih V8V+lRYSGoA2jxj9mKowch3SfT4wjQOiQLqaJKL1H0RrTSaJjFsXJvo8aSMV382chfXJ 9f8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725863457; x=1726468257; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CoqLW/5qu0BZ09r5pzjiODJD6PqPKb7wrm3WFgYp4sw=; b=uBac56Ct747jZtvYXN5HY5yg/tlZpZCnmkeqTVJawjuCAFNthnU/LoUIMKsLBsNGk+ rHiyx1hc/UbB+Ws5nV/eFQ7y7ME9YIutcE++cJh2yvfyD3llru0x9UvQwtrQCSX/oyo4 sHlESnQK717YPn/62zYo4vubkLoo/JS8cOBPF/2X+8jM+RYXx4tuyfZcV0WWEpRr5VAC Hh4nmPIPA2jGRnvqFCHcobjUJ7Ej9BNygcfKWvUjOZ7CfkKYJQ1lzlT56jAnPGAV+7la 48f2CI/91TnOWz7jUeqcfM3lI7x/ok+uCO3UPrpYQh23MCuZX8x+1px0PffhX5lPXpVG l/CQ== X-Forwarded-Encrypted: i=1; AJvYcCXs2AgRN33Rv/KjTL9MNGlyckmj47im6lWRmwfA3C442EkI0+1ryR2pnYfJ9K9N1Sn9B2XERMqEaX4NGcB/@gnu.org X-Gm-Message-State: AOJu0YzJ+WOedps5HQ9v6JfXQvUrH6y+m1Cvp2xzcCHJrF7NB45PVfM/ twm1b/mlynAxs3i0NGs39l2ZwK5BNi2zJO8Kpv8QoK8wre8ScfZj X-Google-Smtp-Source: AGHT+IHsTMoTFF+iSkhYfRjbhdTRq3K9xSB1hn2llKcz+EiDuqtiJYG9cYRpaLY5g1eBLOXq9xqnOg== X-Received: by 2002:a05:6e02:1a88:b0:39b:2ceb:1a23 with SMTP id e9e14a558f8ab-3a04f069c7bmr140562535ab.3.1725863456547; Sun, 08 Sep 2024 23:30:56 -0700 (PDT) Received: from localhost ([2600:8802:5726:2500:719e:314f:34a1:46f7]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7d823736421sm2650461a12.15.2024.09.08.23.30.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Sep 2024 23:30:56 -0700 (PDT) From: Karthik Chikmagalur To: Ihor Radchenko Cc: stardiviner , Org mode Subject: Re: [PATCH v3] Inline image display as part of a new org-link-preview system In-Reply-To: <87jzflqs2g.fsf@localhost> References: <6461a84b.a70a0220.b6d36.5d00@mx.google.com> <871q3logb9.fsf@localhost> <66a8b73b.170a0220.383476.996e@mx.google.com> <87o75yhwnu.fsf@localhost> <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> <87cyldzf3p.fsf@gmail.com> <87jzflqs2g.fsf@localhost> Date: Sun, 08 Sep 2024 23:30:55 -0700 Message-ID: <87a5ghz6cg.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::136; envelope-from=karthikchikmagalur@gmail.com; helo=mail-il1-x136.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, 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-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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: A900B63200 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -9.81 X-Spam-Score: -9.81 X-TUID: bJ6P+5hWDtdD >> Do you mean something like this? >> >> (while (re-search-forward org-link-any-re end t) >> ;; Make overlay ov here >> ;; Find path, link and preview-func here >> >> (push (list ov preview-func path link) previews-remaining)) >> >> (dolist (preview-data-chunk (seq-partition previews-remaining 6)) >> (run-with-idle-timer >> ... >> Where the chunk size (6) and the idle time (0.10 seconds) will be >> customizable. > > Yes. Okay. There's one more issue to resolve. An asynchronous preview will return t but no preview is placed yet. If the preview then fails when the callback runs, we will have an overlay without a preview that hasn't been cleaned up. How do you suggest handling this case? The only thing I can think of is that the async preview-func should call org-link-preview-clear on the failed preview by itself, and we should include this expectation in the org-link-parameters documentation. Karthik