On Wed, Jul 23, 2025 at 02:20:17PM -0600, Raymond, David wrote:
> I just use emacs formatting.  It has formatters for most languages and I
> have used it on all three that you mention, Clang, Golang, and Python, as
> well as shell scripts.  Maybe there are better formatters out there, but
> emacs formatters work fine for me.  Of course, if you use vi (or some other
> editor) you are out of luck!

Thanks!, Yes I should have mentioned I use vi.
I pipe the buffer to an external filter like gofmt, black, and/or indent.
I also like this because then you can use it in a commit-hook outside
of the editor.

You can also do it in emacs with 'shell-command-on-region.
I have used emacs as a filter to indent lisp code, I suppose
I could do the same thing for C code...

https://codeberg.org/pkw/emacs-scripts/src/branch/main/indent-filter.el

--
Paul Wisehart


Reply via email to