From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +B/UGMjmuWNfGgAAbAwnHQ (envelope-from ) for ; Sat, 07 Jan 2023 22:40:24 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id OO8QGMjmuWPY7wAAG6o9tA (envelope-from ) for ; Sat, 07 Jan 2023 22:40:24 +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 EB73C78AC for ; Sat, 7 Jan 2023 22:40:23 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEGuQ-0003X6-OP; Sat, 07 Jan 2023 16:39:22 -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 1pEGuO-0003Wp-EP for emacs-orgmode@gnu.org; Sat, 07 Jan 2023 16:39:20 -0500 Received: from netyu.xyz ([152.44.41.246] helo=mail.netyu.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEGuM-00028y-JE for emacs-orgmode@gnu.org; Sat, 07 Jan 2023 16:39:20 -0500 Received: from fw.net.yu.netyu.xyz (99-87-204-218.lightspeed.irvnca.sbcglobal.net [99.87.204.218]) by netyu.xyz (OpenSMTPD) with ESMTPSA id bd982e30 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 7 Jan 2023 21:39:11 +0000 (UTC) References: User-agent: mu4e 1.8.13; emacs 29.0.60 To: Andreas Gerler Cc: emacs-orgmode@gnu.org Subject: Re: [O] [PATCH] ob-eval: display error fix Date: Sat, 07 Jan 2023 15:33:25 -0600 In-reply-to: Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=152.44.41.246; envelope-from=ruijie@netyu.xyz; helo=mail.netyu.xyz X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FROM_SUSPICIOUS_NTLD=0.499, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Reply-to: Ruijie Yu From: Ruijie Yu via "General discussions about Org-mode." Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1673127624; a=rsa-sha256; cv=none; b=sXTB8u3QNAZI9U/2AppaBE26T834G8zF3VhhIUGSw/srgMgZwcngoKLAr/HlxbxGuzmqA5 AEElSuBwlk9M4u6JbtsqmhKnOYz8fvLdIrebqlud2LO6cPDDXXWulkmd9wqgk78QSOnODg Qe7oTUzky43cWbSC7QYDcaZjICP+ykyZz1KZVTsTRPbF43TqP2MYsm/DQ7vhrelsCtzkwM IN9TQhl0lT/9seEmuXF/1OELULnAQ7srKKCJ9aH4N/isvn6RINA/+7AhwB0E1Fi7W0e5KZ KoPPOT9MfIF+P4KLAad7oYWVro32RFb5vjZrC02vfm1/TubH491fB1/26JAM1w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673127624; h=from:from:sender:sender:reply-to: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; bh=76bg6veAX0/5A/LPygb1CMtvk5dc5hFD9oC9BPPCPII=; b=Hc72c99nZnjFrO6kr+WzyHfMdptZRX++gf8XGgP2fzO68nZfZgUegZQ6eiyN/AtzIbG5QV v6Kjdb6RrW5HC/8HgziA8YjfuXFPxu/1GRdJnEyMP1cTXNzQm1SxtAdKR+zEXBoyo/5aMb xlY5fVGmIdU1l2ntCVnVETerldmqJVqOy8onTTog9SucuozYHRBBt3GJtvRXANWzVNLLJh rutk/C5ezS1MtkyFFPv2u+s/sl1WWCuFM95M7IlEvq9lOs98UKGH9JsoVpqo2iHJwf6oY2 2Ub/Q8drNAEBy98R4qr7Z/cKZK+QNFF8Yve/MGq7XqLMMqY/XrLrZL4LtWXpug== X-Spam-Score: -3.37 X-Migadu-Queue-Id: EB73C78AC Authentication-Results: aspmx1.migadu.com; dkim=none; 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"; dmarc=pass (policy=none) header.from=gnu.org X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -3.37 X-TUID: OatadCTvOI8/ Hi Andreas, - (display-buffer buf)) + (if org-babel-eval-error-display-notify + (display-buffer buf) + (if (or (not (numberp exit-code)) + (> exit-code 0)) + (display-buffer buf)))) Quick question, does it help or hurt readability if we change this nested `if' into a `cond' expression? Or, alternatively, since both the outer then branch and the inner then branch are the same expression, maybe we can just combine all three conditions into a single `or' call? Something like (when (or org-babel-eval-error-display-notify (not (numberp exit-code)) (> exit-code 0)) (display-buffer buf)) Best, RY