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 2HQCMz7OwWbLhAEAqHPOHw:P1 (envelope-from ) for ; Sun, 18 Aug 2024 10:34:39 +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 2HQCMz7OwWbLhAEAqHPOHw (envelope-from ) for ; Sun, 18 Aug 2024 12:34:38 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=mxdWX4bf; 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=1723977278; 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=gYFnSYPJDYq4uuobRjvPlpqKcjWlKT4ciaSAByHYxJI=; b=kXoPY6KLB4iad6Sz5WTMy4FC8Wv8M3jyQe28vFdKVXYYJCuR3Pn/EhdAbG+Uf+WOtbJqVB NJWKMievjQLL8q1AXy9oqKIG0phPmjF6hZC2mDrRY4/51UgHw3NTt0tma6sYOOjY6D18Wk E4/Kssb5A25j0TXz8aEZMF3mwqSJE+snxNA1SWu4sGaqb72iU3s3LHLGPbyrXBjK9yq6vs NxCfjZ+5jLRV9JndBPlV4UvyitIgXoXXrPySDBeQyFtlbTWzXdEuq3U1OB+usekSgEDRbS vHGGUp/tvOqEsKIpexbubY6WgLcFDZdFwD2qMwHBd3B5tU1lCxTiHphqQ92V7g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=mxdWX4bf; 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=1723977278; a=rsa-sha256; cv=none; b=r2i5MIoLuo+iuUc2GAABJi1xRg9H0+/oH2EGE7m0Ha4GNzE8ay0q5S4l6K7x1OIJ6ZiNH/ ZG4evBzUJgNLVGq9gwS0Ozmy+e3v9Dfm13E8jHeKTA8RwaHGEH7nkGSunRJqbjpVm6zRgv 9ysj88UvTZgKWb3NlawC1Ul/vJyWFloEy7mN78jcRpZjYyFlsSCD2os81Pws9FlEEMKyRd tcb8nTYOnuDS6o4UgiwVIDmAxF+ND3AYa+Bmdq7/L4UaYR6Nb6ow/o5FL9qbfEEvuA3Eh/ UtOdt1UqCB0/rb8ApCX0QEPfTm9Gk+LYth8dZd4w09MCqGAsfJbzuiuhY/AAfQ== 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 B055916365 for ; Sun, 18 Aug 2024 12:34:38 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sfdEQ-00080j-6S; Sun, 18 Aug 2024 06:33:54 -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 1sfdEL-0007ys-QM for emacs-orgmode@gnu.org; Sun, 18 Aug 2024 06:33:50 -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 1sfdEJ-0000Ok-U9 for emacs-orgmode@gnu.org; Sun, 18 Aug 2024 06:33:49 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id AAEA6240028 for ; Sun, 18 Aug 2024 12:33:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1723977224; bh=nruk6uR0ZM04GruastmSWDfOKQJtqsaqLBKtbvmSyTk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=mxdWX4bfCpBGeNOMhd+KyPSovaQK7mAEruyqSbkc1juqtjxgdjGcqkxVWj+upAfWt kFUlj2gpp2uwfpJDiTH3xFuxLogBrBWe7TmAFm9NPbqHsmfadhY9aULD2G5Wrs6WVy oeCPC1q71C3SErVgZ9QOa/q0dMRDDonWZL3V7ffpCwTv/TUvM9qlPUqoP4UrrnPMb1 kF7n/h9c3RacO9B9zq6zOfOnos00DI/HAOT7aLxSv4ViGnke5SyDC9OvVk5JYCIeEm 91Sw8vXHQQc5TTAKk1rG06Zq1bdNW6h7eYdcwdscFQwpSOvvfdtcF8y6cNVjpvd64/ rHDBOnXRtwWvQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WmsX823T4z9rxD; Sun, 18 Aug 2024 12:33:44 +0200 (CEST) From: Ihor Radchenko To: stardiviner Cc: Org mode Subject: [FR] Automatically display images in resutls of evaluation (was: [PATCH v4.0] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer) In-Reply-To: References: <6461a84b.a70a0220.b6d36.5d00@mx.google.com> <87sfbxhmxe.fsf@localhost> <64623c09.170a0220.52bf9.9437@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> Date: Sun, 18 Aug 2024 10:34:49 +0000 Message-ID: <87sev2yv92.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: B055916365 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -9.69 X-Spam-Score: -9.69 X-TUID: Sdz6jCZ9ErMb stardiviner writes: > I have an idea, would you like to add an function in bellowing: > > #+begin_src emacs-lisp > (defun org-toggle-inline-images-in-results () > "Toggle inline images in babel source block results." > (save-excursion > ;; [C-c C-v C-o] `org-babel-open-src-block-result' > (let ((begin (org-babel-where-is-src-block-result)) > (end (progn > (end-of-line) > (skip-chars-forward " \r\t\n") > (looking-at org-link-bracket-re) > ;; (org-babel-read-result) > (point)))) > (org-toggle-inline-images-command nil begin end)))) > > (add-hook 'org-babel-after-execute-hook > 'org-toggle-inline-images-in-results) > #+end_src > > WDYT? after all I originally propose this patch for this purpose to > improve the babel result inline image toggle displaying performance. I do not mind this kind of feature, but `org-babel-after-execute-hook' is probably not the best place - it may be triggered noninteractively, including in Emacs running in batch mode, where displaying images is impossible. In particular, `org-babel-tangle' does it. Also, you do not need `org-toggle-inline-images-command' for this. You do not need "toggle" in general - what if an image was previously displayed and you evaluate an src block? A simple `org-display-inline-images' would do (with REFRESH argument). I suggest to put this (1) under a new custom option; (2) only when Emacs can actually display images. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at