Signal file-locked on lock conflict with noninteractive=t
Previously we would signal a generic error on lock conflict when noninteractive=t. That meant that non-interactively handling a lock conflict would require catching all errors and checking the string in DATA. Now we just signal file-locked instead, which matches the interactive behavior when the user says "q" at the prompt. Also, when noninteractive, we signal before we write the prompt about the lock conflict. That prompt usually gets in the way of noninteractively handling and suppress lock conflict errors. The signal data contains all the necessary information, we don't need to write a separate message for noninteractive. * lisp/userlock.el (ask-user-about-lock): Signal file-locked on noninteractive lock conflict. (bug#66993)
This commit is contained in:
parent
8b458aea86
commit
f554872997
1 changed files with 2 additions and 1 deletions
|
@ -64,10 +64,11 @@ in any way you like."
|
|||
(match-string 0 opponent)))
|
||||
opponent))
|
||||
(while (null answer)
|
||||
(when noninteractive
|
||||
(signal 'file-locked (list file opponent "Cannot resolve lock conflict in batch mode")))
|
||||
(message (substitute-command-keys
|
||||
"%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))
|
||||
|
|
Loading…
Reference in a new issue