[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode cc23fd6a0e 206/500: Default to indent-relative
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode cc23fd6a0e 206/500: Default to indent-relative |
Date: |
Sat, 29 Jan 2022 08:27:06 -0500 (EST) |
branch: elpa/nix-mode
commit cc23fd6a0e394aeeed603e2bfeb4a5ebc63db660
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>
Default to indent-relative
nix-indent-function is still not ready for default. Too many bugs with
let ... in and parameters. Help wanted! I don’t have enough Emacs
parsing knowledge to do this. Haskell is able to get good indentation
with a similar syntax to Nix, so I know it’s possible.
---
nix-mode.el | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/nix-mode.el b/nix-mode.el
index 1c18eb326c..5b52684064 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -22,6 +22,16 @@
"Nix-related customizations"
:group 'languages)
+(defcustom nix-indent-function 'indent-relative
+ "The function to use to indent.
+
+Valid functions for this are:
+
+- indent-relative
+- nix-indent-line (buggy)"
+ :group 'nix
+ :type 'function)
+
(defgroup nix-mode nil
"Nix mode customizations"
:group 'nix)
@@ -406,6 +416,7 @@ STRING-TYPE type of string based off of Emacs syntax table
types"
(* tab-width (+ (nix-indent-level-parens)
(if (nix-indent-level-is-closing) -1 0)))))
+;;;###autoload
(defun nix-indent-line ()
"Indent current line in a Nix expression."
(interactive)
@@ -513,7 +524,7 @@ The hook `nix-mode-hook' is run when Nix mode is started.
(setq-local parse-sexp-lookup-properties t)
;; Automatic indentation [C-j]
- (setq-local indent-line-function 'nix-indent-line)
+ (setq-local indent-line-function nix-indent-function)
;; Indenting of comments
(setq-local comment-start "# ")
- [nongnu] elpa/nix-mode 2a24b400b6 485/500: chore: Bump install-nix-action to v14.1, (continued)
- [nongnu] elpa/nix-mode 2a24b400b6 485/500: chore: Bump install-nix-action to v14.1, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ce7996c6e7 476/500: nix-flake: Cosmetics, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 3d4f24b2b6 472/500: nix-flake: Allow switching the flake inside nix-flake-dispatch, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 5fb9df6f69 497/500: chore(deps): bump cachix/install-nix-action from 14.1 to 16, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 687665a6b0 001/500: Initial commit, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e6b9f1b939 016/500: Add menu bar., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ae68b456f8 022/500: Refactor font lock, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7b47e2b4bc 042/500: Fix formatting., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 570d60d460 045/500: Rewrite nix-indent-level-parens with while loop., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 8a65262d37 200/500: Remove smartparens feature detection, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode cc23fd6a0e 206/500: Default to indent-relative,
ELPA Syncer <=
- [nongnu] elpa/nix-mode 9f4f5d5860 204/500: Checkdoc of elisp, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode be7184ffcd 209/500: use tab-width instead of hardcoded '2', ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 5a8b334c75 212/500: Merge pull request #42 from serokell/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode b8aed79f89 211/500: No need to indent on = and ; (ruins your day), ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 81680dd7ac 213/500: nix-repl.el: make it work with newer nix repl command, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode a8af6e9203 218/500: Find nix executables at start, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode d6286ce43b 235/500: Add pcomplete support to nix.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode dd49386cc7 240/500: Remove global-nix-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1be3ca4666 245/500: Clean up nix-shell.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 4ef5d77214 246/500: Add user manual, ELPA Syncer, 2022/01/29