From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 mE17JtfLXGMXOwAAbAwnHQ (envelope-from ) for ; Sat, 29 Oct 2022 08:44:39 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id kB91JtfLXGNgjAAA9RJhRA (envelope-from ) for ; Sat, 29 Oct 2022 08:44:39 +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 6E454ABD0 for ; Sat, 29 Oct 2022 08:44:39 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oofZa-0008HG-0M; Sat, 29 Oct 2022 02:44:02 -0400 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 1oofZK-00089b-70 for emacs-orgmode@gnu.org; Sat, 29 Oct 2022 02:43:48 -0400 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oofZG-0003Kr-Hf for emacs-orgmode@gnu.org; Sat, 29 Oct 2022 02:43:44 -0400 Received: by mail-lf1-x134.google.com with SMTP id f37so11556270lfv.8 for ; Fri, 28 Oct 2022 23:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=vVy5emupKSPdeytVzCtIfOyYENknKKtoySZY971GrEQ=; b=eiqo3MAg56RLUPNhlLQxeYF3pBoA7vBe9Xrq4D0fVmGYvLis7+xtT+aSqMqC9ADarD rT2GG0gpSPZpEgm0QUb5tYsMXrhSajqaQE0S3MOYBIECH8K2pZ0W6QSKqrwZZS8w+ZYh G3TJ6kLuBBMbUdw/EHibQFyfrPg7eF3W/+Xifj2cU16lgfeBWmsLpeHh+qrdctMHfRqj J5/78cBpNQbyCesOewUqkgGyeIloOo2dacM17gHZwcWm2F24Hof2qsMIAG56XIBEu2qx se52S+0fphVPNtfrwNcHBucYY7SfHUAL+RdNRCVL1ZA61IjuLeE+16YKH8M4uc+u20Y8 SIyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vVy5emupKSPdeytVzCtIfOyYENknKKtoySZY971GrEQ=; b=hw4sN55Hr5FU3YgVUyi3h6tOqnBQxJSFv0KTRlH6RGaPWiDY0ZQ+J1QVfU9CCdIycL BdVHMzbYSCa7wO7zF0Jdq4bOtkGsxvAR+cbdFhd4hGN2j6rJilZCRbIv9Bhn6KspRAm6 hmAlp5coFZeMEmka439xDAgcgeuxYzuUeloAnK8LMZ+SnLlg2+f0hogA0va9CC+uisqz ybanIPQ2oDeunnul0ELCsLAC+AEJLXAaZk/frwvotB3wc2ooZIvM00uyNByP0zwlMSpF m4cjifOLmSSSIsnvJX72WTLNxLmIx+9cSnr0ecu2/JBpVI6WtFB6QIjEzWz4vTrJo/Q/ 6ReA== X-Gm-Message-State: ACrzQf3SngDlpgvTGtHPsGMvYmcJtCsUnB3WT92eSdazLlA27N57UzB4 PcZJZWfRiCbpQVq0OFKLmOG5s6jzbCygXQRZMWg= X-Google-Smtp-Source: AMsMyM7rwSafDRGAoIUM2AVVe0XFePBZ3mWtG8dyaPy4I7R6oYq2EUq4UQ3b+y/afces2cxZMYdOOJKsLO2eCsbWPAU= X-Received: by 2002:a05:6512:3b99:b0:4a2:6151:84fb with SMTP id g25-20020a0565123b9900b004a2615184fbmr1270020lfv.613.1667025820738; Fri, 28 Oct 2022 23:43:40 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6520:4af1:b0:22a:e96a:7f9b with HTTP; Fri, 28 Oct 2022 23:43:39 -0700 (PDT) In-Reply-To: References: <87o7u432tl.fsf@localhost> <87a65o15ut.fsf@localhost> <87fsffqi49.fsf@localhost> <87wn8lorc1.fsf@localhost> <87v8o4krel.fsf@localhost> <87tu3njmv4.fsf@localhost> From: Samuel Wales Date: Fri, 28 Oct 2022 23:43:39 -0700 Message-ID: Subject: Re: [FR] Display stderr contents after executing shell blocks (even when stdout :results output is requested) (was: Org 9.6-pre and Bash sessions) To: tomas@tuxteam.de Cc: emacs-orgmode@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=samologist@gmail.com; helo=mail-lf1-x134.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.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Emacs-orgmode" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-TUID: cSdOx0bIMakK long ago i made the contents of my shell blocks look like this: { code } 2>&1 : On 10/28/22, tomas@tuxteam.de wrote: > On Sat, Oct 29, 2022 at 04:05:19AM +0000, Ihor Radchenko wrote: >> Rudolf Adamkovi=C4=8D writes: >> >> > Ihor Radchenko writes: >> > >> >> I do not think that it make sense to display that buffer when the cod= e >> >> finishes successfully. I can see this kind of behaviour >> >> breaking/spamming automated scripts or export---code working in the >> >> past may throw error output into unsuspecting users. >> > >> > But the exit code has nothing to do with the standard error. > > [...] > >> > For example, I use a program for work that uploads data to a certain >> > 3rd-party server. It exits with a zero code but also shows extremely >> > important notices on error output. As an "unsuspecting user", if I >> > used >> > Babel to run the program, I would end up in a trouble. > > [...] > >> Dear All, >> >> As explained in the above quote, it may be reasonable to display stderr >> in the shell (and possibly other) src blocks upon execution. >> >> + Stderr may contain important information even if the code block >> succeeds >> - Displaying stderr will raise *Error* buffer, which may or may not be >> expected or desired. >> >> What do you think? > > My take as an Org user is that this makes a lot of sense. I don't know > whether there is an elegant way to accomodate all the use cases in > an elegant way, but to provide a concrete example where I'd have found > it handy... > > While preparing a handout for an introduction to shell programming > (at a very basic level), I wanted to embed little examples with > their results. Org rocks at this kind of task. > > But in this case it's important to show everything the students are > going to see. One could argue that the error part is even the most > important. > > So what I needed was not only the stderr (optionally somehow separated > from stdout -- optionally as someone would see it in some terminal > session), but also all the above even when the exit code was nonzero. > > Ideally, a display of that exit code, too. > > I ended up massaging prologue and epilogue, which worked nicely, > but sadly is language dependent for a set of concepts which are, > one could argue, independent of the language [1]. > > So yes, I would be thrilled by such a possibility. > > Cheers > > [1] These are OS conventions. So also a language of sorts, but at > another level. > > -- > tom=C3=A1s > --=20 The Kafka Pandemic A blog about science, health, human rights, and misopathy: https://thekafkapandemic.blogspot.com