One question: what do you key bookmarks on? Line number or regexp string e.g. the occurance of 'function definethisspecialfunction()' is your bookmark? I can see how both might end up being useful.
I am also not a bookmark user. However, I would imagine that if I were, the most accurate behavior for me would be as if it were an invisible (but revealable) character within the file. So if I delete stuff above it, the bookmark automatically moves up; if I rename the function I have marked, the bookmark stays with that function, even though it can no longer be found using the same regular expression. I guess this basically amounts to line number (or better still, character offset), with the proviso that it must be updated when text is inserted or deleted.
Obviously, it is no good to store bookmarks as actual embedded characters. Besides the file-access issues Matthew1344 mentioned, there is the even more fundamental problem that the files would become Emerald-specific! We can neither dictate nor predict how compilers or other editors would interpret them.
So wherever it is that we store bookmarks (how about in the Windows registry?
), I am thinking it would be best to store them as file positions, which would be read in during file loading and written out during file closing (if saving or if the file is unchanged since last save). While in memory, they would behave as if embedded as I described above.
While the regex idea certainly has some merit, you can always have multiple instances of the same string in a file, so which one does the bookmark match? (In practice, when I do want something like a bookmark, I will put a comment in the code with some string that I know is unique, and when I want to go back there, I search for the string. Yeah, I know it's slower than using some key combination. But it also saves my sieve-like brain from having to remember more key combinations for a feature I don't use often.)