fix(emacs): add racket-mode functionality for single-buffer workflows
Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
parent
0b4192c9ea
commit
5df0d653d1
1 changed files with 23 additions and 1 deletions
|
@ -3,17 +3,39 @@
|
||||||
;; Configuration for Racket and Racket-based languages, including Pollen.
|
;; Configuration for Racket and Racket-based languages, including Pollen.
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
(require 'racket-mode)
|
||||||
|
(require 'racket-edit)
|
||||||
|
|
||||||
(add-to-list 'load-path (expand-file-name "lisp/pollen-mode" user-emacs-directory))
|
(add-to-list 'load-path (expand-file-name "lisp/pollen-mode" user-emacs-directory))
|
||||||
(autoload 'pollen-mode "pollen" "A major mode for the pollen preprocessor." t)
|
(autoload 'pollen-mode "pollen" "A major mode for the pollen preprocessor." t)
|
||||||
|
|
||||||
|
(defun racket-repl-switch ()
|
||||||
|
"Switch to the Racket REPL."
|
||||||
|
(interactive)
|
||||||
|
(racket-edit-switch-to-repl)
|
||||||
|
(unless (equal current-prefix-arg nil)
|
||||||
|
(delete-other-windows)))
|
||||||
|
|
||||||
|
(defun racket-edit-switch ()
|
||||||
|
"Switch to the corresponding racket buffer."
|
||||||
|
(interactive)
|
||||||
|
(racket-repl-switch-to-edit)
|
||||||
|
(unless (equal current-prefix-arg nil)
|
||||||
|
(delete-other-windows)))
|
||||||
|
|
||||||
;; Recognize pollen filetypes
|
;; Recognize pollen filetypes
|
||||||
(setq auto-mode-alist (cons '("\\.pp$" . racket-mode) auto-mode-alist))
|
(setq auto-mode-alist (cons '("\\.pp$" . racket-mode) auto-mode-alist))
|
||||||
(setq auto-mode-alist (cons '("\\.pm$" . pollen-mode) auto-mode-alist))
|
(setq auto-mode-alist (cons '("\\.pm$" . pollen-mode) auto-mode-alist))
|
||||||
(setq auto-mode-alist (cons '("\\.pmd$" . pollen-mode) auto-mode-alist))
|
(setq auto-mode-alist (cons '("\\.pmd$" . pollen-mode) auto-mode-alist))
|
||||||
|
|
||||||
|
(defun configure-racket ()
|
||||||
|
"Configure keybinds for racket buffers."
|
||||||
|
(keymap-local-set "C-c C-z" #'racket-repl-switch))
|
||||||
|
|
||||||
(defun configure-racket-repl ()
|
(defun configure-racket-repl ()
|
||||||
"Configure keybinds for the racket repl."
|
"Configure keybinds for the racket repl."
|
||||||
(keymap-local-set "C-c C-k" #'racket-repl-clear-leaving-last-prompt))
|
(keymap-local-set "C-c C-k" #'racket-repl-clear-leaving-last-prompt)
|
||||||
|
(keymap-local-set "C-c C-z" #'racket-edit-switch))
|
||||||
|
|
||||||
(add-hook 'racket-repl-mode-hook #'configure-racket-repl)
|
(add-hook 'racket-repl-mode-hook #'configure-racket-repl)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue