mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 18:40:39 -08:00
Make c-ts-mode indent tests side-effect-free
Running indent tests changes the global value of c-ts-mode-indent-style. That's not good. This change fixes that. I also refactored the indent style functions a bit. * lisp/progmodes/c-ts-mode.el: (c-ts-mode--prompt-for-style): New function. (c-ts-mode-set-local-style): New function. (c-ts-mode-set-style): Use c-ts-mode--prompt-for-style. Use derived-mode-p when testing for major mode. Remove check of current buffer's major mode since it doesn't matter. * test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts: * test/lisp/progmodes/c-ts-mode-resources/indent.erts: Use c-ts-mode-set-local-style to set the indent style locally.
This commit is contained in:
parent
8a6bdf88b4
commit
d963a8f135
3 changed files with 35 additions and 27 deletions
|
|
@ -1,9 +1,9 @@
|
|||
Code:
|
||||
(lambda ()
|
||||
(setq indent-tabs-mode nil)
|
||||
(setq c-ts-mode-indent-offset 2)
|
||||
(setq c-ts-mode-indent-style 'bsd)
|
||||
(c-ts-mode)
|
||||
(setq-local indent-tabs-mode nil)
|
||||
(setq-local c-ts-mode-indent-offset 2)
|
||||
(c-ts-mode-set-local-style 'bsd)
|
||||
(indent-region (point-min) (point-max)))
|
||||
|
||||
Point-Char: |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue