From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 2LTzELImyGYWAAAAe85BDQ:P1 (envelope-from ) for ; Fri, 23 Aug 2024 06:05:38 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 2LTzELImyGYWAAAAe85BDQ (envelope-from ) for ; Fri, 23 Aug 2024 08:05:38 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=k+lkzbFx; 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=1724393138; 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=xE3PHi5tuxJyI/IJMoFYFeBRByrIHWHWwy5X76mVT6U=; b=cPjpuYGNwQqM1AiaMRR3UyLwWcAHlkesD8Jpg0/TPfxBMX2h/bmeofa1iBQYhHS3dqPhuR /dqyNzxr8CztLOSwt59T9bDrwPfavE7hPEZpLlKZ0cfVmcX1hSAhV8aJGkFDUH5uWuKTry wbeUamscSS7Cr5rN8YvUmbtM/h+sKMgAt1IOXUpUhjUSz2+l3QSCdjjbX6VXCmc+VJBpnc cYhVPHBwrsBd6OqCIDfGC3YaZQQ9KS36bqdRfSgUJCkgkcCLquiVc9QXCKtxqdGdtOVMSw 5tbpzrgmIXCragM3VQF8YCNfLzeUK4qTfFOKmRux99qKp/3GOuXDt8v1uGUXzA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1724393138; a=rsa-sha256; cv=none; b=kyuEmsBEDfRCV/bRDXTcaO8xFsa1NoHBlhRDusHdhkZtXG2SKqruWstIZK/yj8jKwVaDPU 1ljz/eyf6tgeNLIN+IbPu392O3pSZShL76QYS5EOKsgDNYx6ynFWPWZmcHpyfP3FPjFTzk 3sWPrLITqMzvVVUjQNSWH97RQYuhIqTMAxEW0H62Wcb6fEaK+MVZBgVYHFmmAXYBzGozlA aQhz2ma9LseraL/RV30b76ympmglRstRNoQ+h2Sx9aZARFeagK94gRcPl7aZ0AGz78K4x8 g4PnMDcA30RXODdEmHLrQ8dzgy84wp0ubjjwBkpmE50mknrLXv6ivdzTQA4R3w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=k+lkzbFx; 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 D1643ED40 for ; Fri, 23 Aug 2024 08:05:37 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1shNPR-0008Uk-R6; Fri, 23 Aug 2024 02:04:29 -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 1shNPQ-0008UX-0C for emacs-orgmode@gnu.org; Fri, 23 Aug 2024 02:04:28 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1shNPO-00022Z-Ca for emacs-orgmode@gnu.org; Fri, 23 Aug 2024 02:04:27 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-713edc53429so1321969b3a.2 for ; Thu, 22 Aug 2024 23:04:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724393064; x=1724997864; 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=xE3PHi5tuxJyI/IJMoFYFeBRByrIHWHWwy5X76mVT6U=; b=k+lkzbFxqtslbltzLbrQYQcPFcyuCqhn/NPNydN5B8+sIIiBTRivDGN1Y/YFLtJwt4 HBdO2BoLtZcWkNFyuHeqjpbwkeWQqoQbOo8pGiIQXZ0HYvUDpXrzYYL1pPv4VfWgp5Z8 yHCRkSryUNwDOttce3Zo0Pxd5PfVqreyJeWIJyJN2/7nfwh9Ah3pRdhxJjo1t5fPv/5w 8QtWNcb1+aJgWHxoy3atGuniLOGlKiqplaZ4zJ18kRQWuQu2uLyAZcU9eqaZJCuuFQ3J XMsN5MKhHLVwxyh9POYOsQCB0LPG2TEIl5cH+VThKXnslaWV/8DQFkMqaxGm11QZNvCQ fvag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724393064; x=1724997864; 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=xE3PHi5tuxJyI/IJMoFYFeBRByrIHWHWwy5X76mVT6U=; b=rbMno2IzbmDgHSsvlsur9dsciuegG+vT159AGFkicPQMdM49cHO2GsJaVwh0+1XcSb YtC9KCk0xGwg4CxxuMb0EXC1Q4C7dugf4HZmewwQz3+GlUgm/iStvqdQY3eoKdsXcPvZ cY2vb1M86TKUKIPyI+N1y6Z6bITMp9kkDWVNQ3CW9jqW8p9ATfTH87PL0OGJHPJefVPz HwXtYNRVDn2ykFATUfwO9Gie0QKsAG7ETDtToFwSuw9VjW/DtTVi3as95F9i8RadlJ8u S4HbbQeypbe/WP9CRVtgqc2JUnoRWGwJ+vE1jyTm1oOnTKYcsG8D1Gqx247DT2fINkyB 6tKw== X-Forwarded-Encrypted: i=1; AJvYcCWz+kNi7gmKoVidaIZIBgUrzONMl+2NmdHIkazY/s+6QD6cPacZaC6mtwV6u8EDb/v2K8b1x7LkYRXQeBwI@gnu.org X-Gm-Message-State: AOJu0YxLWFcBSJR1Cn5ardCYC4R+Z0Pn81flQtDvYpI2m0H3AX+0KHjD FH0WeCUpd4Z8bMKCW9k7dDWpOQ0oXM3lJePxr9YrgW+7tvCML3Uw X-Google-Smtp-Source: AGHT+IGYiHtVEhXtoLmk3BT2bj8Sm+NWV5CB+43xoG6SsZ4TWaTa5gxSTgDoIZ46YCpmIfSwNysgqA== X-Received: by 2002:a05:6a21:3401:b0:1c6:edbc:a0da with SMTP id adf61e73a8af0-1cc89d28db3mr1349474637.8.1724393063789; Thu, 22 Aug 2024 23:04:23 -0700 (PDT) Received: from localhost ([2600:8802:5726:2500:75a6:b711:5692:7197]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2d5eb8d1186sm5428970a91.1.2024.08.22.23.04.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Aug 2024 23:04:23 -0700 (PDT) From: Karthik Chikmagalur To: Ihor Radchenko Cc: stardiviner , Org mode Subject: Re: [PATCH v4.0] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer In-Reply-To: <87msl4wv8d.fsf@localhost> References: <6461a84b.a70a0220.b6d36.5d00@mx.google.com> <87y1lo4ou1.fsf@localhost> <646379fc.620a0220.c0ae4.9fb2@mx.google.com> <87zg3l1rgb.fsf@localhost> <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> Date: Thu, 22 Aug 2024 23:04:22 -0700 Message-ID: <87bk1jg4gp.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=karthikchikmagalur@gmail.com; helo=mail-pf1-x42b.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, 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.79 X-Spam-Score: -6.79 X-Migadu-Queue-Id: D1643ED40 X-Migadu-Scanner: mx11.migadu.com X-TUID: NDRN2mjDbe/i > This is not a problem. > It is possible (and also Elispy) to use advices: > > (add-function :before-until (org-link-get-parameter "id" :follow) #'my-function) > > We may want to document this fact better though. I've noticed that org-link-parameters that are functions, like the :follow, :export and :activate-func parameters, are given very specific arguments. For example: `:activate-func' Function to run at the end of Font Lock activation. It must accept four arguments: - the buffer position at the start of the link, - the buffer position at its end, - the path, as a string, - a boolean, non-nil when the link has brackets. This is even though these functions can gather any information about the link using org-element. This suggests that we have something specific in mind for what these functions should do. Along the same lines, my plan is to add a :preview (or :preview-func) parameter that looks like this: `:preview' Function to run when generating an in-buffer preview for the link. It must accept two arguments: - an overlay placed from the start to the end of the link. - the path, as a string. (I can add more arguments if it proves necessary.) The idea is that the preview function can specify an image as the overlay's display property, or add some other overlay property with suitable content. For example, for notmuch links you could specify a before-string that adds relevant metadata from the email that's not part of the link path, like a date/sender. My question is: is it okay to assume that preview actions for all link types should work by placing an overlay over the link? Or is it too restrictive to pass an overlay? A more general version could leave it to the :preview function to create the overlay, or preview it in some other way entirely, such as by adding text properties instead of an overlay. One reason I would like to restrict it to an overlay is that I think a :preview feature should not modify the buffer in any way, as adding text properties will. Karthik