Skip to content

format: emacs tcl mode indentation#146

Merged
nmoroze merged 1 commit intonmoroze:mainfrom
vries:emacs
Feb 8, 2026
Merged

format: emacs tcl mode indentation#146
nmoroze merged 1 commit intonmoroze:mainfrom
vries:emacs

Conversation

@vries
Copy link
Contributor

@vries vries commented Feb 4, 2026

The emacs tcl mode auto-indents like this:

set options [list a \
                 b c \
                 d \
                 e]

Tclfmt formats this code like this instead:

set options [list a \
    b c \
    d \
    e]

Add an option --emacs that uses the emacs tcl mode style instead.

The option is incomplete, which is why it's marked as experimental.

Fixes issue:

The emacs tcl mode auto-indents like this:
```
set options [list a \
                 b c \
                 d \
                 e]
```

Tclfmt formats this code like this instead:
```
set options [list a \
    b c \
    d \
    e]
```
Add an option `--emacs` that uses the emacs tcl mode style instead.

The option is incomplete, which is why it's marked as experimental.

Fixes issue:
- nmoroze#139
Copy link
Owner

@nmoroze nmoroze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for implementing this!


### Emacs Indentation

An experimental mode (`--emacs`) is available to make indentation style similar
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on --emacs-indent to make the option name more explicit? Or do you expect you might want to put other style controls under this flag?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That name ('--emacs-indent') indeed is better for this particular functionality, but I intended to add the fix for #140 also under --emacs.

If you have a good name for that one though, I'm fine with using that one and --emacs-indent here.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works for me, I'm happy to have a single flag gating an experimental emacs-like style.

@nmoroze nmoroze merged commit bc1f989 into nmoroze:main Feb 8, 2026
7 checks passed
@vries vries deleted the emacs branch February 9, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants