emacs-devel
[Top][All Lists]
Advanced

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

Re: Question: suppress ask-user-about-lock?


From: Michael Albinus
Subject: Re: Question: suppress ask-user-about-lock?
Date: Wed, 08 Dec 2021 20:36:27 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Qiantan Hong <qhong@mit.edu> writes:

Hi,

>>> Is there a standard way to cause lock-buffer immediately fail?
>> 
>> Do you mean with "fail" that lock-buffer shall do nothing?
> No, I mean it should signal ‘file-locked without asking the user
> (through ask-user-about-lock).
> I intended to use it as a mutex in Elisp program.

What about (untested)

(cl-letf (((symbol-function #'ask-user-about-lock)
           (lambda (file proponent)
             (signal 'file-locked (list file proponent)))))

...)

Best regards, Michael.



reply via email to

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