From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 UNr5A0AwfGPX0gAAbAwnHQ (envelope-from ) for ; Tue, 22 Nov 2022 03:13:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id UGP+AkAwfGODPQEAG6o9tA (envelope-from ) for ; Tue, 22 Nov 2022 03:13:20 +0100 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 7AA9746987 for ; Tue, 22 Nov 2022 03:13:19 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxIls-0002Ud-Qj; Mon, 21 Nov 2022 21:12:24 -0500 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 1oxIlq-0002U2-RK for emacs-orgmode@gnu.org; Mon, 21 Nov 2022 21:12:22 -0500 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 1oxIlo-00032J-11 for emacs-orgmode@gnu.org; Mon, 21 Nov 2022 21:12:22 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 2E559240103 for ; Tue, 22 Nov 2022 03:12:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1669083138; bh=+a/LkqDP+9f3l1GRtwC5Lvosx543PBVup35S6s7nm0Y=; h=From:To:Cc:Subject:Date:From; b=sHlxmEmJmjGLMhfZZvX8A/8wcsg3/OzhVENzlbPDQTGE9OhQe6NN4t5GPPkiyIXt1 9nqkvOSmWo9aFAVUdirWW/TMczV6QbTdpU4qLGy72EVgbbEkEhGa6tPYHZr2k8gBn/ JFucO1xABVAUP781Qsb3MJgV0BUkCXkvEEG+QL8Wp97TMC2wr71hoPHNf/1VN2qXXj QxBxb4O9d8Gg4wQ+ycRizZtWxPwk7QxXaSk4Q3fG/gi6ycAmPYjkHH6Jo2RJBG+qpJ QdGAhBVasW7VT/G1NslteObI1bkqXkirKgOW+rrE1uj3PIbb8NepekWSXfpzyjfTLI Rosg0Kxjv2wMA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NGSSc4BjFz6tmS; Tue, 22 Nov 2022 03:12:16 +0100 (CET) From: Ihor Radchenko To: Daniel Ortmann Cc: emacs-orgmode@gnu.org Subject: [PATCH] Add new :results ignore header argument (was: [External] : Re: [BUG] executing sh source block with ':results none' encounters error region is longer than org-table-convert-region-max-lines [9.6-pre (release_9.5.5-1118-g70cee1 @ /home/dortmann/src/git-org-mode/lisp/)]) In-Reply-To: <1e89cf84-e38c-382b-71cf-e4a8ce9b1bf9@oracle.com> References: <290ab489-4c2a-d9b9-fb95-e4e246f3a85d@oracle.com> <87mt8ok5vg.fsf@localhost> <87tu2tjary.fsf@localhost> <1e89cf84-e38c-382b-71cf-e4a8ce9b1bf9@oracle.com> Date: Tue, 22 Nov 2022 02:12:58 +0000 Message-ID: <87cz9fd9ed.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1669083199; 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=tUuLaCITiTXzLcRnAXsKVLrGZ/+TTl0UyTGjk2vc7YU=; b=FHTBIFXL1D9TfZMJbgO9BpfPPISqaMnjen3YMDa4NKhMMnZ62h+TW1kZxB+0ZjZzjpo8cH awagmNXFKND5F/fxe5D3df11Yw7SM+OBaWZxPEo7yoDeoguGtXuj7GKMGNPF23tG/Kz32T CQXM7AcYXO2lxJS40LYyiEb5ur97npekF+semz2Cu/z4NgjzG3J+E5igzbTqgqysXfyo6r Ib7i8d8ZVbNWnavtGnDmoCxHmK0jL5l4kzNVSRXE326ezLQ7Ya5xvku7SnChKN9sayTzWd 6y5JTxVJiN9dSPPKnATWGEn9tGUbuQCq+iTOr7o269yiP5AfrHwi82k27P6swg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669083199; a=rsa-sha256; cv=none; b=oPVxPH/p1CHm0PBQWZ2M3UBkdRNPIW19XdNTshekpa2N0ma5YkEBu9fLCja3jIksIXiFme OfDjj/BNCMfDxdRmCrt2URAYBTjAn8P8VUTuxOr/yIl+o/PHEj25O3b8yrfcr87IkHJHzt YoiIU4tCg72cFqBpuinIaOag24k8YGBX63Jg2myrIztXaj1jsVx1wNG88XcOcu7lTg0bJO eOFh6CKjyImSx2YWOC7ONcEgjKMxZ1YJAe86LUfmJelSy+FzJf94AU/oKED20bv7ppXRFa NTtm8WFp/KuESf3rHmmRkFvdBJPFjnjxkIgDKgacMVSnelChfiyXvn+F6Ctdog== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=sHlxmEmJ; 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" X-Migadu-Spam-Score: 0.08 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=sHlxmEmJ; 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" X-Migadu-Queue-Id: 7AA9746987 X-Spam-Score: 0.08 X-Migadu-Scanner: scn1.migadu.com X-TUID: FH07GT2C4yEG --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Daniel Ortmann writes: > I am happy with whatever you decide.=C2=A0 :-) Then, here is a tentative patch introducing new :results ignore header argument. Any objections? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-babel-Add-new-results-ignore-header-argument.patch >From ea48cb04301588688f736e9461ebb7824224fe44 Mon Sep 17 00:00:00 2001 Message-Id: From: Ihor Radchenko Date: Tue, 22 Nov 2022 10:06:24 +0800 Subject: [PATCH] org-babel: Add new :results ignore header argument * lisp/ob-core.el (org-babel-result-cond): Unconditionally return nil and suppress all the processing for :results ignore. (org-babel-common-header-args-w-values): (org-babel-sha1-hash): Add the new value to know :results value list. * doc/org-manual.org (Handling): * etc/ORG-NEWS (New =:results ignore= header argument): Document the new value. Reported-by: Daniel Ortmann Link: https://orgmode.org/list/87tu2tjary.fsf@localhost --- doc/org-manual.org | 8 ++++++++ etc/ORG-NEWS | 8 ++++++++ lisp/ob-core.el | 31 ++++++++++++++++--------------- 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index 4f877d371..194cabe99 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -18482,6 +18482,14 @@ *** Handling can still be used when referenced from another code block. Usage example: =:results none=. +- =ignore= :: + + Ignore the results completely. This option is similar to =none=, + but no processing is performed on the return value. Calling the + code block programatically (see [[*How to evaluate source code]]) or by + reference (see [[*Passing arguments]] and [[*Noweb Reference Syntax]]) will + always yield nil. + - =append= :: Append results to the Org buffer. Latest results are at the bottom. diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 1f79f8ae5..d92cb139a 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -373,6 +373,14 @@ value of ~org-babel-clojure-backend~. For example: (range 2) #+end_src +*** New =:results ignore= header argument + +Unlike =:results none=, the return value of code blocks called with +=:results ignore= header argument is always ~nil~. Org does not +attempt to analyze the results and simply returns nil. This can be +useful when the code block is used for side effects only but generates +large outputs that may be slow to analyze for Org. + ** New options *** A new option for custom setting ~org-refile-use-outline-path~ to show document title in refile targets diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 1259909a0..89d3e104c 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -425,7 +425,7 @@ (defconst org-babel-common-header-args-w-values (prologue . :any) (results . ((file list vector table scalar verbatim) (raw html latex org code pp drawer link graphics) - (replace silent none append prepend) + (replace silent none ignore append prepend) (output value))) (rownames . ((no yes))) (sep . :any) @@ -1345,7 +1345,7 @@ (defun org-babel-sha1-hash (&optional info context) (lambda (a b) (string< (car a) (car b))))) (let* ((rm (lambda (lst) (dolist (p '("replace" "silent" "none" - "append" "prepend")) + "ignore" "append" "prepend")) (setq lst (remove p lst))) lst)) (norm (lambda (arg) @@ -3282,19 +3282,20 @@ (defmacro org-babel-result-cond (result-params scalar-form &rest table-forms) (declare (indent 1) (debug t)) (org-with-gensyms (params) `(let ((,params ,result-params)) - (if (or (member "scalar" ,params) - (member "verbatim" ,params) - (member "html" ,params) - (member "code" ,params) - (member "pp" ,params) - (member "file" ,params) - (and (or (member "output" ,params) - (member "raw" ,params) - (member "org" ,params) - (member "drawer" ,params)) - (not (member "table" ,params)))) - ,scalar-form - ,@table-forms)))) + (unless (member "ignore" ,params) + (if (or (member "scalar" ,params) + (member "verbatim" ,params) + (member "html" ,params) + (member "code" ,params) + (member "pp" ,params) + (member "file" ,params) + (and (or (member "output" ,params) + (member "raw" ,params) + (member "org" ,params) + (member "drawer" ,params)) + (not (member "table" ,params)))) + ,scalar-form + ,@table-forms))))) (defmacro org-babel-temp-directory () "Return temporary directory suitable for `default-directory'." -- 2.35.1 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--