Skip to content

Improve indentation config msg #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,16 @@ and recommended installation method.
Basic Configuration
-------------------

For setup instructions, please consult the new integrated purescript-mode
[Info](https://www.gnu.org/software/texinfo/manual/info/info.html)
manual which can be accessed after installation via
`M-x info-display-manual [RET] purescript-mode`.

Support
-------

- [Github homepage](https://github.com/purescript-emacs/purescript-mode)

Contributing
------------

Please make sure your pull requests are at least properly rebased and up to date.
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.

Minimal configuration may look something like:

```lisp
(use-package purescript-mode
:defer t
:config
(defun myhook-purescript-mode ()
(turn-on-purescript-indentation)
(add-hook 'before-save-hook #'purescript-sort-imports nil t))
(add-hook 'purescript-mode-hook #'myhook-purescript-mode))
```
5 changes: 4 additions & 1 deletion purescript-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,10 @@ is asked to show extra info for the items matching QUERY.."
has been selected.

Brings up the documentation for purescript-mode-hook."
(describe-variable 'purescript-mode-hook))
(error
"To use indentation you need to turn-on one of the indentation modes. Please see `purescript-mode-hook' documentation for examples.

Currently `purescript-indentation' is the most maintained mode."))

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