From 28718c4449972640c39a7be1b62ccc7f50c6e801 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 14 Apr 2017 21:18:07 -0400 Subject: [PATCH] Avoid userlock queries hanging forever in batch mode * lisp/userlock.el (ask-user-about-lock) (ask-user-about-supersession-threat): Abort in batch mode. --- lisp/userlock.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/userlock.el b/lisp/userlock.el index fc0d3e30d30..a8eb24bd100 100644 --- a/lisp/userlock.el +++ b/lisp/userlock.el @@ -61,6 +61,7 @@ in any way you like." (while (null answer) (message "%s locked by %s: (s, q, p, ?)? " short-file short-opponent) + (if noninteractive (error "Cannot resolve lock conflict in batch mode")) (let ((tem (let ((inhibit-quit t) (cursor-in-echo-area t)) (prog1 (downcase (read-char)) @@ -149,6 +150,9 @@ really edit the buffer? (y, n, r or C-h) " (file-name-nondirectory fn))) (choices '(?y ?n ?r ?? ?\C-h)) answer) + (when noninteractive + (message "%s" prompt) + (error "Cannot resolve conflict in batch mode")) (while (null answer) (setq answer (read-char-choice prompt choices)) (cond ((memq answer '(?? ?\C-h)) -- 2.39.5