Files
machine_setup/nix/configuration/roles/emacs/files/emacs/elisp/lang-d2.el
Tom Alexander 4a6cbfad67 Use lexical binding in elisp files.
This silences a warning for each of these files. Lexical binding will become the default in a future version of emacs.
2026-09-12 21:00:26 -04:00

18 lines
377 B
EmacsLisp

;; -*- lexical-binding: t; -*-
(defun d2-format-buffer ()
"Run prettier."
(interactive)
(run-command-on-buffer-require-output "d2" "fmt" "-")
)
(use-package d2-mode
:commands (d2-mode)
:hook (
(d2-mode . (lambda ()
(add-hook 'before-save-hook 'd2-format-buffer nil 'local)
))
)
)
(provide 'lang-d2)