Comments (14)
I'd like to "vote up" this feature request. I believe the issue is even worse than the original bug report. Not only isn't the error a presentation, the error report is not present in the SLIME REPL buffer, either. That means that when you quit the debugger, you have even lost the error message.
from slime.
@rpgoldman, @attila-lendvai: got any implementation suggestions?
from slime.
I'm afraid I'm not an expert on SLIME internals. But if someone would point me at where SLIME would encounter an error, I'd be willing to try to submit a patch. I see SLIME-DISPATCH-EVENT, which seems to be what triggers SLDB, but I'm not sure how that gets invoked, and how the code in slime.el and contrib/slime-repl.el interact.
from slime.
@rpgoldman I'm not an expert either. The juicy bits on the CL side are in SLDB-LOOP. I suppose the first challenge is to detect, in that context, that the restart set up by WITH-TOP-LEVEL-RESTART was invoked.
from slime.
I think we have to get this BEFORE we get into SLDB. We should be presenting the CONDITION
object into the REPL buffer before we trigger SLDB, IIUC.
from slime.
Ah, I was assuming we would only show the condition when the evaluation is aborted. Currently, the textual description of the condition is only printed to the REPL in that scenario. I interpreted this feature request as "simply" changing that textual description into a presentation.
from slime.
The textual description is printed, but we don't print the error message (the result of invoking the REPORT-FUNCTION
). But if I can find the place where the error is printed, I should be able to supply a patch pretty quickly.
from slime.
Printing the error message is not quite the same as outputting a presentation. It's probably useful regardless. :)
from slime.
i think the main issue here is that the presentation infrastructure was pushed out into a contrib, and as such sldb cannot depend on that in the current status quo (unless we make sldb also a contrib (yes, that's a joke)).
from slime.
With respect to luismbo's comment, I think we want both: (1) we want to output the condition object as a presentation that we can inspect, etc. (2) we should output the error message into the slime repl buffer before we pop up SLDB (in particular so that we can still see the error message after the SLDB buffer has gone away).
Actually, AFAICT outputting the presentation object into the buffer should also be done before popping up the SLDB buffer.
from slime.
attila-lendvai -- is there a way to check whether the presentation infrastructure is available, and based on that either write the condition as a presentation or simply as a string?
from slime.
@attila-lendvai I don't think that's a major barrier. We can always add a hook that the presentations contrib can take advantage of.
@rpgoldman I don't think (2) implies printing before SLDB pops up. The current message ; Evaluation aborted on #<SIMPLE-ERROR "foo" {10052C2553}>.
is only printed after SLDB exits.
Sorry I've only had a chance to poke at this in very short bursts. Here's my first, obviously flawed attempt. (Didn't update the protocol everywhere so this will yield some protocol errors here and there.)
diff --git a/swank.lisp b/swank.lisp
index 638d4f6..5ca49ce 100644
--- a/swank.lisp
+++ b/swank.lisp
@@ -1746,7 +1746,8 @@ Errors are trapped and invoke our debugger."
(send-to-emacs `(:return ,(current-thread)
,(if ok
`(:ok ,result)
- `(:abort ,(prin1-to-string condition)))
+ `(:abort ,(prin1-to-string condition)
+ ,(princ-to-string condition)))
,id)))))
(defvar *echo-area-prefix* "=> "
diff --git a/contrib/slime-repl.el b/contrib/slime-repl.el
index 2158632..c4d926f 100644
--- a/contrib/slime-repl.el
+++ b/contrib/slime-repl.el
@@ -546,8 +546,8 @@ joined together."))
(slime-lisp-package))
((:ok result)
(slime-repl-insert-result result))
- ((:abort condition)
- (slime-repl-show-abort condition))))
+ ((:abort condition message)
+ (slime-repl-show-abort condition message))))
(defun slime-repl-insert-result (result)
(with-current-buffer (slime-output-buffer)
@@ -563,7 +563,7 @@ joined together."))
(slime-repl-insert-prompt))
(slime-repl-show-maximum-output)))
-(defun slime-repl-show-abort (condition)
+(defun slime-repl-show-abort (condition message)
(with-current-buffer (slime-output-buffer)
(save-excursion
(slime-save-marker slime-output-start
@@ -571,6 +571,9 @@ joined together."))
(goto-char slime-output-end)
(insert-before-markers (format "; Evaluation aborted on %s.\n"
condition))
+ (insert-before-markers (mapconcat (lambda (line)
+ (format "; %s\n" line))
+ (split-string message "[\r\n]") ""))
(slime-repl-insert-prompt))))
(slime-repl-show-maximum-output)))
from slime.
Is there some "right way" to work on this with you? E.g., make a topic branch for this feature on github so that we could work on it together? If it's possible to help....
from slime.
@rpgoldman Pushed that patch here: https://github.com/luismbo/slime/tree/issue-28 I guess the git way to do it is that you fetch from there and then push changes to a fork of yours from which I can fetch and so on.
from slime.
Related Issues (20)
- Debugger REPL HOT 4
- Section "Basic customization" talks about two examples, but only has one
- Warning: 'etypecase' is an obsolte alias (as of 27.1) HOT 1
- `slime-edit-definition` with local-nicknames? HOT 1
- double M-x slime fails to open the second slime repl buffer
- New release HOT 5
- emacs Warning (bytecomp): Unused lexical variable βstartβ HOT 3
- Indexing restarts with letters HOT 5
- Mode line issues when package name contains %
- Fuzzy completions: "Selecting deleted buffer"
- `slime-init-command` fails to use the proper directory for `slime-backend` HOT 1
- Lost connection due to large arrays
- M-x slime [No match] HOT 18
- inferior-lisp window causes wonky window layout with lisp-mode slime hook HOT 5
- Infinite loop in slime-presentation-start HOT 1
- SLIME (ver 2.29.1): REPL Font Coloring and Indentation upon TAB Breaks Frequently HOT 3
- Error compilation on SBCL 2.4.2 HOT 3
- Slime (ver 2.29.1) REPL Occasional Incorrect Indentation upon Pressing TAB key HOT 3
- Segmentation fault when running slime with clisp in cygwin HOT 2
- Setting `sly-lisp-implementations` to a command that has quotes HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slime.