From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id wAk3Dmd1LmPzpwAAbAwnHQ (envelope-from ) for ; Sat, 24 Sep 2022 05:11:35 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 6LRQDWd1LmOgJwAAG6o9tA (envelope-from ) for ; Sat, 24 Sep 2022 05:11:35 +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 C9870259F2 for ; Sat, 24 Sep 2022 05:11:34 +0200 (CEST) Received: from localhost ([::1]:56136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obvZl-0003WF-9A for larch@yhetil.org; Fri, 23 Sep 2022 23:11:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obvYk-0003Vb-Eb for emacs-orgmode@gnu.org; Fri, 23 Sep 2022 23:10:30 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:45963) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obvYf-0006wb-9g for emacs-orgmode@gnu.org; Fri, 23 Sep 2022 23:10:30 -0400 Received: by mail-pf1-x432.google.com with SMTP id 9so1747451pfz.12 for ; Fri, 23 Sep 2022 20:10:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date; bh=9eMVS0eOaQta7Mcf/L1AkAfKLWiEPQk7C9hhBiFAiCU=; b=PVGtI6eLEjXygHxVnXSPil3bbFNvBjqodMf1gYoWiUHoacRbRPj+iwbMh4FB6gunRl 7bglttrD7DIoO4ybUnmzwz5ndMg4PxZo9gfqi2KIa3M2VbBqtgHN/j4UfYgc57eHhZw+ 2JwaHspU09tDF6n5CURNsLOPfZ4R7wIfXQDJKOtRXIy9Ogw3306206K557eoYDkk3TD+ wr28bmmD6XyPrZUhLwUz0cZk0LGMLF+7oY02dE/njtWJM2q8HgcIVfph1BpS8HnXHLZS jFQoJ1kFqyfatQdXL7RKSq+Ivd75YuJDWydHT68bOQy0UsNT4OTItqdPoebPkiuXSK4M VWyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date; bh=9eMVS0eOaQta7Mcf/L1AkAfKLWiEPQk7C9hhBiFAiCU=; b=6WVmqYE2r0chEuvMWRyWQd/jCi5MnuIkoddO6EVAIVe5tL4h5ef8dwmMGFeY2r5ri8 nolF5Nhxps9iX7VqwLz3HvBQAEIDRtu+E94rI4b5gTPYdBtGFyZ4keWL6bGc1GIN3bGC LX74w7MvMf+IIXWG1MSYfH2uDttDDgKdEHgO9zF0BZlmrb+8gyNzb/LTZAThG6w2Kh5P s8z1BLHDgvcmQQo65swOx4bBz74ipmjg+45T6bEC20D+asDbauF4gGNV/zKfiT0aFe7y tY4HomwRxPKFibujzvp4OJxa8eUd+N6BSsE4qeftWEW6wAkr9Iv/y86/qyCOKF2S2sV3 EChg== X-Gm-Message-State: ACrzQf1CUl66aYaW/T8Vxjvpwy2SEa2bwaWmgudv0D3RtQ+NFlWjNc3S QBDiUBSotLU9vqQMpNObbCM= X-Google-Smtp-Source: AMsMyM4+mwp5f4dumklORbh+bjvr2D6Fi/7oZyRT9ohfYtIT0tKOP6vbO5xbBqZ4Vc8nX6y2ffHOGg== X-Received: by 2002:a63:6986:0:b0:43c:8417:8dac with SMTP id e128-20020a636986000000b0043c84178dacmr301204pgc.286.1663989023707; Fri, 23 Sep 2022 20:10:23 -0700 (PDT) Received: from localhost ([2409:8970:a80:3a4:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id p5-20020a170902780500b0016f975be2e7sm6732261pll.139.2022.09.23.20.10.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Sep 2022 20:10:22 -0700 (PDT) From: Ihor Radchenko To: Timothy Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Babel evaluation: location and timing information (v2) In-Reply-To: <87mtaq8265.fsf@tec.tecosaur.net> References: <87edw9z81n.fsf@tec.tecosaur.net> <87mtaq8265.fsf@tec.tecosaur.net> Date: Sat, 24 Sep 2022 11:11:03 +0800 Message-ID: <87o7v55uwo.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=yantar92@gmail.com; helo=mail-pf1-x432.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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" 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=1663989094; 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=9eMVS0eOaQta7Mcf/L1AkAfKLWiEPQk7C9hhBiFAiCU=; b=KBFf1grYOBhkdgRMzpIpIOsnp6I4VfylW6E/r+4PIQ50zj7dsMjket+HWph1imfTNNduc+ WNqUwtDMAc5O2hoywMUTuZug3baixWjpzxjuN18qkPk3dkdvYOiLNy6RM27tpt5vZwype7 Dt7YXyglelugD42soBwRI3m4ahYqYC1g9hwGo3xFo1aS9yci5Opx5ooAo14oabYLsMYp8m aEdYaHwB2xOnX/gmCw943Xv3OHEzs4fHLugmUNh3N5u8tILir+Qa6X79bEfmeb1LqVvg5Q pTRdwQ7TJiQDMPWqqfTTmsk+vhJnh9pUArAyVC5UwwosbrBy3kM3aGEzt7fNGw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1663989094; a=rsa-sha256; cv=none; b=iCpDXISO1oPmgWc8E3/4OTDlRm9MTZBWp2RopbE6BBxTaPBKAOXUFAY6BKTM/PZX/oG/QS VKtzxckOpQB9Jufd4+P0lAHR7JTZbNjTuLGUmOKKD8xjoRLNFOB5CrA655RevBASG0P/ua 0N1Cj2FTP4Ssf1z6g7jvdUw80Tsu1scxab0geaaqx7Ba/cgyRQFQ1nf23PdOVW/vHF0rIL Oo4/j+jnvFtSAg3vjqWXnBVUoSBDDKliNMsUqkuX3pnaAgBcDA3NPNQOmnnCBLCkfsUrRe fXJOSqSZsSIPN3RXEc8KYoIeu5VnhJxJBD48YJiS7Sd+k/6x2ha5lnmO3KM34A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=PVGtI6eL; 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" X-Migadu-Spam-Score: -3.35 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=PVGtI6eL; 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" X-Migadu-Queue-Id: C9870259F2 X-Spam-Score: -3.35 X-Migadu-Scanner: scn1.migadu.com X-TUID: jMISfHBE56Bi Timothy writes: > * lisp/ob-core.el (org-babel-execute-src-block, > org-babel-format-result): Record the babel execution time, and then > supplement the "Code block evaluation complete." (etc.) messages with > the execution time when >0.05s. I'd also mention the new optional arguments. > -(defun org-babel-execute-src-block (&optional arg info params) > +(defun org-babel-execute-src-block (&optional arg info params executor) > "Execute the current source code block and return the result. > Insert the results of execution into the buffer. Source code > execution and the collection and formatting of results can be > @@ -729,13 +729,31 @@ (defun org-babel-execute-src-block (&optional arg info params) > > Optionally supply a value for PARAMS which will be merged with > the header arguments specified at the front of the source code > -block." > +block. > + > +EXECUTOR is the type of the org element responsible for the > +execution of the source block. If not provided then this is > +inferred to be a source block or inline source block, inspecting > +the buffer content at the block location to determine which." This argument name executor sounds awkward. Why not something like src-block-type? > + (executor > + (or executor > + ;; If `executor' is unset, then this cannot be a babel > + ;; call (as `org-babel-lob-execute-maybe' provides the > + ;; type of the execution triggering element) and so this > + ;; must be an inline src block or src block. We can > + ;; easily pick between the two by just looking at the > + ;; first character of each case. In case something > + ;; strange happens, this can be set to unknown. This comment is confusing. From my reading of it, you only consider internal usage of `org-babel-execute-src-block' in Org code. But `org-babel-execute-src-block' is not an internal function and hence we cannot assume the callers. I think that it is sufficient to stick to what the docstring says about nil EXECUTOR value. -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92