Skip to content

Commit 23d99bf

Browse files
authored
Merge pull request #62 from Hi-Angel/improve-indentation-config-msg
Improve indentation config msg
2 parents 89ca23a + c5ed55a commit 23d99bf

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

README.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,16 @@ and recommended installation method.
6868
Basic Configuration
6969
-------------------
7070
71-
For setup instructions, please consult the new integrated purescript-mode
72-
[Info](https://www.gnu.org/software/texinfo/manual/info/info.html)
73-
manual which can be accessed after installation via
74-
`M-x info-display-manual [RET] purescript-mode`.
75-
76-
Support
77-
-------
78-
79-
- [Github homepage](https://github.com/purescript-emacs/purescript-mode)
80-
81-
Contributing
82-
------------
83-
84-
Please make sure your pull requests are at least properly rebased and up to date.
71+
PureScript mode provides multiple indentation engines, and leaves the choice up to the user. To have indentation an according indentation mode needs to be enabled. Otherwise, attempting to indent will print an error describing this.
72+
73+
Minimal configuration may look something like:
74+
75+
```lisp
76+
(use-package purescript-mode
77+
:defer t
78+
:config
79+
(defun myhook-purescript-mode ()
80+
(turn-on-purescript-indentation)
81+
(add-hook 'before-save-hook #'purescript-sort-imports nil t))
82+
(add-hook 'purescript-mode-hook #'myhook-purescript-mode))
83+
```

purescript-mode.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,10 @@ is asked to show extra info for the items matching QUERY.."
407407
has been selected.
408408
409409
Brings up the documentation for purescript-mode-hook."
410-
(describe-variable 'purescript-mode-hook))
410+
(error
411+
"To use indentation you need to turn-on one of the indentation modes. Please see `purescript-mode-hook' documentation for examples.
412+
413+
Currently `purescript-indentation' is the most maintained mode."))
411414

412415
(defun purescript-mode-format-imports ()
413416
"Format the imports by aligning and sorting them."

0 commit comments

Comments
 (0)