all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: 64821@debbugs.gnu.org
Subject: bug#64821: 30.0.50; write-region errs when overwriting an already open file
Date: Mon, 24 Jul 2023 18:11:30 +0300	[thread overview]
Message-ID: <83zg3lqr8d.fsf@gnu.org> (raw)
In-Reply-To: <87y1j53hrz.fsf@localhost> (message from Ihor Radchenko on Mon, 24 Jul 2023 07:12:00 +0000)

> From: Ihor Radchenko <yantar92@posteo.net>
> 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.





  reply	other threads:[~2023-07-24 15:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-24  7:12 bug#64821: 30.0.50; write-region errs when overwriting an already open file Ihor Radchenko
2023-07-24 15:11 ` Eli Zaretskii [this message]
2023-07-25  8:16   ` Ihor Radchenko
2023-07-25 12:19     ` Eli Zaretskii
2023-07-27 15:07 ` Mattias Engdegård
2023-07-27 16:31   ` Eli Zaretskii
2023-07-27 17:47     ` Mattias Engdegård
2023-07-27 19:02       ` Eli Zaretskii
2023-07-27 19:49         ` Mattias Engdegård
2023-07-28  6:40           ` Eli Zaretskii
2023-07-28  9:01             ` Mattias Engdegård
2023-07-28 12:08               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83zg3lqr8d.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=64821@debbugs.gnu.org \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.