[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode ad09b3be7f 066/500: Fix flycheck errors.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode ad09b3be7f 066/500: Fix flycheck errors. |
Date: |
Sat, 29 Jan 2022 08:26:36 -0500 (EST) |
branch: elpa/nix-mode
commit ad09b3be7f30b4b929736c18ebb9fce4896e0bf7
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>
Fix flycheck errors.
---
nix-mode.el | 79 +++++++++++++++++++++++++++++++------------------------------
1 file changed, 40 insertions(+), 39 deletions(-)
diff --git a/nix-mode.el b/nix-mode.el
index bb19472a2e..67a211aec0 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -119,7 +119,7 @@
(put-text-property start (1+ start)
'syntax-table (string-to-syntax "|"))
(put-text-property start (+ start 2)
- 'nix-syntax-antiquote t))))
+ 'nix-syntax-antiquote t))))
(defun nix-syntax-propertize-close-brace ()
"Set syntax properties for close braces.
@@ -158,55 +158,56 @@ If a close brace `}' ends an antiquote, the next
character begins a string."
(defun nix-indent-level-parens ()
"Find indent level based on parens."
- (setq n 0)
(save-excursion
(beginning-of-line)
- (setq p1 (point))
- (setq p2 (nth 1 (syntax-ppss)))
+ (let ((p1 (point))
+ (p2 (nth 1 (syntax-ppss)))
+ (n 0))
- (if (eq p2 1)
- (setq n (1+ n)))
+ (if (eq p2 1)
+ (setq n (1+ n)))
- (while (and p2 (not (eq p2 1)))
- (goto-char p2)
- (backward-char)
- (let ((l1 (line-number-at-pos p1))
- (l2 (line-number-at-pos p2)))
- (if (not (eq l1 l2))
- (setq n (+ n 1))))
- (setq p1 p2)
- (setq p2 (nth 1 (syntax-ppss)))))
+ (while (and p2 (not (eq p2 1)))
+ (goto-char p2)
+ (backward-char)
+ (let ((l1 (line-number-at-pos p1))
+ (l2 (line-number-at-pos p2)))
+ (if (not (eq l1 l2))
+ (setq n (+ n 1))))
+ (setq p1 p2)
+ (setq p2 (nth 1 (syntax-ppss))))
- n)
+ n)))
(defun nix-indent-level-let ()
+ "Get indent level based on # of let statements."
(save-excursion
- (setq lets 0)
- (setq ins 0)
(beginning-of-line)
- (while (not (eq (point) (point-min)))
- (forward-line -1)
- (cond
- ((and
- (or
- (looking-at "[[:space:]]*let$")
- (looking-at "[[:space:]]*let[[:space:]]")
- (looking-at ".*[[:space:]]let$"))
- (not
- (or
- (looking-at ".*[[:space:]]in$")
- (looking-at ".*[[:space:]]in[[:space:]]"))))
- (setq lets (1+ lets)))
- ((or
- (looking-at "^in$")
- (looking-at "^in[[:space:]]")
- (looking-at "[[:space:]]+in$")
- (looking-at "[[:space:]]+in[[:space:]]"))
- (setq ins (1+ ins)))))
-
- (- lets ins)))
+ (let ((lets 0)
+ (ins 0))
+ (while (not (eq (point) (point-min)))
+ (forward-line -1)
+ (cond
+ ((and
+ (or
+ (looking-at "[[:space:]]*let$")
+ (looking-at "[[:space:]]*let[[:space:]]")
+ (looking-at ".*[[:space:]]let$"))
+ (not
+ (or
+ (looking-at ".*[[:space:]]in$")
+ (looking-at ".*[[:space:]]in[[:space:]]"))))
+ (setq lets (1+ lets)))
+ ((or
+ (looking-at "^in$")
+ (looking-at "^in[[:space:]]")
+ (looking-at "[[:space:]]+in$")
+ (looking-at "[[:space:]]+in[[:space:]]"))
+ (setq ins (1+ ins)))))
+
+ (- lets ins))))
(defun nix-indent-level-is-closing ()
"Go forward from beginning of line."
- [nongnu] elpa/nix-mode 233bf03b96 040/500: Add nixfmt command., (continued)
- [nongnu] elpa/nix-mode 233bf03b96 040/500: Add nixfmt command., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ff550f9bbd 036/500: Add comments., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ea95e3c9c6 068/500: Add nix-prettify-mode.el., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 6eaf2a97d2 069/500: Fixup hanging indent., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e53d99d840 064/500: Ignore '* chars in syntax propertize., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 9b705381c4 063/500: Fix antiquote highlighting., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 0624820fd3 067/500: Fix org-mode fontification error., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 3338f5997e 056/500: Fix beginning of buffer issue, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 0f01eecdaa 050/500: Make sure everything starts at beginning of line., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 03f462ef34 062/500: Add "+" to hanging indent list., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ad09b3be7f 066/500: Fix flycheck errors.,
ELPA Syncer <=
- [nongnu] elpa/nix-mode 6534f146eb 065/500: Formatting, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 5a29112764 073/500: Add function for escaped antiquote., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 460cc23161 075/500: Make " be treated as generic | syntax class., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ff8409c617 079/500: Declare lexical-binding, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 6a9cb7e682 081/500: Add basic REPL via nix-repl, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 836e14fdd4 093/500: Merge pull request #12 from matthewbauer/case-sensitive-searching, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ea23a301d7 086/500: Fontification.., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode f309e106ef 090/500: Revert "Make " be treated as generic | syntax class.", ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 64d615d628 096/500: Add nix-mode-mmm, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode f968cb98ef 097/500: Add nix-buffer., ELPA Syncer, 2022/01/29