|
From: | Nikolay Kudryavtsev |
Subject: | Re: Debugging SMIE for sh-script.el |
Date: | Mon, 6 Sep 2021 15:47:47 +0300 |
User-agent: | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 |
The key question here is how do we calculate that offset. Currently it is the offset to the start of the second token of the parent line. Kevin wants to change it, so that it would be the start of the first token of the parent non-continuation line + sh-basic-offset.indent the subsequent lines at a fixed offset from the first line
There are two sane ways of accomplishing that:1. Implementing that logic inside sh-smie--indent-continuation. Just so we're clear, when I said "the default (smie-indent-calculation) cycle", I meant the default smie-indent-functions. There's generally no reason to introduce a new function (sh-smie--indent-continuation) into smie-indent-functions if the default ones are adequate for the job(indenting continuation lines), so that's why I've assumed that the default functions are not adequate for the general use case.
2. Getting rid of sh-smie--indent-continuation and implementing its logic and the new fixed logic within sh-smie-sh-rules. Maybe this can be done without opening any Pandora's boxes.
[Prev in Thread] | Current Thread | [Next in Thread] |