This commit is contained in:
Kit Dallege 2026-03-20 13:06:17 -07:00 committed by GitHub
commit ea32258afe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 5 deletions

View file

@ -62,14 +62,20 @@ Formatting is handled using the [[doom-module::editor format]] module via [[http
#+end_quote
** racket-smart-open-bracket-mode
~racket-smart-open-bracket-mode~ gets turned off automatically if you use
~parinfer~, ~lispy~. If you wish to enable it:
~racket-smart-open-bracket-mode~ is enabled by default (mimicking DrRacket's
behavior). It automatically inserts ~(~ or ~[~ based on the surrounding
syntactic context when you press ~[~. It is disabled automatically if you use
~parinfer~ or ~lispy~.
To disable it, set ~+racket-smart-open-bracket-mode~ to nil before racket-mode
loads:
#+begin_src emacs-lisp
;; in $DOOMDIR/config.el
(with-eval-after-load 'racket-mode
(add-hook 'racket-mode-hook #'racket-smart-open-bracket-mode))
(setq +racket-smart-open-bracket-mode nil)
#+end_src
To force a literal ~[~ without disabling the mode, use =C-q [=.
** Unicode Input
The optional ~racket-unicode~ input method lets you type unicode characters such
as λ or π. To enable unicode input for a single buffer, run

View file

@ -4,6 +4,16 @@
(after! projectile
(add-to-list 'projectile-project-root-files "info.rkt"))
(defvar +racket-smart-open-bracket-mode t
"If non-nil, enable `racket-smart-open-bracket-mode'.
This mode, inspired by DrRacket, automatically inserts `(' or `[' based on
the surrounding syntactic context when you press `['. It is disabled
automatically if `:editor parinfer' or `:editor lispy' is active.
Set this to nil to always insert the bracket you type. You can also use
`C-q [' to force a literal `[' without disabling this mode.")
;;
;;; Packages
@ -58,7 +68,8 @@
(cl-pushnew 'racket flycheck-disabled-checkers)))))
(unless (or (modulep! :editor parinfer)
(modulep! :editor lispy))
(modulep! :editor lispy)
(not +racket-smart-open-bracket-mode))
(add-hook mode-hook #'racket-smart-open-bracket-mode))
(map! (:map racket-xp-mode-map