From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id MLGWD0MNLGMQfQEAbAwnHQ (envelope-from ) for ; Thu, 22 Sep 2022 09:22:43 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id oCKID0MNLGNyQwAAauVa8A (envelope-from ) for ; Thu, 22 Sep 2022 09:22:43 +0200 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 E46083C0B2 for ; Thu, 22 Sep 2022 09:22:42 +0200 (CEST) Received: from localhost ([::1]:57414 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obGXg-0004Yc-M2 for larch@yhetil.org; Thu, 22 Sep 2022 03:22:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obGKQ-00081Z-MG for emacs-orgmode@gnu.org; Thu, 22 Sep 2022 03:08:59 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:35103) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obGKP-0003pR-62 for emacs-orgmode@gnu.org; Thu, 22 Sep 2022 03:08:58 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 514103200A4F; Thu, 22 Sep 2022 03:08:49 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 22 Sep 2022 03:08:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tecosaur.net; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1663830528; x=1663916928; bh=LayMTLJPvs OHTqoaiZVRM094CaNkXzQZns8bIkjsjLQ=; b=mwNed8Aw9OuK8215VbtnXRGKkc E4nV6jU+55uc2yDNJg0bUrCLi1gpxWzVZQ3oPGACNAlFn1FXXFspXogJjNpvA2Uj iqO4dwvcaQEawyonHUS+eHSwO1gcRJmCv9XzIFvSj8HY1Md218CqykKqfZ0uYlzZ Z1NOBcv5fRrisHAWAqt4T0voBrqt082RzxYlUddoJ7Mzj5IjRWW8G3rIUvp8jxsC WBwccRw1vW9C1ztgG8igy6E2oV9cR4ftPWLqKClC5FTTTRydWwyIBXbnr36OxyCC AuHqM/ngoSk37J6fKz2uF1+nnQE6jcZQL1vNckjmB49aYaGQDLWwlcFdXkeQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1663830528; x=1663916928; bh=LayMTLJPvsOHTqoaiZVRM094CaNk XzQZns8bIkjsjLQ=; b=kVty3Q69ZdJnqhyeRXBbaAjSP12KUdR6fNIECEv8uICQ 8GfdwehRoHWqWVH+m5vi6/BAKqG9XPxHm4qcPzBr7rWk2Vtmnr9MQ3GzeaxpOYm0 niMWy4g/Vfy9cpx1Ezyf6JLE+U8CXLo1J5JMhNObPgF+OA3cPlz0+fn0+1WbiY4R WcJiRwuQ2PFNWEurovUzWfu21MsWTrmxMhxk6vTtO7hB+hyF4AdOocaxl+wxnkPC 2QJIgtr2bqIdJaYKq2j2AwLgrZakGBwyZhyawx+hhm3Av/x0O++Jh6qaROv5jCXq 1haAMnC2LTHWOtaY1gqZ3h8g6tdNgkSVTVXu/Cx/5A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeefvddguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefuffhffggjkfggtgesmh dtreertderjeenucfhrhhomhepvfhimhhothhhhicuoehorhhgmhhouggvsehtvggtrdht vggtohhsrghurhdrnhgvtheqnecuggftrfgrthhtvghrnhepheeuudfgtdejgeffjeduff fgieeugfehjeejueejledvkeefveejhffhfeevhfegnecuffhomhgrihhnpegtohhnfhhi ghdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehorhhgmhhouggvsehtvggtrdhtvggtohhsrghurhdrnhgvth X-ME-Proxy: Feedback-ID: iecf94634:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 22 Sep 2022 03:08:47 -0400 (EDT) From: Timothy To: emacs-orgmode@gnu.org Cc: Timothy , emacs-orgmode@gnu.org Subject: Re: [PATCH] Babel evaluation: location and timing information Date: Thu, 22 Sep 2022 15:05:01 +0800 References: <87edw9z81n.fsf@tec.tecosaur.net> <87r106qwhv.fsf@localhost> User-agent: mu4e 1.8.8; emacs 28.1.50 In-reply-to: <87r106qwhv.fsf@localhost> Message-ID: <87o7v7998j.fsf@tec.tecosaur.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: none client-ip=64.147.123.19; envelope-from=orgmode@tec.tecosaur.net; helo=wout3-smtp.messagingengine.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_NONE=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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1663831363; 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=LayMTLJPvsOHTqoaiZVRM094CaNkXzQZns8bIkjsjLQ=; b=bdscRQ9z45JMvUTo3wF7cOFHLUJy1bCrKDnT8dcX0qh4v0+DxMN8pT9Khrwa8NipQ1X5SI WFx+39pBtqDIE76ckYc0XE+V+mX7k8vS4qnjiMzOsjXkyBFhT4J9ZDayeMGLdIzl1xa0Ax Jj64W2MMILmiydQeMYqNawr2iiLg2PiHvtgd1MrdZzu/HJpS1vDUjEhwrDignIPKSXoamW mK3m0DDZUnckXBKB36CzmhhbY3LobCWvsVIW1Q7IFvxz7BIX3Bj60CuCiq1MPMkB9O7ceL Uh7CdDZE+08zQkMbgpzW41yAeHZn8cR22dMsrRQ+fqRKV+aB2GA7TnZDjA+KaA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1663831363; a=rsa-sha256; cv=none; b=UfioAcg35l9GLe3/ZwBUYwDvh8LU+JCDUjEQv4v5L+NnLjhNmiXN1Xg+lR5irqkI0bX7iu wlvNEZ8RktVDjIweRGREfJ/stWHd0r5z095VExkiFoCYHiNKoGDzspU1HbpDwCVMZVVjcT YACnbCyqRG7oatPvqO6YL6t6mbnM7aQDuPIY+tR0ssZKcUfU7A7qO8yUdtD0ux30mTNqZq Y1B/cD/k9IJcKD6zVqB8JVUYt4Us4MRdvz1b64kr5d47z/J1CjITc9iAXcvL/ZMkxByBjM 49gReGAk/Tt9fThAV9zebFjIXadW/vuMmilP4HLAZan3gUXMb+LPx++kf67D2w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tecosaur.net header.s=fm1 header.b=mwNed8Aw; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b=kVty3Q69; dmarc=none; 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" X-Migadu-Spam-Score: 2.26 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tecosaur.net header.s=fm1 header.b=mwNed8Aw; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b=kVty3Q69; dmarc=none; 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" X-Migadu-Queue-Id: E46083C0B2 X-Spam-Score: 2.26 X-Migadu-Scanner: scn1.migadu.com X-TUID: v0uB4D5OgT9F --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Ihor, >> - (message =E2=80=9Cexecuting %s code block%s=E2=80=A6=E2=80=9D >> + (message =E2=80=9Cexecuting %s %s %s=E2=80=A6=E2=80=9D >> (capitalize lang) >> + (pcase (org-element-type (org-element-at-point)) >> + (=E2=80=99src-block =E2=80=9Ccode block=E2=80=9D) >> + (=E2=80=99babel-call =E2=80=9Ccall=E2=80=9D) >> + (=E2=80=99paragraph =E2=80=9Cinline code block= =E2=80=9D)) > > This will not work, for example, when inline src block is located inside > a headline. One can think of various other non-paragraph scenarios as wel= l. Good point. Does assuming anything other than a src block or babel call is = an inline src block sound reasonable? > Also, even though org-element-at-point should be caching recent calls, > I=E2=80=99d try to test the performance before/after the patch on large n= umber > of src blocks (like in your config). org-element-at-point can add a fair > bit of CPU load in some scenarios where we have fallback to the full > O(Log N) AVL-tree lookup. I=E2=80=99ll see about giving this a shot at some point. Since parsing woul= d be required before this point I assumed the document structure would be cached and this should be fairly cheap. Would `org-element-at-point-no-context' be better potentially? >> + (let ((time-info >> + (if (and exec-time (> (float-time exec-time) 0.0= 5)) >> + (format =E2=80=9C (took %.1fs)=E2=80=9D (flo= at-time exec-time)) > > Why 0.05?? Because that=E2=80=99s half the resolution at which the time is displayed a= t. The idea is to only show the time when it will show something greater than zero. All the best, Timothy --=-=-=--