Re: [ESS] Style: avoid new lines in chains of square brackets [][]

2021-06-03 Thread Jeremie Juste via ESS-help
Hello Vincent,

> On Wed, Jun 2, 2021, at 19:01, Vincent Arel-Bundock via ESS-help wrote:
>> Jeremie,
>> 
>> This is quite embarrassing, but the behavior does NOT replicate under 
>> vanilla emacs. I should have done my research!

I have fallen into this trap (many times) as well so rest assured you
are in good company.

On Thursday,  3 Jun 2021 at 11:40, Vincent Arel-Bundock via ESS-help wrote:
> On a Windows 10 machine with emacs 27.1, I was able to get the intended 
> formatting with:
>
> (setq lsp-enable-on-type-formatting nil)
>
> Apologies for posting to the wrong list, and thanks again.

Glad you found the culprit and thanks for sharing.

> Apologies for posting to the wrong list, and thanks again.
Learning to seek for help is an quality I cherish and is at the heart of
free software. I never imagined how much I would have learned by doing
so. So no need to apologize. ;-)

Best regards,
Jeremie

PS: We think therefore we R (with ESS).

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Style: avoid new lines in chains of square brackets [][]

2021-06-03 Thread Vincent Arel-Bundock via ESS-help
To close out the thread I report that my issue was related to lsp-mode rather 
than ESS. 

On a Windows 10 machine with emacs 27.1, I was able to get the intended 
formatting with:

(setq lsp-enable-on-type-formatting nil)

Apologies for posting to the wrong list, and thanks again.

On Wed, Jun 2, 2021, at 19:01, Vincent Arel-Bundock via ESS-help wrote:
> Jeremie,
> 
> This is quite embarrassing, but the behavior does NOT replicate under 
> vanilla emacs. I should have done my research!
> 
> I will track down the source of the issue in my config, and report back 
> if it is interesting.
> 
> Thank you for taking the time to answer and sorry for wasting inbox space!
> 
> Vincent
> 
> 
> On Wed, Jun 2, 2021, at 17:37, Jeremie Juste wrote:
> > 
> > Hello Vincent,
> > 
> > On Wednesday,  2 Jun 2021 at 09:14, Vincent Arel-Bundock via ESS-help wrote:
> > > Hi all,
> > >
> > > Thanks for your awesome work on ESS!
> > >
> > > I use the data.table package with chains of square brackets, and would 
> > > like to indent my code as follows:
> > >
> > > library(data.table)
> > > dat = data.table(mtcars)
> > > dat[
> > > cyl == 4][
> > >   , gear := gear * 3]
> > >
> > > However, when I type this code, new lines get inserted automatically and 
> > > I get this:
> > >
> > > dat[
> > > cyl == 4
> > > ][
> > > , gear := gear * 3
> > > ]
> > I cannot reproduce this behavior. Could you try with a vanilla emacs?
> > 
> > In the terminal
> > 
> > $ emacs -Q
> > 
> > then execute
> > 
> > (add-to-list 'load-path "path to ess")
> > (require 'ess-site)
> > 
> > Can you still reproduce the behavior?
> > If yes, could you specify which OS, emacs version and ESS version are
> > you currently using?
> > 
> > HTH,
> > Jeremie
> >
> 
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
>

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Style: avoid new lines in chains of square brackets [][]

2021-06-02 Thread Jeremie Juste via ESS-help


Hello Vincent,

On Wednesday,  2 Jun 2021 at 09:14, Vincent Arel-Bundock via ESS-help wrote:
> Hi all,
>
> Thanks for your awesome work on ESS!
>
> I use the data.table package with chains of square brackets, and would like 
> to indent my code as follows:
>
> library(data.table)
> dat = data.table(mtcars)
> dat[
> cyl == 4][
>   , gear := gear * 3]
>
> However, when I type this code, new lines get inserted automatically and I 
> get this:
>
> dat[
> cyl == 4
> ][
> , gear := gear * 3
> ]
I cannot reproduce this behavior. Could you try with a vanilla emacs?

In the terminal

$ emacs -Q

then execute

(add-to-list 'load-path "path to ess")
(require 'ess-site)

Can you still reproduce the behavior?
If yes, could you specify which OS, emacs version and ESS version are
you currently using?

HTH,
Jeremie

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help