Is there a way to tweak the alignment rules in c-derived modes, in my case d-mode to indent D-style UFCS-Chains such as
foreach (file; dirPath.expandTilde()
.buildNormalizedPath()
.dirEntries(SpanMode.shallow)()
In this case I would like to align on the point, that is.
For details see https://github.com/Emacs-D-Mode-Maintainers/Emacs-D-Mode/issues/26
You have to modify the value of
arglist-cont-nonemptykey in yourc-offsets-alist. Also, you will probably want to modify thestatement-contkey to enable the same indentation in general statements (e.g. assignments) as well:Obviously, you can use something like:
to enable this alignment in every d-mode buffer.
If you want to account for optional parenthesis, I believe you'll have to write your own "lining-up" function, since I can't think of a built-in solution. Here's a dirty rewrite of c-lineup-cascaded-calls:
It seems to work for the optional parenthesis and for double parenthesis call (i.e.
call!(type)(arg)) as well. But maybe there are some corner cases, so don't count on it too much, it's just an idea to work with.