I am looking for a way to save and restore marks at the beginning and end of my custom Vimscript function. I am writing a plugin and I don't want my plugin to change any of the user's marks, so I would like to save the state at the beginning of my function, execute some commands which create marks, and then at the end restore the original state of the marks. Similar how we can do
let l:old_value = getreg("q") --- some work --- setreg("q", l:old_value)
I've read the docs and googled around, but couldn't find any way of saving and restoring a mark in this way.