magnars / tagedit

A collection of paredit-like functions for editing in html-mode.
99 stars 10 forks source link

tagedit-disable-experimental-features locally? #11

Closed maksle closed 8 years ago

maksle commented 9 years ago

Can we make tagedit-add-experimental-features and tagedit-disable-experimental-features buffer-local so that I can have it enabled in html mode but disabled in nxml mode?

magnars commented 9 years ago

It seems to me that the experimental feature with < and > (tagedit-insert-lt) would be very useful in nxml-mode. Does it not work?

maksle commented 9 years ago

It does not work at this time, I think that the xml validator of nxml-mode gets in the way. I have to tinker with it, perhaps disable the validator for the lifetime of the edit or something.

maksle commented 9 years ago

It seems like nxml-mode has some before and after-change functions, one of which signals an error when it sees that the end tag doesn't match what was inserted in the start tag and messes the whole thing up. I am not familiar with it so it may be a while before I figure it out or I may not find a good way to do it but I'll let you know.

maksle commented 9 years ago

It turned out not to be that, thank goodness. I found a way to get it to work although it's sort of a hack -- just said to ignore-errors on one of the lines.

In case you are curious what the problem was: when doing te/current-tag, I try to get the :end property by jumping forward one nxml element. However, since the end tag is momentarily not matching the start tag in that moment when in <ab|></a>, this triggered a scan-error in the xml parser. By adding ignore-error around the nxml-forward-element, it works.