]> git.eshelyaron.com Git - emacs.git/commit
Add electric indent for preproc directives
authorTheodor Thornhill <theo@thornhill.no>
Wed, 15 Feb 2023 20:05:37 +0000 (21:05 +0100)
committerTheodor Thornhill <theo@thornhill.no>
Thu, 16 Feb 2023 18:52:06 +0000 (19:52 +0100)
commitf1f571e72ae10285762d3a941e56f7c4048272af
tree2c4015f070ba1653918a9c9d368044518ca08af7
parent83af806ab7cce7f9d9e184410a9c6921aa5de936
Add electric indent for preproc directives

It looks like there are few if no other cases where we get this
particular error in the AST than with insertion of '#'.

Consider:

```
int
main()
{
  |
}
```

If we only add '#' the AST yields (ERROR (ERROR)), which we can
exploit to hook onto electric indent.  The end result should be the
hashtag anchored to column 0.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): New rule.
(c-ts-base-mode): Add # to electric-indent-chars.
lisp/progmodes/c-ts-mode.el