Fix visit docs for Racket & support racket-xp (#3373)
* Fix visit docs for Racket & support racket-xp
- Fix Racket's +lookup/documentation in the same way as
f20f477a44
- Support the +xp feature which enables racket-xp. When it's not
enabled, default handlers to the traditional racket-repl
(which requires users to run code first)
* PR feedback
* Replace add-hook! with add-hook
This commit is contained in:
parent
991a205ebd
commit
0f3bd57101
3 changed files with 24 additions and 4 deletions
|
@ -10,3 +10,20 @@
|
|||
(let ((buf (get-buffer "*Racket REPL*")))
|
||||
(bury-buffer buf)
|
||||
buf)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +racket-lookup-documentation (thing)
|
||||
"A `+lookup/documentation' handler for Racket."
|
||||
(let ((buf (if racket-xp-mode
|
||||
(racket-xp-describe thing)
|
||||
(racket-repl-describe thing))))
|
||||
(when buf
|
||||
(pop-to-buffer buf)
|
||||
t)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +racket-lookup-definition (_thing)
|
||||
"A `+lookup/definition' handler for Racket."
|
||||
(if racket-xp-mode
|
||||
(call-interactively #'racket-xp-visit-definition)
|
||||
(call-interactively #'racket-repl-visit-definition)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue