|
From: | Dmitry Gutov |
Subject: | bug#47488: Treatment of # in js.el |
Date: | Tue, 11 May 2021 15:45:13 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 |
On 11.05.2021 15:21, Lars Ingebrigtsen wrote:
Dmitry Gutov <dgutov@yandex.ru> writes:We could add a custom var that disables this behavior, of course. js2-mode has one, but it only affects the parser, not the indentation behavior.If we could avoid having a user option, that's be nice...
Probably not without seeing an occasional false positive, e.g. ...
Maybe check against a specific list of preprocessor instructions, such as #define, #ifdef, etc.I think that sounds like a good solution. Grepping around a bit, perhaps `cpp-font-lock-keywords-source-directives' in font-lock.el would be a good source to use here?
... looking at the regexp it also matches #file, #line or #warning.Each of these could also be a name of a private attribute, I think. Still, if those are indeed standard preprocessor directives, this var looks like a good choice.
[Prev in Thread] | Current Thread | [Next in Thread] |