tags:

views:

71

answers:

1

Is there column based narrowing in emacs.

I tend narrow in one everything between script tags but that still keeps the original indent (space before var). It would be great if I could actually column narrow to the the beginning of the indent since otherwise the electrict indent tries to bring it to column 0.

<some html></some html>
<script>
    var foo = 1;
    var bar = 2;
</script>
<some html></some html>

Alternate solution could be to mark the starting indents as uneditable, but I am also not sure how to do this.

P.S. I am aware of MMM and NXHTML and html-helper-modes, but I am not looking to use them due to complexities.

A: 

Can you put { and } around the code within the script tags? It's not ideal but should keep the same semantics for the code and allow for the indenting (assuming you want one level of indent like in the example you gave).

0x4b