mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
* Fix visit docs for Racket & support racket-xp - Fix Racket's +lookup/documentation in the same way as https://github.com/hlissner/doom-emacs/commit/f20f477a44138d3bc8b - 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
30 lines
880 B
EmacsLisp
30 lines
880 B
EmacsLisp
;;; lang/racket/autoload.el -*- lexical-binding: t; -*-
|
|
|
|
;;;###autoload
|
|
(defun +racket/open-repl ()
|
|
"Open the Racket REPL."
|
|
(interactive)
|
|
(pop-to-buffer
|
|
(or (get-buffer "*Racket REPL*")
|
|
(progn (racket-run-and-switch-to-repl)
|
|
(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)))
|