1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-12 09:00:40 -08:00
emacs/test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts
Yuan Fu b80f36b88c
Make c-ts-mode-set-style's effect local (bug#61245)
Now c-ts-mode-set-style's effect is local, and there is a new function
c-ts-mode-set-global-style that changes the global setting.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-style-setter): Use c-ts-mode-set-style.
(c-ts-mode-indent-style)
(c-ts-mode--prompt-for-style): Minor change in docstring.
(c-ts-mode-set-global-style): New function (from c-ts-mode-set-style).
(c-ts-mode-set-local-style): Remove function (became c-ts-mode-set-style).
(c-ts-mode-set-style): Renamed from c-ts-mode-set-local-style.
* test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts:
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Use
c-ts-mode-set-style.
2023-02-04 15:33:26 -08:00

93 lines
798 B
Text

Code:
(lambda ()
(c-ts-mode)
(setq-local indent-tabs-mode nil)
(setq-local c-ts-mode-indent-offset 2)
(c-ts-mode-set-style 'bsd)
(indent-region (point-min) (point-max)))
Point-Char: |
Name: Basic
=-=
int
main (void)
{
return 0;
}
=-=-=
Name: Hanging Braces
=-=
int
main (void)
{
if (true)
{
|
}
}
=-=-=
Name: Labels
=-=
int
main (void)
{
label:
return 0;
if (true)
{
label:
return 0;
}
else
{
if (true)
{
label:
return 0;
}
}
}
=-=-=
Name: If-Else
=-=
int main()
{
if (true)
{
return 0;
}
else
{
return 1;
}
}
=-=-=
Name: Empty Line
=-=
int main()
{
|
}
=-=-=
Name: Consecutive blocks (bug#60873)
=-=
int
main (int argc,
char *argv[])
{
{
int i = 0;
}
}
=-=-=