Another Use Case has occurred to me that I would really like this (hypothetical) editor to be able to support well. That is a diff/patch editor.
The basic idea is that when doing distributed software development, the items that are traded are patches. It is important to be able to work with these effecitively, both including them into ones own source tree, and generating a set of patches to distribute
Needs
One particular need is to be able to work with a set of patches. This is a sequence of patches that apply to a set of files and possibly depend on others in the set. Each patch makes a conceptual change which could affect various files in a common way, and other patches can update changes made by previous patches.When working with a set of patches, one needs to be able to move individual changes from one patch set to another, and to merge and split patches. One also needs to be able to view the before and after versions of the files, and to view just the patches.
Another need is to be able to apply a patch to a set of files and work with the result. This needs to work even if the patch does not apply perfectly.
Viewing an imperfectly applied patch requires being able to view the original file, the original patch, and the file with the patch applied as best as possible (wiggled in). These three views need to move together, and changes in the patch or the result need to be reflected in the other. one need to be appropriately reflected in others.
While these patches are being worked with, it is important that the documents themselves are still being managed appropriately according to their type. The "diff" layer must be able to be a separate handling of each document that runs in parallel to the primary handler.
Approach
A few things are needed to make sure this can work.1/ A document manager must not expect that it is the only entity interested in the document and in particular, it is not the owner of all attributes in the document. Attributes need to be tagged by who owns them.
2/ A non-primary document manager must be able to easily get notification of content changes. This can be as simple as the owner of any attributes of an affected piece of text being alerted.
3/ It must be possible for a number of windows on different documents to be tided together. Thus the patch manager might present a window with three sub windows. One contains the patch and the other two contain 'before' and 'after' versions of the patched file(s). The patch manager will need to set hooks in each window so that cursor movements and scrolling is detected and reflected in the other windows.
With these it should be be quite possible to work with patches and their associated files.
