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

Default indentation style #6

Open
vspinu opened this issue Jul 4, 2016 · 7 comments
Open

Default indentation style #6

vspinu opened this issue Jul 4, 2016 · 7 comments

Comments

@vspinu
Copy link
Member

vspinu commented Jul 4, 2016

@lionel, I have kept only RRR+, Rstudio and Rstudio- styles and made the DEFAULT the real default. Do you have an opinion on this?

As to the default style, I am now favoring indent-ofset of 2 as the default. Not being able to work properly with R-studio code is annoying. I am also thinking of deactivating fancy comments as a default. At least not to indent # to collumn 40 when they are at bol.

With respect to other parameters I am not that decided. On one hand I am convinced of the visual appeal of argument alignment in RRR style and would like to keep as close to RRR as possible for ESS' sake. On the other hand being fully compatible with R-studio projects is kinda a big deal.

@vspinu
Copy link
Member Author

vspinu commented Jul 4, 2016

I also would like to change +- to > and < to indicate the shift direction. I think +,- are not suggestive enough.

@lionel-
Copy link

lionel- commented Jul 4, 2016

I have kept only RRR+, Rstudio and Rstudio- styles and made the DEFAULT the real default. Do you have an opinion on this?

That's a good idea to cleanup all those old styles away. I think I'd prefer the default style to be called ESS.

As to the default style, I am now favoring indent-ofset of 2 as the default. Not being able to work properly with R-studio code is annoying.

I agree. 2 is the convention in R world.

I am also thinking of deactivating fancy comments as a default. At least not to indent # to collumn 40 when they are at bol.

Would this mean that only comments not at bol would be indented at 40? That's an awesome idea.

I also would like to change +- to > and < to indicate the shift direction. I think +,- are not suggestive enough.

I think + and - are better as RRR> looks a bit like a prompt. No strong opinion on this though.

On the other hand being fully compatible with R-studio projects is kinda a big deal.

It's a really big deal to me. I don't use (and don't like) ESS aligned style.

@vspinu
Copy link
Member Author

vspinu commented Jul 4, 2016

default style to be called ESS.

The default is DEFAULT because it picks from global states. ESS might not even exist in several years from now.

Would this mean that only comments not at bol would be indented at 40? That's an awesome idea.

It will mess up indented comments though. So, I think it's either all or nothing. I also see that fancy comments are not used besides lisp modes.

It's a really big deal to me. I don't use (and don't like) ESS aligned style.

Well, this is very much habit dependent. If I look at Rstudo-.R and RRR.R, style side by side, the latter is way more aired and readable (mostly because of the argument alignment and 4 space indentation).

@lionel-
Copy link

lionel- commented Jul 4, 2016

The default is DEFAULT because it picks from global states.

Ok. Shouldn't the default be nil then? And not hardcoded in r-style-alist, so that users can actually change settings. We also need to make sure local variables have precedence over style when it is set.

Well, this is very much habit dependent.

I agree, that's why it's good to have flexibility. We put a lot of thought into this UI, I think we can leave it as is (of course we can improve on it).

@vspinu
Copy link
Member Author

vspinu commented Jul 4, 2016

Shouldn't the default be nil then?

Yes. Good idea.

hardcoded in r-style-alist,

It should not be hardcoded either way. That is, the style should be initialized at the run time of r-mode. If that's not happening it should be fixed.

At least now you can set the style as file local or dir local variable, something which is not possible with ESS.

@vspinu
Copy link
Member Author

vspinu commented Jul 4, 2016

It should not be hardcoded either way.

Done. The principle is now different than in ESS, r-indent-style-alist contains unevaluated expressions which are set to corresponding values during r-mode initialization. This way any change in global values will immediately affect indentation in new buffers.

@lionel-
Copy link

lionel- commented Jul 4, 2016

Now that I think of it, the buffer local variables are applied after mode initialisation, so they will get precedence (if I'm not mistaken), which is great. Glad to have user settings finally getting sorted out!

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

No branches or pull requests

2 participants