Add compile region and compile buffer functions