[Top][All Lists]

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

Re: CC Mode 5.28 (); JavaScript indentation problem

From: Martin Stjernholm
Subject: Re: CC Mode 5.28 (); JavaScript indentation problem
Date: 17 Aug 2001 01:33:31 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

rginda@netscape.com (Robert Ginda) wrote:

> I've been using the C++ variant of CC-mode for JavaScript files and
> noticed a slight indentation problem. Here's the deal...
> 1: Foo.prototype.doFoo =
> 2: function foo()
> 3: {
> 4:     if (this.bar)
> 5:     this.baz();  // XXX This line is indented incorrectly
> 6: }
> Line 5 is considered a brace-list-entry, instead of a substatement,
> and so is indented 0 instead of +. It seems the '=' in line 1 is
> confusing the syntatic match.

This looks pretty much like the lambda construct in Pike. Try to set
c-lambda-key to something that matches the "function" token and it
might work better.

(If there are only small issues like this, it'd be simple to add
support for javascript. The big problem is that linebreaks are
relevant in some cases if I'm not mistaken, and those are consistently
ignored by all the recognition code.)

reply via email to

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