From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file Date: Sat, 20 Mar 2021 12:43:34 +0200 Message-ID: <83k0q2cdgp.fsf@gnu.org> References: <87wnuio0ah.fsf@mdeb> <83h7lhn4he.fsf@gnu.org> <87o8fh1gqv.fsf@rfc20.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1759"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46397@debbugs.gnu.org, eggert@cs.ucla.edu, craven@gmx.net To: Matt Armstrong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 20 11:44:29 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lNZ5o-0000Jo-CY for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Mar 2021 11:44:28 +0100 Original-Received: from localhost ([::1]:50722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNZ5n-0004Gr-0a for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Mar 2021 06:44:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNZ5O-0004GV-IM for bug-gnu-emacs@gnu.org; Sat, 20 Mar 2021 06:44:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40031) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lNZ5O-0004Tu-AY for bug-gnu-emacs@gnu.org; Sat, 20 Mar 2021 06:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lNZ5O-0006RB-6K for bug-gnu-emacs@gnu.org; Sat, 20 Mar 2021 06:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Mar 2021 10:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46397 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 46397-submit@debbugs.gnu.org id=B46397.161623702624713 (code B ref 46397); Sat, 20 Mar 2021 10:44:02 +0000 Original-Received: (at 46397) by debbugs.gnu.org; 20 Mar 2021 10:43:46 +0000 Original-Received: from localhost ([127.0.0.1]:51577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lNZ58-0006QX-2y for submit@debbugs.gnu.org; Sat, 20 Mar 2021 06:43:46 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lNZ55-0006QJ-Mk for 46397@debbugs.gnu.org; Sat, 20 Mar 2021 06:43:44 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52265) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNZ4y-0004Ba-Qh; Sat, 20 Mar 2021 06:43:36 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3510 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lNZ4y-0001pO-6l; Sat, 20 Mar 2021 06:43:36 -0400 In-Reply-To: <87o8fh1gqv.fsf@rfc20.org> (message from Matt Armstrong on Wed, 17 Mar 2021 16:51:20 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:202736 Archived-At: > From: Matt Armstrong > Cc: eggert@cs.ucla.edu, 46397@debbugs.gnu.org, craven@gmx.net > Date: Wed, 17 Mar 2021 16:51:20 -0700 > > Thank you for the review Eli. I've incorporated your feedback in the > attached patches. Thanks, we are close. > I made the warning message even more terse than you suggested because > before doing so the warnings looked like this: > > Warning (unlock-file): Error unlocking file Unlocking file: > Permission denied, /tmp/inaccessible/foo, ignored [Disable showing] > [Disable logging] > > ...which says "unlock file" too many times. With the current patch it > is a little bit better: > > Warning (unlock-file): Unlocking file: Permission denied, > /tmp/inaccessible/foo, ignored [Disable showing] [Disable logging] Fine with me. > * src/filelock.c (unlock_file_body): New function, do what > unlock_file() used to. Please don't use "foo()" to refer to a function 'foo': that looks like a call of 'foo' with no arguments, which is not what you want. Our convention is to use 'foo' instead, quoted 'like this'. > --- a/doc/lispref/files.texi > +++ b/doc/lispref/files.texi > @@ -764,6 +764,8 @@ File Locks > if the buffer is modified. If the buffer is not modified, then > the file should not be locked, so this function does nothing. It also > does nothing if the current buffer is not visiting a file, or is not locked. > +Handles file system errors by calling @code{display-warning} and continuing ^^^^^^^ "This function handles ..." > +** 'unlock-buffer' displays warnings instead of signaling. > +Instead of signaling 'file-error' conditions for file system level > +errors, the function now calls 'display-warning' and continues as if > +the error did not occur. ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ I'd rephrase "... and otherwise ignores the error". > +(defun userlock--handle-unlock-error (err) > + "Report an error ERR that occurred while unlocking a file." This will sound better if you rename the argument: (defun userlock--handle-unlock-error (error) "Report an ERROR that occurred while unlocking a file."