joaotavora / sly

Sylvester the Cat's Common Lisp IDE
1.24k stars 140 forks source link

update-indentation-information should not error when *emacs-connection* #470

Closed Yehouda closed 9 months ago

Yehouda commented 2 years ago

Currently, doing:

(ql:quickload "SLYNK/INDENTATION")
(ql:quickload "softdrink")

Gives an error (on Lispworks):

Error: NIL fell through ETYPECASE expression inside SLYNK::SEND-TO-INDENTATION-CACHE.
Wanted one of (SLYNK::SINGLETHREADED-CONNECTION SLYNK::MULTITHREADED-CONNECTION).

because *emacs-connection* is nil. It would be better if either update-indentation-information or SLYNK::SEND-TO-INDENTATION-CACHE check and do nothing if there is no connection yet.

In slynk/slynk.lisp.

The top frames on the stack are:

Call to ERROR
Call to SLYNK:UPDATE-INDENTATION-INFORMATION
Call to (SETF TRIVIAL-INDENT:INDENTATION)
joaotavora commented 2 years ago

Interesting. Normally the slynk/indentation system would not be loaded manually using ql:quickload. But I guess there's nothing fundamentally wrong with doing that. Still, I wonder what the use case is.

Anyway, if you want to provide a PR for this, I can have a look.

Yehouda commented 2 years ago

There really isn't a "use case". We just run tests where we quickload "all" the systems in quicklisp (and when we can find them run their tests). As it happen "slynk/documentation" and "softdrink" happen to be in the batch of systems. I "fixed" it by moving "softdrink" to another batch.

I don't do any work on github, I just load things from quicklisp and rn them (and if they break check why).

joaotavora commented 2 years ago

OK, but what is your theory on why softdrink caused the error? Can you perhaps post some more of that backtrace? Thanks.

Yehouda commented 2 years ago

It is the call to (SETF TRIVIAL-INDENT:INDENTATION) inthe short backtrace that I post. The last think that I "typed" (actually happened by the running of the tests) was (ql:quickload "softdrink"), bt the error occurs while it loaded other systems. Full session in the attached file jj.txt below.

The actual form in the source file https://github.com/Shinmera/documentation-utils/blob/master/toolkit.lisp is (trivial-indent:define-indentation define-docs (&rest (&whole 2 0 &body))).

The definition of define-indentation is here:

https://github.com/Shinmera/trivial-indent/blob/master/indent.lisp

jj.txt

aadcg commented 9 months ago

@Yehouda see #619.