Re: c-ts-mode: How to set indent-style in dir-locals
Michael Heerdegen via Users list for the GNU Emacs text editor <[email protected]> Tue, 19 May 2026 00:57:35 +0200
| Newsgroups | gmane.emacs.help |
|---|---|
| Message-ID | <[email protected]> |
Stéphane Marks <[email protected]> writes: > It might be worth trying and adapting something like this in your > .dir-locals.el or .dir-locals-2.el file: > > ( > (c-mode . ((eval . (setopt-local c-ts-mode-indent-style 'bsd)))) > ) > > 'setopt-local' is new in Emacs 31. I don't know if this will behave as expected (I guess not), since the custom setter loops over all buffers (`c-ts-mode--indent-style-setter'). But it looks like all you have to do for a single buffer is calling `c-ts-mode-set-style'? That's what that setter does. Michael.