* Tool to format/indent scheme code
@ 2017-03-04 5:54 Huang, Ying
2017-03-04 14:18 ` Mekeor Melire
2017-03-04 19:05 ` Alex Kost
0 siblings, 2 replies; 4+ messages in thread
From: Huang, Ying @ 2017-03-04 5:54 UTC (permalink / raw)
To: help-guix
Hi, All,
Sometimes, I want to check the contents of auto-generated scheme code in
store. But the readability is not very good. So I want to use a code
format/indent tool to help on this. Do you know is there such tool in
Guix? If no, any tool not in Guix? Thanks in advance!
Best Regards,
Huang, Ying
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Tool to format/indent scheme code
2017-03-04 5:54 Tool to format/indent scheme code Huang, Ying
@ 2017-03-04 14:18 ` Mekeor Melire
2017-03-04 19:05 ` Alex Kost
1 sibling, 0 replies; 4+ messages in thread
From: Mekeor Melire @ 2017-03-04 14:18 UTC (permalink / raw)
To: Huang, Ying; +Cc: help-guix
Huang, Ying <huang_ying_caritas@163.com> writes:
> Sometimes, I want to check the contents of auto-generated scheme code in
> store. But the readability is not very good. So I want to use a code
> format/indent tool to help on this. Do you know is there such tool in
> Guix? If no, any tool not in Guix? Thanks in advance!
In Guix' Git-repository, there is a file `etc/indent-code.el.in`. I
think, after running `./bootstrap`, it becomes `etc/indent-code.el` which
is then executable. I guess, it requires emacs being installed though.
You can then run `./etc/indent-code.el gnu/packages/foo.scm` or so.
I'm not sure if `indent-code.el` is only made for package definitions
(like gnu/packages/foo.scm) or if it also works for other Scheme code.
Maybe try it? Maybe somebody else knows? Maybe read the code?
I'm not sure if I was helpful.
--
mekeor ~ EDD3 DFFA 76F6 11C0 145F 9A99 AC85 BAD8 A2F8 C868
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Tool to format/indent scheme code
2017-03-04 5:54 Tool to format/indent scheme code Huang, Ying
2017-03-04 14:18 ` Mekeor Melire
@ 2017-03-04 19:05 ` Alex Kost
2017-03-05 12:19 ` Huang, Ying
1 sibling, 1 reply; 4+ messages in thread
From: Alex Kost @ 2017-03-04 19:05 UTC (permalink / raw)
To: Huang, Ying; +Cc: help-guix
Huang, Ying (2017-03-04 13:54 +0800) wrote:
> Hi, All,
>
> Sometimes, I want to check the contents of auto-generated scheme code in
> store. But the readability is not very good. So I want to use a code
> format/indent tool to help on this. Do you know is there such tool in
> Guix? If no, any tool not in Guix? Thanks in advance!
In Emacs you can use "C-u M-x indent-pp-sexp" to pretty print a sexp
after the point.
BTW, if anyone is interested, Emacs-Guix uses 'indent-pp-sexp' to
pretty-print Shepherd config of a system generation, which can be shown
like this:
1. Run "M-x guix-system-generations"
2. Press "RET" on any generation to get more info
3. Press "Pretty print" button
--
Alex
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Tool to format/indent scheme code
2017-03-04 19:05 ` Alex Kost
@ 2017-03-05 12:19 ` Huang, Ying
0 siblings, 0 replies; 4+ messages in thread
From: Huang, Ying @ 2017-03-05 12:19 UTC (permalink / raw)
To: Alex Kost; +Cc: help-guix
Alex Kost <alezost@gmail.com> writes:
> Huang, Ying (2017-03-04 13:54 +0800) wrote:
>
>> Hi, All,
>>
>> Sometimes, I want to check the contents of auto-generated scheme code in
>> store. But the readability is not very good. So I want to use a code
>> format/indent tool to help on this. Do you know is there such tool in
>> Guix? If no, any tool not in Guix? Thanks in advance!
>
> In Emacs you can use "C-u M-x indent-pp-sexp" to pretty print a sexp
> after the point.
Thanks a lot! That is a useful tool.
> BTW, if anyone is interested, Emacs-Guix uses 'indent-pp-sexp' to
> pretty-print Shepherd config of a system generation, which can be shown
> like this:
>
> 1. Run "M-x guix-system-generations"
> 2. Press "RET" on any generation to get more info
> 3. Press "Pretty print" button
This is a very good interface!
Best Regards,
Huang, Ying
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-03-05 12:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-04 5:54 Tool to format/indent scheme code Huang, Ying
2017-03-04 14:18 ` Mekeor Melire
2017-03-04 19:05 ` Alex Kost
2017-03-05 12:19 ` Huang, Ying
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).