Skip to content

Commit

Permalink
chore: expand default list of excluded modes
Browse files Browse the repository at this point in the history
Adds additional modes which do not behave in a predictable way when
indent-region is called on them, due to indentation having syntactical
importance.
  • Loading branch information
jimeh authored and jeffvalk committed Jun 25, 2023
1 parent 4063420 commit 2b8000f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ To configure via `use-package`, adapt the following example as desired:

### Customization

| Variable | Type | Default | Description |
|:-----------------------------|:-----------------|:----------------------------------------------------------------------------------------------|:----------------------------------------------|
| `snap-indent-excluded-modes` | symbol list | `'(elm-mode haskell-mode makefile-gmake-mode makefile-mode occam-mode python-mode yaml-mode)` | Major modes in which to ignore activation |
| `snap-indent-format` | function or list | `nil` | Additional formatting to apply when indenting |
| `snap-indent-on-save` | boolean | `nil` | Whether to indent the entire buffer on save |
| Variable | Type | Default | Description |
| :--------------------------- | :--------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------- |
| `snap-indent-excluded-modes` | symbol list | `(cmake-ts-mode coffee-mode conf-mode elm-mode haml-mode haskell-mode makefile-automake-mode makefile-bsdmake-mode makefile-gmake-mode makefile-imake-mode makefile-makepp-mode makefile-mode occam-mode python-mode python-ts-mode slim-mode yaml-mode yaml-ts-mode)` | Major modes in which to ignore activation |
| `snap-indent-format` | function or list | `nil` | Additional formatting to apply when indenting |
| `snap-indent-on-save` | boolean | `nil` | Whether to indent the entire buffer on save |

### Additional formatting

Expand Down
15 changes: 13 additions & 2 deletions snap-indent.el
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,24 @@
:prefix "snap-indent-"
:group 'indent)

(defcustom snap-indent-excluded-modes '(elm-mode
(defcustom snap-indent-excluded-modes '(cmake-ts-mode
coffee-mode
conf-mode
elm-mode
haml-mode
haskell-mode
makefile-automake-mode
makefile-bsdmake-mode
makefile-gmake-mode
makefile-imake-mode
makefile-makepp-mode
makefile-mode
occam-mode
python-mode
yaml-mode)
python-ts-mode
slim-mode
yaml-mode
yaml-ts-mode)
"Modes in which `snap-indent-mode' should not be activated.
This permits activation for `prog-mode' while excluding certain modes derived
from `prog-mode', for example."
Expand Down

0 comments on commit 2b8000f

Please sign in to comment.