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 4BuaFBTi5mb5CAEAe85BDQ:P1 (envelope-from ) for ; Sun, 15 Sep 2024 13:33:08 +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 4BuaFBTi5mb5CAEAe85BDQ (envelope-from ) for ; Sun, 15 Sep 2024 15:33:08 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=rl3c3Xg5; 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=1726407188; 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=ooHWvob9/XanMIXkvwdyI47VxQdSzs8A5y/ztsQYmVk=; b=URElAFsTwB3uIJAzU77iEx+w8NANML1P/OoqEB6tQxQj6zwmSSbizYtOQmKLHW9/T/VBHz Th+8Jvt7fHhGj/Jo+R2LVTqeSyF+hSNHNZ4ZbrHKcG9/9yZuCbMv3hcK0lxyONxIzBCKdh En6igSatxtHChG7PM6J7kid5Rp/o9B/MHFWZkTHVNWDWJJS4wm2ZQTw+GgEOa72anox6eH DZSrKrnAcZ87pdk1nBWbM79Kb29eZzYKn2lJNerKCVJMft5Ox64bc6uzs/S5N/ihrM7jsW sTRIzQf47Uxes2pXsuUgLDQIsmIr8U7P6tOpzLoDRv88c3v3CkQgCx2B6zX0DA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=rl3c3Xg5; 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=1726407188; a=rsa-sha256; cv=none; b=YAy45pqxV+nD61Z+GDGrHrJFn8CIXJysH7ghimhW8YDSpHpVqj2C00TQjHQAjzSqQgmBUw 0wfdLj6yqsP/CzrfknPkQWFIEK1uamNU+KZxiGr3HLnvy/mzvJAsQf1Q04H1wq0PCk8Bnw yKE5LcWCOSy2TvClAlWIl1KYesU8n2HNifSAir301iGAeGkd0hpKRMjg2v9tjuC20VxfrJ ztnlEbdDq1hzzSk/M8aa5wUeIegcML0vk+VUmnl5ayYVHzOTJg89s2tV+oUn9P+w4JBmnt UQPKx2wDRv1oSbrS6sc0R4r+KQSoNPJZLkga2s5JHuUQXrY+S+YP/ImctJLzcQ== 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 1D4B17ED8B for ; Sun, 15 Sep 2024 15:33:08 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sppMD-0003DO-Ba; Sun, 15 Sep 2024 09:32:05 -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 1sppMA-0003D5-A1 for emacs-orgmode@gnu.org; Sun, 15 Sep 2024 09:32:02 -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 1sppM8-0000F8-3D for emacs-orgmode@gnu.org; Sun, 15 Sep 2024 09:32:02 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id A960C240105 for ; Sun, 15 Sep 2024 15:31:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1726407117; bh=oronhfz9IK01o1BRAWdRueFwqM0Es5xUFal2MkUYvIE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=rl3c3Xg5kgDnEPR3x0LooCWodBL+ZS2rWdAEEszOWsNQRbcQ940OlJhc2ta6JMafm mKhJF2t0C6n+x04g4BkffTVJPOZNwfZP8SisPWtJuYvS+pka+wnjhI6NUHaSgQHOC/ Ys4O4hoNYJlGy6poQMzP7jjRID7DMKdNZ3Uf9J1rlClVGbUassnCFRmaMOHJCIpzOT z9dehawEmot4PnghrjyyI7kgL7M6e0aTG7pKSDALKgWjSssBoFPjQ9zVd6S8IqUTcs tTDt1/3EsLt8D3XYMOTUVSytGwbYgKrgGl6JVmm5xmObd5IKuZ3zlyndge7wS/i1/u WhAoOMfaN38ZQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4X688r5vTRz6tvh; Sun, 15 Sep 2024 15:31:56 +0200 (CEST) From: Ihor Radchenko To: stardiviner Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH v3] Re: [FR] Automatically display images in resutls of evaluation In-Reply-To: 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> <87sev2yv92.fsf@localhost> <66c54dfc.a70a0220.3c823a.2899@mx.google.com> <87v7zswvuh.fsf@localhost> <66c89411.170a0220.3255c1.0cd5@mx.google.com> <87zfor7b04.fsf@localhost> Date: Sun, 15 Sep 2024 13:33:31 +0000 Message-ID: <87a5g93utw.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.01, RCVD_IN_MSPIKE_WL=-0.01, 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: 1D4B17ED8B X-Migadu-Scanner: mx11.migadu.com X-Spam-Score: -9.73 X-Migadu-Spam-Score: -9.73 X-TUID: InwnRrbzDTOH stardiviner writes: > I updated the patch. Thanks! > + > +(add-hook 'org-babel-after-execute-hook 'org-toggle-inline-image-in-results) Please note that `org-babel-after-execute-hook' is not necessarily evaluated with point at the src block being executed. > +(defun org-toggle-inline-image-in-results () > + "Toggle inline image in babel source block results. > +It support displaying multiple continous inline images in results." > + (unless (eq this-command 'org-babel-tangle) ... so this check is not really sufficient. The very reason why `org-babel-tangle' fails with this code is because `org-babel-tangle' with noweb references may evaluate code blocks and point position will be at the tangled code block rather than at the code blocks being evaluated. `org-babel-tangle' is not the only function that may trigger block evaluation in such a way. Any kind of reference resolution might. We need to come up with same safe way to only display inline images in the results when those images are actually updated interactively. We might even need a new kind of hook that is given more contextual info about code evaluation. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at