From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0B4EF8hYG2EoPwEAgWs5BA (envelope-from ) for ; Tue, 17 Aug 2021 08:35:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id uJSMEshYG2GrCAAAbx9fmQ (envelope-from ) for ; Tue, 17 Aug 2021 06:35:52 +0000 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 9F1941947B for ; Tue, 17 Aug 2021 08:35:51 +0200 (CEST) Received: from localhost ([::1]:33360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mFshR-0004Sl-VB for larch@yhetil.org; Tue, 17 Aug 2021 02:35:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mFsh1-0004Rn-OV for emacs-orgmode@gnu.org; Tue, 17 Aug 2021 02:35:24 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:36478) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mFsgx-0007gl-CK for emacs-orgmode@gnu.org; Tue, 17 Aug 2021 02:35:22 -0400 Received: by mail-pj1-x1032.google.com with SMTP id u13-20020a17090abb0db0290177e1d9b3f7so3467028pjr.1 for ; Mon, 16 Aug 2021 23:35:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=yImLwdLuUYm9k/FKrLTbcWhWtDe/6Q/WQPgBnjXcKdc=; b=lki43zC8aP+m7llpix0sc91zKOA2ZajQuhnxQSmwII9uW2ftpotgl6O5RHgFdgIpi/ HnEpZzJAEwd1PVFLtof0f21BkX/rUCAVxlCde19gjGByQWwSmlg6JDfekcRNdwgGIur1 U83tXEnKs9lVGuI3dVdkgj0uIIf+ap4sqtTREmjUyoXDmydidMfpMXY2p8Ja5lcl/cHC Ubda/qWJWyBMWREM1chWvgXphQZmBjVXxlUOgIN7x4zS9rw5Z2RiPOhJURsuHNyl0n12 4G5JKflaQJitStk6hRuW9As7c0YrEwInLe0eWxlPvwDdMBJfc8TRqJ012Pr1H/saG+pj 1Pjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=yImLwdLuUYm9k/FKrLTbcWhWtDe/6Q/WQPgBnjXcKdc=; b=TObBYSKQVyhTV+17W3f1ICOavCBh8e2MW5fH0NHe97wp5xbdcq9fWnFjEL/ya0mK66 ZbxnXqGP06B5UIqkmk1wmA4YgBEShqMzJtu43VdxJAV2N9I6bYvhl/BLW4ZrOCBHTB/o 4SXClkIg1t8ob689fV89dtF8PmtK7ptpB+d8UcKTiGPMBB4ytcNmEgMVPY2ddREDL/Em p76csxL130i+9QU1MS7mzINceDwNKBeBK4TUIOxeirCk/kyoZVRYSvuM+9qBuM7hwzpY Z/+rhoPjYDh1MbqOMbSRX4bYt2yw+PbGs6SYD1Bac0+rqxXaIPnLZSOi0bbroDomzwhp qacg== X-Gm-Message-State: AOAM533odGQvZQ3Q/oNuFhGg49t93R9eVzercHNVpe5m180BLqCpjv2a DKfFmRfLUcpCkCK89neeXa087sVSjLg= X-Google-Smtp-Source: ABdhPJyPpPvylJLBdgrL98pzUNNEO1TN03RaAPzLPaszx6GMhHRlr155Tht9F3YV5sE7I5goG1CZSQ== X-Received: by 2002:a05:6a00:26ca:b0:3e1:acd9:bb96 with SMTP id p10-20020a056a0026ca00b003e1acd9bb96mr2067347pfw.35.1629182117011; Mon, 16 Aug 2021 23:35:17 -0700 (PDT) Received: from tim-desktop (106-69-131-50.dyn.iinet.net.au. [106.69.131.50]) by smtp.gmail.com with ESMTPSA id c24sm1548457pgj.11.2021.08.16.23.35.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Aug 2021 23:35:16 -0700 (PDT) References: <1755618.1629176532@apollo2.minshall.org> User-agent: mu4e 1.6.3; emacs 28.0.50 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: Bug: :session results in unfriendly error reporting Date: Tue, 17 Aug 2021 16:23:48 +1000 In-reply-to: <1755618.1629176532@apollo2.minshall.org> Message-ID: <871r6swpcu.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=theophilusx@gmail.com; helo=mail-pj1-x1032.google.com 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, 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.23 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1629182151; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=yImLwdLuUYm9k/FKrLTbcWhWtDe/6Q/WQPgBnjXcKdc=; b=YkmepyuirPoJivtbYsvOFfgbp6vZG+EpOEopTaSzqyox4JsvSHi0RphYrw+Ns0h8OMGiWZ MuqOHDE3O3Opg1ilgUVZXNCQMt6dSrcfx4+ebiuXznuytDKfDAZirIx9soXMIRBR9fsP+x TBhGYJVPyqsSufc6u7Gi2KRJERFGzfBIBhnkoqZZG1Dn9NCXZ+X3Qv321yIPQzFqszMSaH ER0QEt4WRX31FbJ+nAKkioaeML95kM5EmkdIRU/KVrfWLl7iCnDP54jCXGrAnr3h6zmk9J /kfN7+m3o+pG/WIXUnFCjWVoeeOSEkMNIBRYW3DEzbz5Asy3uWScdOVakuY5Vw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1629182151; a=rsa-sha256; cv=none; b=UPQsI8SlB/ur4fHfwv73OlvkGuX6t5ZQ2cqW/beElGhqZ2DSXAP9ToSDcXt/zA11d6NH/E +UtbqeWFeUo9yZiWGUjQP/PEYeoC4qXbCktkFgfN7iblqnuYIK/NCAM5yP7dxz5S+ICKL9 L8Ae6jgvk0n7zPEq7ZbpIQo1FTxJ7a6DT9pdLiY4qc8q1DbV3rOVFoBM3wT37FX7uwkfxK xQzUi4noyg6h17HG46WSBxTID+oEEdsWHX0vD+oM+JivW9JLKZvTm2EyJPx/zNcwCCK5an K+M2gChvRrO867TzIPxTm01pToN/7WoCvsKCw7e4cbGWJdEwWybG8T2YUFsPNg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=lki43zC8; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=lki43zC8; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 9F1941947B X-Spam-Score: -3.12 X-Migadu-Scanner: scn1.migadu.com X-TUID: d5fh0BOr5sFu Greg Minshall writes: > Charles, > > being sympathetic with the idea of better error reporting, i'm curious > about the following. > >> Right. But there is no error as far as babel is concerned. R has >> handled the condition. So there is nothing for babel to see/do. > ... >> Running R in this fashion starts a fresh process which signals an >> error that babel can handle. I see no easy way to get sessions to >> sends signals that babel can process. > > what is going on here? is the issue that in the no-session case, the R > process exits with a non-zero exit code, and that is how "babel" picks > up on it? > > i put "babel" in quotes ("\"babel\"" :) above, because, in my simple > mind, babel isn't just the main bit that runs inside org/emacs, but also > some glue bits that run in the various languages' environments. things > like initializing variables, and harvesting results. so, might one not > argue that checking execution status, in a session environment, could > also be part of babel? > I think what Charles is talking about is that with a session, the state of the session and what it returns is not necessarily anything to do with what has occured in the code which was executed in the session. Think of the session as a basic REPL. It reads and expression, tries to parse and evaluate it, 'prints' out the result and then waits for the next expression. Whenn you don't have a session, you just have a basic interpreter. It reads the input, parses and tries to execute it and either returns what the successful execution returns or returns some form of error when something goes wrong. It exits while the session doesn't (yet). Dealing with errors in the interpreter case is much easier. Dealing with them in a session is not because the session has not ended and the whole idea of the session is to manage such things and get ready for the next thing. The session only ends once all blocks have been processed. What happens when you add another block at the end of the org file which is to use the same session - it has to still be running or you have to evaluate all the blocks again. Yes, you could add session variables and use them to track error states etc. But that would be something each separate language would have to do and the ability to capture that information for different languages probably varies. It isn't so much that nothing is possible but rather nobody has implemented a consistent model which can be adopted and has been implemented by all backends. This is why I consider this to be a feature request and not a bug report. This is not expected/defined behaviour which is not behaving according to spec - this is new unimplemented behaviour, a new feature which needs to be designed and implemented across all backends. This would be a good feature to have. The work is non-trivial and would take significant time to implement.