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

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

bug#16907: 24.3.50; [ruby-mode] %w/W literals have incorrect indentation


From: Dmitry Gutov
Subject: bug#16907: 24.3.50; [ruby-mode] %w/W literals have incorrect indentation
Date: Sat, 01 Mar 2014 03:55:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

(This is probably too late for 24.4)

Bozhidar Batsov <bozhidar@batsov.com> writes:

> %w/W should be indented like other array literals.

And %i/I too, I guess.

Looks like this'll have to be done in two parts:

1. syntax-propertize the above cases differently from the rest of the
percent literals (which are treated like strings).

Don't know exactly what syntax to use. The values can contain any
unpaired characters, except those delimiting them. Put syntax "symbol"
on everything inside them, except whitespace?

And still handle interpolations somehow.

2. Tokenize the elements inside the above literals without regard to
characters used in them. `ruby-smie--backward-token' and its counterpart
would have to be able to easily know when it's inside such literal.

Alternatively, still propertize them as "general strings", but replace
`smie-indent-inside-string' in `smie-indent-functions' with a
specialized version that would look at what the string begins with.

The change in syntax highlighting would have to be handled separately.





reply via email to

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