1

popup.el's popup-tip is pretty awesome - check it out. I'm trying to get it to display the output of SLIME's display-documentation method, using the current word pointed by the caret as the argument.

The problem is that display-documentation doesn't return a string but directly displays Swank's output on a buffer:

(popup-tip (slime-documentation "some_name")) ;; fails

I've tried to understand SLIME's source, but failed to do so. How to get a docstring with Slime/Swank for a given name?

deprecated
  • 5,142
  • 3
  • 41
  • 62

1 Answers1

1

I wish I could delete my own question. Couldn't manage to get a string but this code does the job in an even better way. Props go to m2ym.

(defun popup-slime-documentation (symbol-name)
  "Popup function- or symbol-documentation for SYMBOL-NAME."
  (interactive (list (slime-read-symbol-name "Documentation for symbol: ")))
  (when (not symbol-name)
    (error "No symbol given"))
  (slime-eval-async `(swank:documentation-symbol ,symbol-name) 'popup-tip))
deprecated
  • 5,142
  • 3
  • 41
  • 62