eisl icon indicating copy to clipboard operation
eisl copied to clipboard

eislformat program

Open lassik opened this issue 2 years ago • 2 comments

Can you expose formatter.lsp as a standalone program, runnable as a Unix shell command?

Something like: eislformat < unformatted-code.lsp > formatted-code.lsp with error/warning messages to stderr.

If it supports formatting from stdin to stdout, it's easy to add Emacs support.

lassik avatar Aug 12 '22 11:08 lassik

It's difficult to make it standalone, but I think I can change the file output to standard output. It is a method to add an option to the formatter function and set the output destination to standard output. I will try it.

sasagawa888 avatar Aug 12 '22 22:08 sasagawa888

I improved the formatter. If you give the 'stdio symbol instead of file, the input/output will be the standard input/output. Will this work? e.g.

> (formatter 'stdio)
(defun foo (x) (if (= x 1) 2 3))
(defun foo (x)
    (if (= x 1)
        2
        3 ))
^C
Easy-ISLisp Ver2.60
> 

sasagawa888 avatar Aug 12 '22 23:08 sasagawa888