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

Briefl SLY document for variables without value output #653

Open
li-yiyang opened this issue Sep 3, 2024 · 0 comments
Open

Briefl SLY document for variables without value output #653

li-yiyang opened this issue Sep 3, 2024 · 0 comments

Comments

@li-yiyang
Copy link

When using sly-describe-symbol, it will use builtin describe in backend. However, if describing a list with tons of data (in my case, a 34MB in text), this will break the SLY connection (or crash Emacs).

I change the documentation function to something like this:

   (let ((type (plist-get candidate :icon))
	  (key  (plist-get candidate :key)))
      (pcase type
	((or "function" "method" "operator")
	 (sly-eval `(slynk:describe-function ,key)))
	;; use slynk-apropos::briefly-describe-symbol-for-emacs
	;; for variable (make sure it won't print too much of its value).
	((or "variable")
	 (sly-eval
	    `(slynk::with-buffer-syntax
	      ()
	      (cl:format cl:nil "~A"
			 (cl:getf (slynk-apropos::briefly-describe-symbol-for-emacs
				   (slynk::parse-symbol-or-lose ,key) cl:nil)
				  :variable)))))
	(_
	 (sly-eval `(slynk:describe-symbol ,key))))

which use slynk-apropos::briefly-describe-symbol-for-emacs and it was fine to use.

I wander if there's some way to make it more neatly.

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

1 participant