lock-buffer

lock-buffer is a built-in function in `C source code'.

(lock-buffer &optional FILE)

Lock FILE, if current buffer is modified.
FILE defaults to current buffer's visited file,
or else nothing is done if current buffer isn't visiting a file.

If the option `create-lockfiles' is nil, this does nothing.