From 2289589e3942889d9eb86abe400c146cf6c52cab Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Sun, 19 Jun 2022 13:10:06 +0300 Subject: [PATCH] fix definition-source-for-emacs for case when source was categorized as :file-without-position This fix relates to SBCL and the case when definition relates to a function. Here definition-source-for-emacs is called with name having string type: https://github.com/joaotavora/sly/blob/b501b4335096fd4306c2c1eb86382b69e91c09e5/slynk/backend/sbcl.lisp#L872 In this case we have to use it as is instead of trying to call SYMBOL-NAME. I've encounter this problem when attempted to setup logical pathname translations to make SLY open local files when connected to the remote Lisp image. Here is the Reddit discussion where everything begins: https://www.reddit.com/r/Common_Lisp/comments/vc6hix/source_location_for_deployed_binary/ --- slynk/backend/sbcl.lisp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/slynk/backend/sbcl.lisp b/slynk/backend/sbcl.lisp index d1a782b4b..03ad6b2f7 100644 --- a/slynk/backend/sbcl.lisp +++ b/slynk/backend/sbcl.lisp @@ -1003,7 +1003,9 @@ QUALITIES is an alist with (quality . value)" '(:position 1) (when (eql type :function) `(:snippet ,(format nil "(defun ~a " - (symbol-name name)))))) + (etypecase name + (symbol (symbol-name name)) + (string name))))))) (:invalid (error "DEFINITION-SOURCE of ~(~A~) ~A did not contain ~ meaningful information."