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

Customize preferred quotes #82

Merged
merged 3 commits into from
Oct 19, 2016
Merged

Conversation

notetiene
Copy link
Contributor

Using the log this is a nice functionality. However, the only quote style supported is using double quotes ("). This can be quite bothering if someone uses a linter that forbids the use of quotes style.

Those patches fix this problem

Etienne added 2 commits October 13, 2016 22:02
* js2-refactor.el (js2-refactor): Add customization group for the
  package.
* (js2r-use-strict): Refactor the variable as a customizeable option.
* js2-refactor.el (js2r-preferred-quote-type): Add a preferred quotes
  style option.

* js2r-helpers.el (js2r--wrap-text-with-preferred-quotes): Add a helper
  function to wrap text with preferred quotes.
(js2r--wrap-text): Add a shorter name for convenience.

* js2r-conveniences.el (js2r-log-this):
(js2r-debug-this): Add preferred quotes suppport.
(setq prefered-quotes "'"))
(concat prefered-quotes (apply 'concat text) prefered-quotes)))

(defalias 'js2r--wrap-text 'js2r--wrap-text-with-prefered-quotes)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why a defalias? Why not just name it js2r--wrap-text?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was because I found js2r--wrap-text-with-prefered-quotes to be too long to fit inside the js2r--figure-out-what-to-log-where. I'll definitely change it.

@NicolasPetton
Copy link
Collaborator

Thanks!

@NicolasPetton NicolasPetton merged commit 1d15ffd into js-emacs:master Oct 19, 2016
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