[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode 84ee98019f 271/500: Skip over comments in indenta
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode 84ee98019f 271/500: Skip over comments in indentation |
Date: |
Sat, 29 Jan 2022 08:27:13 -0500 (EST) |
branch: elpa/nix-mode
commit 84ee98019fbb48854ebd57cc74848b7e7327a78c
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>
Skip over comments in indentation
---
nix-mode.el | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/nix-mode.el b/nix-mode.el
index 9b885a6736..821f53b5d3 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -53,6 +53,12 @@ Valid functions for this are:
:group 'nix-mode
:type '(repeat string))
+(defcustom nix-mode-comments
+ '("#" "/*" "*/")
+ "Regular expressions to consider comment codes."
+ :group 'nix-mode
+ :type '(repeat string))
+
(defgroup nix-faces nil
"Nix faces."
:group 'nix-mode
@@ -390,11 +396,15 @@ STRING-TYPE type of string based off of Emacs syntax
table types"
"Return regexp for matching string quotes."
(nix-mode-make-regexp nix-mode-quotes))
+(defun nix-mode-comments-regexp ()
+ "Return regexp for matching comments."
+ (nix-mode-make-regexp nix-mode-comments))
+
(defun nix-mode-combined-regexp ()
"Return combined regexp for matching items of interest."
- (nix-mode-make-regexp (append nix-mode-caps
- nix-mode-ends
- nix-mode-quotes)))
+ (nix-mode-make-regexp (append nix-mode-caps
+ nix-mode-ends
+ nix-mode-quotes)))
(defun nix-mode-search-backward ()
"Search backward for items of interest regarding indentation."
@@ -415,6 +425,9 @@ STRING-TYPE type of string based off of Emacs syntax table
types"
((looking-at (nix-mode-quotes-regexp))
;; skip over strings entirely
(re-search-backward (nix-mode-quotes-regexp) nil t))
+ ((looking-at (nix-mode-comments-regexp))
+ ;; skip over comments entirely
+ (re-search-backward (nix-mode-comments-regexp) nil t))
((looking-at (nix-mode-ends-regexp))
;; count the matched end
;; this means we expect to find at least one more cap
- [nongnu] elpa/nix-mode 54ef833100 294/500: Merge pull request #68 from etu/fix-recent-regressions, (continued)
- [nongnu] elpa/nix-mode 54ef833100 294/500: Merge pull request #68 from etu/fix-recent-regressions, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e8921b8a78 295/500: Prioritize closing } over regular indentation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 80a1e96c71 296/500: Merge branch 'grahamc-fix-issue-69', ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 53ea839a52 418/500: Replace javascript-mode with js-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode aae6f710e0 404/500: Address review comments, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode d27820b040 442/500: Merge pull request #131 from nagy/nix-process-refactor, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 5f44621864 474/500: nix-flake: Make the argument bindings more predictable, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode a18a226ce9 123/500: Add nix-mode tests., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 9e59bcf59e 216/500: Fix read only .drv file issue, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 8ab089b251 230/500: Set nix-shell-attribute, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 84ee98019f 271/500: Skip over comments in indentation,
ELPA Syncer <=
- [nongnu] elpa/nix-mode a30e88362a 290/500: Remove line that caused tests to not indent at all in the tests, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 82399e6bc3 305/500: Add missing check for '?' when lexing forward., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ec19a472ec 318/500: Update documentation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 75b907c767 328/500: Improve indentation of function bodies., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 78c3832e48 333/500: Make smie-setup optional, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 56748ac556 457/500: Merge pull request #136 from bcc32/replace-buffer-contents, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e61ecb95ef 456/500: Merge pull request #137 from bcc32/nix-format-before-save, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 0d65c482b2 477/500: nix-flake: Avoid use of flatten-list to support older Emacs versions, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 07b6069c78 491/500: nix-flake: Fix an unexpected error in assert, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 14f1bb20b9 487/500: chore: Bump install-nix-action to v14.1, ELPA Syncer, 2022/01/29