I want to change a magic number (or a time stamp) in a file buffer on each save. The position of the magic number in the buffer can be given through a regex with a keyword or similar.
Is there any package for this? I tried
auto-insert which comes with Emacs 26, but this seems to only update on file buffer creation, not on each save.
I preferably would like to enable this on a per-file basis through file local variables.
I tried a custom hack via
before-save-hook, but struggled to add a function to this hook through afile variable declaration.