X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/d7a0267c8d6be2a9885de797b25ec8f4a61b8895..5d8e0d43b0fdc1b67f745e66c1539c5135fb2808:/lisp/emacs-lock.el diff --git a/lisp/emacs-lock.el b/lisp/emacs-lock.el index dc93f093f9..1553aeae0d 100644 --- a/lisp/emacs-lock.el +++ b/lisp/emacs-lock.el @@ -1,7 +1,6 @@ ;;; emacs-lock.el --- prevents you from exiting Emacs if a buffer is locked -;; Copyright (C) 1994, 1997, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007 Free Software Foundation, Inc +;; Copyright (C) 1994, 1997, 2001-2011 Free Software Foundation, Inc ;; Author: Tom Wurgler ;; Created: 12/8/94 @@ -9,10 +8,10 @@ ;; This file is part of GNU Emacs. -;; GNU Emacs is free software; you can redistribute it and/or modify +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -20,9 +19,7 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see . ;;; Commentary: @@ -79,7 +76,7 @@ If the buffer is locked, signal error and display its name." (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) @@ -91,7 +88,8 @@ If the buffer is locked, signal error and display its name." (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) @@ -100,5 +98,4 @@ If the buffer is locked, signal error and display its name." (provide 'emacs-lock) -;;; arch-tag: 58e6cb43-7cf0-401a-bcb6-4902a0b8bdc1 ;;; emacs-lock.el ends here