Next: , Previous: , Up: Starting and quitting stand-off mode   [Contents]


2.3 Performance

Standoff mode generates tons of overlays. Overlays are an Emacs technique to alter the visual appearance of a buffer’s text on the screen, for the sake of presentation features. Replacing XML character references with the corresponding glyphs is done by overlays. Showing markup ranges in the source document is also done by overlays, since they allow adding visual features and even characters while not changing the underlying text. (That’s why the point can’t be positioned over a markup ranges’ bounding bracket and number. They are not really in the buffers text, but only seem to be there.)

When working with larger XML files, the tons of overlays may slow down Emacs significantly, even render it unusable. But there is another Emacs feature, to work around this: Narrowing the buffer down to a portion of the file. When you run into performance problems with standoff mode, please try narrowing.

Command: narrow-to-region REGION

(C-x n n) Narrow the buffer to the region. The REGION must be active when calling this command. Calling it the first time, you will be asked if you really want to activate the narrowing feature.

Command: widen

(C-x n w) Widen narrowed buffer to see the full file again.

For more information, consult the Emacs manual about narrowing.