1
1
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:
Paul Cadman 2022-07-05 17:55:19 +01:00 committed by GitHub
parent 56e75e58f9
commit 66d7d1beef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 7 deletions

View File

@ -1,4 +1,5 @@
(require 'flycheck) (require 'flycheck)
(require 'minijuvix-customize)
(defgroup flycheck-minijuvix nil (defgroup flycheck-minijuvix nil
"MiniJuvix support for Flycheck." "MiniJuvix support for Flycheck."
@ -9,7 +10,8 @@
(flycheck-define-checker minijuvix (flycheck-define-checker minijuvix
"A MiniJuvix syntax checker." "A MiniJuvix syntax checker."
:command ("minijuvix" "microjuvix" "typecheck" "--only-errors" "--no-colors" :command ("minijuvix" "microjuvix" "typecheck" "--only-errors" "--no-colors"
source-original) (option-flag "--no-stdlib" minijuvix-disable-embedded-stdlib)
source-original)
:error-patterns :error-patterns
( (
(error line-start (file-name) ":" line ":" column ": error:" (message (one-or-more (not "ת")))) (error line-start (file-name) ":" line ":" column ": error:" (message (one-or-more (not "ת"))))

View 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)

View File

@ -1,3 +1,4 @@
(require 'minijuvix-customize)
(require 'minijuvix-highlight) (require 'minijuvix-highlight)
(require 'minijuvix-input) (require 'minijuvix-input)
(require 'flycheck-minijuvix) (require 'flycheck-minijuvix)
@ -17,11 +18,6 @@
;;;###autoload ;;;###autoload
(add-to-list 'auto-mode-alist '("\\.m?juvix\\'" . minijuvix-mode)) (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" (define-derived-mode minijuvix-mode prog-mode "MiniJuvix"
(font-lock-mode 0) (font-lock-mode 0)
@ -52,7 +48,7 @@
(interactive) (interactive)
(save-buffer) (save-buffer)
(minijuvix-clear-annotations) (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) (save-buffer)
) )