From 2b8000f419f24571464f78fd8538ef9f8ff004d6 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sat, 29 Apr 2023 13:34:07 +0100 Subject: [PATCH] chore: expand default list of excluded modes Adds additional modes which do not behave in a predictable way when indent-region is called on them, due to indentation having syntactical importance. --- README.md | 10 +++++----- snap-indent.el | 15 +++++++++++++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 947749c..5e32d0e 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/snap-indent.el b/snap-indent.el index 3f00770..c516bec 100644 --- a/snap-indent.el +++ b/snap-indent.el @@ -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."