Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sly-eval-print: Don't hardcode comment size #618

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aartaka
Copy link

@aartaka aartaka commented Sep 13, 2023

I'm often using sly-eval-print for a kind of literate programming workflow of evaluating forms one after the other and printing results inline. One particular thing that makes this workflow uncomfortable is that sly-eval-print prints the result with a single colon. This single colon is:

  • Often improperly indented by SLY itself.
  • Is against the convention that one-semicolon comments are strictly the inline ones.
    • Block comments (two semicolons) make more sense for result printing with line break.
  • And then it's hard-coded, which makes it much less customizable by user. comment-region has a lot of customizations, so the result of sly-eval-print might be really far from what one might expect in their code comments.

This PR removes the hard-coded prefix arg, so that sly-eval-print comments are more customizable, consistent, and semantically correct.

If there's no prefix arg (1) in the call to comment-region, then
user-specified comment function does whatever the user customized it
to do.

And then, SLY indents single-colon comments weirdly so it's not
optimal to use exactly one colon for long code-result listings—it
needs too much additional work to indent/rewrite it properly.
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.

None yet

1 participant