From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4ea1::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0G0dIpJiymHnrgAAgWs5BA (envelope-from ) for ; Tue, 28 Dec 2021 02:04:18 +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 8P4hHJJiymFPgAEAG6o9tA (envelope-from ) for ; Tue, 28 Dec 2021 02:04:18 +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 2137C6382 for ; Tue, 28 Dec 2021 02:04:18 +0100 (CET) Received: from localhost ([::1]:33590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n20uX-0005dV-0N for larch@yhetil.org; Mon, 27 Dec 2021 20:04:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48756) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n20tn-0005dN-94 for emacs-orgmode@gnu.org; Mon, 27 Dec 2021 20:03:31 -0500 Received: from confino.investici.org ([212.103.72.250]:41725) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n20tk-0003t8-Qm for emacs-orgmode@gnu.org; Mon, 27 Dec 2021 20:03:31 -0500 Received: from mx1.investici.org (unknown [127.0.0.1]) by confino.investici.org (Postfix) with ESMTP id 4JNGVq0773z10vn; Tue, 28 Dec 2021 01:03:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mortemale.org; s=stigmate; t=1640653395; bh=hWMIZjeCA5lSwe1LoLDgPtlCHLKoqG4VFWWIN/oNm4g=; h=From:To:Subject:Date:From; b=KS/oy9qvMw44E8p8MmKIIyiyc2X3Zf1JkKP0ARUSPdX9op1/1vdy7aqQTMAXT2F4w JsB3MHh7WvJXVF64Ud//4qICslZjnT0NuVDzW37PteAtnPnGh2QZ4qe/Iupf4DHOz2 8jkHICdH8l86DMO42KSIfUXPFxePGLIpvGwZ+EXI= Received: from [212.103.72.250] (mx1.investici.org [212.103.72.250]) (Authenticated sender: felipelema@mortemale.org) by localhost (Postfix) with ESMTPSA id 4JNGVp2TPXz10w4; Tue, 28 Dec 2021 01:03:14 +0000 (UTC) From: Felipe Lema To: yantar92@gmail.com, emacs-orgmode@gnu.org Subject: Re: Report error in scheme evaluation Date: Mon, 27 Dec 2021 22:03:09 -0300 Message-ID: <19770238.jTK1MqpFJm@felipe-thinkpad-x200> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart5130371.BxtO4UUgSn" Content-Transfer-Encoding: 7Bit Received-SPF: pass client-ip=212.103.72.250; envelope-from=felipelema@mortemale.org; helo=confino.investici.org 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_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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" 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=1640653458; 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: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=hWMIZjeCA5lSwe1LoLDgPtlCHLKoqG4VFWWIN/oNm4g=; b=iV3IB/zalI/nkZ9SjhpMhySNZbD9mPtWTgsb/bMUFTAMvB0t7hzQ1oGma1e3M2yYF7Z2dV dUgfjtOGUw/146p7A4u5rr0wgrprV5lyNWBD0KaDD7BN/TPe9/y3B95NBEeYRpSh+jsn3A J+iuwMlnN/+QRGRgFxAx7xTy6umic9rBFpWcGzWEGfJxt0G6+j8UVrQfJhfUH0TxTEUX6Z grzYlKEDyJdmrZAAN/h4HTZ/Q3UXO6CO+9KBMpiI+g9vQiN3b/A0gNPgh4FqYEEiUqndcs EEgMcZV2vv8LCx/UgyaaNd6IhDg698qUU3unT+0bZ/3+FPkv9Y1lnG5TnsxWwA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640653458; a=rsa-sha256; cv=none; b=UJm2MtSZqibGzwRt0n1TIDlzewgXGRFu+JDEn8lMyge8H6zn2A1/c1BwHEtRjCKWA0rEsp W/c5Ce+3vSJLWAxKTu29ppHiO19X+eeiU52S8c46vszID1WVJJFYd+U8zDZtyfeUa+srHF LxBVOMqdUlnceNuwFePsGmQssRUUraYg49B2lAF0QWWWPELdXeRmEcJ6YB63TiIcitJEr1 SyhkbXi5G6wg0v7Nuv+fg836EPg3+Hw0FViL3z2R5BqdDX8pJtA4uW5HzzBjVrcpuptngS 2p7DzQQ4YgO20Qcvd3QezXypIWZWSYCePyS2K/jXN+H8LLDAQRyPZiyDjp+Edg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=mortemale.org header.s=stigmate header.b="KS/oy9qv"; dmarc=pass (policy=reject) header.from=mortemale.org; 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: -2.27 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=mortemale.org header.s=stigmate header.b="KS/oy9qv"; dmarc=pass (policy=reject) header.from=mortemale.org; 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: 2137C6382 X-Spam-Score: -2.27 X-Migadu-Scanner: scn1.migadu.com X-TUID: x4zJTT9wl7T7 This is a multi-part message in MIME format. --nextPart5130371.BxtO4UUgSn Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" I just realized I was un-CCed out of the thread Here's the updated patch with the requested changes (actually single one) Lemme know if I'm missing anything else. Felipe --nextPart5130371.BxtO4UUgSn Content-Disposition: attachment; filename="org-babel-scheme-show-error-in-buffer_updated_req.diff" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="utf-8"; name="org-babel-scheme-show-error-in-buffer_updated_req.diff" diff --git a/lisp/org/ob-scheme.el b/lisp/org/ob-scheme.el index f4836b23fe..8720bd099e 100644 --- a/lisp/org/ob-scheme.el +++ b/lisp/org/ob-scheme.el @@ -39,6 +39,7 @@ ;;; Code: (require 'ob) +(require 'subr-x) (require 'geiser nil t) (require 'geiser-impl nil t) (defvar geiser-repl--repl) ; Defined in geiser-repl.el @@ -58,6 +59,7 @@ geiser-repl-window-allow-split (declare-function geiser-repl-exit "ext:geiser-repl" (&optional arg)) (declare-function geiser-eval--retort-output "ext:geiser-eval" (ret)) (declare-function geiser-eval--retort-result-str "ext:geiser-eval" (ret prefix)) +(declare-function geiser-eval--retort-error "ext:geiser-eval" (ret)) (defcustom org-babel-scheme-null-to 'hline "Replace `null' and empty lists in scheme tables with this before returning." @@ -180,8 +182,20 @@ org-babel-scheme-execute-with-geiser (setq result (if output (or (geiser-eval--retort-output ret) "Geiser Interpreter produced no output") - (geiser-eval--retort-result-str ret ""))))) - (when (not repl) + (geiser-eval--retort-result-str ret ""))) + (when-let* ((err (geiser-eval--retort-error ret))) + ;; there was an error, report it! + (org-babel-eval-error-notify + -1 ;; filler value, anything non-zero should do + (geiser-eval--retort-output ret)) + (save-excursion + (when (get-buffer org-babel-error-buffer-name) + (with-current-buffer org-babel-error-buffer-name + (unless (derived-mode-p 'compilation-mode) + (compilation-mode)) + ;; Compilation-mode enforces read-only, but Babel expects the buffer modifiable. + (setq buffer-read-only nil))))))) + (when (not repl) (save-current-buffer (set-buffer repl-buffer) (geiser-repl-exit)) (set-process-query-on-exit-flag (get-buffer-process repl-buffer) nil) --nextPart5130371.BxtO4UUgSn--