@@ -291,6 +291,20 @@ Call ORIG-FN with ARGS and suppress the output. Usage:
291
291
(quiet! (apply orig-fn args)))
292
292
#+end_src
293
293
294
+ Easily define REPL functions.
295
+ #+begin_src emacs-lisp :tangle yes
296
+ (defmacro define-repl (fn-name buffer-name command &rest args)
297
+ "Define a REPL function named FN-NAME running COMMAND inside BUFFER-NAME."
298
+ (let ((repl-buffer (concat "*" buffer-name "*")))
299
+ `(defun ,fn-name ()
300
+ ,(format "Run an inferior instance of %s inside Emacs." command)
301
+ (interactive)
302
+ (let ((buffer (get-buffer-create ,repl-buffer)))
303
+ (unless (comint-check-proc ,repl-buffer)
304
+ (apply 'make-comint-in-buffer ,buffer-name buffer ,command nil ,args))
305
+ (pop-to-buffer buffer)))))
306
+ #+end_src
307
+
294
308
*** Display
295
309
#+begin_src emacs-lisp :tangle yes
296
310
(defun display-ctrl-M-as-newline ()
@@ -3108,6 +3122,8 @@ Elm and elm-mode seems unmaintained at the moment, so I disable this.
3108
3122
:hook
3109
3123
(go-ts-mode-hook . eglot-ensure)
3110
3124
(go-ts-mode-hook . go-ts-mode-set-devdocs)
3125
+ :preface
3126
+ (define-repl go-repl "Go REPL" "gore")
3111
3127
:config
3112
3128
(defun go-ts-mode-set-devdocs ()
3113
3129
(setq-local devdocs-current-docs '("go")))
@@ -3117,6 +3133,9 @@ Elm and elm-mode seems unmaintained at the moment, so I disable this.
3117
3133
(with-eval-after-load 'apheleia
3118
3134
(cl-pushnew '(go-ts-mode . goimports) apheleia-mode-alist :test #'equal))
3119
3135
3136
+ (with-eval-after-load 'repl-toggle
3137
+ (cl-pushnew '(go-ts-mode . go-repl) rtog/mode-repl-alist :test #'equal))
3138
+
3120
3139
(cl-pushnew '("\\([^/]+\\)\\.go\\'" "\\1_test.go") find-sibling-rules :test #'equal)
3121
3140
(cl-pushnew '("\\([^/]+\\)_test\\.go\\'" "\\1.go") find-sibling-rules :test #'equal))
3122
3141
#+end_src
@@ -3134,17 +3153,6 @@ Elm and elm-mode seems unmaintained at the moment, so I disable this.
3134
3153
("C-. t t" . go-test-current-test)))
3135
3154
#+end_src
3136
3155
3137
- **** gorepl-mode
3138
- #+begin_src emacs-lisp :tangle yes
3139
- (use-package gorepl-mode
3140
- :ensure t
3141
- :hook
3142
- (go-ts-mode-hook . gorepl-mode)
3143
- :init
3144
- (with-eval-after-load 'repl-toggle
3145
- (cl-pushnew '(go-ts-mode . gorepl-run) rtog/mode-repl-alist :test #'equal)))
3146
- #+end_src
3147
-
3148
3156
** groovy
3149
3157
#+begin_src emacs-lisp :tangle yes
3150
3158
(use-package groovy-mode
@@ -3400,7 +3408,7 @@ Pretty check-boxes
3400
3408
(nix-ts-mode-hook . nix-ts-mode-set-devdocs)
3401
3409
:init
3402
3410
(with-eval-after-load 'apheleia
3403
- (cl-pushnew '(nix-mode . nix) apheleia-mode-alist :test #'equal))
3411
+ (cl-pushnew '(nix-ts- mode . nix) apheleia-mode-alist :test #'equal))
3404
3412
(with-eval-after-load 'grugru
3405
3413
(grugru-define-on-major-mode 'nix-mode 'symbol '("true" "false")))
3406
3414
(with-eval-after-load 'repl-toggle
@@ -4284,7 +4292,6 @@ I am trying to reduce the amount of custom keybindings, therefore I present a ta
4284
4292
- fish-mode
4285
4293
- flymake-racket
4286
4294
- focus
4287
- - gorepl-mode
4288
4295
- gotest
4289
4296
- gradle-mode
4290
4297
- groovy-mode
0 commit comments