generalizing doc_scroll