Use a buffer for document list when adding docments

And chage code format of '{'