Backport PR #3097: PyQt 4.10: use self._document = self.document()

in PygmentsHighlighter, required for PyQt 4.10 compatibility.

closes #3084

I have tested this on all my machines with earlier PyQt and PySide, and it doesn't break anything.  I don't have any truly old versions of PyQt, though.

see [PyQt list](http://www.riverbankcomputing.com/pipermail/pyqt/2013-March/032512.html) for details.
Backport PR #3117: propagate automagic change to shell

Automagic toggling was broken.

this should fix it. Need to check for backport on 0.13.x
Backport PR #3118: don't give up on weird os names

like java

closes #3113