Never wanted to do this before, but this should work:
(set (make-local-variable 'before-save-hook) '((lambda() (rg-msg "foobie"))))
In general C-h v will prompt for a variable name and display a description telling you whether the var is buffer-local.
before-save-hook is a variable defined
in `files.el'. Its value is nil
This variable is potentially risky
when used as a file local variable.
Documentation: Normal hook that is run
before a buffer is saved to its file.
You can customize this variable.
vs.
next-error-function is a variable
defined in `simple.el'. Its value is
nil
Automatically becomes buffer-local
when set in any fashion. This
variable is potentially risky when
used as a file local variable.
Documentation: Function to use to find
the next error in the current buffer.
The function is called with 2
parameters:
[...]