with-mode-local

with-mode-local is a Lisp macro in `mode-local.el'.

(with-mode-local MODE &rest BODY)

With the local bindings of MODE, evaluate BODY.
The current mode bindings are saved, BODY is evaluated, and the saved
bindings are restored, even in case of an abnormal exit.
Value is what BODY returns.
This is like `with-mode-local-symbol', except that MODE is quoted
and is not evaluated.