GNU bug report logs - #66993
[PATCH] project.el: avoid asking user about project-list-file lock

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Tue, 7 Nov 2023 21:29:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Spencer Baugh <sbaugh <at> janestreet.com>
Cc: dmitry <at> gutov.dev, 66993 <at> debbugs.gnu.org
Subject: bug#66993: [PATCH] project.el: avoid asking user about project-list-file lock
Date: Thu, 09 Nov 2023 18:52:19 +0200
> From: Spencer Baugh <sbaugh <at> janestreet.com>
> Cc: dmitry <at> gutov.dev,  66993 <at> debbugs.gnu.org
> Date: Thu, 09 Nov 2023 11:38:26 -0500
> 
> > That's one way, yes.  Another one is to use define-error to define a
> > new error type for this case.
> 
> Instead of defining a new error type, how about just signaling
> file-locked instead?  e.g. the following patch:
> 
> diff --git a/lisp/userlock.el b/lisp/userlock.el
> index 61f061d3e54..e4d23c56249 100644
> --- a/lisp/userlock.el
> +++ b/lisp/userlock.el
> @@ -67,7 +67,7 @@ ask-user-about-lock
>          (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"))
> +	(if noninteractive (signal 'file-locked (list file opponent)))
>  	(let ((tem (let ((inhibit-quit t)
>  			 (cursor-in-echo-area t))
>  		     (prog1 (downcase (read-char))

Please show the result of this change on what Emacs prints in batch
mode when this error is signaled.




This bug report was last modified 1 year and 268 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.