mirror of
https://github.com/anoma/juvix.git
synced 2024-12-11 08:25:46 +03:00
Add emacs option minijuvix-disable-embedded-stdlib
(#247)
When developing the stdlib or any other project that doesn't use the embedded standard library, the `--no-stdlib` flag must be set on the compiler commands. This PR adds a config option `minijuvix-disable-embedded-stdlib` to set `--no-stdlib` for highlight and flycheck.
This commit is contained in:
parent
56e75e58f9
commit
66d7d1beef
@ -1,4 +1,5 @@
|
||||
(require 'flycheck)
|
||||
(require 'minijuvix-customize)
|
||||
|
||||
(defgroup flycheck-minijuvix nil
|
||||
"MiniJuvix support for Flycheck."
|
||||
@ -9,7 +10,8 @@
|
||||
(flycheck-define-checker minijuvix
|
||||
"A MiniJuvix syntax checker."
|
||||
:command ("minijuvix" "microjuvix" "typecheck" "--only-errors" "--no-colors"
|
||||
source-original)
|
||||
(option-flag "--no-stdlib" minijuvix-disable-embedded-stdlib)
|
||||
source-original)
|
||||
:error-patterns
|
||||
(
|
||||
(error line-start (file-name) ":" line ":" column ": error:" (message (one-or-more (not "ת"))))
|
||||
|
12
minijuvix-mode/minijuvix-customize.el
Normal file
12
minijuvix-mode/minijuvix-customize.el
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
(defcustom minijuvix-auto-input-method t
|
||||
"Automatically set the input method in minijuvix files."
|
||||
:type 'boolean
|
||||
:group 'minijuvix)
|
||||
|
||||
(defcustom minijuvix-disable-embedded-stdlib nil
|
||||
"Disable the embedded standard library."
|
||||
:type 'boolean
|
||||
:group 'minijuvix)
|
||||
|
||||
(provide 'minijuvix-customize)
|
@ -1,3 +1,4 @@
|
||||
(require 'minijuvix-customize)
|
||||
(require 'minijuvix-highlight)
|
||||
(require 'minijuvix-input)
|
||||
(require 'flycheck-minijuvix)
|
||||
@ -17,11 +18,6 @@
|
||||
;;;###autoload
|
||||
(add-to-list 'auto-mode-alist '("\\.m?juvix\\'" . minijuvix-mode))
|
||||
|
||||
(defcustom minijuvix-auto-input-method t
|
||||
"Automatically set the input method in minijuvix files."
|
||||
:type 'boolean
|
||||
:group 'minijuvix)
|
||||
|
||||
(define-derived-mode minijuvix-mode prog-mode "MiniJuvix"
|
||||
|
||||
(font-lock-mode 0)
|
||||
@ -52,7 +48,7 @@
|
||||
(interactive)
|
||||
(save-buffer)
|
||||
(minijuvix-clear-annotations)
|
||||
(eval (read (shell-command-to-string (concat "minijuvix highlight " (buffer-file-name)))))
|
||||
(eval (read (shell-command-to-string (concat "minijuvix highlight " (if minijuvix-disable-embedded-stdlib "--no-stdlib " "") (buffer-file-name)))))
|
||||
(save-buffer)
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user