summaryrefslogtreecommitdiff
path: root/lisp/userlock.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2017-04-14 21:18:07 -0400
committerGlenn Morris <rgm@gnu.org>2017-04-14 21:18:07 -0400
commit28718c4449972640c39a7be1b62ccc7f50c6e801 (patch)
tree33fb25469336cd23989837e125983197f5e510cb /lisp/userlock.el
parente6750596ef55352c260c200747bec3303e181fe8 (diff)
downloademacs-28718c4449972640c39a7be1b62ccc7f50c6e801.tar.gz
emacs-28718c4449972640c39a7be1b62ccc7f50c6e801.tar.bz2
emacs-28718c4449972640c39a7be1b62ccc7f50c6e801.zip
Avoid userlock queries hanging forever in batch mode
* lisp/userlock.el (ask-user-about-lock) (ask-user-about-supersession-threat): Abort in batch mode.
Diffstat (limited to 'lisp/userlock.el')
-rw-r--r--lisp/userlock.el4
1 files changed, 4 insertions, 0 deletions
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))