From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.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 MC8/L6w3x2YU0gAAqHPOHw:P1 (envelope-from ) for ; Thu, 22 Aug 2024 13:05:48 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id MC8/L6w3x2YU0gAAqHPOHw (envelope-from ) for ; Thu, 22 Aug 2024 15:05:48 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Uzvg57bJ; dmarc=pass (policy=none) header.from=posteo.net; 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=1724331948; 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=MBPzJQj3wtdIIx2c4z1ECF9R8xSHGoj0Ga4+3EDXjXM=; b=L+Vafn5H/2awstC5Yj2UcN3sIj0G5UFloaoEYA9ve+2t+wblfrKaN4nE2UG5yTfz6CG/UD XG4KIwi2PWD4TwVe2wQR5wiJlgs8CUB+xovB/1VhM0XCx7RhoojaQU2Rdw0mOaIC0hJ2oE OhLMGA2Y0Mh653J/VBTI4GNpqp8ZrYnz4L8+wzyGT60sjwv0pQomGLgbjEXUvp42DoV/Xo BijwFKPvKLvV2Zh4m+CmAUeQuf06HWm2pPBN4ppwc67nQfvB9wd5WSLR37PpwULjwBXxOD 87czjptHl6kz09jNlJ4pqLEEV4xZ3cN160T+btmKKg3QMBZVmNZHK06+7BvTLQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1724331948; a=rsa-sha256; cv=none; b=Riwo99ULauOOxYCh95qP5ZpfqVPNjvrxeJqBq09w2OZxEE0yB1iTYtbhnrWeervr87ykRW uvQLRAM8mF/J2Z3+AHxl+KEEylPsdlQ2UVKFVCrSffBXrY7LP2Tc1yXeFrsnaPcc9mmCx+ hqxTRj8AeCSIjXYuyWiinwh84CUI7ZqiZOqT0ca72RYdkehZBwEkSOykIQzDOQFeNwjVXX 5/tHHWQlp/UJyqbOrplNPbVwpPisqnLHK2irsMsec3zM/CSk3oVMy+8XxSQP9G7usClufG iXl+NOC3fJuWjymm4Sz2k7DlnoFpYjJRDtK0UBfVuUgizq57uZhkUugeAk7c2w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Uzvg57bJ; dmarc=pass (policy=none) header.from=posteo.net; 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 8F3027CF75 for ; Thu, 22 Aug 2024 15:05:48 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sh7V6-0001kx-I5; Thu, 22 Aug 2024 09:05:16 -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 1sh7V4-0001kX-B3 for emacs-orgmode@gnu.org; Thu, 22 Aug 2024 09:05:14 -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 1sh7V1-0003UP-I3 for emacs-orgmode@gnu.org; Thu, 22 Aug 2024 09:05:13 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A06F6240027 for ; Thu, 22 Aug 2024 15:05:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1724331908; bh=GWaome83WACjX0wL52hquuLB8E/lPixTPnvi5R4r+R0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=Uzvg57bJE787Yeiv5MVRxxuBk3KBAgdC7KrXZLuRa8yHhJcanDxEBSPr2d6xjRURp 9srfvY1vGqLUnkPssDSul5V/Pj2yoNS4xSThZ7LMgLcOLRGJziPuQIaA7TvRtVFXhd jd5+cV/Rg5SpYNjYxlN8iUhFKzSJsbA2Kk3h6pFTh0p9ExGJB8bqOpQH+oPkmahdOX e+IydiuLykRxGJ+/9gqEBZ/jg1gTVnZrZaUjhb33MtFVJnG9NonnA1zIwzxbTa+Ghh yHhsPnlI9TLkC+prWHAlAwRmrSt6U0+9y07oKtZScArHpXlz9AkMm56jMr4tgl6uQT 55A+OmPAsln9g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WqNj00kfGz9rxL; Thu, 22 Aug 2024 15:05:08 +0200 (CEST) From: Ihor Radchenko To: "Christopher M. Miles" Cc: emacs-orgmode@gnu.org Subject: Re: [FR] Automatically display images in resutls of evaluation In-Reply-To: <66c54dfc.a70a0220.3c823a.2899@mx.google.com> 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> <87sev2yv92.fsf@localhost> <66c54dfc.a70a0220.3c823a.2899@mx.google.com> Date: Thu, 22 Aug 2024 13:06:14 +0000 Message-ID: <87v7zswvuh.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, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.69 X-Spam-Score: -6.69 X-Migadu-Queue-Id: 8F3027CF75 X-Migadu-Scanner: mx11.migadu.com X-TUID: ACAMbLl54Z8R [ Adding Org ML back to CC ] "Christopher M. Miles" writes: >> A simple `org-display-inline-images' would do (with REFRESH argument). > > I will adjust my upper code snippet in my Emacs config. I myself have something similar in my config: (add-hook 'org-babel-after-execute-hook (lambda () (unless (eq this-command 'org-babel-tangle) (org-display-inline-images nil nil (save-excursion (org-back-to-heading-or-point-min t) (point)) (save-excursion (or (outline-next-heading) (point-max))))))) And unless (eq this-command 'org-babel-tangle) was there for a reason (although I do not remember what was that reason). Still, need to be careful. >> I suggest to put this (1) under a new custom option; (2) only when >> Emacs can actually display images. > > I suggest use an custom option for this behavior. About (2), can add a condition: (display-graphic-p) > > (when (display-graphic-p) Looks reasonable. > (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)))) What is more than one image? What if it is wrapped into, say, a drawer? I'd rather be a bit less selective and refresh the whole result element. Looking forward to your updated patch. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at