From 086dbba895bdc40347de1b0bff8f77d8f10192d6 Mon Sep 17 00:00:00 2001 From: Jay Xu Date: Sat, 11 Jul 2020 20:58:52 +0800 Subject: make chez display output and error messages. --- elisp/geiser-chez.el | 8 +++++++- scheme/chez/geiser/geiser.ss | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/elisp/geiser-chez.el b/elisp/geiser-chez.el index 9a24a72..3d4b495 100644 --- a/elisp/geiser-chez.el +++ b/elisp/geiser-chez.el @@ -120,7 +120,13 @@ This function uses `geiser-chez-init-file' if it exists." (geiser-eval--send/wait "(begin (import (geiser)) (write `((result ) (output . \"\"))) (newline))"))) (defun geiser-chez--display-error (module key msg) - (and key (message msg) nil)) + (when (stringp msg) + (save-excursion (insert msg)) + (geiser-edit--buttonize-files)) + (and (or (eq key 'chez-error-message) + (not key)) + (not (zerop (length msg))) + msg)) ;;; Implementation definition: diff --git a/scheme/chez/geiser/geiser.ss b/scheme/chez/geiser/geiser.ss index 70313ab..2d13952 100644 --- a/scheme/chez/geiser/geiser.ss +++ b/scheme/chez/geiser/geiser.ss @@ -55,10 +55,10 @@ (with-exception-handler (lambda (e) (k `((result "") - (output . ,(get-output-string output-string)) - (error (key . ,(with-output-to-string - (lambda () - (display-condition e)))))))) + (output . ,(with-output-to-string + (lambda () + (display-condition e)))) + (error (key . chez-error-message))))) (lambda () (call-with-values ;; evaluate form, allow for multiple return values, -- cgit v1.2.3