emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master f554872997a: Signal file-locked on lock conflict with noninteract


From: Eli Zaretskii
Subject: master f554872997a: Signal file-locked on lock conflict with noninteractive=t
Date: Wed, 15 Nov 2023 08:37:53 -0500 (EST)

branch: master
commit f554872997a2f8e4e8ad4342a4b0955bfc7ad3f4
Author: Spencer Baugh <sbaugh@catern.com>
Commit: Eli Zaretskii <eliz@gnu.org>

    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)
---
 lisp/userlock.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/userlock.el b/lisp/userlock.el
index 4623608f1db..91d5b7308dd 100644
--- a/lisp/userlock.el
+++ b/lisp/userlock.el
@@ -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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]