From: Daniel Colascione <dan.colascione@gmail.com>
To: "Felix H. Dahlke" <fhd@ubercode.de>
Cc: 8576@debbugs.gnu.org, 8584@debbugs.gnu.org
Subject: bug#8576: 23.2; js-mode doesn't support multi-line variable declarations
Date: Sun, 19 Jun 2011 13:38:06 -0700 [thread overview]
Message-ID: <4DFE5E2E.2040606@gmail.com> (raw)
In-Reply-To: <4DB915B0.7010605@ubercode.de>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Felix,
Thanks for the bug report.
On 4/28/11 12:22 AM, Felix H. Dahlke wrote:
> The problem can be reproduced as follows:
>
> 1. Open a JavaScript file or load js-mode
> 2. Insert the following code:
> var i = 1,
> j = 2;
> 3. Observe that "j" is not highlighted and that pressing TAB on the
> second line doesn't indent it correctly.
>
> Highlighting works correctly if both variables are declared on the
> same line:
> var i = 1, j = 2;
>
After looking at what would be required to address this bug, I'd like to
leave it unfixed for now:
The machinery required to implement the tracking necessary to handle
this construct in a generic way would be quite complex. Simple cases
could perhaps be recognized more quickly, but such a solution would fail
in hard to predict ways. Long-range effects are notoriously difficult to
recognize in font-lock, and reliably rehighlighting them after a change
is even trickier.
Additionally, this construct is relatively rare; if you're going to
split variable declarations across several lines, you might as well use
another "var". 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.
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.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
iEYEARECAAYFAk3+XiwACgkQ17c2LVA10VvACwCdHD38OsUrXWLaCt3prK4BQ+3a
SqUAoLdQ+C8nVvLXJkvcza3d2JyTXtXs
=58ua
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2011-06-19 20:38 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-28 7:22 bug#8576: 23.2; js-mode doesn't support multi-line variable declarations Felix H. Dahlke
2011-06-19 20:38 ` Daniel Colascione [this message]
2012-02-15 12:32 ` Felix H. Dahlke
2012-02-15 18:58 ` Stefan Monnier
2012-02-15 19:04 ` Glenn Morris
2012-02-15 19:25 ` Daniel Colascione
2012-02-15 20:41 ` Stefan Monnier
2012-04-04 11:26 ` Felix H. Dahlke
2012-06-01 7:30 ` Felix H. Dahlke
[not found] ` <mailman.2065.1338535901.855.bug-gnu-emacs@gnu.org>
2012-07-05 14:53 ` jaseemabid
2012-02-24 2:16 ` Dmitry Gutov
2012-03-03 1:46 ` bug#8576: " Zeth
2012-03-03 4:51 ` Daniel Colascione
2012-06-07 23:04 ` bug#8576: 23.2; " Dmitry Gutov
2012-06-08 3:13 ` Felix H. Dahlke
2012-07-17 3:16 ` Felix H. Dahlke
2012-07-05 23:02 ` bug#8576: 23.2; , " Dmitry Gutov
2012-07-06 0:52 ` Dmitry Gutov
[not found] ` <mailman.4157.1341536766.855.bug-gnu-emacs@gnu.org>
2012-07-06 1:23 ` jaseemabid
2012-07-17 4:21 ` bug#8576: 23.2; " Dmitry Gutov
2012-07-17 4:37 ` Felix H. Dahlke
2012-07-17 5:00 ` Dmitry Gutov
2012-07-17 6:32 ` Stefan Monnier
2012-07-17 8:24 ` Felix H. Dahlke
2012-07-17 9:50 ` Stefan Monnier
2012-07-17 9:51 ` Felix H. Dahlke
2012-07-17 17:33 ` Felix H. Dahlke
2013-01-10 3:48 ` Felix H. Dahlke
2013-01-11 23:25 ` Stefan Monnier
2013-01-12 2:59 ` Felix H. Dahlke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DFE5E2E.2040606@gmail.com \
--to=dan.colascione@gmail.com \
--cc=8576@debbugs.gnu.org \
--cc=8584@debbugs.gnu.org \
--cc=fhd@ubercode.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).