Files
.emacs.d/modules/languages/siren-jsonnet.el
Jim Myhrberg fe6a4e7ce5 fix(elisp): add lexical-binding comment to all files to suppress new Emacs 31 warnings
I've set `lexical-binding` to `nil` in all Emacs Lisp files to suppress
the warnings introduced in Emacs 31 requiring all elisp files to have a
`lexical-binding` comment.

This retains the default behavior of dynamic binding when no
`lexical-binding` comment is present. With it set to `t` across the
board, various things break, and fixing those is a task for another day.
2025-06-29 12:23:03 +01:00

40 lines
1.1 KiB
EmacsLisp

;;; siren-jsonnet.el --- jimeh's Emacs Siren: jsonnet-mode configuration. -*- lexical-binding: nil; -*-
;;; Commentary:
;; Basic configuration for jsonnet-mode.
;;; Code:
(use-package jsonnet-mode
:general
(:keymaps 'jsonnet-mode-map
"C-c C-c" 'jsonnet-eval-buffer
"C-c C-f" 'jsonnet-reformat-buffer
"C-c C-j" 'jsonnet-jump)
:hook
(jsonnet-mode . siren-jsonnet-mode-setup)
:custom
(jsonnet-library-search-directories '("vendor"))
:preface
(defun siren-jsonnet-mode-setup ()
"Default tweaks for `jsonnet-mode'."
(jsonnet-format-buffer-on-save-mode t))
:config
(with-eval-after-load 'flycheck
(setq flycheck-jsonnet-executable "jsonnet -jpath vendor"))
(define-minor-mode jsonnet-format-buffer-on-save-mode
"Run jsonnet-format-buffer as a before-save-hook."
:lighter " fmt"
(if jsonnet-format-buffer-on-save-mode
(add-hook 'before-save-hook 'jsonnet-reformat-buffer t t)
(remove-hook 'before-save-hook 'jsonnet-reformat-buffer t))))
(provide 'siren-jsonnet)
;;; siren-js.el ends here