joaotavora / sly

Sylvester the Cat's Common Lisp IDE
1.26k stars 142 forks source link

Emacs update to 29.1 broke sly #615

Closed ntrocado closed 1 year ago

ntrocado commented 1 year ago

I'm using emacs 29.1 on windows. SBCL is 2.3.7. After 'C:\Program Files\Emacs\emacs-29.1\bin\emacs.exe' -Q -L . -l sly-autoloads --eval '(setq inferior-lisp-program \"ros -Q run\")' -f sly connection hangs, and I have the following on *sly-started inferior-lisp for ros*:

; file: c:/Users/trocado/.emacs.d/straight/build/sly/slynk/slynk.lisp
; in: DEFUN CLOSE-CONNECTION%
;     (FORMAT SLYNK:*LOG-OUTPUT* "~
;   ;; Event history end.~%~
;   ;; Backtrace:~%~{~A~%~}~
;   ;; Connection to Emacs lost. [~%~
;   ;;  condition: ~A~%~
;   ;;  type: ~S~%~
;   ;;  style: ~S]~%"
;             (LOOP SLYNK::FOR (SLYNK::I SLYNK::F) SLYNK::IN SLYNK::BACKTRACE
;                   SLYNK::COLLECT (IGNORE-ERRORS
;                                   (FORMAT NIL "~d: ~a" SLYNK::I
;                                           (SLYNK::ESCAPE-NON-ASCII SLYNK::F))))
;             (SLYNK::ESCAPE-NON-ASCII (SLYNK::SAFE-CONDITION-MESSAGE CONDITION))
;             (TYPE-OF CONDITION) (SLYNK::CONNECTION-COMMUNICATION-STYLE SLYNK::C))
; 
; caught ERROR:
;   during macroexpansion of
;   (FORMATTER "~
;   ;; Event history end.~%~
;   ;; Backtrace:~%~{~A~%~}~
;   ;; Connection to Emacs lost. [~%~
;   ;;  condition: ~A~%~
;   ;;  type: ~S~%~
;   ;;  style: ~S]~%").
;   Use *BREAK-ON-SIGNALS* to intercept.
;   
;    error in FORMAT: Unknown directive (character: Return)
;     ~
;   ;; Event history end.~%~
;   ;; Backtrace:~%~{~A~%~}~
;   ;; Connection to Emacs lost. [~%~
;   ;;  condition: ~A~%~
;   ;;  type: ~S~%~
;   ;;  style: ~S]~%
;      ^
; 
; note: The second argument never returns a value.

; wrote C:/Users/trocado/AppData/Local/cache/common-lisp/sbcl-2.3.7-win-x64/c/Users/trocado/.emacs.d/straight/build/sly/slynk/slynk-tmpGHU3ALSV.fasl
; compilation finished in 0:00:00.889

debugger invoked on a UIOP/LISP-BUILD:COMPILE-FILE-ERROR in thread
#<THREAD "main thread" RUNNING {10044981B3}>:
  COMPILE-FILE-ERROR while compiling #<CL-SOURCE-FILE "slynk" "slynk">

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [RETRY                        ] Retry
                                     compiling #<CL-SOURCE-FILE "slynk" "slynk">.
  1: [ACCEPT                       ] Continue, treating
                                     compiling #<CL-SOURCE-FILE "slynk" "slynk">
                                     as having been successful.
  2:                                 Retry ASDF operation.
  3: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the
                                     configuration.
  4:                                 Retry ASDF operation.
  5:                                 Retry ASDF operation after resetting the
                                     configuration.
  6: [ABORT                        ] Exit debugger, returning to top level.

(UIOP/LISP-BUILD:CHECK-LISP-COMPILE-RESULTS NIL T T "~/asdf-action::format-action/" ((#<ASDF/LISP-ACTION:COMPILE-OP > . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "slynk" "slynk">)))
   error finding frame source: Bogus form-number: the source file has probably
                               changed too much to cope with.
   source: NIL
0] 

Any ideas why?

ntrocado commented 1 year ago

I commented out the offending form and lisp starts, but the <return> key doesn't work on the repl!

Also I get the following after M-x sly: [sly] Versions differ: 1.0.43 (sly) vs. 1.0.43^M (slynk). Continue? (y or n) (note the ^M). Also every line of the welcoming message ends with ^M. So I guess there's a line ending style mismatch somewhere. Funny that this wasn't happening before...

ntrocado commented 1 year ago

The <return> key issue was unrelated, sorry.

joaotavora commented 1 year ago

This seems to be very similar to https://github.com/joaotavora/sly/issues/584 where somehow, the slynk.lisp file after an update was being saved with CRLF line endings. Please follow that discussion and check your method of installing SLY (not Emacs).

ntrocado commented 1 year ago

It does seem the same problem, probably related to straight... Anyway, I deleted the sly directory and restarted emacs, to force a re-pull. Now it works with no issue, so I can't even be sure what the problem really was. :( I only get those pesky ^Ms on the repl (same with the output from e.g. uiop:run-program), but I can live with those.