and variable names, to make them unique to emacs-lock.
(check-was-buffer-locked): New function,
on shell-mode-hook and telnet-mode-hook.
(save-buffer-lock-setting): New permanent local variable.
(check-buffer-lock): New function, on kill-buffer-hook.
(set-shell-sentinel): New function, on shell-mode-hook
and telnet-mode-hook.