From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.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 YHoMD0zO/mYSawAA62LTzQ:P1 (envelope-from ) for ; Thu, 03 Oct 2024 17:03:08 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id YHoMD0zO/mYSawAA62LTzQ (envelope-from ) for ; Thu, 03 Oct 2024 19:03:08 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Fb9OmWA3; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1727974988; 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=gWLTWJBfrccpqkrYgn/VIHBM3sDHhqO+tRjH7wTI4Sg=; b=Gwx62LcMFOsJmOPnnynrOOejJcEGjRGiim13kCPkyuVUT9xAAvj39745jI2uFEEHthOraw obH8P3Mt7U9/W3eJNSMq2/vnoh/pwWydPrre96/HgKWbSibFxEeD6dyTPshdtAyubde5kw OnED7T3lCdvHLWTHVXntLvcFAqeOyEid7RgP/8PCIxpzu41RaTNRuuVOvnK+iImMqEIKme Pl7K2opTKxb+FzFESejL2kQJ1bJ1BVpOG6FM6AbhiYzQrBVKx5fmYtuzCtH5bnYuv5Q1jB +I1yfp0eLE2bfXvanrJXUmn8S78U5WDOLz2t2kSiYte204YnoYrJHSA2+QY5OA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1727974988; a=rsa-sha256; cv=none; b=I5qH/YL48HmeV5PhAqVT487akZ5niRJkmlqKvqG5MrwfSwE9I0hmgwA2AYGsgMYXu6+Nxm ajTPK9E46+uT2u9icnI4SkY0Oqu4U381v+b2I6spvj4/ajdvOK1VQMOEY6sDk4+XAk6g7g jPllTjk0eN1KHNvtU0WiHFIsyxkYqaYRSZu/kWrZKo8kMnW+frxzlUgv6i60A8Wnp4wrki VMR0lM3DTLYNTpH1Xsxuz3F6xhFp9KNs26RHr5sau4S+85/E8+Gw7lcfNa1DHL+lWbTu8q VjW2RPIeSczt8wm63ckNNw2glHuRZLURumZdoAZusHKrKAgHplHDY/9Nkz7qnw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Fb9OmWA3; 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"; dmarc=pass (policy=none) header.from=posteo.net 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 9576E7D594 for ; Thu, 03 Oct 2024 19:03:07 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swPDc-00089W-8A; Thu, 03 Oct 2024 13:02:24 -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 1swPDb-00089M-13 for emacs-orgmode@gnu.org; Thu, 03 Oct 2024 13:02:23 -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 1swPDY-0002QC-GL for emacs-orgmode@gnu.org; Thu, 03 Oct 2024 13:02:22 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id CB361240101 for ; Thu, 3 Oct 2024 19:02:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1727974934; bh=S27gZflg/w1gvN7Z7FDVvBKqksYIIc08ydssGbNtv3s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=Fb9OmWA3OItTzemGR125ZwS9HmxW6BrE7npQhMRZksE7d6U+GhGHgE+r3P2oIV52K ewb3xaKvUc4sKbEejnXogdi3ggD0TVlHB0NEuZsF4PxvCoOkNjqRoksjR0LWFkJRtk rikkXAbvi/Jga0RIMHgL74QuSByJWE53K4VTQc3xpzB+bHGd2d0eTwtix/67jORwn4 ZAe/APQKCoW3qRJPerzXzufZ6ii2/QNmLAVtz3GLuxdMAM7JOvHNVJFDC64MhGk6b4 fIN9qsFYACnpRGhwXM5Xjj5dvqppG/VkpYMjDnmi7p5CfY9z1U2kcKw7rex/3zSHmn 38ZVjtPt+5Y5Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4XKHzB2Lczz9rxK; Thu, 3 Oct 2024 19:02:14 +0200 (CEST) From: Ihor Radchenko To: Karthik Chikmagalur Cc: stardiviner , Org mode Subject: Re: [PATCH v6] Inline image display as part of a new org-link-preview system In-Reply-To: <87tte7wdpj.fsf@gmail.com> References: <6461a84b.a70a0220.b6d36.5d00@mx.google.com> <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> <87bk0hs4dm.fsf@localhost> <87tte7wdpj.fsf@gmail.com> Date: Thu, 03 Oct 2024 17:03:59 +0000 Message-ID: <87y135ce4g.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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -4.70 X-Spam-Score: -4.70 X-Migadu-Queue-Id: 9576E7D594 X-Migadu-Scanner: mx13.migadu.com X-TUID: T4okKjpk0tLg Karthik Chikmagalur writes: >> 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. > > Please try it now, it should be fixed. I now set the > `org-image-overlay' when the preview is done/successful, instead of when > it is queued. I tried and things seems to be working fine now. >>> 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. > > Thanks. And the warnings are still present :) >>> 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. > > I will check this in the final version, along with the manual/NEWS > updates. I have a few minor comments. > + (org-with-point-at (or beg (point-min)) > + (let ((case-fold-search t) > + (preview-queue)) Nitpick: Just preview-queue without parenthesis will be the same. > + ;; Collect links to preview > + (while (re-search-forward org-link-any-re end t) > + (when-let* ((link (org-element-lineage > + (save-match-data (org-element-context)) > + 'link t)) Do we need `save-match-data' here? Nothing inside seems to be making use of it. > + (setq org-link-preview--timer > + (and org-link-preview--queue > + (run-with-idle-timer > + (time-add (or (current-idle-time) 0) > + org-link-preview-delay) > + nil #'org-link-preview--process-queue org-buffer)))))) What if `org-buffer' gets killed when the preview timer triggers? -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at