[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode 56a87c8d81 087/500: Move nix-flycheck to separate
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode 56a87c8d81 087/500: Move nix-flycheck to separate file. |
Date: |
Sat, 29 Jan 2022 08:26:38 -0500 (EST) |
branch: elpa/nix-mode
commit 56a87c8d81a6f640eeb151adb3b1ba6ec9636cd0
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>
Move nix-flycheck to separate file.
---
nix-flycheck.el | 39 +++++++++++++++++++++++++++++++++++++++
nix-mode.el | 42 ++----------------------------------------
2 files changed, 41 insertions(+), 40 deletions(-)
diff --git a/nix-flycheck.el b/nix-flycheck.el
new file mode 100644
index 0000000000..1a61e5fd1e
--- /dev/null
+++ b/nix-flycheck.el
@@ -0,0 +1,39 @@
+;;; Flycheck
+
+(require 'flycheck)
+
+(defconst nix-err-msg-re
+ "error: \\(.*\\) at \\(.*\\):\\([0-9]+\\):\\([0-9]+\\)")
+
+(defun nix--parse-errors (output checker buffer)
+ (with-temp-buffer
+ (insert output)
+ (goto-char (point-min))
+ (let ((errs '()))
+ (while (search-forward-regexp nix-err-msg-re nil t 1)
+ (let* ((file (match-string 2))
+ (line (string-to-number (match-string 3)))
+ (col (string-to-number (match-string 4)))
+ (msg (match-string 1)))
+ (setq errs
+ (cons (flycheck-error-new-at
+ line col 'error msg
+ :filename (and (not (string= file "(string)")) file)
+ :checker checker
+ :buffer buffer)
+ errs))))
+ errs)))
+
+(flycheck-def-args-var flycheck-nix-args (nix))
+
+(flycheck-define-checker nix
+ "A syntax and evaluation checker for Nix using
nix-instantiate."
+ :command ("nix-instantiate" "--eval" "--strict"
"--show-trace" (eval flycheck-nix-args) "-")
+ :standard-input t
+ :error-parser nix--parse-errors
+ :modes (nix-mode)
+ )
+
+(add-to-list 'flycheck-checkers 'nix)
+
+(provide 'nix-flycheck)
diff --git a/nix-mode.el b/nix-mode.el
index 8153293763..8e1d309a7c 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -16,7 +16,6 @@
;;; Code:
(require 'company)
-(require 'flycheck)
;; Emacs 24.2 compatability
(unless (fboundp 'setq-local)
@@ -176,41 +175,6 @@ If a close brace `}' ends an antiquote, the next character
begins a string."
(0 (ignore (nix-syntax-propertize-close-brace)))))
start end))
-;;; Flycheck
-
-(defconst nix-err-msg-re
- "error: \\(.*\\) at \\(.*\\):\\([0-9]+\\):\\([0-9]+\\)")
-
-(defun nix--parse-errors (output checker buffer)
- (with-temp-buffer
- (insert output)
- (goto-char (point-min))
- (let ((errs '()))
- (while (search-forward-regexp nix-err-msg-re nil t 1)
- (let* ((file (match-string 2))
- (line (string-to-number (match-string 3)))
- (col (string-to-number (match-string 4)))
- (msg (match-string 1)))
- (setq errs
- (cons (flycheck-error-new-at
- line col 'error msg
- :filename (and (not (string= file "(string)")) file)
- :checker checker
- :buffer buffer)
- errs))))
- errs)))
-
-(flycheck-def-args-var flycheck-nix-args (nix))
-
-(flycheck-define-checker nix
- "A syntax and evaluation checker for Nix using nix-instantiate."
- :command ("nix-instantiate" "--eval" "--strict" "--show-trace" (eval
flycheck-nix-args) "-")
- :standard-input t
- :error-parser nix--parse-errors
- :modes (nix-mode)
- )
-
-(add-to-list 'flycheck-checkers 'nix)
;;; REPL
@@ -529,6 +493,8 @@ If a close brace `}' ends an antiquote, the next character
begins a string."
(nix-create-keymap)
(nix-create-menu)
+(when (featurep 'flycheck) (require 'nix-flycheck))
+
;;;###autoload
(define-derived-mode nix-mode prog-mode "Nix"
"Major mode for editing Nix expressions.
@@ -583,10 +549,6 @@ The hook `nix-mode-hook' is run when Nix mode is started.
(easy-menu-add nix-mode-menu nix-mode-map)
- ;; Flycheck
- (flycheck-select-checker 'nix)
- (flycheck-mode)
-
;; Company
(add-to-list 'company-backends 'company-nix)
(company-mode))
- [nongnu] elpa/nix-mode f77ae8fb54 380/500: Add more builtins, (continued)
- [nongnu] elpa/nix-mode f77ae8fb54 380/500: Add more builtins, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e4e604ae3a 389/500: Release 1.4.4, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 228f9f9d39 387/500: Release 1.4.3, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode bdfe3b3ae3 391/500: Fix nix-get-completions, add to nix-repl-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 70af0efc9f 076/500: Fix antiquote closing brace., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 59e9ca0abd 084/500: Improve fontification, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 68793d91c5 107/500: Add require 'cl for case statements., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 2221a09aea 108/500: Require 'cl for "case"., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e4bc711d81 094/500: Add some more modes., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e1f2e24cc4 104/500: Move separate modes into own files., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 56a87c8d81 087/500: Move nix-flycheck to separate file.,
ELPA Syncer <=
- [nongnu] elpa/nix-mode 199e20413e 102/500: Ignore comments for hanging let's., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode fcbaf3e054 106/500: Rename flycheck mode to "nix-flycheck"., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 542ae77358 110/500: buffer-substring can't bet <1., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 3e6fdd8311 112/500: Add back syntax coloring of antiquotes., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 66cc5478de 113/500: Merge branch 'master' into separate-files, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 0fd152e118 119/500: Merge pull request #22 from ljli/various, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 04a268a6fe 126/500: Remove "let" handling of indent., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1a4c98fcf7 118/500: Cosmetics, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 23bdbdf21f 124/500: Add custom mmm-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e413069e02 130/500: Fixup some corner cases in indentation, ELPA Syncer, 2022/01/29