Not sure if I have missed something?
It's what this PR tries to avoid plugins having to re-implement each time they need to associate some pointer with each document. It's not terribly difficult to implement, but it requires connecting to several signals (`document-new`, `document-open`, `document-close`) and maintaining own lookup table when a document is opened and closed.