Various indentation issues (eruby-html)

Bug #946464 reported by Dmitry Gutov
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Like discussed previously in Rails on Emacs group.

Each example starts indented as I'd like it to be, then I move to various lines, press Tab, and observe the changes.

1 <a href="#" title="<%= abc(@zz) %>" class="image">
2 <%= image_tag ( ?
3 : '/images/no_photo.jpg')%>
4 </a>

I move point to line 2, press Tab, nothing happens (good). Move to
line 3, press Tab -> the text on line 2 gets un-indented by 2 spaces
(!!), and the minibuffer says "Do not know how to indent here (both
leaving and entering sub chunks)". No idea why.

1 <td>
2 <%= unless params[:abc_id]
3 link_to 'cdf', '#', class: "show_others"
4 end %>
5 </td>

Tab on line 2 -> no effect (ok), tab on line 3 -> it gets un-indented
by 4 spaces (very much not-okay). Tab on line 4 -> line 2 (!!!) gets
un-indented 2 spaces. What's up with that?

1 <li>
2 <%= f.label :fee %>:
3 <%= f.number_field :fee, :maxlength => 6 %> roubles.
4 </li>

This one's harder to reproduce. When I just paste it to the buffer, go to 2, press Tab, go to 3, press Tab, nothing changes.
But if I add a newline at the end of the buffer, move back to 3, press Tab, then it gets un-indented by 2 spaces. I tried this also with (emacs-Q-nxhtml), and while the buggy behavior is not 100% reliable, "add a newline, move back" scenario certainly helps.

Another problem I encountered while writing this: if I have one of the examples in the buffer, do C-x h (select all), and paste another from the system clipboard, thus deleting the previous buffer contents, delete the line numbers, and then press Tab to indent something, I get this:

Debugger entered--Lisp error: (wrong-type-argument overlayp nil)
  overlay-get(nil mumamo-prev-chunk)
  mumamo-indent-line-function-1(nil nil nil)
  call-interactively(indent-for-tab-command nil nil)

The fontification is also broken in the pasted text.

Tags: indentation
Revision history for this message
Dmitry Gutov (dgutov) wrote :

Damn, the launchpad ate all my indentation-whitespace.
Anyway, I think it should be obvious how each example should be indented, and each example should start that way.

Revision history for this message
lborgman (lennart-borgman) wrote :

Thanks for the bug report, Dmitry. Are you using the latest source code from Launchpad?

Revision history for this message
Dmitry Gutov (dgutov) wrote :

Its was the latest at the time of our discussion. Should I update?

Revision history for this message
lborgman (lennart-borgman) wrote :

It is probably the same, but please do so we are sure.

Revision history for this message
Dmitry Gutov (dgutov) wrote :

I checked, it's the latest, revision 834.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers