From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 0NxaNOWx7GIutAAAbAwnHQ (envelope-from ) for ; Fri, 05 Aug 2022 08:00:05 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id CDRENOWx7GLi3AAA9RJhRA (envelope-from ) for ; Fri, 05 Aug 2022 08:00:05 +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 7FDBB28D76 for ; Fri, 5 Aug 2022 08:00:05 +0200 (CEST) Received: from localhost ([::1]:45542 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJqNP-0007Hi-Jy for larch@yhetil.org; Fri, 05 Aug 2022 02:00:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJqMP-0007Fr-6r for emacs-orgmode@gnu.org; Fri, 05 Aug 2022 01:59:01 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:42767) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJqME-0007nY-RC for emacs-orgmode@gnu.org; Fri, 05 Aug 2022 01:59:00 -0400 Received: by mail-pg1-x52c.google.com with SMTP id 73so1821867pgb.9 for ; Thu, 04 Aug 2022 22:58:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=DwCmBao+5ZC64fj7GEmYmUFFYRkZqoMixdNlxtTlM/E=; b=iPOqHcYSeuqiRDG7e2BXBhqHNVfVXNyQbi1UF4yEaCLwbh75qKcR2XCTzEXW5pV7h7 LbK/de314zjnne4Qnpgcoh54V0Yq0CWjCsNa0u4YLjguM5dvrHpdYY+BLshegwXuCGTe 88MJgP0v3Rq6nxao+bro3CTqt37zhnRlLkTV6o0/+C42HD8D6uajQbJfhkbXuCCL1D9D 5b42XlUZUIGF57M7LG/dJT+EXhJDxOIXoFKmWTLqiQLPGZiNVCidnf9ESsYX5J9abyYR PVqwFaTJ5Sq2ujkt8AQ4f/kihVeSxzSUHuob6rD5STYEaBfsdKPOj6xVlBUpLDewA14h yBzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=DwCmBao+5ZC64fj7GEmYmUFFYRkZqoMixdNlxtTlM/E=; b=sF+aO4IStqNJmJuWjWutnTVgUgt2/btPjM+xhJLIqDbKgl1uwN2lGJRUTPGY2GuEwT v0Ms5ueKLXytFaQ8Ne0xaalWPR2LLz504lRZNvMFJQ1RYN9j3u5/1HYzgB3wsqbI62k3 ruNeS7J2jqG+QvvMjOn4utrQUsge8Ws6QKAxvKU3uDnwxZK9L8VbZF2m6U80K2h39gc7 p8um/QjgLqkqTcxa303kD4pjJY5ZVQH8bF6Nv3WD/v7BiqkxYxclNcNCDN/aRu4Mx9Fl CwqWcfmcU527d9lj4KB4xYifgd4FkP7QwRVJo3U52zVrH98V8SFSMxmkc6U80AF4NmrR nu3g== X-Gm-Message-State: ACgBeo2PQIzRTiGAj3krts1QLBDp1wMIwsske6tnWzqEH9jm4Ir8pRUZ +lxWGnXk35DTwRLcWDrbv18= X-Google-Smtp-Source: AA6agR7AGj/BB+edFcJ0JmnMj34IjL4xTxl0WpKNALdHzSAEtkGrcMW91uU5R2LVh22kE6HbvzAISQ== X-Received: by 2002:a63:5403:0:b0:41d:5cf:1f1 with SMTP id i3-20020a635403000000b0041d05cf01f1mr1301628pgb.622.1659679129445; Thu, 04 Aug 2022 22:58:49 -0700 (PDT) Received: from localhost ([115.154.175.57]) by smtp.gmail.com with ESMTPSA id q6-20020a635046000000b0041c66a66d41sm790680pgl.45.2022.08.04.22.58.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 22:58:48 -0700 (PDT) From: Ihor Radchenko To: Greg Minshall Cc: emacs-orgmode@gnu.org Subject: [FR, DISCUSSION] Re: [:results append] and [:wrap ...] don't play well together In-Reply-To: <327595.1617159365@apollo2.minshall.org> References: <327595.1617159365@apollo2.minshall.org> Date: Fri, 05 Aug 2022 13:59:56 +0800 Message-ID: <87tu6rnsbn.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=yantar92@gmail.com; helo=mail-pg1-x52c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, 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" 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=1659679205; 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=DwCmBao+5ZC64fj7GEmYmUFFYRkZqoMixdNlxtTlM/E=; b=blSMl9dYxwLKc/2IPEaE0dixx175Kt8VgYrlHbY8/eb6+BWmx+gSQ4E8r57BrqU80FHFYV 3/xVbK7V8pRZck6gENxPN9KsPDVv9eAWm/2S13XLW31JY2Qn2v6BIQFwnmYEQojtuH/kiy XhEK72apBa6lL0E9+Ntj2p87jJQH32XY72ywq/P+cGBqwo4zUIU2dldauK/wiLV5EBmMBx EgnUlozQL+t7H+G6nmjh4ehqOFzdkvUnsm+qWDT6Dd7WiKZMwbkNhIKFsV6VSrTnxXd+/S iGqcu9jduHZvLHt8I6aElB0m2Yc8GavGBaS6zNWSQV4dujg2YNOQiUTSBGfOMA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659679205; a=rsa-sha256; cv=none; b=Jg9lr36H5CwGbw81EmglCsLmOEzZrw9Iw2HDG8/WMN9G0zel8DdQ+GKHGRKTehDRObQ51P SyR3IwlDYoliLQCi9nD4N7SfVgxZ4sCmyWoO3CRtJuAZMJZsZMUsgjeYUsyLYauMyM6NXG vchHO6EPjxDfa95XPBnvMy4/qrorlmMJ4DckXU8Lp/EtlRtL5Z5KA/z0pi68Qw6r9o0r5v 0itK7Z5dDIvVJjiHd+HdlaVSKFM0eavAwZOn1tCoax4CAZ/eWWVbJJI9eXRqSqtPwydhXX obWENVrwHU4U4FjSA/6ih7B++fKLP1ebF3v/UwzLOII87w1yYOUD9g8j05V2DA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=iPOqHcYS; 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: -5.41 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=iPOqHcYS; 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: 7FDBB28D76 X-Spam-Score: -5.41 X-Migadu-Scanner: scn0.migadu.com X-TUID: zXa1IxMxEtY1 Greg Minshall writes: > hi. this fails with [emacs -Q], which in my case > : Org mode version 9.4.4 (release_9.4.4 @ /usr/share/emacs/27.2/lisp/org/) > > and, also in whatever elpa'ish version i'm running > : Org mode version 9.4.4 (release_9.4.4-277-g2e1c98 @ /home/minshall/.emacs.d/straight/build/org/) > > when i specify [:results append] and also [:wrap foo], the results are > not obviously appended. below it seems as if the second evaluation is > appended, then the following are prepended after the first one? I am replying late, but let's have an explanation for this issue as a record at least. The observed issue is not a bug, but rather a non-intuitive behaviour. Let me explain how Org treats the described sequence of block executions: #+begin_src R :results append :wrap foo Sys.time() #+end_src #1: #+RESULTS: #+begin_foo 2021-03-31 05:51:08 #+end_foo #2: #+RESULTS: #+begin_foo 2021-03-31 05:51:08 #+end_foo #+begin_foo 2021-03-31 05:51:10 #+end_foo #3: #+RESULTS: #+begin_foo 2021-03-31 05:51:08 #+end_foo #+begin_foo 2021-03-31 05:51:12 #+end_foo #+begin_foo 2021-03-31 05:51:10 #+end_foo And so on. It is generally impossible to distinguish between a result consisting of multiple paragraphs/drawers/other Org elements and the consequent ordinary Org text. Consider: #+begin_src elisp :results raw value "paragraph 1 paragraph 2" #+end_src paragraph 3 Executing the above yields #+begin_src elisp :results raw value "paragraph 1 paragraph 2" #+end_src #+RESULTS: paragraph 1 paragraph 2 paragraph 3 By looking at the #+RESULTS:, Org cannot possibly know if paragraph 2 belongs to the results or paragraph 3, or maybe just paragraph 1. We may clarify this in the manual. Another alternative could be treating :results append drawer/code/pp/org/latex/html differently and putting everything into a single drawer/src/export environment like: #+begin_src R :results append :wrap foo Sys.time() #+end_src #3: #+RESULTS: #+begin_foo 2021-03-31 05:51:08 2021-03-31 05:51:10 2021-03-31 05:51:12 #+end_foo However, changing the behaviour will be a breaking change, which we do not want for the sake of back-compatibility. Instead, we may introduce something like :results append-contents drawer that will behave like the above. Is there a demand to have such a feature? Best, Ihor