Skip to content

Support alignment for reader conditionals #486

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

Merged
merged 2 commits into from
Aug 27, 2018

Conversation

vemv
Copy link
Member

@vemv vemv commented Aug 24, 2018

Fixes #483.

@vemv
Copy link
Member Author

vemv commented Aug 24, 2018

I tried this code at work for a week, has given me no issue.

Let me know if there's any point of improvement!

@vemv vemv force-pushed the align-reader-conditionals branch from e9ce48f to 293d739 Compare August 24, 2018 11:17
clojure-mode.el Outdated
(not (eq (char-before (1- point)) ?\#)))
;; Are we in a reader conditional?
(and clojure-align-reader-conditionals
(or (and (eq (char-before (- point 2)) ?\#)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we use some string or regular expressions instead? Seems odd to be looking for a sequence of characters like this.

clojure-mode.el Outdated
clojure-align-cond-forms)
'symbols))
(concat (when clojure-align-reader-conditionals
"#\\?@(\\|#\\?(\\|")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably put those in some var.

@bbatsov
Copy link
Member

bbatsov commented Aug 27, 2018

Apart from my small remarks the changes look good. Also - don't forget to file a PR for the other alignment change we discussed recently.

@vemv vemv force-pushed the align-reader-conditionals branch from 293d739 to 28bf6fc Compare August 27, 2018 16:50
@vemv vemv force-pushed the align-reader-conditionals branch from 28bf6fc to 8ed99ba Compare August 27, 2018 16:55
@vemv vemv force-pushed the align-reader-conditionals branch from 136f172 to 4eeb5b3 Compare August 27, 2018 16:59
@vemv
Copy link
Member Author

vemv commented Aug 27, 2018

Alright, thanks for the review!

Ready again.

@bbatsov bbatsov merged commit e8e0e3d into clojure-emacs:master Aug 27, 2018
@bbatsov
Copy link
Member

bbatsov commented Aug 27, 2018

Thanks!

@vemv
Copy link
Member Author

vemv commented Aug 27, 2018

🙌 I'll work on the other stuff that you mentioned earlier today, during the week.

@bbatsov
Copy link
Member

bbatsov commented Aug 27, 2018 via email

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.

2 participants