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

Make the (comment \n ,) trick aka "comma close parens" work on reformatting #945

Open
clyfe opened this issue Jan 14, 2021 · 6 comments
Open

Comments

@clyfe
Copy link

clyfe commented Jan 14, 2021

When writing a comment, the closing parens is ergonomically on the next line, to work easily with the last form.
Reformatting moves it up. In Clover there's a trick with a comma, that keeps the parens in it's place. It would be nice if that would work with Calva.

(comment
  (dabble)
  ,)
@bpringe
Copy link
Member

bpringe commented Jan 14, 2021

the closing parens is ergonomically on the next line, to work easily with the last form.

Not to say this shouldn't work in Calva, but just curious what your reasons are for saying this. I find that since alt+enter evaluates the top level form within the comment (in Calva), that there's no issue working with the last form being on the same line as the closing paren. Maybe your workflow is different and/or I am missing something(s), though.

@clyfe
Copy link
Author

clyfe commented Jan 14, 2021

You don't always want to evaluate all that's in the comment block, it may not all be pure functional, you may want to cherry pick because order, or side effects.

@PEZ
Copy link
Collaborator

PEZ commented Jan 14, 2021

From en evaluation point of view the placement of that last paren doesn't matter at all, though. Can you describe in a bit more detail what ”work easily with the last form” means?

@bpringe
Copy link
Member

bpringe commented Jan 15, 2021

Just to clarify, if you put your cursor anywhere inside the (dabble) form in your example, and run "Evaluate top level form" (alt+enter by default), it will only evaluate (dabble), even if you had other forms inside the comment form. This is how Calva makes working inside comment forms easier.

@clyfe
Copy link
Author

clyfe commented Jan 15, 2021

I guess I'm used to moving to the end of a form and "eval last form".
I pretty much never use "eval top level". I use "eval file" and "eval last form" ("current" I believe in calva parlance).

@PEZ
Copy link
Collaborator

PEZ commented Jan 15, 2021

Current Form goes beyond parlance, actually. You can also place the cursor before the opening paren and use the command. (Even if it seems to be unnecessary work to move the cursor around and evaluate something that you can just alt+enter instead.)

@PEZ PEZ removed the enhancement label Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants