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#64821: 30.0.50; write-region errs when overwriting an already open file Date: Mon, 24 Jul 2023 18:11:30 +0300 Message-ID: <83zg3lqr8d.fsf@gnu.org> References: <87y1j53hrz.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30108"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64821@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 24 17:12:24 2023 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 1qNxEV-0007e4-D2 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Jul 2023 17:12:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNxED-00054z-4r; Mon, 24 Jul 2023 11:12:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNxEB-00054l-AW for bug-gnu-emacs@gnu.org; Mon, 24 Jul 2023 11:12:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qNxEB-0006uW-31 for bug-gnu-emacs@gnu.org; Mon, 24 Jul 2023 11:12:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qNxEA-0002WR-Ur for bug-gnu-emacs@gnu.org; Mon, 24 Jul 2023 11:12: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: Mon, 24 Jul 2023 15:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64821 X-GNU-PR-Package: emacs Original-Received: via spool by 64821-submit@debbugs.gnu.org id=B64821.16902114709597 (code B ref 64821); Mon, 24 Jul 2023 15:12:02 +0000 Original-Received: (at 64821) by debbugs.gnu.org; 24 Jul 2023 15:11:10 +0000 Original-Received: from localhost ([127.0.0.1]:43784 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qNxDK-0002Uj-5i for submit@debbugs.gnu.org; Mon, 24 Jul 2023 11:11:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qNxDH-0002UT-7X for 64821@debbugs.gnu.org; Mon, 24 Jul 2023 11:11:09 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNxDB-0006iV-Qi; Mon, 24 Jul 2023 11:11:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=yLAjUbV9NKlbPst8onfqAUqoeSvECuSk67jmy4Qo4rw=; b=Y6TsWAtdMMxB HMlV7iuvnoB8W18fXEXV15HCrXHGcTSMPa+m4E2W6YuLLqGXJz15aSEZKP1v9hKBoeSAAEQkc/TpL IEqroqcIT3NhH8/RTHNLGGSeEoq96ppZKCM8VFWXjH+2NCIdShiiIxN8WL5uZrDFTn+YYjn3eiDpX BmZzo+Gu3b37lYGcb0bPw7KRiAMYDLlyEuh8gepPx+piESQr6OhTXKGWD97+8FkDz0Y0b5ODECl9z fwjUL/V2ZDWfAGoopQCOJJ+ZWzUO3Kao2yehis8cbbHo9USeV/2ap6oxQ7e2IyLq90p0s1Pny+bqt wSBEoZ0j5lxEl9TxVHvkyA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNxCw-0003hm-PJ; Mon, 24 Jul 2023 11:11:00 -0400 In-Reply-To: <87y1j53hrz.fsf@localhost> (message from Ihor Radchenko on Mon, 24 Jul 2023 07:12:00 +0000) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:265978 Archived-At: > From: Ihor Radchenko > Date: Mon, 24 Jul 2023 07:12:00 +0000 > > 1. emacs -Q > 2. Evaluate the following in scratch buffer > > (with-temp-buffer > (insert "test") > (write-region nil nil "/tmp/1.txt")) > > 3. Open /tmp/1.txt > 4. Evaluate the above sexp multiple times > 5. Observe > > Debugger entered--Lisp error: (wrong-type-argument stringp nil) > expand-file-name(nil) > userlock--check-content-unchanged("/tmp/1.txt") > userlock--ask-user-about-supersession-threat("/tmp/1.txt") > write-region(nil nil "/tmp/1.txt") > (progn (insert "test") (write-region nil nil "/tmp/1.txt")) > (unwind-protect (progn (insert "test") (write-region nil nil "/tmp/1.txt")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))) > (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert "test") (write-region nil nil "/tmp/1.txt")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))) > (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert "test") (write-region nil nil "/tmp/1.txt")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) > (progn (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert "test") (write-region nil nil "/tmp/1.txt")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))) > elisp--eval-last-sexp(nil) > eval-last-sexp(nil) > funcall-interactively(eval-last-sexp nil) > command-execute(eval-last-sexp) > > Expected: No error is thrown. Thanks, should be fixed now on the master branch.