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

Treat , as a non-logical sexpr character #373

Merged
merged 3 commits into from Mar 28, 2016

Conversation

Projects
None yet
2 participants
@arrdem
Contributor

arrdem commented Mar 26, 2016

This causes clojure-forward-logical-sexp to skip over , when for
instance computing vertical alignments.

Fixes #367

Treat , as a non-logical sexpr character
This causes clojure-forward-logical-sexp to skip over , when for
instance computing vertical alignments.

Fixes #367
@Malabarba

This comment has been minimized.

Show comment
Hide comment
@Malabarba

Malabarba Mar 26, 2016

Member

Well, I guess that was easier than expected. 😄
Could also add a test for this in the alignment tests? It's very easy to write. Just copy one of the other tests in there, and replace the code string with an example that failed before but works now.

Member

Malabarba commented Mar 26, 2016

Well, I guess that was easier than expected. 😄
Could also add a test for this in the alignment tests? It's very easy to write. Just copy one of the other tests in there, and replace the code string with an example that failed before but works now.

@Malabarba

This comment has been minimized.

Show comment
Hide comment
@Malabarba

Malabarba Mar 26, 2016

Member

And thanks a ton btw!

Member

Malabarba commented Mar 26, 2016

And thanks a ton btw!

@arrdem

This comment has been minimized.

Show comment
Hide comment
@arrdem

arrdem Mar 26, 2016

Contributor

Yeah I'm honestly kinda surprised that this is all it took even in some fairly torturous case...

2016-03-25-204426_251x86_scrot

Contributor

arrdem commented Mar 26, 2016

Yeah I'm honestly kinda surprised that this is all it took even in some fairly torturous case...

2016-03-25-204426_251x86_scrot

@arrdem

This comment has been minimized.

Show comment
Hide comment
@arrdem

arrdem Mar 26, 2016

Contributor

I don't think this is right however
2016-03-25-204523_311x87_scrot

Contributor

arrdem commented Mar 26, 2016

I don't think this is right however
2016-03-25-204523_311x87_scrot

@arrdem

This comment has been minimized.

Show comment
Hide comment
@arrdem

arrdem Mar 26, 2016

Contributor

This is also pretty tortured....

2016-03-25-204641_213x114_scrot

Contributor

arrdem commented Mar 26, 2016

This is also pretty tortured....

2016-03-25-204641_213x114_scrot

@arrdem

This comment has been minimized.

Show comment
Hide comment
@arrdem

arrdem Mar 26, 2016

Contributor

Also isn't right... not sure what's going on here.

2016-03-25-205058_615x105_scrot

Contributor

arrdem commented Mar 26, 2016

Also isn't right... not sure what's going on here.

2016-03-25-205058_615x105_scrot

@Malabarba

This comment has been minimized.

Show comment
Hide comment
@Malabarba

Malabarba Mar 26, 2016

Member

Hmm. Now that I think about it... The current code probably assumes that non-logical sexps come before the logical sexp, which is not true for commas.
I don't think we need to change that, though (commas aren't really sexps anyway). It should be enough to just (skip-chars-forward ",") after moving over a logical sexp. This won't cover some of the more tortuous cases you tried above, but it should cover the case of a single comma after a sexp, which is really the only one I'm concerned with.

Member

Malabarba commented Mar 26, 2016

Hmm. Now that I think about it... The current code probably assumes that non-logical sexps come before the logical sexp, which is not true for commas.
I don't think we need to change that, though (commas aren't really sexps anyway). It should be enough to just (skip-chars-forward ",") after moving over a logical sexp. This won't cover some of the more tortuous cases you tried above, but it should cover the case of a single comma after a sexp, which is really the only one I'm concerned with.

@arrdem

This comment has been minimized.

Show comment
Hide comment
@arrdem

arrdem Mar 27, 2016

Contributor

Okay. These two together seem to do the job better.
2016-03-26-232339_241x65_scrot

Contributor

arrdem commented Mar 27, 2016

Okay. These two together seem to do the job better.
2016-03-26-232339_241x65_scrot

@Malabarba Malabarba merged commit 786c74d into clojure-emacs:master Mar 28, 2016

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
@Malabarba

This comment has been minimized.

Show comment
Hide comment
@Malabarba

Malabarba Mar 28, 2016

Member

Merged! I also added a bit of code so that clojure-align will automatically cleanup excessive commas.

Member

Malabarba commented Mar 28, 2016

Merged! I also added a bit of code so that clojure-align will automatically cleanup excessive commas.

@arrdem

This comment has been minimized.

Show comment
Hide comment
@arrdem

arrdem Mar 28, 2016

Contributor

Did you test this at all for yourself? I'm concerned that it has fairly significant limitations from mucking this afternoon 😞

Contributor

arrdem commented Mar 28, 2016

Did you test this at all for yourself? I'm concerned that it has fairly significant limitations from mucking this afternoon 😞

@Malabarba

This comment has been minimized.

Show comment
Hide comment
@Malabarba

Malabarba Mar 28, 2016

Member

I did, but I also changed the code a bit, which might have overcome the limitations. Have you tried the version on master?

Member

Malabarba commented Mar 28, 2016

I did, but I also changed the code a bit, which might have overcome the limitations. Have you tried the version on master?

@arrdem

This comment has been minimized.

Show comment
Hide comment
@arrdem

arrdem Mar 28, 2016

Contributor

No I've been in hospital all day. I'll check it out tomorrow.

Contributor

arrdem commented Mar 28, 2016

No I've been in hospital all day. I'll check it out tomorrow.

@Malabarba

This comment has been minimized.

Show comment
Hide comment
@Malabarba

Malabarba Mar 28, 2016

Member

👍 Let me know when you get a chance.

Member

Malabarba commented Mar 28, 2016

👍 Let me know when you get a chance.

@arrdem

This comment has been minimized.

Show comment
Hide comment
@arrdem

arrdem Mar 28, 2016

Contributor

LGTM. Thanks Artur!

2016-03-28-102731_583x97_scrot

Contributor

arrdem commented Mar 28, 2016

LGTM. Thanks Artur!

2016-03-28-102731_583x97_scrot

@Bost Bost referenced this pull request Oct 16, 2017

Merged

Try to simplify the PR template a bit - Fix #449 #453

6 of 6 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment