Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when clicking on a function name in the browser (with ccl). #3

Open
informatimago opened this issue Jul 29, 2021 · 17 comments
Open

Comments

@informatimago
Copy link

Apparently, an error in the reader on swank messages when browsing (clicking on a function name).

Otherwise, congrats, it looks really nice, I can't wait to be able to use it all the time. Thanks!

Debugger entered--Lisp error: (error "Lisp connection closed unexpectedly")
  signal(error ("Lisp connection closed unexpectedly"))
  error("Lisp connection closed unexpectedly")
  (if (eq (process-status conn) 'open) nil (error "Lisp connection closed unexpectedly"))
  (while t (if (eq (process-status conn) 'open) nil (error "Lisp connection closed unexpectedly")) (accept-process-output nil 0.01))
  (let ((debug-on-quit t) (inhibit-quit nil) (conn (slime-connection))) (while t (if (eq (process-status conn) 'open) nil (error "Lisp connection closed unexpectedly")) (accept-process-output nil 0.01)))
  (catch tag (let ((tag tag) (sexp sexp)) (slime-dispatch-event (list :emacs-rex sexp package slime-current-thread #'(lambda (G16) (let* (... ... ...) (cond ... ... ...)))))) (let ((debug-on-quit t) (inhibit-quit nil) (conn (slime-connection))) (while t (if (eq (process-status conn) 'open) nil (error "Lisp connection closed unexpectedly")) (accept-process-output nil 0.01))))
  (apply #'funcall (catch tag (let ((tag tag) (sexp sexp)) (slime-dispatch-event (list :emacs-rex sexp package slime-current-thread #'(lambda (G16) (let* ... ...))))) (let ((debug-on-quit t) (inhibit-quit nil) (conn (slime-connection))) (while t (if (eq (process-status conn) 'open) nil (error "Lisp connection closed unexpectedly")) (accept-process-output nil 0.01)))))
  (let* ((tag (cl-gensym (format "slime-result-%d-" (1+ (slime-continuation-counter))))) (slime-stack-eval-tags (cons tag slime-stack-eval-tags))) (apply #'funcall (catch tag (let ((tag tag) (sexp sexp)) (slime-dispatch-event (list :emacs-rex sexp package slime-current-thread #'(lambda ... ...)))) (let ((debug-on-quit t) (inhibit-quit nil) (conn (slime-connection))) (while t (if (eq (process-status conn) 'open) nil (error "Lisp connection closed unexpectedly")) (accept-process-output nil 0.01))))))
  slime-eval((esb:serialize-for-emacs (def-properties:function-properties 'COM\.INFORMATIMAGO\.TOOLS\.SOURCE::COUNT-RE-GROUPS t)))
  (let* ((definition-properties (slime-eval (list 'esb:serialize-for-emacs (cons definition-function (cons (list ... ...) '...))))) (source (find :source definition-properties :key 'car)) (file (and source (or (car (cdr (find :file ... :key ...))) (car (cdr (cdr ...)))))) (position (and source (or (car (cdr (find :position ... :key ...))) (car (cdr (find :offset ... :key ...))))))) (if (and file position) (save-current-buffer (set-buffer esb:definition-buffer) (wlf:select esb:wm 'definition) (switch-to-buffer esb:definition-buffer nil t) (esb:set-definition-buffer-file file position)) (message "Definition source not found.")))
  (let ((definition-type (cond ((string= category "functions") :function) ((string= category "variables") :variable) ((string= category "macros") :macro) ((string= category "classes") :class) ((string= category "generic functions") :generic-function) (t (error "Invalid category: %s" category)))) (definition-function (cond ((string= category "functions") 'def-properties:function-properties) ((string= category "variables") 'def-properties:variable-properties) ((string= category "macros") 'def-properties:macro-properties) ((string= category "classes") 'def-properties:class-properties) ((string= category "generic functions") 'def-properties:generic-function-properties) (t (error "Invalid category: %s" category))))) (let* ((definition-properties (slime-eval (list 'esb:serialize-for-emacs (cons definition-function (cons ... ...))))) (source (find :source definition-properties :key 'car)) (file (and source (or (car (cdr ...)) (car (cdr ...))))) (position (and source (or (car (cdr ...)) (car (cdr ...)))))) (if (and file position) (save-current-buffer (set-buffer esb:definition-buffer) (wlf:select esb:wm 'definition) (switch-to-buffer esb:definition-buffer nil t) (esb:set-definition-buffer-file file position)) (message "Definition source not found."))))
  esb:update-definition-buffer("COM.INFORMATIMAGO.TOOLS.SOURCE" "functions" "COUNT-RE-GROUPS")
  esb:select-definition("COM.INFORMATIMAGO.TOOLS.SOURCE" "functions" "COUNT-RE-GROUPS")
  (closure ((definition . "COUNT-RE-GROUPS") (--dolist-tail--) (category . "functions") (package . "COM.INFORMATIMAGO.TOOLS.SOURCE") esb:documentation-buffer esb:definitions-buffer esb:definitions-buffer esb:catgories-buffer esb:packages-buffer t) (btn) (esb:select-definition package category definition))(#<overlay from 11 to 26 in *esb-definitions*>)
  button-activate(#<overlay from 11 to 26 in *esb-definitions*> t)
  push-button(22 t)
  push-button((mouse-2 (#<window 1178 on *esb-definitions*> 22 (102 . 35) 1312064827 nil 22 (11 . 1) nil (3 . 12) (9 . 20))))
  funcall-interactively(push-button (mouse-2 (#<window 1178 on *esb-definitions*> 22 (102 . 35) 1312064827 nil 22 (11 . 1) nil (3 . 12) (9 . 20))))
  call-interactively(push-button nil nil)
  command-execute(push-button)
? ;Loading #P"/Users/pjb/emacs/slime/swank-loader.lisp"...
;; Swank started at port: 50208.
50208
? 2021-07-29 23:14:27.548 dx86cl64[67606:32520020] +[NSSavePanel _warmUp] attempted warmup

Process inferior-lisp finished
(progn (load "/Users/pjb/emacs/slime/swank-loader.lisp" :verbose t) (funcall (read-from-string "swank-loader:init") :from-emacs t) (funcall (read-from-string "swank:start-server") "/var/folders/pq/82920zm125n09frk81rrtp200000gn/T/slime.468"))

;; -*- mode:lisp -*-
(:OUTPUT-TRANSLATIONS :IGNORE-INVALID-ENTRIES (T (:HOME ".cache" "common-lisp" :HOSTNAME :IMPLEMENTATION)) (T (:HOME ".cache" "common-lisp" :IMPLEMENTATION)) :INHERIT-CONFIGURATION) 
To load "uiop":
  Load 1 ASDF system:
    uiop
; Loading "uiop"

To load "com.informatimago.common-lisp":
  Load 1 ASDF system:
    com.informatimago.common-lisp
; Loading "com.informatimago.common-lisp"

To load "com.informatimago.common-lisp.lisp.stepper":
  Load 1 ASDF system:
    com.informatimago.common-lisp.lisp.stepper
; Loading "com.informatimago.common-lisp.lisp.stepper"

To load "com.informatimago.clmisc":
  Load 1 ASDF system:
    com.informatimago.clmisc
; Loading "com.informatimago.clmisc"

To load "com.informatimago.common-lisp.lisp-sexp":
  Load 1 ASDF system:
    com.informatimago.common-lisp.lisp-sexp
; Loading "com.informatimago.common-lisp.lisp-sexp"

To load "com.informatimago.tools.pathname":
  Load 1 ASDF system:
    com.informatimago.tools.pathname
; Loading "com.informatimago.tools.pathname"

To load "com.informatimago.tools.manifest":
  Load 1 ASDF system:
    com.informatimago.tools.manifest
; Loading "com.informatimago.tools.manifest"

To load "com.informatimago.tools.symbol":
  Load 1 ASDF system:
    com.informatimago.tools.symbol
; Loading "com.informatimago.tools.symbol"

To load "com.informatimago.tools.source":
  Load 1 ASDF system:
    com.informatimago.tools.source
; Loading "com.informatimago.tools.source"

To load "com.informatimago.tools.reader-macro":
  Load 1 ASDF system:
    com.informatimago.tools.reader-macro
; Loading "com.informatimago.tools.reader-macro"

To load "com.informatimago.tools.summary":
  Load 1 ASDF system:
    com.informatimago.tools.summary
; Loading "com.informatimago.tools.summary"

To load "com.informatimago.tools.thread":
  Load 1 ASDF system:
    com.informatimago.tools.thread
; Loading "com.informatimago.tools.thread"

To load "com.informatimago.tools.quicklisp":
  Load 1 ASDF system:
    com.informatimago.tools.quicklisp
; Loading "com.informatimago.tools.quicklisp"

To load "com.informatimago.tools.make-depends":
  Load 1 ASDF system:
    com.informatimago.tools.make-depends
; Loading "com.informatimago.tools.make-depends"

To load "com.informatimago.tools.script":
  Load 1 ASDF system:
    com.informatimago.tools.script
; Loading "com.informatimago.tools.script"

To load "com.informatimago.tools.check-asdf":
  Load 1 ASDF system:
    com.informatimago.tools.check-asdf
; Loading "com.informatimago.tools.check-asdf"

To load "alexandria":
  Load 1 ASDF system:
    alexandria
; Loading "alexandria"

;; Using package COM.INFORMATIMAGO.TOOLS.QUICKLISP
;; Using package COM.INFORMATIMAGO.TOOLS.ASDF
;; Using package COM.INFORMATIMAGO.TOOLS.THREAD
;; Using package COM.INFORMATIMAGO.TOOLS.SYMBOL
;; Using package COM.INFORMATIMAGO.COMMON-LISP.UNIX.PASSWD
;; Using package COM.INFORMATIMAGO.COMMON-LISP.UNIX.GROUP
;; Using package COM.INFORMATIMAGO.COMMON-LISP.UNIX.ALIASES
;; Using package COM.INFORMATIMAGO.COMMON-LISP.RFC3548.RFC3548
;; Using package COM.INFORMATIMAGO.COMMON-LISP.RFC2822.RFC2822
;; Using package COM.INFORMATIMAGO.COMMON-LISP.INTERACTIVE.INTERACTIVE
;; Using package COM.INFORMATIMAGO.COMMON-LISP.INTERACTIVE.BROWSER
;; Using package COM.INFORMATIMAGO.COMMON-LISP.INVOICE.INVOICE
;; Using package COM.INFORMATIMAGO.COMMON-LISP.GRAPHVIZ.GRAPH-DOT
;; Using package COM.INFORMATIMAGO.COMMON-LISP.REGEXP.REGEXP
;; Using package COM.INFORMATIMAGO.COMMON-LISP.DIAGRAM.TREE-TO-DIAGRAM
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CSV.CSV
;; Using package COM.INFORMATIMAGO.COMMON-LISP.BANK.RIB
;; Using package COM.INFORMATIMAGO.COMMON-LISP.BANK.IBAN
;; Using package COM.INFORMATIMAGO.COMMON-LISP.HTTP.HTRANS
;; Using package COM.INFORMATIMAGO.COMMON-LISP.HTTP.HQUERY
;; Using package COM.INFORMATIMAGO.COMMON-LISP.HTML-PARSER.PARSE-HTML
;; Using package COM.INFORMATIMAGO.COMMON-LISP.HTML-BASE.ML-SEXP
;; Using package COM.INFORMATIMAGO.COMMON-LISP.DATA-ENCODING.IEEE-754
;; Using package COM.INFORMATIMAGO.COMMON-LISP.DATA-ENCODING.ECP
;; Using package COM.INFORMATIMAGO.COMMON-LISP.DATA-ENCODING.HEXADECIMAL
;; Using package COM.INFORMATIMAGO.COMMON-LISP.DATA-ENCODING.BENCODE
;; Using package COM.INFORMATIMAGO.COMMON-LISP.DATA-ENCODING.DATA-ENCODING
;; Using package COM.INFORMATIMAGO.COMMON-LISP.ARITHMETIC.ALGEBRA
;; Using package COM.INFORMATIMAGO.COMMON-LISP.ARITHMETIC.P127N2
;; Using package COM.INFORMATIMAGO.COMMON-LISP.ARITHMETIC.PRIMES
;; Using package COM.INFORMATIMAGO.COMMON-LISP.PICTURE.TREE-TO-ASCII
;; Using package COM.INFORMATIMAGO.COMMON-LISP.PICTURE.CONS-TO-ASCII
;; Using package COM.INFORMATIMAGO.COMMON-LISP.PICTURE.PICTURE
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.FLOAT-BINIO
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.CACHE
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.PEEK-STREAM
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.FILE
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.STREAM
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.VERSION
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.DATE.UTILITY
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.ACTIVITY
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.A-STAR
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.HISTOGRAM
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.CIRCULAR
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.TEA
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.DFA
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.RAIDEN
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.CONSTRAINTS
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.COMBINATION
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.PMATCH
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.ISO639A
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.ISO4217
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.ISO3166
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.CHARACTER-SETS
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.ASCII
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.CHARACTER
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.PRIORITY-QUEUE
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.MESSAGE-QUEUE
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.QUEUE
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.LLRBTREE
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.DLL
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.DICTIONARY
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.PACKAGE
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.STRING
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.UTILITY
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.SYMBOL
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.LIST
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.SEQUENCE
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.ARRAY
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.SIMPLE-TEST
;; Using package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.TIME
;; Using package COM.INFORMATIMAGO.COMMON-LISP.LISP-TEXT.SOURCE-TEXT
;; Using package COM.INFORMATIMAGO.COMMON-LISP.LISP-SEXP.SOURCE-FORM
To load "split-sequence":
  Load 1 ASDF system:
    split-sequence
; Loading "split-sequence"

(OPTIMIZE (SAFETY 3) (DEBUG 3) (SPEED 0) (SPACE 0) (COMPILATION-SPEED 3))
Clozure Common Lisp Version 1.12.1 (v1.12.1-7-g4912320e) DarwinX8664

For more information about CCL, please see http://ccl.clozure.com.

CCL is free software.  It is distributed under the terms of the Apache
Licence, Version 2.0.
? ;Loading #P"/Users/pjb/emacs/slime/swank-loader.lisp"...
;; Swank started at port: 56324.
56324
? 
;Compiler warnings for "/Users/pjb/emacs/lisp-system-browser/def-properties.lisp" :
;   In macro-properties: Unused lexical variable shallow
;Compiler warnings for "/Users/pjb/emacs/lisp-system-browser/def-properties.lisp" :
;   In function-properties: Unused lexical variable shallow
;Compiler warnings :
;   In variable-source-location: Unused lexical variable name
;Compiler warnings :
;   In macro-source-location: Unused lexical variable name
;Compiler warnings for "/Users/pjb/emacs/lisp-system-browser/def-properties.lisp" :
;   In variable-properties: Unused lexical variable shallow
;; swank:close-connection: Reader error: Illegal symbol syntax.
;; Event history start:
wait-for-event: (:EMACS-REX . SWANK::_) NIL
dispatch-event: (:RETURN #<PROCESS worker(28) [Reset] #x3020028CB0FD> (:OK ("COUNT-RE-GROUPS" "DEPENDENCIES" "ENSURE-SOURCE-FILE-PATHNAME" "EXTRACT-SOURCE-FROM-REQUIRE-SEXP" "FILE-EMACS-VARIABLES" "FIND-FILE-IN-DIRECTORY" "FIND-FILE-PATH" "FIND-FILE-WITH-EXTENSION" "GET-CLOSED-DEPENDENCIES" "GET-DEPENDENCIES" "GET-DEPENDS" "GET-PACKAGE" "GET-REQUIRES" "GET-SOURCE-FILE" "HEADER-AUTHORS" "HEADER-DESCRIPTION" "HEADER-LICENCE" "HEADER-SLOT" "OBJECT-EXTENSIONS" "PACKAGE-MEMBER-P" "PARSE-EMACS-VARIABLES" "PDEBUG" "READ-SEXP-FROM-FILE" "READ-SOURCE-CODE" "READ-SOURCE-HEADER" "SAFE-REGEXP-COMPILE" "SAFE-REGEXP-EXEC" "SAFE-REGEXP-MATCH-STRING" "SCAN-SOURCE-FILE" "SHOW" "SOURCE-EXTENSIONS" "SOURCE-FILE-ADDED-NICKNAMES" "SOURCE-FILE-EMACS-VARIABLES" "SOURCE-FILE-EXTERNAL-FORMAT" "SOURCE-FILE-FOR-OBJECT" "SOURCE-FILE-HEADER" "SOURCE-FILE-PACKAGES-DEFINED" "SOURCE-FILE-PACKAGES-USED" "SOURCE-FILE-PATHNAME" "SOURCE-FILE-PROVIDES" "SOURCE-FILE-REQUIRES" "SOURCE-PACKAGE-DOCUMENTATION" "SOURCE-PACKAGE-EXPORT" "SOURCE-PACKAGE-IMPORT-FROM" "SOURCE-PACKAGE-INTERN" "SOURCE-PACKAGE-NAME" "SOURCE-PACKAGE-NICKNAMES" "SOURCE-PACKAGE-SHADOW" "SOURCE-PACKAGE-SHADOWING-IMPORT-FROM" "SOURCE-PACKAGE-USE" "SYMBOL-PACKAGE-NAME" "WRITE-EMACS-HEAD-VARIABLES" "WRITE-EMACS-TAIL-VARIABLES" "WRITE-SOURCE-HEADER")) 14)
encode-message
decode-message
dispatch-event: (:EMACS-REX (EMACS-SYSTEM-BROWSER:LIST-DEFINITIONS "COM.INFORMATIMAGO.TOOLS.SOURCE" :VARIABLE) "COMMON-LISP-USER" T 15)
send-event: #<PROCESS worker(29) [Reset] #x3020028C667D> (:EMACS-REX (EMACS-SYSTEM-BROWSER:LIST-DEFINITIONS "COM.INFORMATIMAGO.TOOLS.SOURCE" :VARIABLE) "COMMON-LISP-USER" 15)
wait-for-event: (:EMACS-REX . SWANK::_) NIL
dispatch-event: (:RETURN #<PROCESS worker(29) [Reset] #x3020027EC6ED> (:OK ("*EMACS-HEAD-VARIABLES*" "*FILE-HEADERS*" "*LINE-LENGTH*" "*SOURCE-FILE-DB*" "EXTENSIONS-CLISP" "EXTENSIONS-EMACS")) 15)
encode-message
decode-message
dispatch-event: (:EMACS-REX (EMACS-SYSTEM-BROWSER:LIST-DEFINITIONS "COM.INFORMATIMAGO.TOOLS.SOURCE" :FUNCTION) "COMMON-LISP-USER" T 16)
send-event: #<PROCESS worker(30) [Reset] #x30200285E9ED> (:EMACS-REX (EMACS-SYSTEM-BROWSER:LIST-DEFINITIONS "COM.INFORMATIMAGO.TOOLS.SOURCE" :FUNCTION) "COMMON-LISP-USER" 16)
wait-for-event: (:EMACS-REX . SWANK::_) NIL
dispatch-event: (:RETURN #<PROCESS worker(30) [Reset] #x30200285E9ED> (:OK ("COUNT-RE-GROUPS" "DEPENDENCIES" "ENSURE-SOURCE-FILE-PATHNAME" "EXTRACT-SOURCE-FROM-REQUIRE-SEXP" "FILE-EMACS-VARIABLES" "FIND-FILE-IN-DIRECTORY" "FIND-FILE-PATH" "FIND-FILE-WITH-EXTENSION" "GET-CLOSED-DEPENDENCIES" "GET-DEPENDENCIES" "GET-DEPENDS" "GET-PACKAGE" "GET-REQUIRES" "GET-SOURCE-FILE" "HEADER-AUTHORS" "HEADER-DESCRIPTION" "HEADER-LICENCE" "HEADER-SLOT" "OBJECT-EXTENSIONS" "PACKAGE-MEMBER-P" "PARSE-EMACS-VARIABLES" "PDEBUG" "READ-SEXP-FROM-FILE" "READ-SOURCE-CODE" "READ-SOURCE-HEADER" "SAFE-REGEXP-COMPILE" "SAFE-REGEXP-EXEC" "SAFE-REGEXP-MATCH-STRING" "SCAN-SOURCE-FILE" "SHOW" "SOURCE-EXTENSIONS" "SOURCE-FILE-ADDED-NICKNAMES" "SOURCE-FILE-EMACS-VARIABLES" "SOURCE-FILE-EXTERNAL-FORMAT" "SOURCE-FILE-FOR-OBJECT" "SOURCE-FILE-HEADER" "SOURCE-FILE-PACKAGES-DEFINED" "SOURCE-FILE-PACKAGES-USED" "SOURCE-FILE-PATHNAME" "SOURCE-FILE-PROVIDES" "SOURCE-FILE-REQUIRES" "SOURCE-PACKAGE-DOCUMENTATION" "SOURCE-PACKAGE-EXPORT" "SOURCE-PACKAGE-IMPORT-FROM" "SOURCE-PACKAGE-INTERN" "SOURCE-PACKAGE-NAME" "SOURCE-PACKAGE-NICKNAMES" "SOURCE-PACKAGE-SHADOW" "SOURCE-PACKAGE-SHADOWING-IMPORT-FROM" "SOURCE-PACKAGE-USE" "SYMBOL-PACKAGE-NAME" "WRITE-EMACS-HEAD-VARIABLES" "WRITE-EMACS-TAIL-VARIABLES" "WRITE-SOURCE-HEADER")) 16)
encode-message
decode-message
dispatch-event: (:EMACS-REX (EMACS-SYSTEM-BROWSER:LIST-DEFINITIONS "COM.INFORMATIMAGO.TOOLS.SOURCE" :CLASS) "COMMON-LISP-USER" T 17)
send-event: #<PROCESS worker(31) [Reset] #x302002859F7D> (:EMACS-REX (EMACS-SYSTEM-BROWSER:LIST-DEFINITIONS "COM.INFORMATIMAGO.TOOLS.SOURCE" :CLASS) "COMMON-LISP-USER" 17)
wait-for-event: (:EMACS-REX . SWANK::_) NIL
dispatch-event: (:RETURN #<PROCESS worker(31) [Reset] #x302002859F7D> (:OK ("SOURCE-FILE" "SOURCE-PACKAGE")) 17)
encode-message
dispatch-event: (:EMACS-REX (EMACS-SYSTEM-BROWSER:LIST-DEFINITIONS "COM.INFORMATIMAGO.TOOLS.SOURCE" :GENERIC-FUNCTION) "COMMON-LISP-USER" T 18)
wait-for-event: (:EMACS-REX . SWANK::_) NIL
send-event: #<PROCESS worker(32) [Reset] #x30200285852D> (:EMACS-REX (EMACS-SYSTEM-BROWSER:LIST-DEFINITIONS "COM.INFORMATIMAGO.TOOLS.SOURCE" :GENERIC-FUNCTION) "COMMON-LISP-USER" 18)
wait-for-event: (:EMACS-REX . SWANK::_) NIL
dispatch-event: (:RETURN #<PROCESS worker(32) [Reset] #x30200285852D> (:OK NIL) 18)
encode-message
decode-message
dispatch-event: (:EMACS-REX (EMACS-SYSTEM-BROWSER:LIST-DEFINITIONS "COM.INFORMATIMAGO.TOOLS.SOURCE" :CLASS) "COMMON-LISP-USER" T 19)
send-event: #<PROCESS worker(33) [Reset] #x302002856BFD> (:EMACS-REX (EMACS-SYSTEM-BROWSER:LIST-DEFINITIONS "COM.INFORMATIMAGO.TOOLS.SOURCE" :CLASS) "COMMON-LISP-USER" 19)
wait-for-event: (:EMACS-REX . SWANK::_) NIL
dispatch-event: (:RETURN #<PROCESS worker(33) [Reset] #x302002856BFD> (:OK ("SOURCE-FILE" "SOURCE-PACKAGE")) 19)
encode-message
decode-message
dispatch-event: (:EMACS-REX (EMACS-SYSTEM-BROWSER:LIST-DEFINITIONS "COM.INFORMATIMAGO.TOOLS.SOURCE" :FUNCTION) "COMMON-LISP-USER" T 20)
send-event: #<PROCESS worker(34) [Reset] #x3020028551CD> (:EMACS-REX (EMACS-SYSTEM-BROWSER:LIST-DEFINITIONS "COM.INFORMATIMAGO.TOOLS.SOURCE" :FUNCTION) "COMMON-LISP-USER" 20)
wait-for-event: (:EMACS-REX . SWANK::_) NIL
dispatch-event: (:RETURN #<PROCESS worker(34) [Reset] #x3020028551CD> (:OK ("COUNT-RE-GROUPS" "DEPENDENCIES" "ENSURE-SOURCE-FILE-PATHNAME" "EXTRACT-SOURCE-FROM-REQUIRE-SEXP" "FILE-EMACS-VARIABLES" "FIND-FILE-IN-DIRECTORY" "FIND-FILE-PATH" "FIND-FILE-WITH-EXTENSION" "GET-CLOSED-DEPENDENCIES" "GET-DEPENDENCIES" "GET-DEPENDS" "GET-PACKAGE" "GET-REQUIRES" "GET-SOURCE-FILE" "HEADER-AUTHORS" "HEADER-DESCRIPTION" "HEADER-LICENCE" "HEADER-SLOT" "OBJECT-EXTENSIONS" "PACKAGE-MEMBER-P" "PARSE-EMACS-VARIABLES" "PDEBUG" "READ-SEXP-FROM-FILE" "READ-SOURCE-CODE" "READ-SOURCE-HEADER" "SAFE-REGEXP-COMPILE" "SAFE-REGEXP-EXEC" "SAFE-REGEXP-MATCH-STRING" "SCAN-SOURCE-FILE" "SHOW" "SOURCE-EXTENSIONS" "SOURCE-FILE-ADDED-NICKNAMES" "SOURCE-FILE-EMACS-VARIABLES" "SOURCE-FILE-EXTERNAL-FORMAT" "SOURCE-FILE-FOR-OBJECT" "SOURCE-FILE-HEADER" "SOURCE-FILE-PACKAGES-DEFINED" "SOURCE-FILE-PACKAGES-USED" "SOURCE-FILE-PATHNAME" "SOURCE-FILE-PROVIDES" "SOURCE-FILE-REQUIRES" "SOURCE-PACKAGE-DOCUMENTATION" "SOURCE-PACKAGE-EXPORT" "SOURCE-PACKAGE-IMPORT-FROM" "SOURCE-PACKAGE-INTERN" "SOURCE-PACKAGE-NAME" "SOURCE-PACKAGE-NICKNAMES" "SOURCE-PACKAGE-SHADOW" "SOURCE-PACKAGE-SHADOWING-IMPORT-FROM" "SOURCE-PACKAGE-USE" "SYMBOL-PACKAGE-NAME" "WRITE-EMACS-HEAD-VARIABLES" "WRITE-EMACS-TAIL-VARIABLES" "WRITE-SOURCE-HEADER")) 20)
encode-message
close-connection: Reader error: Illegal symbol syntax. ...
;; Event history end.
;; Backtrace:
0: (nil #<Unknown Arguments>)
1: (nil #<Unknown Arguments>)
2: (swank:backtrace 0 nil)
3: (nil #<Unknown Arguments>)
4: ((:internal swank::safe-backtrace))
5: (swank/backend:call-with-debugging-environment #<Compiled-function (:internal swank::safe-backtrace) (Non-Global)  #x302..
6: (swank/backend:call-with-debugging-environment #<Compiled-function (:internal swank::safe-backtrace) (Non-Global)  #x302..
7: (swank::safe-backtrace)
8: (swank::signal-swank-error #<common-lisp:simple-error #x30200287D10D> nil)
9: (common-lisp:signal #<common-lisp:simple-error #x30200287D10D>)
10: (ccl::%error #<common-lisp:simple-error #x30200287D10D> nil 79194191)
11: (ccl::read-symbol-token #<string-input-stream  #x30200287D3AD>)
12: (#<Anonymous Function #x30000056609F> #<string-input-stream  #x30200287D3AD> #\: nil)
13: (ccl::read-dispatch #<string-input-stream  #x30200287D3AD> #\#)
14: (ccl::%parse-expression #<string-input-stream  #x30200287D3AD> #\# nil)
15: (ccl::%read-form #<string-input-stream  #x30200287D3AD> 0 nil)
16: (ccl::|'-reader| #<string-input-stream  #x30200287D3AD> #\')
17: (ccl::%parse-expression #<string-input-stream  #x30200287D3AD> #\' (nil))
18: (ccl::%read-list-expression #<string-input-stream  #x30200287D3AD> (nil) #\))
19: (ccl::read-list #<string-input-stream  #x30200287D3AD> nil #\))
20: (ccl::%parse-expression #<string-input-stream  #x30200287D3AD> #\( (nil))
21: (ccl::%read-list-expression #<string-input-stream  #x30200287D3AD> (nil) #\))
22: (ccl::read-list #<string-input-stream  #x30200287D3AD> nil #\))
23: (ccl::%parse-expression #<string-input-stream  #x30200287D3AD> #\( (nil))
24: (ccl::%read-list-expression #<string-input-stream  #x302002802FDD> (nil) #\))
25: (ccl::read-list #<string-input-stream  #x302002802FDD> nil #\))
26: (ccl::%parse-expression #<string-input-stream  #x302002802FDD> #\( nil)
27: (ccl::%read-form #<string-input-stream  #x302002802FDD> 0 nil)
28: (ccl::read-internal #<string-input-stream  #x302002802FDD> t nil nil)
29: (common-lisp:read #<string-input-stream  #x302002802FDD> t nil nil)
30: (common-lisp:read-from-string "(:emacs-rex (esb:serialize-for-emacs (def-properties:function-properties '#:COM\\.INFORMA..
31: (swank/rpc::read-form "(:emacs-rex (esb:serialize-for-emacs (def-properties:function-properties '#:COM\\.INFORMATIMAGO\\..
32: (swank/rpc:read-message #<basic-tcp-stream utf-8 (socket/14) #x3020021193AD> #<Package "SWANK-IO-PACKAGE">)
33: (swank::decode-message #<basic-tcp-stream utf-8 (socket/14) #x3020021193AD>)
34: (swank::read-loop #<multithreaded-connection #x302002118F5D>)
35: ((:internal swank::control-thread))
36: (ccl::run-process-initial-form #<process reader-thread(11) [Active] #x30200211D71D> (#<ccl:compiled-lexical-closure (:in..
37: ((:internal (ccl::%process-preset-internal (ccl:process))) #<process reader-thread(11) [Active] #x30200211D71D> (#<ccl:c..
38: ((:internal ccl::thread-make-startup-function))
;; Connection to Emacs lost. [
;;  condition: Reader error: Illegal symbol syntax.
;;  type: SIMPLE-ERROR
;;  style: :SPAWN]

🇶🇦 
? (COM.INFORMATIMAGO.TOOLS.MANIFEST:PRINT-BUG-REPORT-INFO)
; Compiler warning: In a toplevel form: Nonspecific warning
; While executing: UIOP/UTILITY:STYLE-WARN, in process listener(1).


LISP-IMPLEMENTATION-TYPE     "Clozure Common Lisp"
LISP-IMPLEMENTATION-VERSION  "Version 1.12.1 (v1.12.1-7-g4912320e) DarwinX8664"
SOFTWARE-TYPE                "Darwin"
SOFTWARE-VERSION             "20.5.0"
MACHINE-INSTANCE             "ip-192-168-7-10.eu-west-1.compute.internal"
MACHINE-TYPE                 "x86_64"
MACHINE-VERSION              "iMac17,1"
distribution                 (:DARWIN :UNKNOWN "11.4")
uname -a                     "Darwin ip-192-168-7-10.eu-west-1.compute.internal 20.5.0 Darwin Kernel Version 20.5.0: Sat May  8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64"
*FEATURES*                   (:SWANK :COM.INFORMATIMAGO.PJB :BORDEAUX-THREADS
                              :CLOSER-MOP :THREAD-SUPPORT :UIOP :SPLIT-SEQUENCE
                              :COM.INFORMATIMAGO.COMMON-LISP.LISP.CL-STEPPER
                              :CL-PPCRE :NEWLINE-IS-LINEFEED :HAS-ASCII-CODE
                              :HAS-ASCII-STANDARD-CHARACTERS :HAS-NULL :HAS-VT
                              :HAS-BELL :HAS-ESCAPE :HAS-LINEFEED :HAS-RETURN
                              :HAS-BACKSPACE :HAS-TAB :HAS-PAGE :HAS-RUBOUT
                              :QUICKLISP :ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3
                              :ASDF2 :ASDF :OS-MACOSX :OS-UNIX :ASDF-UNICODE
                              :PRIMARY-CLASSES :COMMON-LISP :OPENMCL :CCL
                              :CCL-1.2 :CCL-1.3 :CCL-1.4 :CCL-1.5 :CCL-1.6
                              :CCL-1.7 :CCL-1.8 :CCL-1.9 :CCL-1.10 :CCL-1.11
                              :CCL-1.12 :CLOZURE :CLOZURE-COMMON-LISP :ANSI-CL
                              :UNIX :OPENMCL-UNICODE-STRINGS :IPV6
                              :OPENMCL-NATIVE-THREADS :OPENMCL-PARTIAL-MOP
                              :MCL-COMMON-MOP-SUBSET :OPENMCL-MOP-2
                              :OPENMCL-PRIVATE-HASH-TABLES
                              :STATIC-CONSES-SHOULD-WORK-WITH-EGC-IN-CCL
                              :PACKAGE-LOCAL-NICKNAMES :X86-64 :X86_64
                              :X86-TARGET :X86-HOST :X8664-TARGET :X8664-HOST
                              :DARWIN-HOST :DARWIN-TARGET :DARWINX86-TARGET
                              :DARWINX8664-TARGET :DARWINX8664-HOST
                              :64-BIT-TARGET :64-BIT-HOST :DARWIN
                              :LITTLE-ENDIAN-TARGET :LITTLE-ENDIAN-HOST)


? 
@mmontone
Copy link
Owner

Sorry, yes, it needs more work!!

I've been working with SBCL exclusively so far.

@informatimago
Copy link
Author

We have to be careful with reader macros in the protocol between slime and swank.
ccl has a few additional dispatching reader macros on the default *readtable*.

30: (common-lisp:read-from-string "(:emacs-rex (esb:serialize-for-emacs (def-properties:function-properties '#:COM\\.INFORMA..

I'll try to get the whole string next time.

@informatimago
Copy link
Author

Here are better logs; I changed read-form in swank rpc.lisp:

(defun read-form (string package)
  (with-standard-io-syntax
    (let ((*package* package))
      (if *validate-input*
          (validating-read string)
          (handler-case
              (read-from-string string)
            (error (err)
              (format *terminal-io*
                      "~&Error while reading from the string: ~%~S~2%~A~%"
                      string err)
              (finish-output *terminal-io*)
              (if (typep err 'reader-error)
                  (error 'swank-reader-error 
                         :packet string
                         :cause err)
                  (error 'swank-reader-error 
                         :packet string))))))))

We get this error reported:

Error while reading from the string: 
"(:emacs-rex (esb:serialize-for-emacs (def-properties:function-properties '#:ALEXANDRIA::CIRCULAR-LIST t)) \"COMMON-LISP-USER\" t 12)
"

Reader error: Illegal symbol syntax.

So it looks like a string designator for package name has been used blindly and generated the wrong syntax for a qualified symbol #:alexandria::circular-list.

@mmontone
Copy link
Owner

Odd thing is I've just tried it on Clozure CL and I'm able to navigate all alexandria package functions without any problems.

@mmontone
Copy link
Owner

One particular problem I'm having with Clozure is that SWANK classifies macros as functions :(

CL-USER> (swank::describe-symbol-for-emacs 'anaphora:aand)
(:FUNCTION "Like AND, except binds the first argument to IT (via LET) for the
scope of the rest of the arguments.")

And I'm using that Swank function to determine the type of symbols.

@informatimago
Copy link
Author

informatimago commented Jul 30, 2021

The error seems to be in esb:update-definition-buffer with the use of make-symbol:

    (let* ((definition-properties (slime-eval `(esb:serialize-for-emacs (,definition-function ',(make-symbol (concat package "::" definition)) t))))

(make-symbol (concat "FOO" "::" "BAR")) --> #:FOO::BAR

There's another occurence in esb:update-documentation-buffer.

You want to use intern here! And yes, it's a bummer that we have to intern a lot of qualified CL symbols in emacs lisp!

@mmontone
Copy link
Owner

Ohh. auch. Thanks for looking.

@mmontone
Copy link
Owner

I can fix that (and I will), but CCL support will remain lacking unfortunately, unless I find a straightforward and portable way of getting the source location of definitions, and I can also fix the problem I mention above (macros are given type 'function' by swank).

@mmontone
Copy link
Owner

Shinmera's definitions library probably implements what I need, but I didn't go that path...

@mmontone
Copy link
Owner

I've replaced the make-symbol by intern in eb9931c

but don't expect a working version for CCL yet, until I can solve what I mention above.

@informatimago
Copy link
Author

informatimago commented Jul 30, 2021

I can fix that (and I will), but CCL support will remain lacking unfortunately, unless I find a straightforward and portable way of getting the source location of definitions, and I can also fix the problem I mention above (macros are given type 'function' by swank).

Well, notice how this is a problem in the emacs lisp code, so independent of ccl. It's only that it looks like sbcl accepts 3 colons in symbol names and does something with them. (Well, more precisely "#:foo::bar" seems to be read in sbcl). But it would break in any strictly conforming implementation.

Otherwise, of course you can rely on swank, and if a swank backend is missing, too bad, we'll have to post issues and patches to slime/swank.

@informatimago
Copy link
Author

I've replaced the make-symbol by intern in eb9931c

but don't expect a working version for CCL yet, until I can solve what I mention above.

Once you've tested that it's corrected (perhaps you'd write unit tests? there are nice CI on github and gitlab ;-) ), you can Close the issue.

@mmontone
Copy link
Owner

You'll have to test it because for my configuration it already worked before my change, so I cannot tell whether it made a difference or not. No, I don't have tests or CI :)

@informatimago
Copy link
Author

You'll have to test it because for my configuration it already worked before my change, so I cannot tell whether it made a difference or not. No, I don't have tests or CI :)

Ok, I'll pull the new version and test it tomorrow. For now, good night and thanks for this lisp browser, it'll be great!

@mmontone
Copy link
Owner

For the record, I need this patch in SWANK/CCL:

(defimplementation describe-symbol-for-emacs (symbol)
  (let ((result '()))
    (flet ((doc (kind &optional (sym symbol))
             (or (documentation sym kind) :not-documented))
           (maybe-push (property value)
             (when value
               (setf result (list* property value result)))))
      (maybe-push
       :variable (when (boundp symbol)
                   (doc 'variable)))
      (maybe-push
       :macro (when (macro-function symbol)
                (doc 'function)))
      (maybe-push
       :function (if (and (not (macro-function symbol)) (fboundp symbol))
                     (doc 'function)))
      (maybe-push
       :setf (let ((setf-function-name (ccl:setf-function-spec-name
                                        `(setf ,symbol))))
               (when (fboundp setf-function-name)
                 (doc 'function setf-function-name))))
      (maybe-push
       :type (when (ccl:type-specifier-p symbol)
               (doc 'type)))
      result)))

So that, (swank::describe-symbol-for-emacs 'anaphora:aand)
gives me

(:MACRO "Like AND, except binds the first argument to IT (via LET) for the scope of the rest of the arguments.")

and not :function

@informatimago
Copy link
Author

I will also report an issue to swank about the disconnection upon receiving unparsable "user" message ("#:foo::bar"). We must expect some sturdiness in slime/swank when "user-level" expressions are passed over.

Now, for the lisp browser, as I mentioned, the current patch makes internalise in emacs-lisp the CL symbols that are processed. This is not too good. A better solution would be to generate the CL expression as an emacs lisp string, and let swank read and evaluate it:

(slime-eval
`(swank:eval-and-grab-output
  ,(format "(esb:serialize-for-emacs (%s '%s::%s t))"
           definition-function package definition)))

This way, only O(1) CL symbols are interned in emacs lisp (the definition-function, and you could even use strings instead of symbols for them), and swank:eval-and-grab-output.

@mmontone
Copy link
Owner

mmontone commented Aug 1, 2021

I'm interning symbols on Common Lisp side now. Isn't it better like that? It is working on both SBCL and CCL for me.

4561f7d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants