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

View file

@ -28,13 +28,22 @@
#'highlight-quoted-mode) #'highlight-quoted-mode)
(when (featurep! +xp) (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) (unless (or (featurep! :editor parinfer)
(featurep! :editor lispy)) (featurep! :editor lispy))
(add-hook 'racket-mode-hook #'racket-smart-open-bracket-mode)) (add-hook 'racket-mode-hook #'racket-smart-open-bracket-mode))
(map! :localleader (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 :map racket-mode-map
"a" #'racket-align "a" #'racket-align
"A" #'racket-unalign "A" #'racket-unalign
@ -63,4 +72,4 @@
(:prefix ("s" . "send") (:prefix ("s" . "send")
"d" #'racket-send-definition "d" #'racket-send-definition
"e" #'racket-send-last-sexp "e" #'racket-send-last-sexp
"r" #'racket-send-region))) "r" #'racket-send-region))))