Disable flycheck in racket-xp-mode

Plus minor refactors.

Closes #3594

Co-authored-by: sorawee <sorawee@users.noreply.github.com>
This commit is contained in:
Henrik Lissner 2020-07-26 15:08:28 -04:00
parent 0f39d7bda4
commit e6979166ee
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 36 additions and 26 deletions

View file

@ -13,7 +13,7 @@
;;;###autoload
(defun +racket-lookup-documentation (thing)
"A `+lookup/documentation' handler for Racket."
"A `+lookup/documentation' handler for `racket-mode' and `racket-xp-mode'."
(let ((buf (if racket-xp-mode
(racket-xp-describe thing)
(racket-repl-describe thing))))
@ -23,7 +23,8 @@
;;;###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)))
"A `+lookup/definition' handler for `racket-mode' and `racket-xp-mode'."
(call-interactively
(if racket-xp-mode
#'racket-xp-visit-definition
#'racket-repl-visit-definition)))

View file

@ -28,39 +28,48 @@
#'highlight-quoted-mode)
(when (featurep! +xp)
(add-hook 'racket-mode-hook #'racket-xp-mode))
(add-hook 'racket-mode-local-vars-hook #'racket-xp-mode)
;; Both flycheck and racket-xp produce error popups, but racket-xp's are
;; higher quality so disable flycheck's:
(when (featurep! :checkers syntax)
(add-hook! 'racket-xp-mode-hook
(defun +racket-disable-flycheck-h ()
(flycheck-disable-checker 'racket)))))
(unless (or (featurep! :editor parinfer)
(featurep! :editor lispy))
(add-hook 'racket-mode-hook #'racket-smart-open-bracket-mode))
(map! :localleader
:map racket-mode-map
"a" #'racket-align
"A" #'racket-unalign
"f" #'racket-fold-all-tests
"F" #'racket-unfold-all-tests
"h" #'racket-doc
"i" #'racket-unicode-input-method-enable
"l" #'racket-logger
"o" #'racket-profile
"p" #'racket-cycle-paren-shapes
"r" #'racket-run
"R" #'racket-run-and-switch-to-repl
"t" #'racket-test
"u" #'racket-backward-up-list
"y" #'racket-insert-lambda
(:prefix ("m" . "macros")
(map! (:map racket-xp-mode-map
[remap next-error] #'racket-xp-next-error
[remap previous-error] #'racket-xp-previous-error)
(:localleader
:map racket-mode-map
"a" #'racket-align
"A" #'racket-unalign
"f" #'racket-fold-all-tests
"F" #'racket-unfold-all-tests
"h" #'racket-doc
"i" #'racket-unicode-input-method-enable
"l" #'racket-logger
"o" #'racket-profile
"p" #'racket-cycle-paren-shapes
"r" #'racket-run
"R" #'racket-run-and-switch-to-repl
"t" #'racket-test
"u" #'racket-backward-up-list
"y" #'racket-insert-lambda
(:prefix ("m" . "macros")
"d" #'racket-expand-definition
"e" #'racket-expand-last-sexp
"r" #'racket-expand-region
"a" #'racket-expand-again)
(:prefix ("g" . "goto")
(:prefix ("g" . "goto")
"b" #'racket-unvisit
"d" #'racket-visit-definition
"m" #'racket-visit-module
"r" #'racket-open-require-path)
(:prefix ("s" . "send")
(:prefix ("s" . "send")
"d" #'racket-send-definition
"e" #'racket-send-last-sexp
"r" #'racket-send-region)))
"r" #'racket-send-region))))