bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8576: 23.2; js-mode doesn't support multi-line variable declarations


From: Felix H. Dahlke
Subject: bug#8576: 23.2; js-mode doesn't support multi-line variable declarations
Date: Wed, 15 Feb 2012 13:32:01 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:9.0) Gecko/20111229 Thunderbird/9.0

On 06/19/2011 10:38 PM, Daniel Colascione wrote:
> Hi Felix,
> 
> Thanks for the bug report.

Hi Daniel,

sorry for getting back so terribly late, I somehow failed to notice the
email and didn't use Emacs for JS much in the past year. But I'm using
js-mode intensively again from now on, so the issue has become important
for me again.

> Additionally, this construct is relatively rare; if you're going to
> split variable declarations across several lines, you might as well use
> another "var".

I disagree, it's a very popular style and I'm using it all the time.
Many others do, look e.g. at the jQuery code:
https://github.com/jquery/jquery/blob/master/src/core.js

> Also, the existing highlighting has no ill effects: the
> second declaration is just interpreted as an assignment, and the worst
> part is a lack of font-lock-variable-name-face, not syntactic incoherence.

True, but it's still very irritating to have Emacs indent it incorrectly
every time you insert/edit such a statement and having to manually fix
the indentation. That's why I used other editors for JS in the past
year, but I really want to use Emacs, so I'm back.

> > I'll take patches, but for now, I think we should defer a solution to
> this issue until we have a more sophisticated and general highlighting
> scheme.

I did have a look at the code, but I'm not familiar with font-lock, so I
couldn't fix it. But I'd be very happy to help with the more general
highlighting scheme.

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]