Possibly also set up proper major mode for the buffer (or do the calculation in background hidden buffer). Inspired by #148