[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-gauche 40f4886 065/119: Implement eval error messag
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-gauche 40f4886 065/119: Implement eval error message |
Date: |
Sun, 1 Aug 2021 18:27:58 -0400 (EDT) |
branch: elpa/geiser-gauche
commit 40f48867998ba1c685ff585c611d9430e41c65cc
Author: András Simonyi <andras.simonyi@gmail.com>
Commit: András Simonyi <andras.simonyi@gmail.com>
Implement eval error message
---
geiser-gauche.el | 13 ++++++++++++-
geiser.scm | 28 ++++++++++++++--------------
2 files changed, 26 insertions(+), 15 deletions(-)
diff --git a/geiser-gauche.el b/geiser-gauche.el
index 04c8ca6..5782248 100644
--- a/geiser-gauche.el
+++ b/geiser-gauche.el
@@ -227,8 +227,19 @@
(compilation-setup t)
(geiser-eval--send/wait "(newline)")))
+
+;;; Error display
+
(defun geiser-gauche--display-error (module key msg)
- (and key (message msg) nil))
+ (when key
+ (insert key)
+ (save-excursion
+ (goto-char (point-min))
+ (re-search-forward "report-error err #f")
+ (kill-whole-line 2)))
+ (when msg
+ (insert msg))
+ (if (and msg (string-match "\\(.+\\)$" msg)) (match-string 1 msg) key))
;;; Manual look up
diff --git a/geiser.scm b/geiser.scm
index 63be94f..ff24735 100644
--- a/geiser.scm
+++ b/geiser.scm
@@ -59,17 +59,19 @@
(cut pprint (macroexpand form))))
(define (geiser:eval module-name form . rest)
- ;; (call-with-output-file "/tmp/gauche.log"
- ;; (^o (format o "FORM: ~s, REST: ~s" form rest)))
- (let* ((output (open-output-string))
- (module (or (and (symbol? module-name )
- (find-module module-name))
- (find-module 'user)))
- (result (with-output-to-port output
- (lambda ()
- (eval form module)))))
- (write `((result ,(write-to-string result))
- (output . ,(get-output-string output))))))
+ rest
+ (guard (err
+ (else
+ (write
+ `((error (key . ,(report-error err #f)))))))
+ (let* ((output (open-output-string))
+ (module (or (and (symbol? module-name )
+ (find-module module-name))
+ (find-module 'user)))
+ (result (with-output-to-port output
+ (^ () (eval form module)))))
+ (write `((result ,(write-to-string result))
+ (output . ,(get-output-string output)))))))
(define (geiser:load-file filename . rest)
(geiser:eval 'user `(load ,filename)))
@@ -137,7 +139,7 @@
;;;; Autodoc
-(define (geiser:autodoc symbols pref-module)
+(define (geiser:autodoc symbols pref-module . rest)
(map (cut formatted-autodoc <> pref-module)
symbols))
@@ -262,5 +264,3 @@
;;; TODO We add the load-path at the end. Is this correct?
(define-macro (geiser:add-to-load-path dir)
`(add-load-path ,dir :after))
-
-
- [nongnu] elpa/geiser-gauche 2ef21b4 044/119: Remove a TODO comment, (continued)
- [nongnu] elpa/geiser-gauche 2ef21b4 044/119: Remove a TODO comment, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 762cd22 035/119: Add guessing functions, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche fbcd9a4 050/119: Minor fix, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 2002cc0 056/119: Cleanup, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche e406a0e 051/119: Minor fixes, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 8a7dc24 064/119: Semicolon aesthetic changes, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 73346c2 066/119: Add unsupported procedures list, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 541ca86 060/119: Make eldoc work in the repl, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche f277a44 096/119: Update README.md, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 067c227 022/119: Aesthetics, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 40f4886 065/119: Implement eval error message,
Philip Kaludercic <=
- [nongnu] elpa/geiser-gauche 0d2827c 093/119: Minor aesthetic improvement, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 13e4030 015/119: Implement adding to load-path, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche d2ffff8 104/119: Update README, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 26e3c14 105/119: Change minimum required Gauche version to 9.9, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 8908ad8 108/119: Lower require minimal version to 0.9.6, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche b10594b 042/119: Fixes and logging, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 30f4558 052/119: Fix no-values, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 429ad45 055/119: Add special handling for compile-file in the elisp eval proc, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 72f5107 054/119: Minor fixes, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche b702719 057/119: Simplify elisp-side eval, Philip Kaludercic, 2021/08/01