GNU bug report logs -
#64821
30.0.50; write-region errs when overwriting an already open file
Previous Next
Reported by: Ihor Radchenko <yantar92 <at> posteo.net>
Date: Mon, 24 Jul 2023 07:13:02 UTC
Severity: normal
Found in version 30.0.50
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: Ihor Radchenko <yantar92 <at> 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.
This bug report was last modified 1 year and 299 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.