Klimi's new dotfiles with stow.
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.5 KiB

  1. (eval-and-compile
  2. (require 'slime))
  3. (define-slime-contrib slime-fancy-inspector
  4. "Fancy inspector for CLOS objects."
  5. (:authors "Marco Baringer <mb@bese.it> and others")
  6. (:license "GPL")
  7. (:slime-dependencies slime-parse)
  8. (:swank-dependencies swank-fancy-inspector)
  9. (:on-load
  10. (add-hook 'slime-edit-definition-hooks 'slime-edit-inspector-part))
  11. (:on-unload
  12. (remove-hook 'slime-edit-definition-hooks 'slime-edit-inspector-part)))
  13. (defun slime-inspect-definition ()
  14. "Inspect definition at point"
  15. (interactive)
  16. (slime-inspect (slime-definition-at-point)))
  17. (defun slime-disassemble-definition ()
  18. "Disassemble definition at point"
  19. (interactive)
  20. (slime-eval-describe `(swank:disassemble-form
  21. ,(slime-definition-at-point t))))
  22. (defun slime-edit-inspector-part (name &optional where)
  23. (and (eq major-mode 'slime-inspector-mode)
  24. (cl-destructuring-bind (&optional property value)
  25. (slime-inspector-property-at-point)
  26. (when (eq property 'slime-part-number)
  27. (let ((location (slime-eval `(swank:find-definition-for-thing
  28. (swank:inspector-nth-part ,value))))
  29. (name (format "Inspector part %s" value)))
  30. (when (and (consp location)
  31. (not (eq (car location) :error)))
  32. (slime-edit-definition-cont
  33. (list (make-slime-xref :dspec `(,name)
  34. :location location))
  35. name
  36. where)))))))
  37. (provide 'slime-fancy-inspector)