- (or (emacs-lock--can-auto-unlock 'kill)
- (memq emacs-lock-mode '(nil exit))
- (progn
- (message "Buffer %S is locked and cannot be killed" (buffer-name))
- nil)))
+ (if (or (emacs-lock--can-auto-unlock 'kill)
+ (memq emacs-lock-mode '(nil exit)))
+ t
+ (run-hook-with-args 'emacs-lock-locked-buffer-functions (current-buffer))
+ (message "Buffer %S is locked and cannot be killed" (buffer-name))
+ nil))