On 07/17/2012 06:21 AM, Dmitry Gutov wrote: > You shouldn't add the `js--indent-operator-re' constant, though, it's > already present in js-mode. Oh, you're right, thanks. I've updated the gists and attached a new patch. >> The only solution I can think of would be to go back up after typing a >> closing brace followed by a comma and indent the preceeding lines. >> Some modes do that, but it would require drastic changes to js.el. >> I'd rather get this patch in first and see if the issue annoys me (or >> anyone else) enough to work further on this. > > I don't think this will be much of a problem. Probably not, but I fear it's going to be a lot of work - at least when I do it. > There is an alternative approach, though: one js2-mode user requested > that when the first value in the declaration is a function/object/array, > it should always be indented: https://github.com/mooz/js2-mode/issues/3 > > That option probably won't be very popular. Yes, I thought about suggesting that. But considering that that makes single variable declarations of functions/object literals look weird, I figured that wouldn't be desirable. I saw that you can configure this in j2-mode, perhaps that's an option. But I'd personally prefer the clever solution.