emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/nix-mode ec19a472ec 318/500: Update documentation


From: ELPA Syncer
Subject: [nongnu] elpa/nix-mode ec19a472ec 318/500: Update documentation
Date: Sat, 29 Jan 2022 08:27:17 -0500 (EST)

branch: elpa/nix-mode
commit ec19a472ecc3eb6a3d05cfac288f75803697fd21
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>

    Update documentation
---
 CHANGELOG.md | 19 +++++++++++++------
 README.md    | 21 ++++++++++++++++++++-
 nix-mode.org | 28 +++++++++++++++++++++-------
 3 files changed, 54 insertions(+), 14 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index a9c0fab1fe..e438be6dc2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,21 +1,28 @@
 # Changelog
 
-## master
+## 1.4.0
 
-### New files
+### Changes
 
-* create CHANGELOG.md
+* Introduced SMIE indentation mode. It is now the default. The old
+  behavior can be restored by setting ‘nix-indent-function’ to
+  indent-relative.
 
-### Changes
+* Added the ‘nix-indent-region’ function to indent blocks of Nix
+  expressions. This can be used as a dumb formatter.
 
-## 2.0
+* Better testing has been added to make sure we handle more cases of
+  Nix indentation style.
+
+## 1.3.0
 
 * Added manual.
 
+* Create CHANGELOG.md
+
 ### New files
 
 * nix.el: customization settings for nix installation
-* 
 
 ## 1.2.1
 
diff --git a/README.md b/README.md
index 3a61edfcff..449d096742 100644
--- a/README.md
+++ b/README.md
@@ -4,12 +4,31 @@
 [![MELPA 
Stable](https://stable.melpa.org/packages/nix-mode-badge.svg)](https://stable.melpa.org/#/nix-mode)
 [![Build 
Status](https://travis-ci.com/NixOS/nix-mode.svg?branch=master)](https://travis-ci.com/NixOS/nix-mode)
 
-An emacs major mode for editing nix expressions.
+An emacs major mode for editing nix expressions. There is also a
+manual available at nix-mode.org.
 
 ## Submodes
 
 A quick list of what is provided.
 
+### nix-mode.el
+
+This is the main usage of nix-mode. This provides basic handling of
+.nix files. Syntax highlighting and indentation support using SMIE are
+provided. nix-mode can be used with the following snippet:
+
+~~~
+(require 'nix-mode)
+(add-to-list 'auto-mode-alist '("\\.nix\\'" . nix-mode))
+~~~
+
+or with use-package:
+
+~~~
+(use-package nix-mode
+  :mode "\\.nix\\'")
+~~~
+
 ### nix.el
 
 nix.el contains some miscellaneous tools for Nix developers.
diff --git a/nix-mode.org b/nix-mode.org
index ab33d2d73d..907127878b 100644
--- a/nix-mode.org
+++ b/nix-mode.org
@@ -91,7 +91,13 @@ recommended configuration,
 
 You can also use the traditional require usage, but use-package
 provides many useful helpers for our purposes. In the next sections,
-some of the things provided will be explained
+some of the things provided will be explained. This snippet will work
+to set up just nix-mode without use-package:
+
+#+BEGIN_SRC emacs-lisp
+(require 'nix-mode)
+(add-to-list 'auto-mode-alist '("\\.nix\\'" . nix-mode))
+#+END_SRC
 
 ** Modes
 
@@ -115,12 +121,15 @@ typing,
 M-x customize-variable RET nix-indent-function RET
 #+END_SRC
 
-To set it to the experimental indentation, set this value to the
-function, nix-indent-line. Note that there are major bugs that
-prevents this from becoming the default. Certain kinds of code
-involving lots of hanging indents will be incorrect. But, we welcome
-attempts to improve this experience! Please submit pull requests at
-https://github.com/NixOS/nix-mode/pulls.
+There are three possible values for nix-mode. They are:
+
+- indent-relative
+- smie-indent-line (default)
+- nix-indent-line
+
+Starting in version 1.4.0, SMIE is the default and it works very well
+(kudos to @j-piecuch on GitHub). You can restore the old behavior by
+setting =nix-indent-function= to =indent-relative=.
 
 *** nix-drv-mode
 
@@ -255,3 +264,8 @@ It is available at 
[[https://github.com/shlevy/nix-buffer][shlevy/nix-buffer]].
 
 @travisbhartwell also has some package dealing with Nix. They are
 available at 
[[https://github.com/travisbhartwell/nix-emacs][travisbhartwell/nix-emacs]].
+** Contributing
+
+Please submit pull requests at https://github.com/NixOS/nix-mode/pulls
+and issues at https://github.com/NixOS/nix-mode/issues. All
+contributions are welcome!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]