Subject: Re: bug#47488: Treatment of # in js.el

From: Dmitry Gutov <[email-masked]>
Date: Tue, 11 May 2021 15:45:13 +0300

On 11.05.2021 15:21, Lars Ingebrigtsen wrote:
> Dmitry Gutov <[email-masked]> 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.