{"action":"created","issue":{"url":"https://api.github.com/repos/emacs-ess/ESS/issues/279","labels_url":"https://api.github.com/repos/emacs-ess/ESS/issues/279/labels{/name}","comments_url":"https://api.github.com/repos/emacs-ess/ESS/issues/279/comments","events_url":"https://api.github.com/repos/emacs-ess/ESS/issues/279/events","html_url":"https://github.com/emacs-ess/ESS/issues/279","id":119890735,"number":279,"title":"indentation of list() of functions","user":{"login":"mmaechler","id":995722,"avatar_url":"https://avatars.githubusercontent.com/u/995722?v=3","gravatar_id":"","url":"https://api.github.com/users/mmaechler","html_url":"https://github.com/mmaechler","followers_url":"https://api.github.com/users/mmaechler/followers","following_url":"https://api.github.com/users/mmaechler/following{/other_user}","gists_url":"https://api.github.com/users/mmaechler/gists{/gist_id}","starred_url":"https://api.github.com/users/mmaechler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmaechler/subscriptions","organizations_url":"https://api.github.com/users/mmaechler/orgs","repos_url":"https://api.github.com/users/mmaechler/repos","events_url":"https://api.github.com/users/mmaechler/events{/privacy}","received_events_url":"https://api.github.com/users/mmaechler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-02T08:26:42Z","updated_at":"2015-12-02T11:02:42Z","closed_at":null,"body":"kind of a deja-vu ... but of course different.  Thanks to our great regression test collection:\r\nThis currently indents as\r\n```{r}\r\na <- list(ex1 = function(p) {\r\n    cMah <- qchisq(0.975, p)   \r\n    function(d) as.numeric(d < cMah)\r\n},\r\nex2 = function(p) {\r\n    cM <- qchisq(0.95, p)\r\n    function(d) as.numeric(d < cM)\r\n})\r\n```\r\nwhere notably the  `},`  alignment to column 0 is very bad (and the one of `ex2 = ...` is just a consequence of that.\r\n"},"comment":{"url":"https://api.github.com/repos/emacs-ess/ESS/issues/comments/161261133","html_url":"https://github.com/emacs-ess/ESS/issues/279#issuecomment-161261133","issue_url":"https://api.github.com/repos/emacs-ess/ESS/issues/279","id":161261133,"user":{"login":"lionel-","id":4465050,"avatar_url":"https://avatars.githubusercontent.com/u/4465050?v=3","gravatar_id":"","url":"https://api.github.com/users/lionel-","html_url":"https://github.com/lionel-","followers_url":"https://api.github.com/users/lionel-/followers","following_url":"https://api.github.com/users/lionel-/following{/other_user}","gists_url":"https://api.github.com/users/lionel-/gists{/gist_id}","starred_url":"https://api.github.com/users/lionel-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lionel-/subscriptions","organizations_url":"https://api.github.com/users/lionel-/orgs","repos_url":"https://api.github.com/users/lionel-/repos","events_url":"https://api.github.com/users/lionel-/events{/privacy}","received_events_url":"https://api.github.com/users/lionel-/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T11:02:42Z","updated_at":"2015-12-02T11:02:42Z","body":"I believe that indentation is on purpose. It makes most sense with higher order functionals like `lapply()` where you provide a function, and with DSL functions like `test_that()` where you supply blocks of code to a call.\r\n\r\nBut even here, where would you place the closing `}`? In the same column as the elements of the function body? That wouldn't make sense.\r\n\r\nThough if you set `ess-offset-block` to `prev-call` and `ess-indent-from-lhs` to `nil`, you can have this alignment instead:\r\n```r\r\na <- list(param1 = function() {\r\n         body1\r\n     },\r\n     param2 = function() {\r\n         body2\r\n     })\r\n```\r\nBut it will probably look bad with other patterns. So if it's important, we'll need to introduce additional flexibility to set different offset types for different calls (higher order functionals vs containers, etc)"}}