;;; emacs-lock.el --- prevents you from exiting Emacs if a buffer is locked
-;; Copyright (C) 1994, 1997, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc
+;; Copyright (C) 1994, 1997, 2001-2011 Free Software Foundation, Inc
;; Author: Tom Wurgler <twurgler@goodyear.com>
;; Created: 12/8/94
(set-process-sentinel
(get-buffer-process (buffer-name)) (function emacs-lock-clear-sentinel)))
-(defun emacs-lock-clear-sentinel (proc str)
+(defun emacs-lock-clear-sentinel (_proc _str)
(if emacs-lock-from-exiting
(progn
(setq emacs-lock-from-exiting nil)
(if emacs-lock-buffer-locked
(setq emacs-lock-from-exiting t)))
-(add-hook 'kill-emacs-hook 'check-emacs-lock)
+(unless noninteractive
+ (add-hook 'kill-emacs-hook 'check-emacs-lock))
(add-hook 'kill-buffer-hook 'emacs-lock-check-buffer-lock)
(add-hook 'shell-mode-hook 'emacs-lock-was-buffer-locked)
(add-hook 'shell-mode-hook 'emacs-lock-shell-sentinel)
(provide 'emacs-lock)
-;; arch-tag: 58e6cb43-7cf0-401a-bcb6-4902a0b8bdc1
;;; emacs-lock.el ends here