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 qIKiLYNK02YmagEAqHPOHw:P1 (envelope-from ) for ; Sat, 31 Aug 2024 16:53:23 +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 qIKiLYNK02YmagEAqHPOHw (envelope-from ) for ; Sat, 31 Aug 2024 18:53:23 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=fsioFF9I; 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=1725123203; 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=c16MQ/U/DHgep6KcTWP/xr0OQoOky5f8wCdIDprtDtU=; b=aH1ZcuFehTwDPZDtZo1d90wiPNRO6EyOOh6YuHwL7BRJlNWAcYExGOm7VxGSJqXnXFpt3O ostWkYKNAc1tKwV4Mlgh33UDTX/YxxGY/caxLuI+6ndoEPBsGlVwMmnhLuFzsi3rdXKzl+ Lh0e4kBuszHjXe+JMKJ1+X1MLUNiLjHJ69+P64div94favD7rd5s/YDnAxsnipD5W0tqj9 WdgKxGy1m1IoU0YUtpIR6lxnZoaYCAnqs/DW3rdWfMFYxJVm65Tj3rW5dwQ6lUDz+rLrCZ N0WgQA9y7PnPbtU1HYiJyviJOXIJQA8GZzCglweK4fQIVUZn0tVCsEg31CuPGg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=fsioFF9I; 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-Seal: i=1; s=key1; d=yhetil.org; t=1725123203; a=rsa-sha256; cv=none; b=Mf1XdhlfiWwmSLhut3vUN2wFP7wBGbKesQbaX6V3hJPScJUHpmFpjG/3bt1F0ISBm1sR+I NOSKXPwlMZn5RnNJ23DMuxeLm/W764ZKuFWdgj95UAgKVSwGFzZduMMz9oInQRlNv5KL/d sPquQxyWAQbmBlFnDP7Zg/RT+NKV42GQsBTCiG6D3SW+11my+Oeqm1mlE/d2aJO6ofELFp Lx19jm1Qgwaa8tC0rxc4Pth94TNR7mfxNXS2pr6QtvpQ8Sz4w2xv+5UaXaNGSLC9p5Lkai hYqN6r1oedRm0VmShNc4nr+yTOcWkdHzKpdUdE1XcmS7YuW0N24icZ+KeNfs4A== 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 9C28316FD7 for ; Sat, 31 Aug 2024 18:53:22 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1skRL5-0008NE-OB; Sat, 31 Aug 2024 12:52:39 -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 1skRL3-0008My-9c for emacs-orgmode@gnu.org; Sat, 31 Aug 2024 12:52:38 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1skRL1-0008Ty-9d for emacs-orgmode@gnu.org; Sat, 31 Aug 2024 12:52:37 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 52742240028 for ; Sat, 31 Aug 2024 18:52:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1725123153; bh=DdYgXnbb6F1q63kg/bqX6hbxPYLkgSZVaeY+QIOLFIc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=fsioFF9IpVvQ9DqXTMT49sP/jcvr84G5Nq43wA5jozl/O8HUKw6EEl5r5b/08+c1M daaobjXl1XvCLnDPBNSj3yZYoeQseicKcW310U9BNqZB2WM7FGBgNW7SfjIZMmpDw4 9Z7oa5JPsModwQko2zrO4LaKUXjI3gm/jXv2LFNcpJwNKtEriarP42Qr48Ul22Hc8z CTk8k9X3Ja2DYywwcdRbD+9Uoh34fRLk1S7Y0j+yysCeXyxFgjVI9jdjhYEi+X3u6n 42/22zVP622oem9OAUurEuNZTsGle8LFWjPRH1jgxszNv4HiV0jPHbQ5qd2O/u/rWZ aGhwFFPC7BOYQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Wx1KD44MNz9rxK; Sat, 31 Aug 2024 18:52:32 +0200 (CEST) From: Ihor Radchenko To: Karthik Chikmagalur Cc: stardiviner , Org mode Subject: Re: [PATCH v1] Inline image display as part of a new org-link-preview system In-Reply-To: <87msksabld.fsf@gmail.com> References: <6461a84b.a70a0220.b6d36.5d00@mx.google.com> <64c8a313.a70a0220.93ee0.14fb@mx.google.com> <87il9zgpdp.fsf@localhost> <64c905d7.170a0220.f434a.fddb@mx.google.com> <87o7jpoqfl.fsf@localhost> <64cc9b8a.170a0220.dfa99.2e18@mx.google.com> <87msz7kym0.fsf@localhost> <669882e5.050a0220.8ff6d.33c6@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> Date: Sat, 31 Aug 2024 16:53:57 +0000 Message-ID: <87jzfwljkq.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.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, T_SCC_BODY_TEXT_LINE=-0.01 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-Queue-Id: 9C28316FD7 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -9.71 X-Spam-Score: -9.71 X-TUID: umBPfNnIBd1C Karthik Chikmagalur writes: >> We may simply pass the link object to :preview function. > > If we pass the link object instead of the overlay, it will be the > preview function's job to create overlays as needed. This overlay > should have special properties (like `org-image-overlay') for previewing > to work correctly. > > Q: Is this okay? Or did you mean we can pass both the link and the > overlay, like this: > > (funcall preview-func ov link) > > and let the previewer figure out the link type and path details? No, I meant to pass link object in addition to other parameters: (funcall preview-func ov path link) We need to pass PATH because we use special rules to derive it. It is not simply LINK :path property. >>> * lisp/org-keys.el: Bind `C-c C-x C-v' to new command >>> `org-link-preview', which has the same prefix arg behaviors as >>> `org-latex-preview'. >> >> Didn't we discuss changes to the behavior? > > Yes, those changes have been implemented, please see the docstring for > org-link-preview. The behavior is identical to that of > org-latex-preview, but in addition the 1 and the 11 numeric prefix args > are handled specially. Then, the commit message is not accurate. >>> + (if-let ((file-full >>> + (if (equal "attachment" linktype) >>> + (progn >>> + (require 'org-attach) >>> + (ignore-errors (org-attach-expand path))) >>> + (expand-file-name path))) >> >> I'd rather put this part into org-attach, as a separate function that >> calls `org-link-preview-file'. > > Q: I don't follow. Right now `org-link-preview-file' is the :preview > org-link-parameter of file links and attachments. Could you explain how > this indirection should work instead? What I meant is that org-attach will define a custom `org-attach-preview-file' function that will compute the filename, and then internally call `org-link-preview-file'. Then, attachment: link will have :preview set to `org-attach-preview-file'. This way, you will not need to require org-attach from ol and ol from org-attach simultaneously. (no cyclic dependencies, please) -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at