emacs-ess / ESS

Emacs Speaks Statistics: ESS
https://ess.r-project.org/
GNU General Public License v3.0
623 stars 162 forks source link

Possible bug indenting arguments and `if`-conditions with `prev-line`? #1300

Open pglpm opened 3 months ago

pglpm commented 3 months ago

ess-version: [elpa: 20240803.1733]

GNU Emacs 29.4 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2024-07-28

The value of my custom-defined ess-own-style-list is as follows:

((ess-indent-offset . 4)
 (ess-offset-arguments . prev-line)
 (ess-offset-arguments-newline . prev-line)
 (ess-offset-block . prev-line)
 (ess-offset-continued . straight)
 (ess-align-continuations-in-calls . t)
 (ess-align-blocks)
 (ess-indent-from-lhs)
 (ess-indent-from-chain-start . t)
 (ess-indent-with-fancy-comments . t))

With this setup I would like to obtain a simple nested indentation of 4 spaces, without special vertical indentation of function arguments, if-else conditions, and similar.

The value above seems to produce exactly the indentation I wish for – except for function arguments and if-conditions containing binary operators. Here is an example of indentations I obtain:

a23456 <- function(a23456,
    a23456) {a23456,
    a23456
}

a23456 <- function(a23456 +
                   a23456) {a23456 +
                                a23456
}

I would expect the second to be indented similarly to the first.

After trying several changes in the various ess-own-style-list subarguments, to no avail, I wonder whether there might be a bug somewhere. Happy to receive advice!